code: def train_test_data_setup(
      data: Union[InputData, MultiModalData],
      split_ratio: float = 0.8,
      shuffle: bool = False,
      shuffle_flag: bool = False,
      stratify: bool = True,
      random_seed: int = 42,
      validation_blocks: Optional[int] = None,
  ) -> Tuple[
      Union[InputData, MultiModalData], Union[InputData, MultiModalData]
  ]:
      """Function for train and test split for both InputData and MultiModalData
  
      :param data: InputData object to split
      :param split_ratio: share of train data between 0 and 1
      :param shuffle: is data needed to be shuffled or not
      :param shuffle_flag: same is shuffle, use for backward compatibility
      :param stratify: make stratified sample or not
      :param random_seed: random_seed for shuffle
      :param validation_blocks: validation blocks are used for test
  
      :return: data for train, data for validation
      """
  
      # for backward compatibility
      shuffle |= shuffle_flag
      # check that stratification may be done
      stratify &= _are_stratification_allowed(data, split_ratio)
      # stratification is allowed only with shuffle
      shuffle |= stratify
      # shuffle is allowed only with random_seed and vise versa
      random_seed = (random_seed or 42) if shuffle else None
  
      input_arguments = {
          "split_ratio": split_ratio,
          "shuffle": shuffle,
          "stratify": stratify,
          "random_seed": random_seed,
          "validation_blocks": validation_blocks,
      }
      if isinstance(data, InputData):
          split_func_dict = {
              DataTypesEnum.multi_ts: _split_time_series,
              DataTypesEnum.ts: _split_time_series,
              DataTypesEnum.table: _split_any,
              DataTypesEnum.image: _split_any,
              DataTypesEnum.text: _split_any,
          }
  
          if data.data_type not in split_func_dict:
              raise TypeError(
                  (
                      f"Unknown data type {type(data)}. Supported data types:"
                      f' {", ".join(str(x) for x in split_func_dict)}'
                  )
              )
  
          split_func = split_func_dict[data.data_type]
          train_data, test_data = split_func(data, **input_arguments)
      elif isinstance(data, MultiModalData):
          train_data, test_data = MultiModalData(), MultiModalData()
          for node in data.keys():
              train_data[node], test_data[node] = train_test_data_setup(
                  data[node], **input_arguments
              )
      else:
          raise ValueError(
              (
                  f"Dataset {type(data)} is not supported. Supported types:"
                  " InputData, MultiModalData"
              )
          )
  
      return train_data, test_data
  
file_path: FEDOT/fedot/core/data/data_split.py
imports: from copy import deepcopy
  from typing import Tuple, Optional, Union
  import numpy
  from sklearn.model_selection import train_test_split
  from fedot.core.data.data import InputData
  from fedot.core.data.multi_modal import MultiModalData
  from fedot.core.repository.dataset_types import DataTypesEnum
  from fedot.core.repository.tasks import TaskTypesEnum
label_desc: Use image node_id 5 for calling a global function with example usage: train_test_data_setup(data, split_ratio, shuffle, shuffle_flag, stratify, random_seed, validation_blocks) and returns: train_data,  test_data