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`).
code: def __init__(
      self,
      url_template,
      target_path_template,
      pre_downloaded_path_template="",
  ):
      self.url_template = url_template
      self.target_path_template = target_path_template
      self.pre_downloaded_path_template = pre_downloaded_path_template
  
      # define a formatter which will process the templates. Subclasses
      # may override the standard ``''.format`` formatting by defining
      # their own formatter subclass here.
      self._formatter = string.Formatter()
  
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 1 to create a new Downloader object  with example: obj = Downloader(url_template, target_path_template, pre_downloaded_path_template)