Rename existing dependency interface + name
184855
public function move(string $sourceInterface, string $sourceName, string $targetInterface, string $targetName)
    {
        $sourceIndex = $sourceInterface . '-' . $sourceName;
        if (! isset($this->container[$sourceIndex])) {
            throw $this->unbound($sourceIndex);
        }
        $targetIndex = $targetInterface . '-' . $targetName;
        $this->container[$targetIndex] = $this->container[$sourceIndex];
        unset($this->container[$sourceIndex]);
    }
1127250
def remove_dependency(id=None, name=None, dependency_id=None, dependency_name=None):
    
    data = remove_dependency_raw(id, name, dependency_id, dependency_name)
    if data:
        return utils.format_json_list(data)
172626
def interface_by_name(self, name):
        '''
        
        '''
        if name in self._devinfo:
            return self._devinfo[name]
        raise KeyError("No device named {}".format(name))
81923
function tryRenameExternalModule(moduleName) {
                if (renamedDependencies && moduleName.text in renamedDependencies) {
                    return "\"" + renamedDependencies[moduleName.text] + "\"";
                }
                return undefined;
            }
502743
function renameFilesIOS (oldPackageName, newPackageName) {
  const filesAndFolders = [
    `ios/${oldPackageName}.xcodeproj/xcshareddata/xcschemes/<?>-tvOS.xcscheme`,
    `ios/${oldPackageName}.xcodeproj/xcshareddata/xcschemes/<?>.xcscheme`,
    'ios/<?>.xcodeproj',
    `ios/${oldPackageName}/<?>.entitlements`,
    'ios/<?>',
    'ios/<?>-tvOS',
    'ios/<?>-tvOSTests',
    `ios/${oldPackageName}Tests/<?>Tests.m`,
    'ios/<?>Tests',
    'ios/<?>.xcworkspace',
  ]

  for (let i = 0; i < filesAndFolders.length; i++) {
    const element = filesAndFolders[i]
    const srcFile = fullPath(element.replace('<?>', oldPackageName))

    console.log(`From ${relative(srcFile)}`)
    if (fs.existsSync(srcFile)) {
      const destFile = fullPath(element.replace('<?>', newPackageName))

      fs.renameSync(srcFile, destFile)
      console.log(`  to ${relative(destFile)}`)
    } else {
      console.log(`${srcFile} does not exists.`)
    }
  }
}
373908
def rename_command(source, destination):
    
    source_ep, source_path = source
    dest_ep, dest_path = destination

    if source_ep != dest_ep:
        raise click.UsageError(
            (
                "rename requires that the source and dest "
                "endpoints are the same, {} != {}"
            ).format(source_ep, dest_ep)
        )
    endpoint_id = source_ep

    client = get_client()
    autoactivate(client, endpoint_id, if_expires_in=60)

    res = client.operation_rename(endpoint_id, oldpath=source_path, newpath=dest_path)
    formatted_print(res, text_format=FORMAT_TEXT_RAW, response_key="message")
523903
def rename(client, old, new, force):
    """"""
    from renku.models.refs import LinkReference
    LinkReference(client=client, name=_ref(old)).rename(_ref(new), force=force)
654244
def rename(self, new_name, range=None):
        """"""
        self.log.debug('rename: in')
        if not new_name:
            new_name = self.editor.ask_input("Rename to:")
        self.editor.write(noautocmd=True)
        b, e = self.editor.word_under_cursor_pos()
        current_file = self.editor.path()
        self.editor.raw_message(current_file)
        self.send_refactor_request(
            "RefactorReq",
            {
                "typehint": "RenameRefactorDesc",
                "newName": new_name,
                "start": self.get_position(b[0], b[1]),
                "end": self.get_position(e[0], e[1]) + 1,
                "file": current_file,
            },
            {"interactive": False}
        )
282247
public void renamedType(String oldName, Class<?> currentValue) {
        if (oldName == null) {
            throw new IllegalArgumentException("oldName must not be null");
        }
        if (currentValue == null) {
            throw new IllegalArgumentException("currentValue must not be null");
        }
        if (oldName.startsWith("java.") || oldName.startsWith("javax.") || oldName.startsWith("org.joda.")) {
            throw new IllegalArgumentException("oldName must not be a java.*, javax.* or org.joda.* type");
        }
        checkNotLocked();
        typeRenames.put(oldName, currentValue);
    }
508374
def _new_name(method, old_name):
    """"""
    # Looks suspiciously like a decorator, but isn't!

    @wraps(method)
    def _method(*args, **kwargs):
        warnings.warn(
            "method '{}' has been deprecated, please rename to '{}'".format(
                old_name, method.__name__
            ),
            DeprecationWarning,
        )
        return method(*args, **kwargs)

    deprecated_msg = """
        Note:
            .. deprecated:: 2.2.0
                Please use `~{}`
""".format(
        method.__name__
    )
    if getattr(_method, "__doc__"):
        _method.__doc__ += deprecated_msg

    return _method
990395
function rename(oldPath, newPath, callback) {
        appshell.fs.rename(oldPath, newPath, _wrap(callback));
    }
870549
function createFromDependency(pluginName) {
    var npmID = PluginDependency.nameToNpmID(pluginName);
    var version = pkg.dependencies[npmID];

    return PluginDependency.create(pluginName, version);
}
707589
def rename(id, name)
      wf_proxy_id?(id)
      wf_string?(name)
      update(id, name: name)
    end
654113
public void addDependency(Dependency dependency) {
        Dependency newDep = null;
        String classifier = dependency.getArtifact().getClassifier();
        if ( Const.TEST.equals( classifier ) || Const.TEST_JAR.equals( classifier ) ) {
            ArtifactType artifactType = new DefaultArtifactType( Const.TEST_JAR, Const.JAR, Const.TEST_JAR, null );
            
            Artifact artifact = dependency.getArtifact();
            
            artifact = new DefaultArtifact( artifact.getGroupId(), artifact.getArtifactId(),
                    null, Const.JAR, artifact.getBaseVersion(), artifactType );
            newDep =  new Dependency(artifact, dependency.getScope());
        } else {
            newDep = dependency;
        }
        dependencies.add(newDep);
    }
547858
def rename_library(self, from_lib, to_lib):
        
        to_colname = to_lib
        if '.' in from_lib and '.' in to_lib:
            if from_lib.split('.')[0] != to_lib.split('.')[0]:
                raise ValueError("Collection can only be renamed in the same database")
            to_colname = to_lib.split('.')[1]

        lib = ArcticLibraryBinding(self, from_lib)
        colname = lib.get_top_level_collection().name

        logger.info('Renaming collection: %s' % colname)
        lib._db[colname].rename(to_colname)
        for coll in lib._db.list_collection_names():
            if coll.startswith(colname + '.'):
                lib._db[coll].rename(coll.replace(colname, to_colname))

        if from_lib in self._library_cache:
            del self._library_cache[from_lib]
            del self._library_cache[lib.get_name()]

        self._cache.update_item_for_key(
            'list_libraries', self._sanitize_lib_name(from_lib), self._sanitize_lib_name(to_lib))
1088863
def rename(self, name):
        
        if name is None:
            raise Exception("name (%s) not-valid" % (name,))
        self.prefix, self.name = splitPrefix(name)
861125
def rename(self, name):
        """"""
        self.ec2.create_tags(Resources = [self.instance_id],
                             Tags      = [{'Key':   'Name',
                                           'Value':  name}])
        self.refresh_info()