code: def generate_data_for_registered_problem(problem_name):
      """Generate data for a registered problem."""
      tf.logging.info("Generating data for %s.", problem_name)
      if FLAGS.num_shards:
          raise ValueError(
              "--num_shards should not be set for registered Problem."
          )
      problem = registry.problem(problem_name)
      task_id = None if FLAGS.task_id < 0 else FLAGS.task_id
      data_dir = os.path.expanduser(FLAGS.data_dir)
      tmp_dir = os.path.expanduser(FLAGS.tmp_dir)
      if task_id is None and problem.multiprocess_generate:
          if FLAGS.task_id_start != -1:
              assert FLAGS.task_id_end != -1
              task_id_start = FLAGS.task_id_start
              task_id_end = FLAGS.task_id_end
          else:
              task_id_start = 0
              task_id_end = problem.num_generate_tasks
          pool = multiprocessing.Pool(
              processes=FLAGS.num_concurrent_processes
          )
          problem.prepare_to_generate(data_dir, tmp_dir)
          args = [
              (problem_name, data_dir, tmp_dir, task_id)
              for task_id in range(task_id_start, task_id_end)
          ]
          pool.map(generate_data_in_process, args)
      else:
          problem.generate_data(data_dir, tmp_dir, task_id)
  
file_path: tensor2tensor/tensor2tensor/bin/t2t_datagen.py
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import multiprocessing
  import os
  import random
  import tempfile
  import numpy
  from tensor2tensor import problems
  from tensor2tensor.data_generators import generator_utils
  from tensor2tensor.envs import env_problem_utils
  from tensor2tensor.utils import registry
  from tensor2tensor.utils import usr_dir
  import tensorflow.compat.v1
label_desc: Use image node_id 6 for calling a global function with example usage: generate_data_for_registered_problem(problem_name) without return types