code: def _tar_artifact_directory(
      local_path: str, tar_filename: str, key, ignore_filepath, logger
  ):
      tf = None
      try:
          debug_str: str = (
              "Tarring artifact directory. "
              + "tar_filename = {0}, "
              + "local_path = {1}, "
              + "key = {2}"
          ).format(tar_filename, local_path, key)
          if ignore_filepath is not None:
              debug_str += ", exclude = {0}".format(ignore_filepath)
          logger.debug(debug_str)
  
          tf = tarfile.open(tar_filename, "w")
          files_list = os.listdir(local_path)
          for file_name in files_list:
              tf.add(
                  os.path.join(local_path, file_name), arcname=file_name
              )
      except Exception as exc:
          msg: str = "FAILED to create tarfile: {0} for artifact {1} reason: {2}".format(
              tar_filename, local_path, exc
          )
          util.report_fatal(msg, logger)
      finally:
          if tf is not None:
              tf.close()
  
file_path: studio/studio/storage/storage_util.py
imports: import os
  import requests
  import shutil
  import time
  import tarfile
  import tempfile
  from studio.artifacts import artifacts_tracker
  from studio.util import util
label_desc: Use image node_id 3 for calling a global function with example usage: _tar_artifact_directory(local_path, tar_filename, key, ignore_filepath, logger) without return types