code: def actual_fitness(data_split, pipeline, metric):
      metric_values = []
      for train_data, test_data in data_split():
          pipeline.fit(train_data)
          metric_function = MetricsRepository.get_metric(metric)
          metric_values.append(
              metric_function(
                  pipeline=pipeline, reference_data=test_data
              )
          )
      mean_metric = np.mean(metric_values, axis=0)
      return SingleObjFitness(mean_metric)
  
imports: import datetime
  from copy import deepcopy
  import numpy
  import pytest
  from golem.core.optimisers.fitness import SingleObjFitness
  from fedot.core.data.data import InputData
  from fedot.core.data.supplementary_data import SupplementaryData
  from fedot.core.optimisers.objective import PipelineObjectiveEvaluate
  from fedot.core.optimisers.objective.data_source_splitter import DataSourceSplitter
  from fedot.core.optimisers.objective.metrics_objective import MetricsObjective
  from fedot.core.pipelines.pipeline import Pipeline
  from fedot.core.pipelines.pipeline_builder import PipelineBuilder
  from fedot.core.repository.dataset_types import DataTypesEnum
  from fedot.core.repository.metrics_repository import ClassificationMetricsEnum, MetricsRepository, RegressionMetricsEnum
  from fedot.core.repository.tasks import Task, TaskTypesEnum
  from test.integration.models.test_model import classification_dataset, classification_dataset_with_str_labels
  from test.unit.tasks.test_forecasting import get_simple_ts_pipeline
  from test.unit.validation.test_table_cv import sample_pipeline
  from test.unit.validation.test_time_series_cv import configure_experiment
label_desc: Use image node_id 6 for calling a global function with example usage: actual_fitness(data_split, pipeline, metric) and returns: SingleObjFitness