class_docstr: Resolve JSON References.
  
  Arguments:
  
      base_uri (str):
  
          The URI of the referring document
  
      referrer:
  
          The actual referring document
  
      store (dict):
  
          A mapping from URIs to documents to cache
  
      cache_remote (bool):
  
          Whether remote refs should be cached after first resolution
  
      handlers (dict):
  
          A mapping from URI schemes to functions that should be used
          to retrieve them
  
      urljoin_cache (:func:`functools.lru_cache`):
  
          A cache that will be used for caching the results of joining
          the resolution scope to subscopes.
  
      remote_cache (:func:`functools.lru_cache`):
  
          A cache that will be used for caching the results of
          resolved remote URLs.
  
  Attributes:
  
      cache_remote (bool):
  
          Whether remote refs should be cached after first resolution
class_docstr_tok: ["Resolve","JSON","References",".","Arguments",":","base_uri","(","str",")",":","The","URI","of","the","referring","document","referrer",":","The","actual","referring","document","store","(","dict",")",":","A","mapping","from","URIs","to","documents","to","cache","cache_remote","(","bool",")",":","Whether","remote","refs","should","be","cached","after","first","resolution","handlers","(","dict",")",":","A","mapping","from","URI","schemes","to","functions","that","should","be","used","to","retrieve","them","urljoin_cache","(",":","func",":","`","functools.lru_cache","`",")",":","A","cache","that","will","be","used","for","caching","the","results","of","joining","the","resolution","scope","to","subscopes",".","remote_cache","(",":","func",":","`","functools.lru_cache","`",")",":","A","cache","that","will","be","used","for","caching","the","results","of","resolved","remote","URLs",".","Attributes",":","cache_remote","(","bool",")",":","Whether","remote","refs","should","be","cached","after","first","resolution"]
docstr: Resolve a remote ``uri``.
  
  If called directly, does not check the store first, but after
  retrieving the document at the specified URI it will be saved in
  the store if :attr:`cache_remote` is True.
  
  .. note::
  
      If the requests_ library is present, ``jsonschema`` will use it to
      request the remote ``uri``, so that the correct encoding is
      detected and used.
  
      If it isn't, or if the scheme of the ``uri`` is not ``http`` or
      ``https``, UTF-8 is assumed.
  
  Arguments:
  
      uri (str):
  
          The URI to resolve
  
  Returns:
  
      The retrieved document
  
  .. _requests: https://pypi.org/project/requests/
docstr_tok: ["Resolve","a","remote","``","uri","``",".","If","called","directly",",","does","not","check","the","store","first",",","but","after","retrieving","the","document","at","the","specified","URI","it","will","be","saved","in","the","store","if",":","attr",":","`","cache_remote","`","is","True",".","..","note",":",":","If","the","requests_","library","is","present",",","``","jsonschema","``","will","use","it","to","request","the","remote","``","uri","``",",","so","that","the","correct","encoding","is","detected","and","used",".","If","it","is","n't",",","or","if","the","scheme","of","the","``","uri","``","is","not","``","http","``","or","``","https","``",",","UTF-8","is","assumed",".","Arguments",":","uri","(","str",")",":","The","URI","to","resolve","Returns",":","The","retrieved","document","..","_requests",":","https",":","\/\/pypi.org\/project\/requests\/"]
code: def resolve_remote(self, uri):
      """
      Resolve a remote ``uri``.
  
      If called directly, does not check the store first, but after
      retrieving the document at the specified URI it will be saved in
      the store if :attr:`cache_remote` is True.
  
      .. note::
  
          If the requests_ library is present, ``jsonschema`` will use it to
          request the remote ``uri``, so that the correct encoding is
          detected and used.
  
          If it isn't, or if the scheme of the ``uri`` is not ``http`` or
          ``https``, UTF-8 is assumed.
  
      Arguments:
  
          uri (str):
  
              The URI to resolve
  
      Returns:
  
          The retrieved document
  
      .. _requests: https://pypi.org/project/requests/
      """
      try:
          import requests
      except ImportError:
          requests = None
  
      scheme = urlsplit(uri).scheme
  
      if scheme in self.handlers:
          result = self.handlers[scheme](uri)
      elif scheme in ["http", "https"] and requests:
          # Requests has support for detecting the correct encoding of
          # json over http
          result = requests.get(uri).json()
      else:
          # Otherwise, pass off to urllib and assume utf-8
          with urlopen(uri) as url:
              result = json.loads(url.read().decode("utf-8"))
  
      if self.cache_remote:
          self.store[uri] = result
      return result
  
imports: from __future__ import division
  from warnings import warn
  import contextlib
  import json
  import numbers
  from six import add_metaclass
  from jsonschema import _legacy_validators, _types, _utils, _validators, exceptions
  from jsonschema.compat import Sequence, int_types, iteritems, lru_cache, str_types, unquote, urldefrag, urljoin, urlopen, urlsplit
  from jsonschema.exceptions import ErrorTree
label_desc: Use image node_id 12 for calling the RefResolver obj's underlying member method code with example usage: obj.resolve_remote(uri) and returns: result