code: def test_api_predict_correct(task_type, metric_name):
      train_data, test_data, _ = get_dataset(task_type)
      changed_api_params = {
          **TESTS_MAIN_API_DEFAULT_PARAMS,
          "timeout": 1,
          "preset": "fast_train",
      }
      model = Fedot(
          problem=task_type, metric=metric_name, **changed_api_params
      )
      fedot_model = model.fit(features=train_data)
      prediction = model.predict(features=test_data)
      metric = model.get_metrics(
          metric_names=metric_name, rounding_order=5
      )
      assert isinstance(fedot_model, Pipeline)
      assert len(prediction) == len(test_data.target)
      assert all(value >= 0 for value in metric.values())
      # composing and tuning was applied
      assert model.history is not None
      assert model.history.tuning_result is not None
      assert is_predict_ignores_target(
          model.predict, model.train_data, "features"
      )
  
imports: import os
  import shutil
  from copy import deepcopy
  import numpy
  import pandas
  import pytest
  from golem.core.dag.graph_utils import graph_structure
  from sklearn.datasets import load_iris
  from sklearn.preprocessing import LabelEncoder
  from examples.simple.time_series_forecasting.ts_pipelines import ts_complex_ridge_smoothing_pipeline
  from fedot import Fedot
  from fedot.core.pipelines.node import PipelineNode
  from fedot.core.pipelines.pipeline import Pipeline
  from fedot.core.repository.tasks import TsForecastingParams
  from test.data.datasets import get_dataset, get_multimodal_ts_data, load_categorical_unimodal, load_categorical_multidata
  from test.unit.common_tests import is_predict_ignores_target
  from test.unit.tasks.test_multi_ts_forecast import get_multi_ts_data
label_desc: Use image node_id 1 for calling a global function with example usage: test_api_predict_correct(task_type, metric_name) without return types