:type path: str

        :rtype: ApiContext
15269
def restore(cls, path=None):
        

        if path is None:
            path = cls._PATH_API_CONTEXT_DEFAULT

        with open(path, cls._FILE_MODE_READ) as file_:
            return cls.from_json(file_.read())
362363
def get(self, path, params=None):
        
        api_url = self.api_base_url + path

        headers = None
        try:
            headers = {
                "Authorization": 'Bearer {}'.format(settings.WP_API_AUTH_TOKEN)
            }
        except AttributeError:
            if self.first_get:
                logger.warning("WP_API_AUTH_TOKEN not found in settings. Only public APIs are available.")

        self.first_get = False

        return requests.get(api_url, headers=headers, params=params)
837312
def processPath(self, path, objectType):
        '''
        
        '''
        if objectType == win32security.SE_REGISTRY_KEY:
            splt = path.split("\\")
            hive = self.getSecurityHkey(splt.pop(0).upper())
            splt.insert(0, hive)
            path = r'\\'.join(splt)
        else:
            path = os.path.expandvars(path)
        return path
374271
def path(self):
        
        path = self._path()
        statobj = os.stat(path)
        ae = self.request.META.get('HTTP_ACCEPT_ENCODING', '')
        if re_accepts_gzip.search(ae) and getattr(settings, 'UMAP_GZIP', True):
            gzip_path = "{path}{ext}".format(path=path, ext=self.EXT)
            up_to_date = True
            if not os.path.exists(gzip_path):
                up_to_date = False
            else:
                gzip_statobj = os.stat(gzip_path)
                if statobj.st_mtime > gzip_statobj.st_mtime:
                    up_to_date = False
            if not up_to_date:
                gzip_file(path, gzip_path)
            path = gzip_path
        return path
1126620
function get_path(context, path, options = {}) {
	const node = get_node_by_path(context, path, options);
	return node_type(node) == NodeTypes.NODE
		? get_all_node_props(context, node, options)
		: node;
}
684014
def __ConstructRelativePath(self, method_config, request,
                                relative_path=None):
        """"""
        python_param_names = util.MapParamNames(
            method_config.path_params, type(request))
        params = dict([(param, getattr(request, param, None))
                       for param in python_param_names])
        params = util.MapRequestParams(params, type(request))
        return util.ExpandRelativePath(method_config, params,
                                       relative_path=relative_path)
1120668
def api_url(self):
        ''''''
        return pathjoin(Request.path, self.id, url=self.bin.api_url)
186647
def __path(self, path):
        
        if path.startswith(self.__prefix):
            return path

        return "{}{}".format(self.__prefix, path)
293373
def set_api_from_config_path(self):
        """"""
        config = ConfigParser(allow_no_value=False)
        config.optionxform = str
        config.read(self.config_path, "utf-8")
        if config.has_option("defaults", "dynamic_loading"):
            dynamic_loading = config.get("defaults", "dynamic_loading")
        else:
            dynamic_loading = "infura"
        if dynamic_loading == "infura":
            self.set_api_rpc_infura()
        elif dynamic_loading == "localhost":
            self.set_api_rpc_localhost()
        else:
            self.set_api_rpc(dynamic_loading)
641215
def context(self):
        
        ret = libxml2mod.xmlXPathParserGetContext(self._o)
        if ret is None:raise xpathError('xmlXPathParserGetContext() failed')
        __tmp = xpathContext(_obj=ret)
        return __tmp
193790
def context(self, name):
        
        data = self._context(name)
        context = data.get("context")
        if context:
            return context

        assert self.load_path
        context_path = os.path.join(self.load_path, "contexts", "%s.rxt" % name)
        context = ResolvedContext.load(context_path)
        data["context"] = context
        data["loaded"] = True
        return context
391928
function _getContextsFromPath(path) {
  const allContexts = {
    add: [],
    remove: [],
  }
  _each(_pathContexts, pathContext => {
    let contextAdded = false
    const contexts = pathContext.contexts
    const regexes = pathContext.regexes
    const paths = pathContext.paths

    _each(regexes, regex => {
      regex.lastIndex = 0
      const matches = regex.exec(path)
      if (matches && matches.length > 0) {
        const contextsToAdd = []
        _each(contexts, context => {
          const replacedContext = context.replace(
            _contextRegex,
            (match, group) => {
              return matches[group]
            },
          )
          contextsToAdd.push(replacedContext)
        })
        allContexts.add = allContexts.add.concat(contextsToAdd)
        contextAdded = true
      }
      return !contextAdded
    })

    if (!contextAdded) {
      _each(paths, pathToTry => {
        if (path === pathToTry) {
          allContexts.add = allContexts.add.concat(contexts)
          contextAdded = true
        }
        return !contextAdded
      })
      if (!contextAdded) {
        allContexts.remove = allContexts.remove.concat(contexts)
      }
    }
  })
  return allContexts
}
118910
def validate_path_parameters(target_path, api_path, path_parameters, context):
    
    base_path = context.get('basePath', '')
    full_api_path = re.sub(NORMALIZE_SLASH_REGEX, '/', base_path + api_path)
    parameter_values = get_path_parameter_values(
        target_path, full_api_path, path_parameters, context,
    )
    validate_parameters(parameter_values, path_parameters, context=context)
769674
def generate_path_parameters_validator(api_path, path_parameters, context):
    
    path_parameter_validator = functools.partial(
        validate_path_parameters,
        api_path=api_path,
        path_parameters=path_parameters,
        context=context,
    )
    return path_parameter_validator
1333465
def render_path(self, template_path, *context, **kwargs):
        
        loader = self._make_loader()
        template = loader.read(template_path)

        return self._render_string(template, *context, **kwargs)
528282
def path(self, which=None):
        
        base = urljoin(
            self._server_config.url + '/',
            self._meta['api_path']  # pylint:disable=no-member
        )
        if (which == 'self' or which is None) and hasattr(self, 'upload_id'):
            # pylint:disable=E1101
            return urljoin(base + '/', str(self.upload_id))
        return super(ContentUpload, self).path(which)
756422
def path(self, *paths, **kwargs):
        
        return self.__class__(self.__root__, *paths, **kwargs)