code: def visualize_histories(
      histories: Sequence[OptHistory],
      labels: Sequence[str],
      with_confidence_interval: bool = True,
  ):
      best_num = 5
      for history, label in zip(histories, labels):
          h = history.historical_fitness[
              1:-1
          ]  # without initial and last pop
          best_fitness = np.abs(np.array([np.min(pop) for pop in h]))
  
          ys = best_fitness
          xs = np.arange(0, len(best_fitness))
          plt.xticks(xs)
          plt.plot(xs, ys, label=label)
  
          if with_confidence_interval:
              best_num = min(len(xs), best_num)
              std_fitness = np.array(
                  [np.std(sorted(pop)[:best_num]) for pop in h]
              )
              plt.fill_between(
                  xs, ys + std_fitness, ys - std_fitness, alpha=0.2
              )
  
      plt.xlabel("Поколение")
      plt.ylabel("Метрика")
      plt.legend()
      plt.show()
  
imports: import os
  from datetime import timedelta
  from typing import Sequence, Optional
  import numpy
  from matplotlib import pyplot
  from sklearn.metrics import roc_auc_score
  from fedot.core.composer.composer_builder import ComposerBuilder
  from fedot.core.data.data import InputData
  from golem.core.optimisers.genetic.gp_params import GPAlgorithmParameters
  from golem.core.optimisers.genetic.operators.crossover import CrossoverTypesEnum
  from golem.core.optimisers.genetic.operators.inheritance import GeneticSchemeTypesEnum
  from golem.core.optimisers.genetic.operators.mutation import MutationTypesEnum
  from golem.core.optimisers.opt_history_objects.opt_history import OptHistory
  from fedot.core.pipelines.pipeline_composer_requirements import PipelineComposerRequirements
  from fedot.core.repository.operation_types_repository import get_operations_for_task
  from fedot.core.repository.metrics_repository import ClassificationMetricsEnum
  from fedot.core.repository.tasks import Task, TaskTypesEnum
  from fedot.core.utils import fedot_project_root
label_desc: Use image node_id 3 for calling a global function with example usage: visualize_histories(histories, labels, with_confidence_interval) without return types