code: def test_pipeline_objective_evaluate_with_time_constraint(
      classification_dataset,
  ):
      pipeline = sample_pipeline()
  
      data_producer = DataSourceSplitter(cv_folds=None).build(
          classification_dataset
      )
      metric = ClassificationMetricsEnum.ROCAUC_penalty
  
      time_constraint = datetime.timedelta(seconds=0.0001)
      objective_eval = PipelineObjectiveEvaluate(
          MetricsObjective(metric),
          data_producer=data_producer,
          time_constraint=time_constraint,
      )
      fitness = objective_eval(pipeline)
      assert not fitness.valid
  
      time_constraint = datetime.timedelta(seconds=300)
      objective_eval = PipelineObjectiveEvaluate(
          MetricsObjective(metric),
          data_producer=data_producer,
          time_constraint=time_constraint,
      )
      fitness = objective_eval(pipeline)
      assert fitness.valid
      assert fitness.value is not None
  
imports: import datetime
  from copy import deepcopy
  import numpy
  import pytest
  from golem.core.optimisers.fitness import SingleObjFitness
  from fedot.core.data.data import InputData
  from fedot.core.data.supplementary_data import SupplementaryData
  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.pipeline import Pipeline
  from fedot.core.pipelines.pipeline_builder import PipelineBuilder
  from fedot.core.repository.dataset_types import DataTypesEnum
  from fedot.core.repository.metrics_repository import ClassificationMetricsEnum, MetricsRepository, RegressionMetricsEnum
  from fedot.core.repository.tasks import Task, TaskTypesEnum
  from test.integration.models.test_model import classification_dataset, classification_dataset_with_str_labels
  from test.unit.tasks.test_forecasting import get_simple_ts_pipeline
  from test.unit.validation.test_table_cv import sample_pipeline
  from test.unit.validation.test_time_series_cv import configure_experiment
label_desc: Use image node_id 13 for calling a global function with example usage: test_pipeline_objective_evaluate_with_time_constraint(classification_dataset) without return types