code: def main(_):
      if FLAGS.tfrecord_file_pattern is None:
          raise RuntimeError("Must specify --tfrecord_file_pattern.")
      if FLAGS.tfrecord2idx_script is None:
          raise RuntimeError("Must specify --tfrecord2idx_script")
  
      tfrecord_files = glob(FLAGS.tfrecord_file_pattern)
      tfrecord_idxs = [filename + "_idx" for filename in tfrecord_files]
      if not os.path.isfile(FLAGS.tfrecord2idx_script):
          raise ValueError(
              f"{FLAGS.tfrecord2idx_script} does not lead to valid tfrecord2idx script."
          )
  
      for tfrecord, tfrecord_idx in zip(tfrecord_files, tfrecord_idxs):
          logging.info(f"Generating index file for {tfrecord}")
          call([FLAGS.tfrecord2idx_script, tfrecord, tfrecord_idx])
  
imports: from absl import app
  from absl import flags
  from absl import logging
  from glob import glob
  from subprocess import call
  import os.path
label_desc: Use image node_id 1 for calling a global function with example usage: main(_) without return types