def _im_func(f):
 if hasattr(f, '__func__'):
  return f.__func__
 else:
  return f

def _im_func ( f ) : if hasattr ( f , '__func__' ) : return f . __func__ else : return f
wrapper to get at the underlying function belonging to a method .