<s> from fabric . tasks import WrappedCallableTask <EOL> def unwrap_tasks ( module , hide_nontasks = False ) : <EOL> """<STR_LIT>""" <EOL> set_tasks = [ ] <EOL> for name , obj in vars ( module ) . items ( ) : <EOL> if isinstance ( obj , WrappedCallableTask ) : <EOL> setattr ( module , obj . name , obj . wrapped ) <EOL> set_tasks . append ( obj . name ) <EOL> obj . wrapped . func_name = obj . name <EOL> else : <EOL> if name in set_tasks : <EOL> continue <EOL> has_docstring = getattr ( obj , '<STR_LIT>' , False ) <EOL> if hide_nontasks and has_docstring and not name . startswith ( '<STR_LIT:_>' ) : <EOL> setattr ( module , '<STR_LIT>' % name , obj ) <EOL> delattr ( module , name ) </s>
