r"""
	Wrapper around os.path.join that works with Windows drive letters.

	>>> join('d:\\foo', '\\bar')
	'd:\\bar'
432184
def join(*paths):
	
	"""
	paths_with_drives = map(os.path.splitdrive, paths)
	drives, paths = zip(*paths_with_drives)
	# the drive we care about is the last one in the list
	drive = next(filter(None, reversed(drives)), '')
	return os.path.join(drive, os.path.join(*paths))
996382
def convert_windows_path_to_cygwin(path):
    """"""
    if len(path) > 2 and path[1] == ":" and path[2] == "\\":
        newpath = cygwin_full_path_prefix + "/" + path[0]
        if len(path) > 3: newpath += "/" + path[3:]
        path = newpath
    path = path.replace("\\", "/")
    return path
1148459
function join() {
    var path = '';
    var args = slice.call(arguments, 0);
    if (arguments.length <= 1) args.unshift(cwd());

    for (var i = 0; i < args.length; i += 1) {
      var segment = args[i];
      if (!isString(segment)) {
        throw new TypeError ('Arguemnts to path.join must be strings');
      }
      if (segment) {
        if (!path) {
          path += segment;
        } else {
          path += '/' + segment;
        }
      }
    }

    return normalize(path);
  }
685248
def safe_join(directory: FilePath, *paths: FilePath) -> Path:
    
    try:
        safe_path = file_path_to_path(directory).resolve(strict=True)
        full_path = file_path_to_path(directory, *paths).resolve(strict=True)
    except FileNotFoundError:
        raise NotFound()
    try:
        full_path.relative_to(safe_path)
    except ValueError:
        raise NotFound()
    return full_path
1190358
def joinpath(self, *args):
        
        return self.__class__(os.path.join(self, *args))
384268
function join(args) {
  var arg;
  var i = 0;
  var path = '';

  if (arguments.length === 0) {
    return utils.sep;
  }

  while ((arg = arguments[i++])) {
    if (typeof arg !== 'string') {
      throw new TypeError('utils.join() expects string arguments');
    }

    path += utils.sep + arg;
  }

  path = path.replace(/\/+/g, utils.sep);
  if (path[path.length - 1] === utils.sep) {
    path = path.substring(0, path.length - 1);
  }
  return path;
}
506869
def join_path(*path_to_join, **kwargs):
    
    if "get_root" in kwargs:
        get_root = kwargs["get_root"]
    else:
        # default value
        get_root = False
    sdp = dataset_path(get_root=get_root)
    pth = os.path.join(sdp, *path_to_join)
    logger.debug("sample_data_path" + str(sdp))
    logger.debug("path " + str(pth))
    return pth
706608
def rel_path(filename):
    
    return os.path.join(os.getcwd(), os.path.dirname(__file__), filename)
599540
def join_path(a, *p):
    """"""
    path = a
    for b in p:
        if len(b) == 0:
            continue
        if b.startswith('/'):
            path += b[1:]
        elif path == '' or path.endswith('/'):
            path += b
        else:
            path += '/' + b
    # END for each path token to add
    return path
582753
def join(items, separator=None):
    
    if not items:
        return ''
    if separator is None:
        separator = _default_separator()
    return separator.join([str(item) for item in items])
972357
function replacePath (path, keys) {
  var index = 0;

  function replace (_, escaped, prefix, key, capture, group, suffix, escape) {
    if (escaped) {
      return escaped;
    }

    if (escape) {
      return '\\' + escape;
    }

    var repeat   = suffix === '+' || suffix === '*';
    var optional = suffix === '?' || suffix === '*';

    keys.push({
      name:      key || index++,
      delimiter: prefix || '/',
      optional:  optional,
      repeat:    repeat
    });

    prefix = prefix ? ('\\' + prefix) : '';
    capture = escapeGroup(capture || group || '[^' + (prefix || '\\/') + ']+?');

    if (repeat) {
      capture = capture + '(?:' + prefix + capture + ')*';
    }

    if (optional) {
      return '(?:' + prefix + '(' + capture + '))?';
    }

    // Basic parameter support.
    return prefix + '(' + capture + ')';
  }

  return path.replace(PATH_REGEXP, replace);
}
139634
def include(d, e):
    """"""

    return (d, [f for f in glob.glob('%s/%s' % (d, e)) if os.path.isfile(f)])
1349689
def join(l, conj=CONJUNCTION, im_a_moron=MORON_MODE, separator=COMMA):
    """"""

    collector = []
    left = len(l)
    separator = separator + SPACE
    conj = conj + SPACE

    for _l in l[:]:

        left += -1

        collector.append(_l)
        if left == 1:
            if len(l) == 2 or im_a_moron:
                collector.append(SPACE)
            else:
                collector.append(separator)

            collector.append(conj)

        elif left is not 0:
            collector.append(separator)

    return unicode(str().join(collector))
1032949
def path_to(self, p):
        """"""
        if os.path.isabs(p):
            return p

        return os.sep.join([self._original_dir, p])
866758
public static String joinPath(String path1, String path2) {
        return path1 + Constants.SEP_STRING + path2;
    }
1223899
def path_to_tuple(path, windows=False):
    
    if windows:
        path_tup = tuple(path.split('\\'))
    else:
        path_tup = tuple(path.split('/'))
    #
    # Normalize UTF-8 encoding to consistent form so cache lookups will work, see
    # https://docs.python.org/3.6/library/unicodedata.html#unicodedata.normalize
    path_tup = tuple(normalize('NFD', part) for part in path_tup)
    return path_tup
106568
def _join_keys_v1(left, right):
    
    if left.endswith(':') or '::' in left:
        raise ValueError("Can't join a left string ending in ':' or containing '::'")
    return u"{}::{}".format(_encode_v1(left), _encode_v1(right))