code: def upload(self, local_path=None):
      if self.storage_handler is None:
          msg: str = (
              "No storage handler is set for artifact {0}".format(
                  self.key
              )
          )
          util.report_fatal(msg, self.logger)
  
      if local_path is None:
          local_path = self.local_path
  
      if self.in_blobstore:
          msg: str = (
              "Artifact with key {0} exists in blobstore, "
              + "skipping the upload"
          ).format(self.key)
          self.logger.debug(msg)
          return self.key
  
      if os.path.exists(local_path):
          tar_filename = tar_artifact(
              local_path, self.key, self.get_compression(), self.logger
          )
          if self.key is None:
              self.key = (
                  "blobstore/"
                  + util.sha256_checksum(tar_filename)
                  + ".tar"
                  + util.compression_to_extension(
                      self.get_compression()
                  )
              )
              time_stamp = self.storage_handler.get_file_timestamp(
                  self.key
              )
              if time_stamp is not None:
                  self.logger.debug(
                      "Artifact with key %s exists in blobstore, skipping the upload",
                      self.key,
                  )
                  os.remove(tar_filename)
                  return self.key
  
          self.storage_handler.upload_file(self.key, tar_filename)
          os.remove(tar_filename)
          return self.key
      self.logger.debug(
          "Local path %s does not exist. Not uploading anything.",
          local_path,
      )
      return None
  
imports: import hashlib
  import os
  import re
  import tarfile
  from typing import Dict
  from studio.artifacts import artifacts_tracker
  from studio.util import util, logs
  from studio.credentials import credentials
  from studio.storage import storage_setup
  from studio.storage.storage_type import StorageType
  from studio.storage.storage_handler import StorageHandler
  from studio.storage.storage_handler_factory import StorageHandlerFactory
  from studio.storage.storage_util import tar_artifact, untar_artifact
label_desc: Use image node_id 2 for calling the Artifact obj's underlying member method code with example usage: obj.upload(local_path) and returns: None, self, self, self