Return the regex for the path to the build folder.
557662
def path_regex(self):
        """"""
        regex = r'releases/%(VERSION)s/%(PLATFORM)s/%(LOCALE)s/'
        return regex % {'LOCALE': self.locale,
                        'PLATFORM': self.platform_regex,
                        'VERSION': self.version}
168996
def regex(self):
        """"""
        if not self._compiled_regex:
            self._compiled_regex = re.compile(self.raw)
        return self._compiled_regex
625625
def get_path(query):
	
	match = re.search(r'/(.*/)+(\S*(\.[\d\w]{1,4})?)', query)
	if(os.path.isfile(match.group()) or os.path.isdir(match.group())):
		return match.group()
	else:
		return None
1076173
def walkfiles(startdir, regex=None, recurse=True):
    """"""
    for r,_,fs in os.walk(startdir):
        if not recurse and startdir != r:
            return
        for f in fs:
            path = op.abspath(op.join(r,f))
            if regex and not _is_match(regex, path):
                    continue
            if op.isfile(path):
                yield path
529468
def find_best_match(path, prefixes):
    """"""
    path_parts = path.split('.')
    for p in prefixes:
        if len(p) <= len(path_parts) and p == path_parts[:len(p)]:
            return '.'.join(p), '.'.join(path_parts[len(p):])
    return '', path
1265305
public function buildPath() : string
    {
        return self::buildRepositoryPath(
            dirname($this->path),
            $this->domain,
            $this->language
        );
    }
1099909
def get_build_files_family(project_tree, dir_relpath, build_ignore_patterns=None):
    """"""
    build_files = set()
    for build in sorted(project_tree.glob1(dir_relpath, '{prefix}*'.format(prefix=BuildFile._BUILD_FILE_PREFIX))):
      if BuildFile._is_buildfile_name(build) and project_tree.isfile(os.path.join(dir_relpath, build)):
        build_files.add(os.path.join(dir_relpath, build))
    return BuildFile._build_files_from_paths(project_tree, build_files, build_ignore_patterns)
42789
private void getPath(String uri, StringBuilder builder) {
        if (pattern.length() == 0) {
            return;
        }
        String hash = getHash(uri);
        int hashPos = 0;
        for (int i = 0; i < pattern.length(); i++) {
            char c = pattern.charAt(i);
            if (c == '#') {
                builder.append(hash.charAt(hashPos++));
            } else {
                builder.append(c);
            }
        }
        builder.append('/');
    }
846388
def get_formatted_path(path):
        
        if path[0] != '/':
            path = '/' + path
        if path[-1] != '/':
            path = '{0}/'.format(path)
        return path
755330
def get_paths(patterns, start_dirs=None, max_depth=1):
    """"""
    # Shortcut: if there is only one pattern, make sure we process just that.
    if len(patterns) == 1 and not start_dirs:
        pattern = patterns[0]
        directory = os.path.dirname(pattern)
        if directory:
            patterns = [os.path.basename(pattern)]
            start_dirs = directory
            max_depth = 1

    if not start_dirs or start_dirs == '.':
        start_dirs = os.getcwd()
    for start_dir in start_dirs.split(','):
        for root, dirs, files in os.walk(start_dir):  # pylint: disable=W0612
            if max_depth is not None:
                relpath = os.path.relpath(root, start=start_dir)
                depth = len(relpath.split(os.sep))
                if depth > max_depth:
                    continue
            names = []
            for pattern in patterns:
                names += fnmatch.filter(files, pattern)
            for name in names:
                path = os.path.join(root, name)
                yield path
171296
function buildRegExps(basePath, dirPaths) {
  return dirPaths.map(folderPath =>
    // Babel cares about windows/unix paths since v7b44
    // https://github.com/babel/babel/issues/8184
    // basePath + path.sep + dirPath/dirRegex
    // /home/name/webroot/js + / + relative/path/to/exclude
    // c:\home\name\webroot\js + \ + relative\path\to\exclude
    folderPath instanceof RegExp
      ? new RegExp(
          `^${escapeRegExp(path.resolve(basePath, '.') + path.sep)}${
            folderPath.source // This is actual regex, don't escape it
          }`,
          folderPath.flags,
        )
      : new RegExp('^' + escapeRegExp(path.resolve(basePath, folderPath))),
  );
}
573417
def get_incomplete_path(filename):
  """"""
  random_suffix = "".join(
      random.choice(string.ascii_uppercase + string.digits) for _ in range(6))
  return filename + ".incomplete" + random_suffix
1045579
function getIgnoreRegexes(rootFolder) {
    const gasignoreFilepath = path.join(rootFolder, constants.IGNORE_FILE);

    let regexes = [];
    if (fs.existsSync(gasignoreFilepath)) {
        regexes = parse(fs.readFileSync(gasignoreFilepath));
    }
    return regexes;
}
1168463
def fnmatch_pathname_to_regex(pattern):
	
	i, n = 0, len(pattern)
	nonsep = ''.join(['[^', os.sep, ']'])
	res = []
	while i < n:
		c = pattern[i]
		i = i + 1
		if c == '*':
			try:
				if pattern[i] == '*':
					i = i + 1
					res.append('.*')
					if pattern[i] == '/':
						i = i + 1
						res.append(''.join([os.sep, '?']))
				else:
					res.append(''.join([nonsep, '*']))
			except IndexError:
				res.append(''.join([nonsep, '*']))
		elif c == '?':
			res.append(nonsep)
		elif c == '/':
			res.append(os.sep)
		elif c == '[':
			j = i
			if j < n and pattern[j] == '!':
				j = j + 1
			if j < n and pattern[j] == ']':
				j = j + 1
			while j < n and pattern[j] != ']':
				j = j+1
			if j >= n:
				res.append('\\[')
			else:
				stuff = pattern[i:j].replace('\\', '\\\\')
				i = j+1
				if stuff[0] == '!':
					stuff = ''.join('^', stuff[1:])
				elif stuff[0] == '^':
					stuff = ''.join('\\' + stuff)
				res.append('[{}]'.format(stuff))
		else:
			res.append(re.escape(c))
	res.insert(0, '(?ms)')
	res.append('\Z')
	return ''.join(res)
1359026
def sinatra_path_to_regex(cls, path):
        
        # Return the path if already a (compiled) regex
        if type(path) is cls.regex_type:
            return path

        # Build a regular expression string which is split on the '/' character
        regex = [
            "(?P<{}>\w+)".format(segment[1:])
            if cls.sinatra_param_regex.match(segment)
            else segment
            for segment in path.split('/')
        ]
        return re.compile('/'.join(regex))
1032949
def path_to(self, p):
        """"""
        if os.path.isabs(p):
            return p

        return os.sep.join([self._original_dir, p])
1193383
def path_for(self, *args):
        """"""
        if args and args[0].startswith(os.path.sep):
            return os.path.join(*args)
        return os.path.join(self._root_path or os.getcwd(), *args)