def insert_into_module(func, module_name, base_name, prefix):
 func.__module__ = module_name
 module = sys.modules[module_name]
 for i in range(1000):
  func.__name__ = str((u'%s_%s_%s' % (prefix, base_name, i)))
  if (not hasattr(module, func.__name__)):
   break
 setattr(module, func.__name__, func)

def insert_into_module ( func , module_name , base_name , prefix ) : func . __module__ = module_name module = sys . modules [ module_name ] for i in range ( 1000 ) : func . __name__ = str ( ( u'%s_%s_%s' % ( prefix , base_name , i ) ) ) if ( not hasattr ( module , func . __name__ ) ) : break setattr ( module , func . __name__ , func )
add a function into a module .