code: def data_gen(
      file_path, data_config, n_route, n_frame=21, day_slot=288
  ):
      """Source file load and dataset generation."""
      n_train, n_val, n_test = data_config
      # generate training, validation and test data
      try:
          data_seq = pd.read_csv(file_path, header=None).values
      except FileNotFoundError:
          print(f"ERROR: input file was not found in {file_path}.")
  
      seq_train = seq_gen(
          n_train, data_seq, 0, n_frame, n_route, day_slot
      )
      seq_val = seq_gen(
          n_val, data_seq, n_train, n_frame, n_route, day_slot
      )
      seq_test = seq_gen(
          n_test, data_seq, n_train + n_val, n_frame, n_route, day_slot
      )
  
      # x_stats: dict, the stats for the train dataset, including the value of mean and standard deviation.
      x_stats = {"mean": np.mean(seq_train), "std": np.std(seq_train)}
  
      # x_train, x_val, x_test: np.array, [sample_size, n_frame, n_route, channel_size].
      x_train = z_score(seq_train, x_stats["mean"], x_stats["std"])
      x_val = z_score(seq_val, x_stats["mean"], x_stats["std"])
      x_test = z_score(seq_test, x_stats["mean"], x_stats["std"])
  
      x_data = {"train": x_train, "val": x_val, "test": x_test}
      dataset = Dataset(x_data, x_stats)
      return dataset
  
file_path: PGL/legacy/examples/stgcn/data_loader/data_utils.py
imports: import numpy
  import pandas
  from utils.math_utils import z_score
label_desc: Use image node_id 5 for calling a global function with example usage: data_gen(file_path, data_config, n_route, n_frame, day_slot) and returns: dataset