def task_description(task):
 name = (task.__name__ if hasattr(task, '__name__') else None)
 if ((name is not None) and isinstance(task, (types.MethodType, types.FunctionType))):
  if (getattr(task, '__self__', None) is not None):
   return ('%s from %s' % (six.text_type(name), task.__self__))
  else:
   return six.text_type(name)
 return encodeutils.safe_decode(repr(task))

def task_description ( task ) : name = ( task . __name__ if hasattr ( task , '__name__' ) else None ) if ( ( name is not None ) and isinstance ( task , ( types . MethodType , types . FunctionType ) ) ) : if ( getattr ( task , '__self__' , None ) is not None ) : return ( '%s from %s' % ( six . text_type ( name ) , task . __self__ ) ) else : return six . text_type ( name ) return encodeutils . safe_decode ( repr ( task ) )
return a human-readable string description of a task .