def load_function(path):
 (module_path, _, name) = path.rpartition('.')
 return getattr(import_module(module_path), name)

def load_function ( path ) : ( module_path , _ , name ) = path . rpartition ( '.' ) return getattr ( import_module ( module_path ) , name )
load a function by name .