For the given mold_id_path, look up the mold_id and translate
        that path to its filesystem equivalent.
548158
def lookup_path(self, mold_id_path, default=_marker):
        

        fragments = mold_id_path.split('/')
        mold_id = '/'.join(fragments[:2])
        try:
            subpath = []
            for piece in fragments[2:]:
                if (sep in piece or (altsep and altsep in piece) or
                        piece == pardir):
                    raise KeyError
                elif piece and piece != '.':
                    subpath.append(piece)
            path = self.mold_id_to_path(mold_id)
        except KeyError:
            if default is _marker:
                raise
            return default

        return join(path, *subpath)
1010646
def pyfile_path(path):
    
    if "/" in path:
        parts = path.split("/")
        join_term = "/"
    elif "\\" in path:
        parts =path.split("\\")
        join_term = "\\"
    parts.reverse()
    base = parts[:parts.index('rdfframework')]
    base.reverse()
    return join_term.join(base)
1170371
def from_path(path):
  
  for item in ref:
    build = ref[item]
    valid_ = build['is_valid']
    if valid_(path) is True:
      return build['builder'](path)
  raise errors.InvalidProjectStructure()
64510
def build_id_of(path)
      File.open(path) { |f| ELFTools::ELFFile.new(f).build_id }
    end
467741
def object_path(collection, id):
    """"""
    _logger.debug(type(id))
    _logger.debug(id)
    if isinstance(id, dict) and 'id' in id:
        id = id['id']
    normalized_id = normalize_text(str(id), lcase=False)
    return os.path.join(_basepath, collection,
        '%s.%s' % (normalized_id, _ext))
1024758
def _OpenFileObject(self, path_spec):
    
    if not path_spec.HasParent():
      raise errors.PathSpecError(
          'Unsupported path specification without parent.')

    resolver.Resolver.key_chain.ExtractCredentialsFromPathSpec(path_spec)

    file_object = resolver.Resolver.OpenFileObject(
        path_spec.parent, resolver_context=self._resolver_context)
    fvde_volume = pyfvde.volume()
    fvde.FVDEVolumeOpen(
        fvde_volume, path_spec, file_object, resolver.Resolver.key_chain)
    return fvde_volume
1262785
def get_root_path(self, path):
        """"""
        # Look at the directories present in the current working directory. In
        # case a .svn directory is present, we know we are in the root directory
        # of a Subversion repository (for Subversion 1.7.x). In case no
        # repository specific folder is found, and the current directory has a
        # parent directory, look if a repository specific directory can be found
        # in the parent directory.
        while path != '/':
            if '.svn' in os.listdir(path):
                return path
            path = os.path.abspath(os.path.join(path, os.pardir))

        # No Subversion repository found.
        return None
1299873
def canonizePath(path):
    """"""
    return os.path.abspath(os.path.normpath(os.path.realpath(path)))
67629
def expand_path(*paths):
    """"""
    return os.path.join(
        os.path.dirname(os.path.realpath(sys.argv[0])), *paths)
128329
def import_path(self):
    """"""
    return os.path.join(self.remote_root, self.pkg) if self.pkg else self.remote_root
1237464
def getobjpath(obj, path):
    
    if not path:
        return obj
    if path.startswith("["):
        item = path[1:path.index("]")]
        return getobjpath(obj[item], path[len(item) + 2:])
    if path.startswith("."):
        path = path[1:]
    if "." in path or "[" in path:
        dot_idx = path.find(".")
        bracket_idx = path.find("[")
        if dot_idx == -1 or bracket_idx < dot_idx:
            idx = bracket_idx
            next_idx = idx
        else:
            idx = dot_idx
            next_idx = idx + 1
        attr = path[:idx]
        return getobjpath(getattr(obj, attr), path[next_idx:])
    return getattr(obj, path)
1284644
def _path_from_module(module):
        """"""
        # Convert paths to list because Python's _NamespacePath doesn't support
        # indexing.
        paths = list(getattr(module, '__path__', []))
        if len(paths) != 1:
            filename = getattr(module, '__file__', None)
            if filename is not None:
                paths = [os.path.dirname(filename)]
            else:
                # For unknown reasons, sometimes the list returned by __path__
                # contains duplicates that must be removed.
                paths = list(set(paths))
        if len(paths) > 1:
            raise ImproperlyConfigured(
                "The bot module %r has multiple filesystem locations (%r); "
                "you must configure this bot with an AppConfig subclass "
                "with a 'path' class attribute." % (module, paths))
        elif not paths:
            raise ImproperlyConfigured(
                "The bot module %r has no filesystem location, "
                "you must configure this bot with an AppConfig subclass "
                "with a 'path' class attribute." % (module,))
        return paths[0]
892463
def relpath(self, path, start=None):
        """"""
        if not path:
            raise ValueError("no path specified")
        path = make_string_path(path)
        if start is not None:
            start = make_string_path(start)
        else:
            start = self.filesystem.cwd
        if self.filesystem.alternative_path_separator is not None:
            path = path.replace(self.filesystem.alternative_path_separator,
                                self._os_path.sep)
            start = start.replace(self.filesystem.alternative_path_separator,
                                  self._os_path.sep)
        path = path.replace(self.filesystem.path_separator, self._os_path.sep)
        start = start.replace(
            self.filesystem.path_separator, self._os_path.sep)
        path = self._os_path.relpath(path, start)
        return path.replace(self._os_path.sep, self.filesystem.path_separator)
146735
def from_path(cls, path: pathlib.Path) -> 'Directory':
        
        if not path.is_dir():
            raise ValueError('Path does not point to a directory')
        return Directory(path.name, {entity.name: Entity.from_path(entity)
                                     for entity in path.iterdir()})
532403
def convert_to_path(name):
    """"""
    if name.startswith('.'):
        remainder = name.lstrip('.')
        dot_count = (len(name) - len(remainder))
        prefix = '../'*(dot_count-1)
    else:
        remainder = name
        dot_count = 0
        prefix = ''
    filename = prefix + os.path.join(*remainder.split('.'))
    return (filename, dot_count)
764468
def join_path(path):
    """"""

    if isinstance(path, str):
        return path

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

        return os.sep.join([self._original_dir, p])