code: def generate_data_for_problem(problem):
      """Generate data for a problem in _SUPPORTED_PROBLEM_GENERATORS."""
      training_gen, dev_gen, test_gen = _SUPPORTED_PROBLEM_GENERATORS[
          problem
      ]
  
      num_train_shards = FLAGS.num_shards or 10
      tf.logging.info("Generating training data for %s.", problem)
      train_output_files = generator_utils.train_data_filenames(
          problem + generator_utils.UNSHUFFLED_SUFFIX,
          FLAGS.data_dir,
          num_train_shards,
      )
      generator_utils.generate_files(
          training_gen(), train_output_files, FLAGS.max_cases
      )
      num_dev_shards = int(num_train_shards * 0.1)
      tf.logging.info("Generating development data for %s.", problem)
      dev_output_files = generator_utils.dev_data_filenames(
          problem + generator_utils.UNSHUFFLED_SUFFIX,
          FLAGS.data_dir,
          num_dev_shards,
      )
      generator_utils.generate_files(dev_gen(), dev_output_files)
      num_test_shards = int(num_train_shards * 0.1)
      test_output_files = []
      test_gen_data = test_gen()
      if test_gen_data is not None:
          tf.logging.info("Generating test data for %s.", problem)
          test_output_files = generator_utils.test_data_filenames(
              problem + generator_utils.UNSHUFFLED_SUFFIX,
              FLAGS.data_dir,
              num_test_shards,
          )
          generator_utils.generate_files(
              test_gen_data, test_output_files
          )
      all_output_files = (
          train_output_files + dev_output_files + test_output_files
      )
      generator_utils.shuffle_dataset(all_output_files)
  
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 3 for calling a global function with example usage: generate_data_for_problem(problem) without return types