code: def main(_):
      shard_urls = fetch.get_urls_for_shard(
          FLAGS.urls_dir, FLAGS.shard_id
      )
      num_groups = int(
          math.ceil(len(shard_urls) / fetch.URLS_PER_CLIENT)
      )
      tf.logging.info(
          "Launching get_references_web_single_group sequentially for "
          "%d groups in shard %d. Total URLs: %d",
          num_groups,
          FLAGS.shard_id,
          len(shard_urls),
      )
      command_prefix = FLAGS.command.split() + [
          "--urls_dir=%s" % FLAGS.urls_dir,
          "--shard_id=%d" % FLAGS.shard_id,
          "--debug_num_urls=%d" % FLAGS.debug_num_urls,
      ]
      with utils.timing("all_groups_fetch"):
          for i in range(num_groups):
              command = list(command_prefix)
              out_dir = os.path.join(FLAGS.out_dir, "process_%d" % i)
              command.append("--out_dir=%s" % out_dir)
              command.append("--group_id=%d" % i)
              try:
                  # Even on 1 CPU, each group should finish within an hour.
                  sp.check_call(command, timeout=60 * 60)
              except sp.TimeoutExpired:
                  tf.logging.error("Group %d timed out", i)
  
imports: import math
  import os
  import subprocess
  from tensor2tensor.data_generators.wikisum import get_references_web_single_group
  from tensor2tensor.data_generators.wikisum import utils
  import tensorflow.compat.v1
label_desc: Use image node_id 1 for calling a global function with example usage: main(_) without return types