Renames a library

        Parameters
        ----------
        from_lib: str
            The name of the library to be renamed
        to_lib: str
            The new name of the library
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))
1045134
def rename(self, target):
        
        if self._closed:
            self._raise_closed()
        self._accessor.rename(self, target)
706518
def rename(self, new_name):
        

        yield from self._hypervisor.send("nio rename {name} {new_name}".format(name=self._name, new_name=new_name))

        log.info("NIO {name} renamed to {new_name}".format(name=self._name, new_name=new_name))
        self._name = new_name
201440
def rename(python_data: LdapObject, new_base_dn: str = None,
           database: Optional[Database] = None, **kwargs) -> LdapObject:
    
    table = type(python_data)
    dn = python_data.get_as_single('dn')
    assert dn is not None

    database = get_database(database)
    connection = database.connection

    # extract key and value from kwargs
    if len(kwargs) == 1:
        name, value = list(kwargs.items())[0]

        # work out the new rdn of the object
        split_new_rdn = [[(name, value, 1)]]

        field = _get_field_by_name(table, name)
        assert field.db_field

        python_data = python_data.merge({
            name: value,
        })

    elif len(kwargs) == 0:
        split_new_rdn = [str2dn(dn)[0]]
    else:
        assert False

    new_rdn = dn2str(split_new_rdn)

    connection.rename(
        dn,
        new_rdn,
        new_base_dn,
    )

    if new_base_dn is not None:
        split_base_dn = str2dn(new_base_dn)
    else:
        split_base_dn = str2dn(dn)[1:]

    tmp_list = [split_new_rdn[0]]
    tmp_list.extend(split_base_dn)

    new_dn = dn2str(tmp_list)

    python_data = python_data.merge({
        'dn': new_dn,
    })
    return python_data
1273807
def rename(new_name, options = {})
      endpoint = "/api/build/rename/#{url_safe(name)}" + "?to=#{new_name}"
      client.post(endpoint, {})
      true
    rescue Error::HTTPError => e
      false
    end
128080
def rename(oldPath, newPath, **kwargs):
    """"""
    import os
    return os.rename(oldPath, newPath, **kwargs)
495800
def rename(self, dn: str, new_rdn: str, new_base_dn: Optional[str] = None) -> None:
        

        return self._do_with_retry(
            lambda obj: obj.rename_s(dn, new_rdn, new_base_dn))
872488
def _versioned_lib_name(env, libnode, version, prefix, suffix, prefix_generator, suffix_generator, **kw):
    """'"""
    Verbose = False

    if Verbose:
        print("_versioned_lib_name: libnode={:r}".format(libnode.get_path()))
        print("_versioned_lib_name: version={:r}".format(version))
        print("_versioned_lib_name: prefix={:r}".format(prefix))
        print("_versioned_lib_name: suffix={:r}".format(suffix))
        print("_versioned_lib_name: suffix_generator={:r}".format(suffix_generator))

    versioned_name = os.path.basename(libnode.get_path())
    if Verbose:
        print("_versioned_lib_name: versioned_name={:r}".format(versioned_name))

    versioned_prefix = prefix_generator(env, **kw)
    versioned_suffix = suffix_generator(env, **kw)
    if Verbose:
        print("_versioned_lib_name: versioned_prefix={:r}".format(versioned_prefix))
        print("_versioned_lib_name: versioned_suffix={:r}".format(versioned_suffix))

    versioned_prefix_re = '^' + re.escape(versioned_prefix)
    versioned_suffix_re = re.escape(versioned_suffix) + '$'
    name = re.sub(versioned_prefix_re, prefix, versioned_name)
    name = re.sub(versioned_suffix_re, suffix, name)
    if Verbose:
        print("_versioned_lib_name: name={:r}".format(name))
    return name
949905
def renames(self, new):
        
        os.renames(self, new)
        return self._next_class(new)
1080205
def rename(self, **mapping):
        
        params = {k: v for k, v in self.get_param_values() if k != 'name'}
        return self.__class__(rename=mapping,
                              source=(self._source() if self._source else None),
                              linked=self.linked, **params)
538626
def update_libraries_list_store(self):
        
        self.library_list_store.clear()
        libraries = self.core_config_model.get_current_config_value("LIBRARY_PATHS", use_preliminary=True, default={})
        library_names = sorted(libraries.keys())
        for library_name in library_names:
            library_path = libraries[library_name]
            self.library_list_store.append((library_name, library_path))
1122732
def rename(self):
        
        params = self.relation_name ^ (Optional(self.relation_name) +
                                       self.parenthesize(self.attribute_list))
        return self.parametrize(self.syntax.rename_op, params)
686524
def load_library_handle(libname, path):
    """"""

    if path is None or path in ['None', 'none']:
        # Either could not find a library via ctypes or
        # user-configuration-file, or we could not find it in any of the
        # default locations, or possibly the user intentionally does not want
        # one of the libraries to load.
        return None

    try:
        if os.name == "nt":
            opj_lib = ctypes.windll.LoadLibrary(path)
        else:
            opj_lib = ctypes.CDLL(path)
    except (TypeError, OSError):
        msg = 'The {libname} library at {path} could not be loaded.'
        msg = msg.format(path=path, libname=libname)
        warnings.warn(msg, UserWarning)
        opj_lib = None

    return opj_lib
1292256
def rename(self, new_name):
    
    update = copy.copy(self)
    update.name = new_name
    return self._do_update(update)
567072
def load_library(version):
    
    check_version(version)
    module_name = SUPPORTED_LIBRARIES[version]
    lib = sys.modules.get(module_name)
    if lib is None:
        lib = importlib.import_module(module_name)
    return lib
302859
def rename_experiment(self, new_name):
        '''
        '''
        logger.info('rename experiment "%s"', self.experiment_name)
        content = {'name': new_name}
        url = self._build_api_url(
            '/experiments/{experiment_id}'.format(
                experiment_id=self._experiment_id
            )
        )
        res = self._session.put(url, json=content)
        res.raise_for_status()
        self.experiment_name = new_name
1287723
def _libname(self):
        """"""
        prefix = 'lib'
        suffix = '.so'
        if platform.system() == 'Darwin':
            suffix = '.dylib'
        if platform.system() == 'Windows':
            prefix = ''
            suffix = '.dll'
        return prefix + self.engine + suffix