code: def _split_input_data_by_indexes(
      origin_input_data: Union[InputData, MultiModalData],
      index,
      retain_first_target=False,
  ):
      """The function get InputData or MultiModalData and return
      only data with indexes in index, not in idx
      f.e. index = [0, 1, 2, 3] == input_data.features[[0, 1, 2, 3], :]
      :param origin_input_data: data to split
      :param index: indexes that needed in output data
      :param retain_first_target: set to True for use only first column of target
      """
  
      if isinstance(origin_input_data, MultiModalData):
          data = MultiModalData()
          for key in origin_input_data:
              data[key] = _split_input_data_by_indexes(
                  origin_input_data[key],
                  index=index,
                  retain_first_target=retain_first_target,
              )
          return data
      elif isinstance(origin_input_data, InputData):
          idx = np.take(origin_input_data.idx, index, 0)
          target = np.take(origin_input_data.target, index, 0)
          features = np.take(origin_input_data.features, index, 0)
  
          if retain_first_target and len(target.shape) > 1:
              target = target[:, 0]
  
          data = InputData(
              idx=idx,
              features=features,
              target=target,
              task=deepcopy(origin_input_data.task),
              data_type=origin_input_data.data_type,
              supplementary_data=origin_input_data.supplementary_data,
              categorical_features=origin_input_data.categorical_features,
              categorical_idx=origin_input_data.categorical_idx,
              numerical_idx=origin_input_data.numerical_idx,
              encoded_idx=origin_input_data.encoded_idx,
              features_names=origin_input_data.features_names,
          )
          return data
      else:
          raise TypeError(
              f"Unknown data type {type(origin_input_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 1 for calling a global function with example usage: _split_input_data_by_indexes(origin_input_data, index, retain_first_target) and returns: data, data