parameters: (self, module, import_statement)
return_statement: return True
docstring: Update an import statement in a module and all its references..
  
      Args:
        module: The refactor.Module to update.
        import_statement:  The refactor.Import to update.
  
      Returns:
        True if the import statement was updated, or False if the import statement
        needed no updating.
docstring_summary: Update an import statement in a module and all its references..
docstring_tokens: Update an import statement in a module and all its references ..
function: def UpdateImportAndReferences(self, module, import_statement):
      """Update an import statement in a module and all its references..
  
      Args:
        module: The refactor.Module to update.
        import_statement:  The refactor.Import to update.
  
      Returns:
        True if the import statement was updated, or False if the import statement
        needed no updating.
      """
      statement_path_parts = import_statement.path.split('.')
      source_path_parts = self.source_module_path.split('.')
      if source_path_parts != statement_path_parts[:len(source_path_parts)]:
        return False
  
      # Update import statement.
      old_name_parts = import_statement.name.split('.')
      new_name_parts = ([self.target_module_path] +
                        statement_path_parts[len(source_path_parts):])
      import_statement.path = '.'.join(new_name_parts)
      new_name = import_statement.name
  
      # Update references.
      for reference in module.FindAll(refactor.Reference):
        reference_parts = reference.value.split('.')
        if old_name_parts != reference_parts[:len(old_name_parts)]:
          continue
  
        new_reference_parts = [new_name] + reference_parts[len(old_name_parts):]
        reference.value = '.'.join(new_reference_parts)
  
      return True
function_tokens: def UpdateImportAndReferences ( self , module , import_statement ) : statement_path_parts = import_statement . path . split ( '.' ) source_path_parts = self . source_module_path . split ( '.' ) if source_path_parts != statement_path_parts [ : len ( source_path_parts ) ] : return False # Update import statement. old_name_parts = import_statement . name . split ( '.' ) new_name_parts = ( [ self . target_module_path ] + statement_path_parts [ len ( source_path_parts ) : ] ) import_statement . path = '.' . join ( new_name_parts ) new_name = import_statement . name # Update references. for reference in module . FindAll ( refactor . Reference ) : reference_parts = reference . value . split ( '.' ) if old_name_parts != reference_parts [ : len ( old_name_parts ) ] : continue new_reference_parts = [ new_name ] + reference_parts [ len ( old_name_parts ) : ] reference . value = '.' . join ( new_reference_parts ) return True