code: def _tar_and_copy(src_dir, target_dir):
      """Tar and gzip src_dir and copy to GCS target_dir."""
      src_dir = src_dir.rstrip("/")
      target_dir = target_dir.rstrip("/")
      tmp_dir = tempfile.gettempdir().rstrip("/")
      src_base = os.path.basename(src_dir)
      shell_run(
          "tar --exclude=.git -zcf {tmp_dir}/{src_base}.tar.gz -C {src_dir} .",
          src_dir=src_dir,
          src_base=src_base,
          tmp_dir=tmp_dir,
      )
      final_destination = "%s/%s.tar.gz" % (target_dir, src_base)
      shell_run(
          (
              "gsutil cp {tmp_dir}/{src_base}.tar.gz "
              "{final_destination}"
          ),
          tmp_dir=tmp_dir,
          src_base=src_base,
          final_destination=final_destination,
      )
      return final_destination
  
imports: import datetime
  import os
  import pprint
  import shutil
  import subprocess
  import sys
  import tempfile
  from googleapiclient import discovery
  from oauth2client.client import GoogleCredentials
  from tensor2tensor.data_generators import text_encoder
  from tensor2tensor.layers import common_hparams
  from tensor2tensor.utils import registry
  from tensor2tensor.utils import usr_dir
  import tensorflow.compat.v1
label_desc: Use image node_id 13 for calling a global function with example usage: _tar_and_copy(src_dir, target_dir) and returns: final_destination