docs: def auto_download(status,
                    credentials=None, subjects_path=None, overwrite=False, release='HCP_1200',
                    database='hcp-openaccess', retinotopy_path=None, retinotopy_cache=True):
      '''
      auto_download(True) enables automatic downloading of HCP subject data when the subject ID
        is requested. The optional arguments are identical to those required for the function
        download(), and they are passed to download() when auto-downloading occurs.
      auto_download(False) disables automatic downloading.
  
      Automatic downloading is disabled by default unless the environment variable
      HCP_AUTO_DOWNLOAD is set to true. In this case, the database and release are derived from
      the environment variables HCP_AUTO_DATABASE and HCP_AUTO_RELEASE, and the variable
      HCP_AUTO_PATH can be used to override the default subjects path.
      '''
      global _auto_download_options, _retinotopy_path
      status = (['structure','retinotopy'] if status is True       else
                []                         if status is False      else
                [status]                   if pimms.is_str(status) else
                status)
      _auto_download_options = {'structure':False, 'retinotopy':False}
      for s in status:
          if s.lower() == 'structure':
              if s3fs is None:
                  raise RuntimeError(
                      's3fs was not successfully loaded, so downloads may not occur; check'
                      ' your Python configuration to make sure that s3fs is installed. See'
                      ' http://s3fs.readthedocs.io/en/latest/install.html for details.')
              if credentials is None: credentials = config['hcp_credentials']
              if credentials is None: raise ValueError('No HCP credentials detected or found')
              (s3fs_key, s3fs_secret) = to_credentials(credentials)
              if subjects_path is None:
                  sdirs = config['hcp_subject_paths']
                  subjects_path = next((sd for sd in sdirs if os.path.isdir(sd)), None)
                  if subjects_path is None: raise ValueError('No subjects path given or found')
              else: subjects_path = os.path.expanduser(subjects_path)
              fs = s3fs.S3FileSystem(key=s3fs_key, secret=s3fs_secret)
              hcpbase = '/'.join([database, release])
              if not fs.exists(hcpbase):
                  raise ValueError('database/release (%s/%s) not found' % (database, release))
              sids = set([])
              for f in fs.ls(hcpbase):
                  f = os.path.split(f)[-1]
                  if len(f) == 6 and f[0] != '0':
                      try: sids.add(int(f))
                      except Exception: pass
              _auto_download_options['structure'] = True
              _auto_download_options['subjects_path'] = subjects_path
              _auto_download_options['overwrite'] = overwrite
              _auto_download_options['release'] = release
              _auto_download_options['database'] = database
              _auto_download_options['subject_ids'] = frozenset(sids)
              _auto_download_options['s3fs'] = fs
          elif s.lower() == 'retinotopy':
              if retinotopy_path is None:
                  dirs = config['hcp_subject_paths']
                  if subjects_path is not None: dirs = [subjects_path] + list(dirs)
                  if _retinotopy_path is not None: dirs = [_retinotopy_path] + list(dirs)
                  retinotopy_path = next((sd for sd in dirs if os.path.isdir(sd)), None)
              if retinotopy_path is None: raise ValueError('No retinotopy path given or found')
              else: retinotopy_path = os.path.expanduser(retinotopy_path)
              _auto_download_options['retinotopy'] = True
              _auto_download_options['retinotopy_path'] = retinotopy_path
              _auto_download_options['retinotopy_cache'] = retinotopy_cache
          else: raise ValueError('unrecognized auto_download argument: %s' % s)
      if all(v is False for v in six.itervalues(_auto_download_options)):
          _auto_download_options = None