code: def test_pipeline_fit_time_constraint():
      system = platform.system()
      if system == "Linux":
          set_start_method("spawn", force=True)
      data = classification_dataset_with_redundant_features()
      train_data, test_data = train_test_data_setup(data=data)
      test_pipeline_first = pipeline_first()
  
      time_constraint = datetime.timedelta(seconds=0)
      predicted_first = None
      computation_time_first = None
      process_start_time = time.time()
      try:
          predicted_first = test_pipeline_first.fit(
              input_data=train_data, time_constraint=time_constraint
          )
      except Exception as ex:
          received_ex = ex
          computation_time_first = test_pipeline_first.computation_time
          assert isinstance(received_ex, TimeoutError)
      comp_time_proc_with_first_constraint = (
          time.time() - process_start_time
      )
  
      time_constraint = datetime.timedelta(seconds=3)
      process_start_time = time.time()
      try:
          test_pipeline_first.fit(
              input_data=train_data, time_constraint=time_constraint
          )
      except Exception as ex:
          received_ex = ex
          assert isinstance(received_ex, TimeoutError)
      comp_time_proc_with_second_constraint = (
          time.time() - process_start_time
      )
  
      test_pipeline_second = pipeline_first()
      predicted_second = test_pipeline_second.fit(
          input_data=train_data,
          time_constraint=datetime.timedelta(seconds=2.1),
      )
      computation_time_second = test_pipeline_second.computation_time
      assert (
          comp_time_proc_with_first_constraint
          < comp_time_proc_with_second_constraint
      )
      assert computation_time_first is None
      assert predicted_first is None
      assert computation_time_second is not None
      assert predicted_second is not None
  
imports: import datetime
  import os
  import platform
  import time
  from copy import deepcopy
  from multiprocessing import set_start_method
  import numpy
  import pytest
  from sklearn.datasets import load_iris
  from fedot.core.data.data import InputData
  from fedot.core.data.data_split import train_test_data_setup
  from fedot.core.pipelines.node import PipelineNode
  from fedot.core.pipelines.pipeline import Pipeline
  from fedot.core.repository.dataset_types import DataTypesEnum
  from fedot.core.repository.tasks import Task, TaskTypesEnum, TsForecastingParams
  from fedot.core.utils import probs_to_labels
  from fedot.preprocessing.preprocessing import DataPreprocessor
  from test.integration.composer.test_composer import to_categorical_codes
  from test.integration.models.test_model import classification_dataset_with_redundant_features
  from test.unit.dag.test_graph_operator import get_pipeline
  from test.unit.pipelines.test_pipeline_comparison import pipeline_first
  from test.unit.tasks.test_forecasting import get_ts_data
label_desc: Use image node_id 18 for calling a global function with example usage: test_pipeline_fit_time_constraint() without return types