code: def has_correct_data_connections(pipeline: Pipeline):
      """Check if the pipeline contains incorrect connections between operation for different data types"""
      for node in pipeline.nodes:
          # check atomized pipeline
          if isinstance(node.operation, AtomizedModel):
              has_correct_data_connections(node.operation.pipeline)
  
          # skip custom node
          if node.operation.metadata.id == "custom":
              continue
  
          # skip primary node
          if node.is_primary:
              continue
  
          # check node (also if it is atomized)
          types = set(node.operation.metadata.input_types)
          for _node in node.nodes_from:
              if _node.operation.metadata.id != "custom":
                  types &= set(_node.operation.metadata.output_types)
              if len(types) == 0:
                  raise ValueError(
                      f"{ERROR_PREFIX} Pipeline has incorrect subgraph with wrong parent nodes combination"
                  )
      return True
  
imports: from typing import Optional
  from fedot.core.operations.atomized_model import AtomizedModel
  from fedot.core.operations.model import Model
  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, get_operations_for_task, atomized_model_type
  from fedot.core.repository.tasks import Task, TaskTypesEnum
label_desc: Use image node_id 5 for calling a global function with example usage: has_correct_data_connections(pipeline) and returns: True