def get_doc(arg1, arg2=None):
 if isinstance(arg1, BaseDocument):
  return arg1
 elif isinstance(arg1, basestring):
  doctype = arg1
 else:
  doctype = arg1.get(u'doctype')
 controller = get_controller(doctype)
 if controller:
  return controller(arg1, arg2)
 raise ImportError, arg1

def get_doc ( arg1 , arg2 = None ) : if isinstance ( arg1 , BaseDocument ) : return arg1 elif isinstance ( arg1 , basestring ) : doctype = arg1 else : doctype = arg1 . get ( u'doctype' ) controller = get_controller ( doctype ) if controller : return controller ( arg1 , arg2 ) raise ImportError , arg1
get the docstring from our command and options map .