code: def compose_pipeline(pipeline, train_data, task):
      # pipeline structure optimization
      (
          primary_operations,
          secondary_operations,
      ) = get_available_operations()
      composer_requirements = PipelineComposerRequirements(
          primary=primary_operations,
          secondary=secondary_operations,
          max_arity=3,
          max_depth=5,
          num_of_generations=30,
          timeout=datetime.timedelta(minutes=10),
      )
      optimizer_parameters = GPAlgorithmParameters(
          pop_size=15,
          mutation_prob=0.8,
          crossover_prob=0.8,
          mutation_types=[
              parameter_change_mutation,
              MutationTypesEnum.single_change,
              MutationTypesEnum.single_drop,
              MutationTypesEnum.single_add,
          ],
      )
      composer = (
          ComposerBuilder(task=task)
          .with_optimizer_params(optimizer_parameters)
          .with_requirements(composer_requirements)
          .with_metrics(RegressionMetricsEnum.MAE)
          .with_initial_pipelines([pipeline])
          .build()
      )
      obtained_pipeline = composer.compose_pipeline(data=train_data)
      obtained_pipeline.show()
      return obtained_pipeline
  
file_path: FEDOT/examples/advanced/time_series_forecasting/multi_ts_arctic_forecasting.py
imports: import datetime
  from copy import deepcopy
  import numpy
  from golem.core.optimisers.genetic.gp_params import GPAlgorithmParameters
  from golem.core.optimisers.genetic.operators.mutation import MutationTypesEnum
  from golem.core.tuning.simultaneous import SimultaneousTuner
  from fedot.core.pipelines.pipeline_composer_requirements import PipelineComposerRequirements
  from matplotlib import pyplot
  from sklearn.metrics import mean_squared_error, mean_absolute_error
  from cases.multi_ts_level_forecasting import prepare_data
  from examples.simple.time_series_forecasting.ts_pipelines import ts_complex_ridge_smoothing_pipeline
  from fedot.core.composer.composer_builder import ComposerBuilder
  from fedot.core.composer.gp_composer.specific_operators import parameter_change_mutation
  from fedot.core.pipelines.tuning.tuner_builder import TunerBuilder
  from fedot.core.repository.metrics_repository import RegressionMetricsEnum
label_desc: Use image node_id 3 for calling a global function with example usage: compose_pipeline(pipeline, train_data, task) and returns: obtained_pipeline