code: def create_data_set_to_use(data_format, raw_data):
      # helper function for generating training and test data with specified
      # format handles all data formats except for hdf5
      # assumes raw_data is a csv dataset generated by
      # tests.integration_tests.utils.generate_data() function
  
      # support for writing to a fwf dataset based on this stackoverflow posting:
      # https://stackoverflow.com/questions/16490261/python-pandas-write-dataframe-to-fixed-width-file-to-fwf
      from ray._private.thirdparty.tabulate.tabulate import tabulate
  
      def to_fwf(df, fname):
          content = tabulate(
              df.values.tolist(), list(df.columns), tablefmt="plain"
          )
          open(fname, "w").write(content)
  
      pd.DataFrame.to_fwf = to_fwf
  
      dataset_to_use = None
  
      if data_format == "csv":
          dataset_to_use = raw_data
  
      elif data_format in {"df", "dict"}:
          dataset_to_use = pd.read_csv(raw_data)
          if data_format == "dict":
              dataset_to_use = dataset_to_use.to_dict(orient="list")
  
      elif data_format == "excel":
          dataset_to_use = replace_file_extension(raw_data, "xlsx")
          pd.read_csv(raw_data).to_excel(dataset_to_use, index=False)
  
      elif data_format == "excel_xls":
          dataset_to_use = replace_file_extension(raw_data, "xls")
          pd.read_csv(raw_data).to_excel(dataset_to_use, index=False)
  
      elif data_format == "feather":
          dataset_to_use = replace_file_extension(raw_data, "feather")
          pd.read_csv(raw_data).to_feather(dataset_to_use)
  
      elif data_format == "fwf":
          dataset_to_use = replace_file_extension(raw_data, "fwf")
          pd.read_csv(raw_data).to_fwf(dataset_to_use)
  
      elif data_format == "html":
          dataset_to_use = replace_file_extension(raw_data, "html")
          pd.read_csv(raw_data).to_html(dataset_to_use, index=False)
  
      elif data_format == "json":
          dataset_to_use = replace_file_extension(raw_data, "json")
          pd.read_csv(raw_data).to_json(
              dataset_to_use, orient="records"
          )
  
      elif data_format == "jsonl":
          dataset_to_use = replace_file_extension(raw_data, "jsonl")
          pd.read_csv(raw_data).to_json(
              dataset_to_use, orient="records", lines=True
          )
  
      elif data_format == "parquet":
          dataset_to_use = replace_file_extension(raw_data, "parquet")
          pd.read_csv(raw_data).to_parquet(dataset_to_use, index=False)
  
      elif data_format == "pickle":
          dataset_to_use = replace_file_extension(raw_data, "pickle")
          pd.read_csv(raw_data).to_pickle(dataset_to_use)
  
      elif data_format == "stata":
          dataset_to_use = replace_file_extension(raw_data, "stata")
          pd.read_csv(raw_data).to_stata(dataset_to_use)
  
      elif data_format == "tsv":
          dataset_to_use = replace_file_extension(raw_data, "tsv")
          pd.read_csv(raw_data).to_csv(
              dataset_to_use, sep="\t", index=False
          )
  
      else:
          ValueError(
              "'{}' is an unrecognized data format".format(data_format)
          )
  
      return dataset_to_use
  
imports: import multiprocessing
  import os
  import random
  import shutil
  import sys
  import traceback
  import unittest
  import uuid
  from distutils.util import strtobool
  import cloudpickle
  import numpy
  import pandas
  from ludwig.api import LudwigModel
  from ludwig.backend import LocalBackend
  from ludwig.constants import VECTOR, COLUMN, NAME, PROC_COLUMN
  from ludwig.data.dataset_synthesizer import DATETIME_FORMATS
  from ludwig.data.dataset_synthesizer import build_synthetic_dataset
  from ludwig.experiment import experiment_cli
  from ludwig.features.feature_utils import compute_feature_hash
  from ludwig.utils.data_utils import read_csv, replace_file_extension
label_desc: Use image node_id 23 for calling a global function with example usage: create_data_set_to_use(data_format, raw_data) and returns: dataset_to_use