For `doc_id` returns the path from the
        repo to the doc file. This is useful because
        (if you know the remote), it lets you construct the full path.
976968
def get_rel_path_fragment(self, doc_id):
        
        with self._index_lock:
            r = self._doc_index[doc_id]
        fp = r[-1]
        return fp[(len(self.path) + 1):]
553855
def __inst_doc(self, docid, doc_type_name=None):
        
        doc = None
        docpath = self.fs.join(self.rootdir, docid)
        if not self.fs.exists(docpath):
            return None
        if doc_type_name is not None:
            # if we already know the doc type name
            for (is_doc_type, doc_type_name_b, doc_type) in DOC_TYPE_LIST:
                if (doc_type_name_b == doc_type_name):
                    doc = doc_type(self.fs, docpath, docid)
            if not doc:
                logger.warning(
                    ("Warning: unknown doc type found in the index: %s") %
                    doc_type_name
                )
        # otherwise we guess the doc type
        if not doc:
            for (is_doc_type, doc_type_name, doc_type) in DOC_TYPE_LIST:
                if is_doc_type(self.fs, docpath):
                    doc = doc_type(self.fs, docpath, docid)
                    break
        if not doc:
            logger.warning("Warning: unknown doc type for doc '%s'" % docid)

        return doc
601325
function getProjectPathFromHubID(id) {
		var query = sharedProject.findOne({hubid: id}, 'location');
		return query.exec()
		.then(function(doc) {
			return doc ? doc.location : undefined;
		});
	}
516802
def get_from_search_doc(cls, doc_id):
        
        # If the document was passed instead of the doc_id, get the document.
        if hasattr(doc_id, 'doc_id'):
            doc_id = doc_id.doc_id
        return cls.from_urlsafe(doc_id)
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))
132706
def _get_id(self, file_path):
        
        '''  '''
        
        title = '%s._get_id' % self.__class__.__name__
        
    # construct request kwargs
        list_kwargs = {
            'spaces': self.drive_space,
            'fields': 'files(id, parents)'
        }
    
    # determine path segments
        path_segments = file_path.split(os.sep)
        
    # walk down parents to file name
        parent_id = ''
        empty_string = ''
        while path_segments:
            walk_query = "name = '%s'" % path_segments.pop(0)
            if parent_id:
                walk_query += "and '%s' in parents" % parent_id
            list_kwargs['q'] = walk_query
            try:
                response = self.drive.list(**list_kwargs).execute()
            except:
                raise DriveConnectionError(title)
            file_list = response.get('files', [])
            if file_list:
                if path_segments:
                    parent_id = file_list[0].get('id')
                else:
                    file_id = file_list[0].get('id')
                    return file_id, parent_id
            else:
                return empty_string, empty_string
1087831
def _get_doc_by_raw_offset(self, doc_id):
        
        bounds = self._get_meta()[str(doc_id)].bounds
        return xml_utils.load_chunk(self.filename, bounds)
475068
def _get_doc_by_line_offset(self, doc_id):
        
        bounds = self._get_meta()[str(doc_id)].bounds
        return xml_utils.load_chunk(self.filename, bounds, slow=True)
403401
def get_path(self, repo):
        
        if repo.endswith('.git'):
            repo = repo.split('.git')[0]
        org, name = repo.split('/')[-2:]
        path = self.plugins_dir
        path = join(path, org, name)
        return path, org, name
714534
public static String getFilePath(int docId, String extention) {
        int[] split = getSplit(docId);
        return split[0] + "/" + split[1] + "/" + split[2] + "." + extention;
    }
896321
def get_repo_relpath(repo, relpath):
    
    from os import path
    if relpath[0:2] == "./":
        return path.join(repo, relpath[2::])
    else:
        from os import chdir, getcwd
        cd = getcwd()
        chdir(path.expanduser(repo))
        result = path.abspath(relpath)
        chdir(cd)
        return result
853859
def repo_id(self, repo: str) -> str:
        
        if repo.startswith("http"):
            repo_id = re.sub(r"https?://(.www)?", "", repo)
            repo_id = re.sub(r"\.git/?$", "", repo_id)
        else:
            repo_id = repo.replace("file://", "")
            repo_id = re.sub(r"\.git/?$", "", repo_id)
            if repo_id.startswith("~"):
                repo_id = str(Path(repo_id).resolve())

        # replaces everything that isn't alphanumeric, a dot or an underscore
        # to make sure it's a valid folder name and to keep it readable
        # multiple consecutive invalid characters replaced with a single underscore
        repo_id = re.sub(r"[^a-zA-Z0-9._]+", "_", repo_id)

        # and add a hash of the original to make it absolutely unique
        return repo_id + hashlib.sha256(repo.encode("utf-8")).hexdigest()
900637
def get_file_content(self, path):
        
        id = self._get_id_for_path(path)
        blob = self.repository._repo[id]
        return blob.as_pretty_string()
1107972
def get_repo_paths(path):
    
    repo_paths = []
    dirnames = (os.path.abspath(dirname) for dirname in os.listdir(path))
    for dirname in dirnames:
        try:
            get_scm(dirname)
            repo_paths.append(dirname)
        except VCSError:
            pass
    return repo_paths
576905
def download_archive_artifact_bundle(self, id_or_uri, file_path):
        

        uri = self.BACKUP_ARCHIVE_PATH + '/' + extract_id_from_uri(id_or_uri)
        return self._client.download(uri, file_path)
1239246
def _get_filepath(self, ext):
        
        filename = ("%s%d.%s" % (self.FILE_PREFIX, self.page_nb + 1, ext))
        return self.fs.join(self.doc.path, filename)
327352
def get_repo(self, repo: str, branch: str, *,
                 depth: Optional[int]=1,
                 reference: Optional[Path]=None
                 ) -> Repo:
        
        git_repo, _ = self.get_files(repo, branch, depth=depth, reference=reference)

        return git_repo