code: def test_label_encoding_correct():
      """
      Check if LabelEncoder can perform transformations correctly. Also the dataset
      is generated so that new categories appear in the test sample.
      """
      cat_data = data_with_only_categorical_features()
      train_data, test_data = train_test_data_setup(cat_data)
  
      encoding_node = PipelineNode("label_encoding")
      encoding_node.fit(train_data)
  
      predicted_train = encoding_node.predict(train_data)
      predicted_test = encoding_node.predict(test_data)
  
      # Label 'a' was in the training sample - convert it into 0
      assert predicted_train.predict[0, 0] == 0
      # Label 'b' was in the training sample - convert it into 1
      assert predicted_train.predict[1, 0] == 1
      # Label 'c' was not in the training sample - convert it into 2
      assert predicted_test.predict[0, 0] == 2
  
imports: import os
  import numpy
  import pytest
  from examples.simple.classification.classification_with_tuning import get_classification_dataset
  from examples.simple.regression.regression_with_tuning import get_regression_dataset
  from examples.simple.time_series_forecasting.gapfilling import generate_synthetic_data
  from fedot.core.data.data import InputData
  from fedot.core.data.data_split import train_test_data_setup
  from fedot.core.data.supplementary_data import SupplementaryData
  from fedot.core.operations.evaluation.operation_implementations.data_operations.sklearn_imbalanced_class import ResampleImplementation
  from fedot.core.operations.evaluation.operation_implementations.data_operations.sklearn_transformations import ImputationImplementation
  from fedot.core.operations.evaluation.operation_implementations.data_operations.ts_transformations import CutImplementation, LaggedTransformationImplementation
  from fedot.core.operations.operation_parameters import OperationParameters
  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.operation_types_repository import OperationTypesRepository
  from fedot.core.repository.tasks import Task, TaskTypesEnum, TsForecastingParams
  from fedot.preprocessing.data_types import TYPE_TO_ID
  from test.unit.preprocessing.test_preprocessing_through_api import data_with_only_categorical_features
label_desc: Use image node_id 24 for calling a global function with example usage: test_label_encoding_correct() without return types