Adding some new function to scanpy

I have several papers under preparation some of them are related to dimensional reduction and some others related to clustering of differential expression of RNA-Seq. I have some codes in python for dimensional reduction or clustering for example assume ‘’New_method’ is a function for reduction and “New_cluster” is a new method for clustering I want to use the result of reduction and clustering in downstream analysis. For example, I want to run some code such as, color=[‘new_cluster’,‘leiden’, ‘CST3’, ‘NKG7’])
or, ’ new_cluster’, method=‘new_statistical_HT’)
and similar codes such as

Can anyone help me who I can do it?