code: def test_data_merge_images(output_images):
      def get_num_channels(output_image: OutputData):
          return atleast_4d(output_image.predict).shape[3]
  
      img_wh = [img.predict.shape[1:3] for img in output_images]
      invalid_sizes = (
          len(set(img_wh)) > 1
      )  # Can merge only images of the same size
      expected_channels = sum(map(get_num_channels, output_images))
      expected_shape = (*img_wh[0], expected_channels)
  
      if invalid_sizes:
          with pytest.raises(ValueError, match="different sizes"):
              merged_image = DataMerger.get(output_images).merge()
      else:
          merged_image = DataMerger.get(output_images).merge()
          assert merged_image.features.shape[1:] == expected_shape
  
file_path: FEDOT/test/unit/data/test_data_merge_image.py
imports: import pytest
  from typing import Tuple, Iterable
  import numpy
  from fedot.core.data.data import OutputData
  from fedot.core.data.merge.data_merger import DataMerger
  from fedot.core.repository.dataset_types import DataTypesEnum
  from fedot.core.repository.tasks import Task, TaskTypesEnum
  from fedot.core.data.array_utilities import atleast_4d
label_desc: Use image node_id 3 for calling a global function with example usage: test_data_merge_images(output_images) and returns: atleast_4d