def create_move(project, resource, offset=None):
 if (offset is None):
  return MoveModule(project, resource)
 this_pymodule = project.get_pymodule(resource)
 pyname = evaluate.eval_location(this_pymodule, offset)
 if (pyname is not None):
  pyobject = pyname.get_object()
  if (isinstance(pyobject, pyobjects.PyModule) or isinstance(pyobject, pyobjects.PyPackage)):
   return MoveModule(project, pyobject.get_resource())
  if (isinstance(pyobject, pyobjects.PyFunction) and isinstance(pyobject.parent, pyobjects.PyClass)):
   return MoveMethod(project, resource, offset)
  if ((isinstance(pyobject, pyobjects.PyDefinedObject) and isinstance(pyobject.parent, pyobjects.PyModule)) or isinstance(pyname, pynames.AssignedName)):
   return MoveGlobal(project, resource, offset)
 raise exceptions.RefactoringError('Move only works on global classes/functions/variables, modules and methods.')

def create_move ( project , resource , offset = None ) : if ( offset is None ) : return MoveModule ( project , resource ) this_pymodule = project . get_pymodule ( resource ) pyname = evaluate . eval_location ( this_pymodule , offset ) if ( pyname is not None ) : pyobject = pyname . get_object ( ) if ( isinstance ( pyobject , pyobjects . PyModule ) or isinstance ( pyobject , pyobjects . PyPackage ) ) : return MoveModule ( project , pyobject . get_resource ( ) ) if ( isinstance ( pyobject , pyobjects . PyFunction ) and isinstance ( pyobject . parent , pyobjects . PyClass ) ) : return MoveMethod ( project , resource , offset ) if ( ( isinstance ( pyobject , pyobjects . PyDefinedObject ) and isinstance ( pyobject . parent , pyobjects . PyModule ) ) or isinstance ( pyname , pynames . AssignedName ) ) : return MoveGlobal ( project , resource , offset ) raise exceptions . RefactoringError ( 'Move only works on global classes/functions/variables, modules and methods.' )
a factory for creating move objects based on resource and offset .