Absolute path to the data file for `anchor_id`.
164149
def _anchor_path(self, anchor_id):
        ""
        file_name = '{}.yml'.format(anchor_id)
        file_path = self._spor_dir / file_name
        return file_path
1218693
def load_file_contents(file_path, as_list=True):
    """"""
    abs_file_path = join(HERE, file_path)
    with open(abs_file_path, encoding='utf-8') as file_pointer:
        if as_list:
            return file_pointer.read().splitlines()
        return file_pointer.read()
3268
def get_route(self, file_id):

        ''' 
        '''

        title = '%s.get_route' % self.__class__.__name__

    # validate inputs
        input_fields = {
            'file_id': file_id,
        }
        for key, value in input_fields.items():
            if value:
                object_title = '%s(%s=%s)' % (title, key, str(value))
                self.fields.validate(value, '.%s' % key, object_title)

    # construct key word arguments
        request_kwargs = {
            'url': '%s/getFile' % self.api_endpoint,
            'data': {
                'file_id': file_id
            }
        }

    # send request
        response_details = self._post_request(**request_kwargs)

        return response_details
666232
def link(self):
    """"""
    if self._link is None:
      self._link = ''

      if not self.IsLink():
        return self._link

      location = getattr(self.path_spec, 'location', None)
      if location is None:
        return self._link

      self._link = os.readlink(location)
      self._link = os.path.abspath(self._link)
    return self._link
1172688
def cache_path(archive, root_dir, build_id):
    
    root = root_dir or Path("~/.shiv").expanduser()
    name = Path(archive.filename).resolve().stem
    return root / f"{name}_{build_id}"
480674
def file_abspath(self, resource):
        """"""
        warnings.warn(
            "file_abspath is deprecated; use resource_path instead",
            DeprecationWarning, stacklevel=2)
        return self.resource_path(resource)
59599
private URI handleLocalDita(final URI href, final AttributesImpl atts) {
        final URI attValue = href;
        final int sharpIndex = attValue.toString().indexOf(SHARP);
        URI pathFromMap;
        URI retAttValue;
        if (sharpIndex != -1) { // href value refer to an id in a topic
            if (sharpIndex == 0) {
                pathFromMap = toURI(filePath);
            } else {
                pathFromMap = toURI(filePath).resolve(attValue.toString().substring(0, sharpIndex));
            }
            XMLUtils.addOrSetAttribute(atts, ATTRIBUTE_NAME_OHREF, toURI(pathFromMap + attValue.toString().substring(sharpIndex)).toString());
            final String topicID = getTopicID(attValue.getFragment());
            final int index = attValue.toString().indexOf(SLASH, sharpIndex);
            final String elementId = index != -1 ? attValue.toString().substring(index) : "";
            final URI pathWithTopicID = setFragment(dirPath.toURI().resolve(pathFromMap), topicID);
            if (util.findId(pathWithTopicID)) {// topicId found
                retAttValue = toURI(SHARP + util.getIdValue(pathWithTopicID) + elementId);
            } else {// topicId not found
                retAttValue = toURI(SHARP + util.addId(pathWithTopicID) + elementId);
            }
        } else { // href value refer to a topic
            pathFromMap = toURI(filePath).resolve(attValue.toString());
            URI absolutePath = dirPath.toURI().resolve(pathFromMap);
            XMLUtils.addOrSetAttribute(atts, ATTRIBUTE_NAME_OHREF, pathFromMap.toString());
            if (util.findId(absolutePath)) {
                retAttValue = toURI(SHARP + util.getIdValue(absolutePath));
            } else {
                final String fileId = util.getFirstTopicId(absolutePath, false);
                final URI key = setFragment(absolutePath, fileId);
                if (util.findId(key)) {
                    util.addId(absolutePath, util.getIdValue(key));
                    retAttValue = toURI(SHARP + util.getIdValue(key));
                } else {
                    retAttValue = toURI(SHARP + util.addId(absolutePath));
                    util.addId(key, util.getIdValue(absolutePath));
                }

            }
        }
        return retAttValue;
    }
657861
def get_fn_link(ft)->str:
    ""
    ft = getattr(ft, '__func__', ft)
    anchor = strip_fastai(get_anchor(ft))
    module_name = strip_fastai(get_module_name(ft))
    base = '' if use_relative_links else FASTAI_DOCS
    return f'{base}/{module_name}.html#{anchor}'
1027530
function mklink (anchor, name) {
    var id = mkid(name);
    if (anchor) {
        if (!defined[id]) {
            defined[id] = true;
            return "<a name=\"" + id + "\">" + name + "</a>";
        }
        else
            return name;
    }
    else
        return "<a href=\"#" + id + "\">" + name + "</a>";
}
476145
def get_data_path(module_id: str) -> Path:
    
    profile = coordinator.profile
    data_path = get_base_path() / 'profiles' / profile / module_id
    if not data_path.exists():
        data_path.mkdir(parents=True)
    return data_path
655411
def get_rlbot_directory() -> str:
    """"""
    return os.path.dirname(os.path.dirname(os.path.realpath(__file__)))
648440
def find_raw(self, file_id):
        """"""
        raw_handler = lambda resp, data: data
        return self.transport.GET(url='/file/%d/raw' % file_id, handler=raw_handler)
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
389455
def make_anchor_id(self):
        
        result = re.sub(
            '[^a-zA-Z0-9_]', '_', self.user + '_' + self.timestamp)
        return result
638342
def _get_member_file_data(member_data, id_filename=False):
        
        file_data = {}
        for datafile in member_data['data']:
            if id_filename:
                basename = '{}.{}'.format(datafile['id'], datafile['basename'])
            else:
                basename = datafile['basename']
            if (basename not in file_data or
                    arrow.get(datafile['created']) >
                    arrow.get(file_data[basename]['created'])):
                file_data[basename] = datafile
        return file_data
1172626
def _GetRelPath(self, filename):
		""""""
		assert filename.startswith(self.subdir), (filename, self.subdir)
		return filename[len(self.subdir):].lstrip(r"\/")
285619
def doc_dir(self):
        """"""
        from os.path import abspath

        if not self.ref:
            return None

        u = parse_app_url(self.ref)
        return abspath(dirname(u.path))