Expands paths (e.g. css/*.css in files_root /actual/path/to/css/files/)
422883
def expand_file_names(path, files_root):
    
    # For non-wildcards just return the path. This allows us to detect when
    # explicitly listed files are missing.
    if not any(wildcard in path for wildcard in '*?['):
        return [path]
    else:
        dir_path, filename = os.path.split(path)
        return [os.path.join(dir_path, f) for f in fnmatch.filter(os.listdir(os.path.join(files_root, dir_path)), filename)]
37598
def fully_expanded_path(self):
        
        return os.path.abspath(
            os.path.normpath(
                os.path.normcase(
                    os.path.expandvars(
                        os.path.expanduser(self.path)))))
683353
def _expand_path(path):
    """"""
    path = os.path.expandvars(path)
    path = os.path.expanduser(path)
    return path
509735
def expand_path(experiment_config, key):
    ''''''
    if experiment_config.get(key):
        experiment_config[key] = os.path.expanduser(experiment_config[key])
648716
def expandPath(self, path):
        
        iiPath = self.model().findItemAndIndexPath(path)
        for (item, index) in iiPath[1:]: # skip invisible root
            assert index.isValid(), "Sanity check: invalid index in path for item: {}".format(item)
            self.expand(index)

        leaf = iiPath[-1]
        return leaf
1226873
function _expandNestedPaths(paths) {
  var expandedPaths = [];

  _pathsArray(paths).forEach(function (p) {
    if (p.indexOf('.') !== -1) {
      var pathsWithRoots = p.split('.').map(function (value, index, array) {
        return array.slice(0, index + 1).join('.');
      });

      expandedPaths = expandedPaths.concat(pathsWithRoots);
    } else {
      expandedPaths.push(p);
    }
  });

  return expandedPaths;
}
1097310
def append_rez_path(self):
        """"""
        if system.rez_bin_path:
            self.env.PATH.append(system.rez_bin_path)
329193
function flattenPath(file, opts) {
  var fileName = path.basename(file.path);
  var dirs;

  if (!opts.includeParents && !opts.subPath) {
    return fileName;
  }

  dirs = path.dirname(file.relative).split(path.sep);
  if (opts.includeParents) {
    dirs = includeParents(dirs, opts.includeParents);
  }
  if (opts.subPath) {
    dirs = subPath(dirs, opts.subPath);
  }

  dirs.push(fileName);
  return path.join.apply(path, dirs);
}
1070396
def expand_dir(_dir, cwd=os.getcwd()):
    
    _dir = os.path.expanduser(os.path.expandvars(_dir))
    if not os.path.isabs(_dir):
        _dir = os.path.normpath(os.path.join(cwd, _dir))
    return _dir
619548
def expanduser(path):
    # type: (str) -> str
    
    expanded = os.path.expanduser(path)
    if path.startswith('~/') and expanded.startswith('//'):
        expanded = expanded[1:]
    return expanded
227071
function expandPath (path, replacements) {
  return R.toPairs(replacements).reduce((path, [key, value]) => path.replace(`{${key}}`, value), path)
}
335762
def change_path_prefix(self, path, old_prefix, new_prefix, app_name):
        """"""
        relative_path = os.path.relpath(path, old_prefix)
        return os.path.join(new_prefix, app_name, relative_path)
1100518
function expandFiles(files, basePath) {
    var expandedFiles = [];
    files = files ? _.isArray(files) ? files : [files] : [];

    _.forEach(files, function(fileName) {
        expandedFiles = _.union(
            expandedFiles,
            glob.sync(path.join(basePath, fileName), { dot: true, nodir: true })
        );
    });

    return expandedFiles;
}
394020
def extend(path=None, cache=None):
    """"""
    if path is None:
        path = config.PATH
    try:
        path = path.split(':')
    except:
        pass

    sys.path.extend([library.to_path(p, cache) for p in path])
695267
def addextension(path, ext=None):
    
    if ext:
        if '*' in path:
            return path
        elif os.path.splitext(path)[1]:
            return path
        else:
            if not ext.startswith('.'):
                ext = '.'+ext
            if not path.endswith(ext):
                if not path.endswith(os.path.sep):
                    path += os.path.sep
                return path + '*' + ext
            else:
                return path
    else:
        return path
111629
def expand_folder(files):
    """"""
    expfiles = []
    for file in files:
        if os.path.isdir(file):
            for dirpath, dirnames, filenames in os.walk(file):
                for filename in filenames:
                    expfiles.append(os.path.join(dirpath, filename))
        else:
            expfiles.append(file)

    for path in expfiles:
        if not os.path.exists(path):
            sys.stderr.write('%s: No such file or directory\n' % path)

    return expfiles
1291682
function normalizePaths(opts) {
  for (var srcKey in opts.src) {
    if (!path.isAbsolute(opts.src[srcKey].glob)) {
      opts.src[srcKey].glob = path.resolve(opts.src[srcKey].glob);
    }
    if (!path.isAbsolute(opts.src[srcKey].basedir)) {
      opts.src[srcKey].basedir = path.resolve(opts.src[srcKey].basedir);
    }
  }
}