code: def concatenate_splits(train_df, vali_df, test_df, backend):
      def to_frame(df, split):
          if df is None:
              return None
  
          df = df.index.to_frame(name=SPLIT)
          df[SPLIT] = split
          return df
  
      dfs = [train_df, vali_df, test_df]
      dfs = [to_frame(df, split) for split, df in enumerate(dfs)]
      return backend.df_engine.df_lib.concat(
          [df for df in dfs if df is not None]
      )
  
file_path: ludwig/ludwig/data/concatenate_datasets.py
imports: import argparse
  import logging
  import numpy
  from ludwig.backend import LOCAL_BACKEND
  from ludwig.constants import SPLIT
  from ludwig.utils.data_utils import read_csv
label_desc: Use image node_id 4 for calling a global function with example usage: concatenate_splits(train_df, vali_df, test_df, backend) and returns: backend, df, None