class_docstr: Represents a resource, that can be configured easily, which knows
  how to acquire itself (perhaps via HTTP).
  
  The key interface method is :meth:`path` - typically *all* external calls
  will be made to that method. To get hold of an appropriate
  :class:`Downloader` instance the :func:`Downloader.from_config` static
  method should be considered.
  
  Parameters
  ----------
  url_template
      The template of the full URL representing this
      resource.
  
  target_path_template
      The template of the full path to the file
      that this Downloader represents. Typically the path will be a
      subdirectory of ``config['data_dir']``, but this is not a strict
      requirement. If the file does not exist when calling
      :meth:`Downloader.path` it will be downloaded to this location.
  
  pre_downloaded_path_template: optional
      The template of a full path of a file which has been downloaded
      outside of this Downloader which should be used as the file that
      this resource represents. If the file does not exist when
      :meth:`Downloader.path` is called it will not be downloaded
      to this location (unlike the ``target_path_template`` argument).
  
  Note
  ----
      All ``*_template`` arguments should be formattable using the
      standard :meth:`string.format` rules. The formatting itself
      is not done until a call to a subsequent method (such as
      :meth:`Downloader.path`).
docstr: Returns the path to a file on disk that this resource represents.
  
  If the file doesn't exist in :meth:`pre_downloaded_path` then it
  will check whether it exists in :meth:`target_path`, otherwise
  the resource will be downloaded via :meth:`acquire_resouce` from
  :meth:`url` to :meth:`target_path`.
  
  Typically, this is the method that most applications will call,
  allowing implementers of new Downloaders to specialise
  :meth:`acquire_resource`.
  
  Parameters
  ----------
  format_dict
      The dictionary which is used to replace certain
      template variables. Subclasses should document which keys are
      expected as a minimum in their ``FORMAT_KEYS`` class attribute.
docstr_tok: ["Returns","the","path","to","a","file","on","disk","that","this","resource","represents",".","If","the","file","does","n't","exist","in",":","meth",":","`","pre_downloaded_path","`","then","it","will","check","whether","it","exists","in",":","meth",":","`","target_path","`",",","otherwise","the","resource","will","be","downloaded","via",":","meth",":","`","acquire_resouce","`","from",":","meth",":","`","url","`","to",":","meth",":","`","target_path","`",".","Typically",",","this","is","the","method","that","most","applications","will","call",",","allowing","implementers","of","new","Downloaders","to","specialise",":","meth",":","`","acquire_resource","`",".","Parameters","--","--","--","--","--","format_dict","The","dictionary","which","is","used","to","replace","certain","template","variables",".","Subclasses","should","document","which","keys","are","expected","as","a","minimum","in","their","``","FORMAT_KEYS","``","class","attribute","."]
code: def path(self, format_dict):
      """
      Returns the path to a file on disk that this resource represents.
  
      If the file doesn't exist in :meth:`pre_downloaded_path` then it
      will check whether it exists in :meth:`target_path`, otherwise
      the resource will be downloaded via :meth:`acquire_resouce` from
      :meth:`url` to :meth:`target_path`.
  
      Typically, this is the method that most applications will call,
      allowing implementers of new Downloaders to specialise
      :meth:`acquire_resource`.
  
      Parameters
      ----------
      format_dict
          The dictionary which is used to replace certain
          template variables. Subclasses should document which keys are
          expected as a minimum in their ``FORMAT_KEYS`` class attribute.
  
      """
      pre_downloaded_path = self.pre_downloaded_path(format_dict)
      target_path = self.target_path(format_dict)
      if (
          pre_downloaded_path is not None
          and pre_downloaded_path.exists()
      ):
          result_path = pre_downloaded_path
      elif target_path.exists():
          result_path = target_path
      else:
          # we need to download the file
          result_path = self.acquire_resource(target_path, format_dict)
  
      return result_path
  
imports: import collections
  from pathlib import Path
  import string
  from urllib.request import urlopen
  import warnings
  from cartopy import config
label_desc: Use image node_id 5 for calling the Downloader obj's underlying member method code with example usage: obj.path(format_dict) and returns: result_path