def unwrap_tasks(module, hide_nontasks=False):
 set_tasks = []
 for (name, obj) in vars(module).items():
  if isinstance(obj, WrappedCallableTask):
   setattr(module, obj.name, obj.wrapped)
   set_tasks.append(obj.name)
   obj.wrapped.func_name = obj.name
  else:
   if (name in set_tasks):
    continue
   has_docstring = getattr(obj, '__doc__', False)
   if (hide_nontasks and has_docstring and (not name.startswith('_'))):
    setattr(module, ('_%s' % name), obj)
    delattr(module, name)

def unwrap_tasks ( module , hide_nontasks = False ) : set_tasks = [ ] for ( name , obj ) in vars ( module ) . items ( ) : if isinstance ( obj , WrappedCallableTask ) : setattr ( module , obj . name , obj . wrapped ) set_tasks . append ( obj . name ) obj . wrapped . func_name = obj . name else : if ( name in set_tasks ) : continue has_docstring = getattr ( obj , '__doc__' , False ) if ( hide_nontasks and has_docstring and ( not name . startswith ( '_' ) ) ) : setattr ( module , ( '_%s' % name ) , obj ) delattr ( module , name )
replace task objects on module with their wrapped functions instead .