code: def maybe_copy_file_to_directory(source_filepath, target_directory):
      """Copy a file to a directory if it is not already there.
  
      Returns the target filepath.
  
      Args:
        source_filepath: a string
        target_directory: a string
  
      Returns:
        a string
      """
      if not tf.gfile.Exists(target_directory):
          tf.logging.info("Creating directory %s" % target_directory)
          os.mkdir(target_directory)
      target_filepath = os.path.join(
          target_directory, os.path.basename(source_filepath)
      )
      if not tf.gfile.Exists(target_filepath):
          tf.logging.info(
              "Copying %s to %s" % (source_filepath, target_filepath)
          )
          tf.gfile.Copy(source_filepath, target_filepath)
          statinfo = os.stat(target_filepath)
          tf.logging.info(
              "Successfully copied %s, %s bytes."
              % (target_filepath, statinfo.st_size)
          )
      else:
          tf.logging.info(
              "Not copying, file already found: %s" % target_filepath
          )
      return target_filepath
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import math
  import os
  import random
  import re
  import subprocess
  from tensor2tensor.data_generators import generator_utils
  from tensor2tensor.data_generators import text_encoder
  import tensorflow.compat.v1
label_desc: Use image node_id 8 for calling a global function with example usage: maybe_copy_file_to_directory(source_filepath, target_directory) and returns: target_filepath