code: def fit_predict_for_pipeline(pipeline, train_input, predict_input):
      """Function apply fit and predict operations
  
      :param pipeline: pipeline to process
      :param train_input: InputData for fit
      :param predict_input: InputData for predict
  
      :return preds: prediction of the pipeline
      """
      # Fit it
      pipeline.fit_from_scratch(train_input)
  
      # Predict
      predicted_values = pipeline.predict(predict_input)
      preds = predicted_values.predict
  
      return preds
  
file_path: FEDOT/cases/river_levels_prediction/river_level_case_composer.py
imports: import datetime
  import warnings
  import numpy
  import pandas
  from golem.core.tuning.simultaneous import SimultaneousTuner
  from sklearn.metrics import mean_absolute_error, mean_squared_error
  from golem.core.optimisers.genetic.gp_params import GPAlgorithmParameters
  from fedot.core.composer.composer_builder import ComposerBuilder
  from fedot.core.data.data import InputData
  from fedot.core.data.data_split import train_test_data_setup
  from fedot.core.pipelines.node import PipelineNode
  from fedot.core.pipelines.pipeline import Pipeline
  from fedot.core.pipelines.pipeline_composer_requirements import PipelineComposerRequirements
  from fedot.core.pipelines.tuning.tuner_builder import TunerBuilder
  from fedot.core.repository.metrics_repository import RegressionMetricsEnum
  from fedot.core.repository.tasks import Task, TaskTypesEnum
label_desc: Use image node_id 2 for calling a global function with example usage: fit_predict_for_pipeline(pipeline, train_input, predict_input) and returns: preds