class_docstr: StorageManager is helper interface for downloading & uploading files to supported remote storage
  Support remote servers: http(s)/S3/GS/Azure/File-System-Folder
  Cache is enabled by default for all downloaded remote urls/files
docstr: Download remote file to the local machine, maintaining the sub folder structure from the
  remote storage.
  
  .. note::
  
      If we have a remote file `s3://bucket/sub/file.ext` then
      `StorageManager.download_file('s3://bucket/sub/file.ext', '~/folder/')`
      will create `~/folder/sub/file.ext`
  :param str remote_url: Source remote storage location, path of `remote_url` will
      be created under the target local_folder. Supports S3/GS/Azure and shared filesystem.
      Example: 's3://bucket/data/'
  :param bool overwrite: If False, and target files exist do not download.
      If True, always download the remote files. Default False.
  :param bool skip_zero_size_check: If True, no error will be raised for files with zero bytes size.
  :param bool silence_errors: If True, silence errors that might pop up when trying to download
      files stored remotely. Default False
  
  :return: Path to downloaded file or None on error
docstr_tok: ["Download","remote","file","to","the","local","machine",",","maintaining","the","sub","folder","structure","from","the","remote","storage",".","..","note",":",":","If","we","have","a","remote","file","`","s3",":","\/\/bucket\/sub\/file.ext","`","then","`","StorageManager.download_file","(","'s3",":","\/\/bucket\/sub\/file.ext","'",",","'~\/folder\/","'",")","`","will","create","`","~\/folder\/sub\/file.ext","`",":","param","str","remote_url",":","Source","remote","storage","location",",","path","of","`","remote_url","`","will","be","created","under","the","target","local_folder",".","Supports","S3\/GS\/Azure","and","shared","filesystem",".","Example",":","'s3",":","\/\/bucket\/data\/'",":","param","bool","overwrite",":","If","False",",","and","target","files","exist","do","not","download",".","If","True",",","always","download","the","remote","files",".","Default","False",".",":","param","bool","skip_zero_size_check",":","If","True",",","no","error","will","be","raised","for","files","with","zero","bytes","size",".",":","param","bool","silence_errors",":","If","True",",","silence","errors","that","might","pop","up","when","trying","to","download","files","stored","remotely",".","Default","False",":","return",":","Path","to","downloaded","file","or","None","on","error"]
code: def download_file(
      cls,
      remote_url,
      local_folder=None,
      overwrite=False,
      skip_zero_size_check=False,
      silence_errors=False,
  ):
      # type: (str, Optional[str], bool, bool, bool) -> Optional[str]
      """
      Download remote file to the local machine, maintaining the sub folder structure from the
      remote storage.
  
      .. note::
  
          If we have a remote file `s3://bucket/sub/file.ext` then
          `StorageManager.download_file('s3://bucket/sub/file.ext', '~/folder/')`
          will create `~/folder/sub/file.ext`
      :param str remote_url: Source remote storage location, path of `remote_url` will
          be created under the target local_folder. Supports S3/GS/Azure and shared filesystem.
          Example: 's3://bucket/data/'
      :param bool overwrite: If False, and target files exist do not download.
          If True, always download the remote files. Default False.
      :param bool skip_zero_size_check: If True, no error will be raised for files with zero bytes size.
      :param bool silence_errors: If True, silence errors that might pop up when trying to download
          files stored remotely. Default False
  
      :return: Path to downloaded file or None on error
      """
  
      def remove_prefix_from_str(target_str, prefix_to_be_removed):
          # type: (str, str) -> str
          if target_str.startswith(prefix_to_be_removed):
              return target_str[len(prefix_to_be_removed) :]
          return target_str
  
      longest_configured_url = StorageHelper._resolve_base_url(
          remote_url
      )  # noqa
      bucket_path = remove_prefix_from_str(
          remote_url[len(longest_configured_url) :], "/"
      )
  
      if not local_folder:
          local_folder = (
              CacheManager.get_cache_manager().get_cache_folder()
          )
      local_path = str(
          Path(local_folder).expanduser().absolute() / bucket_path
      )
      helper = StorageHelper.get(remote_url)
  
      return helper.download_to_file(
          remote_url,
          local_path,
          overwrite_existing=overwrite,
          skip_zero_size_check=skip_zero_size_check,
          silence_errors=silence_errors,
      )
  
imports: import fnmatch
  import shutil
  import tarfile
  from multiprocessing.pool import ThreadPool
  from random import random
  from time import time
  from typing import List, Optional, Union
  from zipfile import ZipFile
  from pathlib2 import Path
  from .cache import CacheManager
  from .callbacks import ProgressReport
  from .helper import StorageHelper
  from .util import encode_string_to_filename, safe_extract, create_zip_directories
  from ..debugging.log import LoggerRoot
  from ..config import deferred_config
label_desc: Use image node_id 7 for calling the StorageManager obj's underlying member method code with example usage: obj.download_file(cls, remote_url, local_folder, overwrite, skip_zero_size_check, silence_errors) and returns: helper, target_str, target_str