code: def test_newly_generated_history(n_jobs: int):
      file_path_train = fedot_project_root().joinpath(
          "test/data/simple_classification.csv"
      )
  
      num_of_gens = 2
      auto_model = Fedot(
          problem="classification",
          seed=42,
          timeout=None,
          num_of_generations=num_of_gens,
          pop_size=3,
          preset="fast_train",
          n_jobs=n_jobs,
          with_tuning=False,
      )
      auto_model.fit(features=file_path_train, target="Y")
  
      history = auto_model.history
  
      assert history is not None
      assert (
          len(history.individuals) == num_of_gens + 2
      )  # initial_assumptions + num_of_gens + final_choices
      assert (
          len(history.archive_history) == num_of_gens + 2
      )  # initial_assumptions + num_of_gens + final_choices
      assert len(history.initial_assumptions) >= 2
      assert len(history.final_choices) == 1
      assert isinstance(history.tuning_result, Graph)
      _test_individuals_in_history(history)
      # Test history dumps
      dumped_history_json = history.save()
      loaded_history = OptHistory.load(dumped_history_json)
      assert dumped_history_json is not None
      assert (
          dumped_history_json == loaded_history.save()
      ), "The history is not equal to itself after reloading!"
      _test_individuals_in_history(loaded_history)
  
imports: from itertools import chain
  from pathlib import Path
  import numpy
  import pytest
  from golem.core.dag.graph import Graph
  from golem.core.optimisers.fitness import SingleObjFitness
  from golem.core.optimisers.genetic.evaluation import MultiprocessingDispatcher
  from golem.core.optimisers.opt_history_objects.individual import Individual
  from golem.core.optimisers.opt_history_objects.opt_history import OptHistory
  from fedot import Fedot
  from fedot.core.data.data import InputData
  from fedot.core.operations.model import Model
  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.node import PipelineNode
  from fedot.core.pipelines.pipeline import Pipeline
  from fedot.core.pipelines.pipeline_graph_generation_params import get_pipeline_generation_params
  from fedot.core.repository.metrics_repository import ClassificationMetricsEnum, MetricIDType, RegressionMetricsEnum
  from fedot.core.repository.tasks import TaskTypesEnum
  from fedot.core.utils import fedot_project_root
  from test.unit.tasks.test_forecasting import get_ts_data
  from test.unit.validation.test_table_cv import get_classification_data
label_desc: Use image node_id 4 for calling a global function with example usage: test_newly_generated_history(n_jobs) without return types