code: def compose_pipeline(
      self,
      train_data: InputData,
      initial_assumption: Sequence[Pipeline],
      fitted_assumption: Pipeline,
  ) -> Tuple[Pipeline, List[Pipeline], GPComposer]:
      gp_composer: GPComposer = (
          ComposerBuilder(task=self.params.task)
          .with_requirements(self.params.composer_requirements)
          .with_initial_pipelines(initial_assumption)
          .with_optimizer(self.params.get("optimizer"))
          .with_optimizer_params(
              parameters=self.params.optimizer_params
          )
          .with_metrics(self.metrics)
          .with_cache(self.pipelines_cache, self.preprocessing_cache)
          .with_graph_generation_param(
              self.params.graph_generation_params
          )
          .build()
      )
  
      if self.timer.have_time_for_composing(
          self.params.get("pop_size"), self.params.n_jobs
      ):
          # Launch pipeline structure composition
          with self.timer.launch_composing():
              self.log.message("Pipeline composition started.")
              self.was_optimised = False
              best_pipelines = gp_composer.compose_pipeline(
                  data=train_data
              )
              best_pipeline_candidates = gp_composer.best_models
              self.was_optimised = True
      else:
          # Use initial pipeline as final solution
          self.log.message(
              f"Timeout is too small for composing and is skipped "
              f"because fit_time is {self.timer.assumption_fit_spend_time.total_seconds()} sec."
          )
          best_pipelines = fitted_assumption
          best_pipeline_candidates = [fitted_assumption]
  
      for pipeline in best_pipeline_candidates:
          pipeline.log = self.log
      best_pipeline = (
          best_pipelines[0]
          if isinstance(best_pipelines, Sequence)
          else best_pipelines
      )
      return best_pipeline, best_pipeline_candidates, gp_composer
  
imports: import datetime
  import gc
  from copy import deepcopy
  from typing import List, Optional, Sequence, Tuple, Union
  from golem.core.log import default_log
  from golem.core.optimisers.opt_history_objects.opt_history import OptHistory
  from golem.core.tuning.simultaneous import SimultaneousTuner
  from fedot.api.api_utils.assumptions.assumptions_handler import AssumptionsHandler
  from fedot.api.api_utils.params import ApiParams
  from fedot.api.time import ApiTime
  from fedot.core.caching.pipelines_cache import OperationsCache
  from fedot.core.caching.preprocessing_cache import PreprocessingCache
  from fedot.core.composer.composer_builder import ComposerBuilder
  from fedot.core.composer.gp_composer.gp_composer import GPComposer
  from fedot.core.constants import DEFAULT_TUNING_ITERATIONS_NUMBER
  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 MetricIDType
label_desc: Use image node_id 5 for calling the ApiComposer obj's underlying member method code with example usage: obj.compose_pipeline(train_data, initial_assumption, fitted_assumption) and returns: best_pipeline,  best_pipeline_candidates,  gp_composer