code: def fetch(which=None, mirror_url=None, resources_yaml='resources.yaml',
            force=False, reporthook=None):
      
      resources = _load(resources_yaml, None)
      if reporthook is None:
          reporthook = lambda r: juju_log('Fetching %s' % r, level='INFO')
      _fetch(resources, which, mirror_url, force, reporthook)
      failed = _invalid(resources, which)
      if failed:
          juju_log('Failed to fetch resource%s: %s' % (
              's' if len(failed) > 1 else '',
              ', '.join(failed)
          ), level='WARNING')
      else:
          juju_log('All resources successfully fetched', level='INFO')
      return not failed
docs: Attempt to fetch all resources for a charm.
  
      :param list which: A name, or a list of one or more resource names, to
          fetch.  If ommitted, all non-optional resources are fetched.
          You can also pass ``jujuresources.ALL`` to fetch all optional *and*
          required resources.
      :param str mirror_url: Fetch resources from the given mirror.
      :param str resources_yaml: Location of the yaml file containing the
          resource descriptions (default: ``./resources.yaml``).
          Can be a local file name or a remote URL.
      :param force bool: Force re-downloading of valid resources.
      :param func reporthook: Callback for reporting download progress.
          Will be called once for each resource, just prior to fetching, and will
          be passed the resource name.
      :return: True or False indicating whether the resources were successfully
          downloaded.