code: def get_tfrecords_filenames(
      data_root, num_images_per_epoch, num_images_per_input_file
  ):
      num_files = num_images_per_epoch // num_images_per_input_file
      if num_images_per_epoch % num_images_per_input_file:
          num_files += 1
      filenames = [
          os.path.join(data_root, filename)
          for filename in os.listdir(data_root)
      ][:num_files]
      assert (
          len(filenames) == num_files
      ), f"Need {num_files} input files, only found {len(filenames)}"
      return filenames
  
imports: from collections import defaultdict
  import tensorflow
  import numpy
  import os
  import pandas
  import time
  import logging
  import csv
  import json
  import torchvision
  import torch
  import ray
  from ray.train.tensorflow import prepare_dataset_shard, TensorflowTrainer
  from ray.train import DataConfig, ScalingConfig
  from ray import train, tune
  from ray.tune import Tuner
  from ray.data.datasource.partitioning import Partitioning
  from tf_utils import DEFAULT_IMAGE_SIZE, NUM_CHANNELS, preprocess_image, build_tf_dataset
  from metric_utils import determine_if_memory_monitor_is_enabled_in_latest_session, get_ray_spilled_and_restored_mb, MaxMemoryUtilizationTracker
label_desc: Use image node_id 8 for calling a global function with example usage: get_tfrecords_filenames(data_root, num_images_per_epoch, num_images_per_input_file) and returns: filenames