code: def _try_twice_tf_glob(pattern):
      """Glob twice, first time possibly catching `NotFoundError`.
  
      tf.gfile.Glob may crash with
  
      ```
      tensorflow.python.framework.errors_impl.NotFoundError:
      xy/model.ckpt-1130761_temp_9cb4cb0b0f5f4382b5ea947aadfb7a40;
      No such file or directory
      ```
  
      Standard glob.glob does not have this bug, but does not handle multiple
      filesystems (e.g. `gs://`), so we call tf.gfile.Glob, the first time possibly
      catching the `NotFoundError`.
  
      Args:
        pattern: str, glob pattern.
  
      Returns:
        list<str> matching filepaths.
      """
      try:
          return tf.gfile.Glob(pattern)
      except tf.errors.NotFoundError:
          return tf.gfile.Glob(pattern)
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import collections
  import math
  import os
  import re
  import sys
  import time
  import unicodedata
  import numpy
  import six
  from six.moves import range
  from six.moves import zip
  from tensor2tensor.data_generators import text_encoder
  import tensorflow.compat.v1
label_desc: Use image node_id 6 for calling a global function with example usage: _try_twice_tf_glob(pattern) and returns: tf, tf