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: Upload a local file to a remote location. remote url is the final destination of the uploaded file.
  
  Examples:
  
  .. code-block:: py
  
      upload_file('/tmp/artifact.yaml', 'http://localhost:8081/manual_artifacts/my_artifact.yaml')
      upload_file('/tmp/artifact.yaml', 's3://a_bucket/artifacts/my_artifact.yaml')
      upload_file('/tmp/artifact.yaml', '/mnt/share/folder/artifacts/my_artifact.yaml')
  
  :param str local_file: Full path of a local file to be uploaded
  :param str remote_url: Full path or remote url to upload to (including file name)
  :param bool wait_for_upload: If False, return immediately and upload in the background. Default True.
  :param int retries: Number of retries before failing to upload file.
  :return: Newly uploaded remote URL.
docstr_tok: ["Upload","a","local","file","to","a","remote","location",".","remote","url","is","the","final","destination","of","the","uploaded","file",".","Examples",":","..","code-block",":",":","py","upload_file","(","'\/tmp\/artifact.yaml","'",",","'http",":","\/\/localhost:8081\/manual_artifacts\/my_artifact.yaml","'",")","upload_file","(","'\/tmp\/artifact.yaml","'",",","'s3",":","\/\/a_bucket\/artifacts\/my_artifact.yaml","'",")","upload_file","(","'\/tmp\/artifact.yaml","'",",","'\/mnt\/share\/folder\/artifacts\/my_artifact.yaml","'",")",":","param","str","local_file",":","Full","path","of","a","local","file","to","be","uploaded",":","param","str","remote_url",":","Full","path","or","remote","url","to","upload","to","(","including","file","name",")",":","param","bool","wait_for_upload",":","If","False",",","return","immediately","and","upload","in","the","background",".","Default","True",".",":","param","int","retries",":","Number","of","retries","before","failing","to","upload","file",".",":","return",":","Newly","uploaded","remote","URL","."]
code: def upload_file(
      cls, local_file, remote_url, wait_for_upload=True, retries=None
  ):  # type: (str, str, bool, Optional[int]) -> str
      """
      Upload a local file to a remote location. remote url is the final destination of the uploaded file.
  
      Examples:
  
      .. code-block:: py
  
          upload_file('/tmp/artifact.yaml', 'http://localhost:8081/manual_artifacts/my_artifact.yaml')
          upload_file('/tmp/artifact.yaml', 's3://a_bucket/artifacts/my_artifact.yaml')
          upload_file('/tmp/artifact.yaml', '/mnt/share/folder/artifacts/my_artifact.yaml')
  
      :param str local_file: Full path of a local file to be uploaded
      :param str remote_url: Full path or remote url to upload to (including file name)
      :param bool wait_for_upload: If False, return immediately and upload in the background. Default True.
      :param int retries: Number of retries before failing to upload file.
      :return: Newly uploaded remote URL.
      """
      return CacheManager.get_cache_manager().upload_file(
          local_file=local_file,
          remote_url=remote_url,
          wait_for_upload=wait_for_upload,
          retries=retries if retries else cls._file_upload_retries,
      )
  
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 2 for calling the StorageManager obj's underlying member method code with example usage: obj.upload_file(cls, local_file, remote_url, wait_for_upload, retries) and returns: CacheManager