class_docstr: Class for selecting optimal data processing strategies based on type of data.
  Available data sources are:
      * numpy array
      * pandas DataFrame
      * string (path to csv file)
      * InputData (FEDOT dataclass)
  
  Data preprocessing such a class performing also
class_docstr_tok: ["Class","for","selecting","optimal","data","processing","strategies","based","on","type","of","data",".","Available","data","sources","are",":","*","numpy","array","*","pandas","DataFrame","*","string","(","path","to","csv","file",")","*","InputData","(","FEDOT","dataclass",")","Data","preprocessing","such","a","class","performing","also"]
docstr: Prepare data for FEDOT pipeline composing.
  Obligatory preprocessing steps are applying also. If features is dictionary
  there is a need to process MultiModalData
docstr_tok: ["Prepare","data","for","FEDOT","pipeline","composing",".","Obligatory","preprocessing","steps","are","applying","also",".","If","features","is","dictionary","there","is","a","need","to","process","MultiModalData"]
code: def define_data(
      self,
      features: FeaturesType,
      target: Optional[TargetType] = None,
      is_predict=False,
  ):
      """Prepare data for FEDOT pipeline composing.
      Obligatory preprocessing steps are applying also. If features is dictionary
      there is a need to process MultiModalData
      """
      try:
          # TODO remove workaround
          idx = None
          if isinstance(features, dict) and "idx" in features:
              idx = features["idx"]
              del features["idx"]
          data = data_strategy_selector(
              features=features,
              target=target,
              task=self.task,
              is_predict=is_predict,
          )
          if isinstance(data, dict) and idx is not None:
              for key in data:
                  data[key].idx = idx
      except Exception as ex:
          raise ValueError(
              'Please specify the "features" as path to csv file/'
              "Numpy array/Pandas DataFrame/FEDOT InputData/dict for multimodal data, "
              f"Exception: {ex}"
          )
  
      # Perform obligatory steps of data preprocessing
      if is_predict:
          data = self.preprocessor.obligatory_prepare_for_predict(data)
      else:
          data = self.preprocessor.obligatory_prepare_for_fit(data)
      return data
  
imports: import sys
  from datetime import datetime
  from typing import Dict, Union
  from typing import Optional
  import numpy
  from golem.core.log import default_log
  from fedot.api.api_utils.data_definition import data_strategy_selector, FeaturesType, TargetType
  from fedot.core.data.data import InputData, OutputData, data_type_is_table
  from fedot.core.data.data_preprocessing import convert_into_column
  from fedot.core.data.multi_modal import MultiModalData
  from fedot.core.pipelines.pipeline import Pipeline
  from fedot.core.pipelines.ts_wrappers import in_sample_ts_forecast, convert_forecast_to_output
  from fedot.core.repository.tasks import Task, TaskTypesEnum
  from fedot.core.utils import convert_memory_size
  from fedot.preprocessing.dummy_preprocessing import DummyPreprocessor
  from fedot.preprocessing.preprocessing import DataPreprocessor
label_desc: Use image node_id 2 for calling the ApiDataProcessor obj's underlying member method code with example usage: obj.define_data(features, target, is_predict) and returns: data