code: def _wait_for_lock_to_disappear(
      handle, lock_file, lock_file_timeout_sec
  ):
      """Waits for the lock file to disappear.
  
      The lock file was created by another process that is performing a download
      into its own temporary directory. The name of this temp directory is
      sha1(<module>).<uuid>.tmp where <uuid> comes from the lock file.
  
      Args:
        handle: The location from where a module is being download.
        lock_file: Lock file created by another process downloading this module.
        lock_file_timeout_sec: The amount of time to wait (in seconds) before we
                               can declare that the other downloaded has been
                               abandoned. The download is declared abandoned if
                               there is no file size change in the temporary
                               directory within the last 'lock_file_timeout_sec'.
      """
      locked_tmp_dir_size = 0
      locked_tmp_dir_size_check_time = time.time()
      lock_file_content = None
      while tf.compat.v1.gfile.Exists(lock_file):
          try:
              logging.log_every_n(
                  logging.INFO,
                  "Module '%s' already being downloaded by '%s'. Waiting.",
                  10,
                  handle,
                  tf_utils.read_file_to_string(lock_file),
              )
              if (
                  time.time() - locked_tmp_dir_size_check_time
                  > lock_file_timeout_sec
              ):
                  # Check whether the holder of the current lock downloaded anything
                  # in its temporary directory in the last 'lock_file_timeout_sec'.
                  cur_locked_tmp_dir_size = _locked_tmp_dir_size(
                      lock_file
                  )
                  cur_lock_file_content = tf_utils.read_file_to_string(
                      lock_file
                  )
                  if (
                      cur_locked_tmp_dir_size == locked_tmp_dir_size
                      and cur_lock_file_content == lock_file_content
                  ):
                      # There is was no data downloaded in the past
                      # 'lock_file_timeout_sec'. Steal the lock and proceed with the
                      # local download.
                      logging.warning(
                          "Deleting lock file %s due to inactivity.",
                          lock_file,
                      )
                      tf.compat.v1.gfile.Remove(lock_file)
                      break
                  locked_tmp_dir_size = cur_locked_tmp_dir_size
                  locked_tmp_dir_size_check_time = time.time()
                  lock_file_content = cur_lock_file_content
          except tf.errors.NotFoundError:
              # Lock file or temp directory were deleted during check. Continue
              # to check whether download succeeded or we need to start our own
              # download.
              pass
          finally:
              time.sleep(5)
  
imports: import abc
  import datetime
  import enum
  import os
  import socket
  import ssl
  import sys
  import tarfile
  import tempfile
  import time
  import urllib
  import uuid
  from absl import flags
  from absl import logging
  import tensorflow
  from tensorflow_hub import file_utils
  from tensorflow_hub import tf_utils
label_desc: Use image node_id 15 for calling a global function with example usage: _wait_for_lock_to_disappear(handle, lock_file, lock_file_timeout_sec) without return types