def guess(method):
 if hasattr(method, '_api'):
  return method
 (args, vname, kwname, defaults) = getargspec(method)
 names = (tuple(args) + ((None,) * 4))
 if (names[0] == 'self'):
  if (names[1] in ('cr', 'cursor')):
   if (names[2] in ('uid', 'user')):
    if (names[3] == 'ids'):
     if (('context' in names) or kwname):
      return cr_uid_ids_context(method)
     else:
      return cr_uid_ids(method)
    elif ((names[3] == 'id') or (names[3] == 'res_id')):
     if (('context' in names) or kwname):
      return cr_uid_id_context(method)
     else:
      return cr_uid_id(method)
    elif (('context' in names) or kwname):
     return cr_uid_context(method)
    else:
     return cr_uid(method)
   elif ('context' in names):
    return cr_context(method)
   else:
    return cr(method)
 return noguess(method)

def guess ( method ) : if hasattr ( method , '_api' ) : return method ( args , vname , kwname , defaults ) = getargspec ( method ) names = ( tuple ( args ) + ( ( None , ) * 4 ) ) if ( names [ 0 ] == 'self' ) : if ( names [ 1 ] in ( 'cr' , 'cursor' ) ) : if ( names [ 2 ] in ( 'uid' , 'user' ) ) : if ( names [ 3 ] == 'ids' ) : if ( ( 'context' in names ) or kwname ) : return cr_uid_ids_context ( method ) else : return cr_uid_ids ( method ) elif ( ( names [ 3 ] == 'id' ) or ( names [ 3 ] == 'res_id' ) ) : if ( ( 'context' in names ) or kwname ) : return cr_uid_id_context ( method ) else : return cr_uid_id ( method ) elif ( ( 'context' in names ) or kwname ) : return cr_uid_context ( method ) else : return cr_uid ( method ) elif ( 'context' in names ) : return cr_context ( method ) else : return cr ( method ) return noguess ( method )
decorate method to make it callable in both traditional and record styles .