code: def upload_file(
      local_path: str, destination_path: str, sas_token: str
  ) -> str:
      """For NNI maintainers to add updated static files to the Azure blob easily.
      In most cases, you don't need to calculate the hash on your own, it will be automatically inserted.
      For example, if you write ``https://xxx.com/myfile.zip``, the uploaded file will look like
      ``https://xxx.com/myfile-da5f43b7.zip``.
  
      Need to have `azcopy installed <https://docs.microsoft.com/en-us/azure/storage/common/storage-ref-azcopy>`_,
      and a SAS token for the destination storage (``?`` should be included as prefix of token).
  
      Returns a string which is the uploaded path.
      """
  
      _logger = logging.getLogger(__name__)
  
      sha256 = hashlib.sha256()
  
      with Path(local_path).open("rb") as fr:
          while True:
              chunk = fr.read(8192)
              if len(chunk) == 0:
                  break
              sha256.update(chunk)
  
      digest = sha256.hexdigest()
      hash_prefix = digest[:8]
      _logger.info("Hash of %s is %s", local_path, digest)
  
      stem, suffix = destination_path.rsplit(".", 1)
      if not stem.endswith("-" + hash_prefix):
          destination_path = stem + "-" + hash_prefix + "." + suffix
  
      subprocess.run(
          ["azcopy", "copy", local_path, destination_path + sas_token],
          check=True,
      )
  
      return destination_path
  
file_path: nni/nni/common/blob_utils.py
imports: import logging
  import hashlib
  import os
  import shutil
  import subprocess
  import tempfile
  from pathlib import Path
  from shutil import which
  from typing import Optional
  import tqdm
label_desc: Use image node_id 3 for calling a global function with example usage: upload_file(local_path, destination_path, sas_token) and returns: destination_path