code: def pipeline_tuning(
      pipeline: Pipeline,
      train_data: InputData,
      test_data: InputData,
      local_iter: int,
      tuner_iter_num: int = 30,
  ) -> (float, list):
      """Function for tuning pipeline with SimultaneousTuner
  
      :param pipeline: pipeline to tune
      :param train_data: InputData for train
      :param test_data: InputData for validation
      :param local_iter: amount of tuner launches
      :param tuner_iter_num: amount of iterations, which tuner will perform
  
      :return mean_metric: mean value of ROC AUC metric
      :return several_iter_scores_test: list with metrics
      """
      several_iter_scores_test = []
      tuner = (
          TunerBuilder(train_data.task)
          .with_tuner(SimultaneousTuner)
          .with_metric(ClassificationMetricsEnum.ROCAUC)
          .with_iterations(tuner_iter_num)
          .build(train_data)
      )
      for iteration in range(local_iter):
          print(f"current local iteration {iteration}")
  
          # Pipeline tuning
          tuned_pipeline = tuner.tune(pipeline)
  
          # After tuning prediction
          tuned_pipeline.fit(train_data)
          after_tuning_predicted = tuned_pipeline.predict(test_data)
  
          # Metrics
          aft_tun_roc_auc = roc_auc(
              y_true=test_data.target,
              y_score=after_tuning_predicted.predict,
          )
          several_iter_scores_test.append(aft_tun_roc_auc)
  
      max_metric = float(np.max(several_iter_scores_test))
      return max_metric, several_iter_scores_test
  
file_path: FEDOT/examples/simple/pipeline_tune.py
imports: from copy import deepcopy
  import numpy
  from golem.core.tuning.simultaneous import SimultaneousTuner
  from sklearn.metrics import roc_auc_score
  from cases.data.data_utils import get_scoring_case_data_paths
  from examples.simple.classification.classification_pipelines import classification_complex_pipeline
  from fedot.core.data.data import InputData
  from fedot.core.pipelines.pipeline import Pipeline
  from fedot.core.pipelines.tuning.tuner_builder import TunerBuilder
  from fedot.core.repository.metrics_repository import ClassificationMetricsEnum
label_desc: Use image node_id 2 for calling a global function with example usage: pipeline_tuning(pipeline, train_data, test_data, local_iter, tuner_iter_num) and returns: max_metric,  several_iter_scores_test