Finds joining path with plus
541911
def find_path_join_using_plus(node):
    """"""
    return (
        isinstance(node, ast.BinOp)
        and isinstance(node.op, ast.Add)
        and isinstance(node.left, ast.BinOp)
        and isinstance(node.left.op, ast.Add)
        and isinstance(node.left.right, ast.Str)
        and node.left.right.s in ['/', "\\"]
    )
971118
def path2unix(path, nojoin=False, fromwinpath=False):
    ''''''
    if fromwinpath:
        pathparts = list(PureWindowsPath(path).parts)
    else:
        pathparts = list(PurePath(path).parts)
    if nojoin:
        return pathparts
    else:
        return posixpath.join(*pathparts)
475661
def join_path(base, *parts: str):
    """"""
    _parts = "/".join((_part.strip("/") for _part in parts))
    # _parts = '/'.join(parts)
    if base.endswith("/"):
        url = base + _parts
    else:
        url = base + "/" + _parts
    return url
323719
def join_path(*components):
        
        if components:
            path = components[0]
            for next in components[1:]:
                path = win32.PathAppend(path, next)
        else:
            path = ""
        return path
935112
def simplify_path(path):
    
    skip = {'..', '.', ''}
    stack = []
    paths = path.split('/')
    for tok in paths:
        if tok == '..':
            if stack:
                stack.pop()
        elif tok not in skip:
            stack.append(tok)
    return '/' + '/'.join(stack)
665392
function findSync(pattern, basePath, findDir) {
  const matches = [];

  (function findSyncRecurse(base) {
    let children;
    try {
      children = fs.readdirSync(base);
    } catch (exception) {
      if (exception.code === 'ENOENT') {
        return;
      }
      throw exception;
    }

    children.forEach((child) => {
      const childPath = path.join(base, child);
      const childIsDirectory = fs.lstatSync(childPath).isDirectory();
      const patternMatches = pattern.test(childPath);

      if (!patternMatches) {
        if (!childIsDirectory) {
          return;
        }
        findSyncRecurse(childPath);
        return;
      }

      if (!findDir) {
        matches.push(childPath);
        return;
      }

      if (childIsDirectory) {
        matches.push(childPath);
      }
    });
  })(basePath);
  return matches;
}
537256
def norm_join(prefix, suffix):
    
    if (prefix is None) and (suffix is None):
        return "."
    if prefix is None:
        return os.path.normpath(suffix)
    if suffix is None:
        return os.path.normpath(prefix)
    return os.path.normpath(os.path.join(prefix, suffix))
930426
def Plus(self, other):
    
    return Point(self.x + other.x,
                 self.y + other.y,
                 self.z + other.z)
127993
static int[] join(int[] pathToY, int[] pathToZ) {
        int[] path = copyOf(pathToY, pathToY.length + pathToZ.length);
        int j = path.length - 1;
        for (int i = 0; i < pathToZ.length; i++) {
            path[j--] = pathToZ[i];
        }
        return path;
    }
483626
function join(base) {
  var args = [].slice.call(arguments, 1);
  base = str(base);
  var m = base.match(/^(\w+:\/\/)(.*)/);
  if (m) {
    base = m[1];
    if (!m[2] && !args.join('')) { return base; }
    args.unshift(m[2]);
  }
  else {
    args.unshift(base);
    base = '';
  }
  return base + ppath.join.apply(this, _.map(args,str));
}
131686
def find(self, start, end):
        """"""
        if self.intervals and not end < self.intervals[0].start:
            overlapping = [i for i in self.intervals if i.end >= start
                                                    and i.start <= end]
        else:
            overlapping = []

        if self.left and start <= self.center:
            overlapping += self.left.find(start, end)

        if self.right and end >= self.center:
            overlapping += self.right.find(start, end)

        return overlapping
1026803
def join(*args, **kwargs):
    """"""
    import os.path
    if _is_list(args[0]):
        return os.path.join(*args[0])
    return os.path.join(*args, **kwargs)
273754
def join_field(path):
    
    output = ".".join([f.replace(".", "\\.") for f in path if f != None])
    return output if output else "."
543808
public static String join(String endpoint, String path) {
        if (endpoint == null || endpoint.isEmpty())
            return path;
        if (path == null || path.isEmpty())
            return endpoint;

        if (StringUtils.endsWith(endpoint, "/") && path.startsWith("/")) {
            return endpoint + path.substring(1);
        } else if (StringUtils.endsWith(endpoint, "/") ^ path.startsWith("/")) {
            return endpoint + path;
        }
        return endpoint + "/" + path;
    }
883335
def match_path(original_parts, remaining_parts, node)
      # Take off the top part and get the rest into a new array
      # part will be nil if we are out of parts (fancy how that works out, now
      # stand in wonder about how much someone thought this through, though
      # really I just got lucky)
      part, *parts = remaining_parts

      if part.nil?
        if node[part]
          # We found a match, replace the bindings and return
          # TODO: Handle nested
          setup_bindings_in_params(original_parts, node[part])
        else
          false
        end
      else
        if (new_node = node[part])
          # Direct match for section, continue
          result = match_path(original_parts, parts, new_node)
          return result if result
        end
        if (new_node = node['*'])
          # Match on binding single section
          result = match_path(original_parts, parts, new_node)
          return result if result
        end
        if ((params = node['**']) && params && (params = params[nil]))
          # Match on binding multiple sections
          result = setup_bindings_in_params(original_parts, params)
          return result if result
        end

        return false
      end
    end
751337
private void findAdditionalPossiblePaths(Map<String, List<String>> pathNodes,
                                             List<String> paths,
                                             String base,
                                             String baseType,
                                             int maxDepth,
                                             String logPrefix) {
        if (maxDepth == 0) {
            return;
        }

        LOG.debug("Possible:{} > {}:{}", logPrefix, baseType, base);

        if (pathNodes.containsKey(baseType)) {
            List<String> childPaths = pathNodes.get(baseType);
            if (childPaths != null) {
                for (String childPath : childPaths) {
                    final int colonPos = childPath.indexOf(':');
                    final String childType = childPath.substring(0, colonPos);
                    final String childName = childPath.substring(colonPos + 1);

                    String childBase;
                    if (base.isEmpty()) {
                        childBase = childName;
                    } else {
                        if (childName.isEmpty()) {
                            childBase = base;
                        } else {
                            childBase = base + '.' + childName;
                        }
                    }

                    String newPath = childType + ':' + childBase;
                    if (!paths.contains(newPath)) {
                        LOG.debug("Possible:{} + {}:{}", logPrefix, childType, childBase);
                        paths.add(childType + ':' + childBase);

                        findAdditionalPossiblePaths(pathNodes, paths, childBase, childType, maxDepth - 1, logPrefix + "--");
                    }
                }
            }
        }
        LOG.debug("Possible:{} < {}:{}", logPrefix, baseType, base);
    }
696196
def find(C, node, path, namespaces=None, extensions=None, smart_strings=True, **args):
        """"""
        xp = node.xpath(
            path,
            namespaces=namespaces or C.NS,
            extensions=extensions,
            smart_strings=smart_strings,
            **args
        )
        if len(xp) > 0:
            return xp[0]