def call_method(class_obj, method, *args):
 if method.is_retriever():
  args = args[:(-1)]
 else:
  assert (args[(-1)] is not None), 'No argument given.'
 if (class_obj.__class__.__name__ == 'RTorrent'):
  rt_obj = class_obj
 else:
  rt_obj = class_obj._rt_obj
 if (not method.is_available(rt_obj)):
  _handle_unavailable_rpc_method(method, rt_obj)
 m = Multicall(class_obj)
 m.add(method, *args)
 ret_value = m.call()[0]
 return ret_value

def call_method ( class_obj , method , * args ) : if method . is_retriever ( ) : args = args [ : ( - 1 ) ] else : assert ( args [ ( - 1 ) ] is not None ) , 'No argument given.' if ( class_obj . __class__ . __name__ == 'RTorrent' ) : rt_obj = class_obj else : rt_obj = class_obj . _rt_obj if ( not method . is_available ( rt_obj ) ) : _handle_unavailable_rpc_method ( method , rt_obj ) m = Multicall ( class_obj ) m . add ( method , * args ) ret_value = m . call ( ) [ 0 ] return ret_value
handles single rpc calls .