code: def pipeline_by_task(task, metric, data, is_composed):
      if is_composed:
          pipeline = get_composed_pipeline(
              data, task, metric_function=metric
          )
      else:
          if task.task_type.name == "classification":
              pipeline = classification_three_depth_manual_pipeline()
          else:
              pipeline = regression_three_depth_manual_pipeline()
  
      return pipeline
  
imports: from os import makedirs
  from os.path import exists, join
  from golem.core.optimisers.genetic.gp_params import GPAlgorithmParameters
  from golem.core.optimisers.genetic.operators.inheritance import GeneticSchemeTypesEnum
  from fedot.core.pipelines.pipeline_composer_requirements import PipelineComposerRequirements
  from examples.simple.classification.classification_pipelines import classification_three_depth_manual_pipeline
  from examples.simple.regression.regression_pipelines import regression_three_depth_manual_pipeline
  from fedot.core.composer.composer_builder import ComposerBuilder
  from fedot.core.data.data import InputData
  from fedot.core.data.data_split import train_test_data_setup
  from fedot.core.repository.operation_types_repository import get_operations_for_task
  from fedot.core.repository.metrics_repository import ClassificationMetricsEnum, MetricsRepository, RegressionMetricsEnum
  from fedot.core.repository.tasks import Task, TaskTypesEnum
  from fedot.core.utils import default_fedot_data_dir, fedot_project_root
  from fedot.structural_analysis.node_sa_approaches import NodeDeletionAnalyze, NodeReplaceOperationAnalyze
  from fedot.structural_analysis.nodes_sensitivity import NodesAnalysis
label_desc: Use image node_id 5 for calling a global function with example usage: pipeline_by_task(task, metric, data, is_composed) and returns: pipeline