code: def _get_case_file_paths(tmp_dir, case, training_fraction=0.95):
      """Obtain a list of image paths corresponding to training or eval case.
  
      Args:
        tmp_dir: str, the root path to which raw images were written, at the
          top level having meta/ and raw/ subdirs.
        case: bool, whether obtaining file paths for training (true) or eval
          (false).
        training_fraction: float, the fraction of the sub-image path list to
          consider as the basis for training examples.
  
      Returns:
        list: A list of file paths.
  
      Raises:
        ValueError: if images not found in tmp_dir, or if training_fraction would
          leave no examples for eval.
      """
  
      paths = tf.gfile.Glob("%s/*.jpg" % tmp_dir)
  
      if not paths:
          raise ValueError(
              "Search of tmp_dir (%s) " % tmp_dir,
              "for subimage paths yielded an empty list, ",
              "can't proceed with returning training/eval split.",
          )
  
      split_index = int(math.floor(len(paths) * training_fraction))
  
      if split_index >= len(paths):
          raise ValueError(
              "For a path list of size %s "
              "and a training_fraction of %s "
              "the resulting split_index of the paths list, "
              "%s, would leave no elements for the eval "
              "condition."
              % (len(paths), training_fraction, split_index)
          )
  
      if case:
          return paths[:split_index]
      else:
          return paths[split_index:]
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  from io import BytesIO
  import math
  import os
  import numpy
  import requests
  from tensor2tensor.data_generators import generator_utils
  from tensor2tensor.data_generators import image_utils
  from tensor2tensor.data_generators import problem
  from tensor2tensor.data_generators import text_encoder
  from tensor2tensor.layers import modalities
  from tensor2tensor.utils import contrib
  from tensor2tensor.utils import metrics
  from tensor2tensor.utils import registry
  import tensorflow.compat.v1
label_desc: Use image node_id 2 for calling a global function with example usage: _get_case_file_paths(tmp_dir, case, training_fraction) and returns: paths, paths