if a ~/.pyradio files exists, relocate it in user
            config folder and rename it to stations.csv, or if
            that exists, to pyradio.csv
357971
def _move_old_csv(self, usr):
        

        src = path.join(getenv('HOME', '~'), '.pyradio')
        dst = path.join(usr, 'pyradio.csv')
        dst1 = path.join(usr, 'stations.csv')
        if path.exists(src) and path.isfile(src):
            if path.exists(dst1):
                copyfile(src, dst)
            else:
                copyfile(src, dst1)
            try:
                remove(src)
            except:
                pass
48355
def _update_from_standard_locations():
    ''' 
    '''
    locs = [
        join(expanduser('~'), _config_name),
        join('.', _config_name)
    ]
    if 'PLIERS_CONFIG' in os.environ:
        locs.insert(1, os.environ['PLIERS_CONFIG'])

    from_file(locs, False)
144530
def move(ctx, client, sources, destination):
    """"""
    from renku.api._git import _expand_directories

    dst = Path(destination)

    def fmt_path(path):
        """Format path as relative to the client path."""
        return str(Path(path).absolute().relative_to(client.path))

    files = {
        fmt_path(source): fmt_path(file_or_dir)
        for file_or_dir in sources
        for source in _expand_directories((file_or_dir, ))
    }

    def fmt_dst(path):
        """Build a destination path for a source path."""
        return str(dst / os.path.relpath(path, start=files[path]))

    destinations = {source: fmt_dst(source) for source in files}

    # 1. Check .gitignore.
    ignored = client.find_ignored_paths(*destinations.values())
    if ignored:
        click.echo(WARNING + 'Renamed files match .gitignore.\n')
        if click.confirm(
            'Do you want to edit ".gitignore" now?', default=False
        ):
            click.edit(filename=str(client.path / '.gitignore'))

    # 2. Update dataset metadata files.
    with progressbar(
        client.datasets.items(),
        item_show_func=lambda item: str(item[1].short_id) if item else '',
        label='Updating dataset metadata',
        width=0,
    ) as bar:
        for (path, dataset) in bar:
            renames = {}

            for file in dataset.files:
                filepath = fmt_path(os.path.normpath(str(path.parent / file)))

                if filepath in files:
                    renames[file] = os.path.relpath(
                        destinations[filepath], start=str(path.parent)
                    )

            if renames:
                dataset = dataset.rename_files(
                    lambda key: renames.get(key, key)
                )

                dataset.to_yaml()

    # 3. Manage .gitattributes for external storage.
    tracked = tuple(
        path for path, attr in client.find_attr(*files).items()
        if attr.get('filter') == 'lfs'
    )
    client.untrack_paths_from_storage(*tracked)
    existing = client.find_attr(*tracked)
    if existing:
        click.echo(WARNING + 'There are custom .gitattributes.\n')
        if click.confirm(
            'Do you want to edit ".gitattributes" now?', default=False
        ):
            click.edit(filename=str(client.path / '.gitattributes'))

    client.track_paths_in_storage(*(destinations[path] for path in tracked))

    # 4. Handle symlinks.
    dst.parent.mkdir(parents=True, exist_ok=True)

    for source, target in destinations.items():
        src = Path(source)
        if src.is_symlink():
            Path(target).parent.mkdir(parents=True, exist_ok=True)
            Path(target).symlink_to(
                os.path.relpath(
                    str(src.resolve()), start=os.path.dirname(target)
                )
            )
            src.unlink()
            del files[source]

    # Finally move the files.
    final_sources = list(set(files.values()))
    if final_sources:
        run(['git', 'mv'] + final_sources + [destination], check=True)
1049630
def rename_source_file(self, src, dst):
        
        try:
            os.rename(self.source_msgs_dir.joinpath(src), self.source_msgs_dir.joinpath(dst))
        except OSError:
            pass
478182
def cleanup_mprocess(config_path, cfg):
    
    for key in ('keyFile', 'logPath', 'dbpath'):
        remove_path(cfg.get(key, None))
    isinstance(config_path, str) and os.path.exists(config_path) and remove_path(config_path)
54802
def rename_file(old, new, path=None):
    
    cwd = os.getcwd()
    try:
        if path:
            os.chdir(path)
    except OSError:
        raise
    try:
        os.rename(old, new)
        os.chdir(cwd)
        return True
    except OSError:
        os.chdir(cwd)
        raise
855209
def rename(src, dst):
    '''
    
    '''
    try:
        os.rename(src, dst)
    except OSError as exc:
        if exc.errno != errno.EEXIST:
            raise
        try:
            os.remove(dst)
        except OSError as exc:
            if exc.errno != errno.ENOENT:
                raise MinionError(
                    'Error: Unable to remove {0}: {1}'.format(
                        dst,
                        exc.strerror
                    )
                )
        os.rename(src, dst)
359406
def rename(self, src, dst):
        
        with self.pipe as pipe:
            return pipe.rename(self.redis_key(src), self.redis_key(dst))
529247
def merged_srcmaps(self, **kwargs):
        
        kwargs_copy = self.base_dict.copy()
        kwargs_copy.update(**kwargs)
        kwargs_copy['dataset'] = kwargs.get('dataset', self.dataset(**kwargs))
        kwargs_copy['component'] = kwargs.get(
            'component', self.component(**kwargs))
        self._replace_none(kwargs_copy)        
        localpath = NameFactory.merged_srcmaps_format.format(**kwargs_copy)
        if kwargs.get('fullpath', False):
            return self.fullpath(localpath=localpath)
        return localpath
953847
def expandConfigPaths (config, prefix=None, datetime=None, pathvars=None, parameter_key='', *keys):
    
    if len(keys) == 0:
        keys = PATH_KEYS

    for name, value in config.items():
        if name in keys and type(name) is str:
            expanded = util.expandPath(value, prefix)
            cleaned = replaceVariables(expanded, datetime=datetime, pathvars=pathvars)

            for p in cleaned:
                if not os.path.exists(p):
                    msg = "Config parameter {}.{} specifies nonexistent path {}".format(parameter_key, name, p)
                    log.warn(msg)

            config[name] = cleaned[0] if len(cleaned) == 1 else cleaned

        elif type(value) is dict:
            param_key = name if parameter_key == '' else parameter_key + '.' + name
            expandConfigPaths(value, prefix, datetime, pathvars, param_key, *keys)
517454
function() {
        var conf = self.conf
        var src = self.root +'/'+ conf.src;
        var sample = new _(GINA_PATH +'/template/samples/bundle/');
        var target = _(src);
        sample.cp(target, function done(err) {
            if (err) {
                rollback(err)
            }
            // Browse, parse and replace keys
            self.source = _(target);
            browse(self.source)
        })
    }
735217
def rename(self, newpath):
        ""
        # POST https://www.jottacloud.com/jfs/**USERNAME**/Jotta/Sync/Ny%20mappe?mvDir=/**USERNAME**/Jotta/Sync/testFolder
        #url = '%s?mvDir=/%s%s' % (self.path, self.jfs.username, newpath)
        params = {'mvDir':'/%s%s' % (self.jfs.username, newpath)}
        r = self.jfs.post(self.path,
                          extra_headers={'Content-Type':'application/octet-stream'},
                          params=params)
        return r
170300
public static void adjustMetaDirectoryNames(Configuration conf, String serviceKey) {
    adjustMetaDirectoryName(conf, DFS_SHARED_NAME_DIR0_KEY, serviceKey);
    adjustMetaDirectoryName(conf, DFS_SHARED_NAME_DIR1_KEY, serviceKey);
    adjustMetaDirectoryName(conf, DFS_SHARED_EDITS_DIR0_KEY, serviceKey);
    adjustMetaDirectoryName(conf, DFS_SHARED_EDITS_DIR1_KEY, serviceKey);
  }
1308423
def checkConfig():
    """"""
    config_file_dir = os.path.join(cwd, "config.py")
    if os.path.exists(config_file_dir):
        print("Making a backup of your config file!")
        config_file_dir2 = os.path.join(cwd, "config.py.oldbak")
        copyfile(config_file_dir, config_file_dir2)
971001
def v1_folder_rename(request, response, kvlclient,
                     fid_src, fid_dest, sfid_src=None, sfid_dest=None):
    '''
    '''
    src, dest = make_path(fid_src, sfid_src), make_path(fid_dest, sfid_dest)
    new_folders(kvlclient, request).move(src, dest)
    response.status = 200
730827
function replaceFilePaths () {
    // handle docs.js
    const filePath = path.join(__dirname, '/dist/docs/docs.js');
    const file = fs.readFileSync(filePath);
    const contents = file.toString()
        .replace(/http:\/\/localhost:8080\/angular-material/g, 'https://gitcdn.xyz/cdn/angular/bower-material/v' + newVersion + '/angular-material')
        .replace(/http:\/\/localhost:8080\/docs.css/g, 'https://material.angularjs.org/' + newVersion + '/docs.css');
    fs.writeFileSync(filePath, contents);
  }
941425
def configs_in(src_dir):
    """"""
    for filename in files_in_dir(src_dir, 'json'):
        with open(os.path.join(src_dir, filename), 'rb') as in_f:
            yield json.load(in_f)