docstr: Download manager constructor.
  
  Args:
      data_dir:
          can be used to specify a manual directory to get the files from.
      dataset_name (`str`):
          name of dataset this instance will be used for. If
          provided, downloads will contain which datasets they were used for.
      download_config (`DownloadConfig`):
          to specify the cache directory and other
          download options
      base_path (`str`):
          base path that is used when relative paths are used to
          download files. This can be a remote url.
      record_checksums (`bool`, defaults to `True`):
          Whether to record the checksums of the downloaded files. If None, the value is inferred from the builder.
docstr_tok: ["Download","manager","constructor",".","Args",":","data_dir",":","can","be","used","to","specify","a","manual","directory","to","get","the","files","from",".","dataset_name","(","`","str","`",")",":","name","of","dataset","this","instance","will","be","used","for",".","If","provided",",","downloads","will","contain","which","datasets","they","were","used","for",".","download_config","(","`","DownloadConfig","`",")",":","to","specify","the","cache","directory","and","other","download","options","base_path","(","`","str","`",")",":","base","path","that","is","used","when","relative","paths","are","used","to","download","files",".","This","can","be","a","remote","url",".","record_checksums","(","`","bool","`",",","defaults","to","`","True","`",")",":","Whether","to","record","the","checksums","of","the","downloaded","files",".","If","None",",","the","value","is","inferred","from","the","builder","."]
code: def __init__(
      self,
      dataset_name: Optional[str] = None,
      data_dir: Optional[str] = None,
      download_config: Optional[DownloadConfig] = None,
      base_path: Optional[str] = None,
      record_checksums=True,
  ):
      """Download manager constructor.
  
      Args:
          data_dir:
              can be used to specify a manual directory to get the files from.
          dataset_name (`str`):
              name of dataset this instance will be used for. If
              provided, downloads will contain which datasets they were used for.
          download_config (`DownloadConfig`):
              to specify the cache directory and other
              download options
          base_path (`str`):
              base path that is used when relative paths are used to
              download files. This can be a remote url.
          record_checksums (`bool`, defaults to `True`):
              Whether to record the checksums of the downloaded files. If None, the value is inferred from the builder.
      """
      self._dataset_name = dataset_name
      self._data_dir = data_dir
      self._base_path = base_path or os.path.abspath(".")
      # To record what is being used: {url: {num_bytes: int, checksum: str}}
      self._recorded_sizes_checksums: Dict[
          str, Dict[str, Optional[Union[int, str]]]
      ] = {}
      self.record_checksums = record_checksums
      self.download_config = download_config or DownloadConfig()
      self.downloaded_paths = {}
      self.extracted_paths = {}
  
imports: import enum
  import io
  import os
  import posixpath
  import tarfile
  import warnings
  import zipfile
  from datetime import datetime
  from functools import partial
  from itertools import chain
  from typing import Callable, Dict, Generator, List, Optional, Tuple, Union
  from ..None import config
  from ..utils import tqdm
  from ..utils.deprecation_utils import DeprecatedEnum, deprecated
  from ..utils.file_utils import cached_path, get_from_cache, hash_url_to_filename, is_relative_path, stack_multiprocessing_download_progress_bars, url_or_path_join
  from ..utils.info_utils import get_size_checksum_dict
  from ..utils.logging import get_logger
  from ..utils.py_utils import NestedDataStructure, map_nested, size_str
  from ..utils.track import TrackedIterable, tracked_str
  from .download_config import DownloadConfig
label_desc: Use image node_id 1 to create a new DownloadManager object  with example: obj = DownloadManager(dataset_name, data_dir, download_config, base_path, record_checksums)