code: def has_no_data_flow_conflicts_in_ts_pipeline(pipeline: Pipeline):
      """Function checks the correctness of connection between nodes"""
      task = Task(TaskTypesEnum.ts_forecasting)
      ts_models = get_operations_for_task(
          task=task, mode="model", tags=["non_lagged"]
      )
      non_ts_models = sorted(
          list(
              set(
                  get_operations_for_task(task=task, mode="model")
              ).difference(set(ts_models))
          )
      )
  
      # Preprocessing not only for time series
      non_ts_data_operations = get_operations_for_task(
          task=task,
          mode="data_operation",
          tags=["non_applicable_for_ts"],
      )
      ts_data_operations = get_operations_for_task(
          task=task, mode="data_operation", tags=["non_lagged"]
      )
      # Remove lagged and sparse lagged transformation
      ts_data_operations.remove("lagged")
      ts_data_operations.remove("sparse_lagged")
      ts_data_operations.remove("exog_ts")
  
      ts_to_table_operations = ["lagged", "sparse_lagged", "exog_ts"]
  
      # Dictionary as {'current operation in the node': 'parent operations list'}
      wrong_connections = get_wrong_links(
          ts_to_table_operations,
          ts_data_operations,
          non_ts_data_operations,
          ts_models,
          non_ts_models,
      )
  
      limit_parents_count, need_to_have_parent = get_parent_limits(
          ts_to_table_operations,
          ts_data_operations,
          non_ts_data_operations,
          ts_models,
      )
  
      for node in pipeline.nodes:
          raise_error = False
          if node.is_primary:
              # if node is primary then it should use time series
              raise_error = (
                  DataTypesEnum.ts
                  not in node.operation.metadata.input_types
              )
              raise_error |= (
                  node.operation.operation_type in need_to_have_parent
              )
          else:
              # Operation name in the current node
              current_operation = node.operation.operation_type
              if current_operation in limit_parents_count:
                  raise_error = limit_parents_count[
                      current_operation
                  ] < len(node.nodes_from)
  
              # There are several parents for current node or at least 1
              if not raise_error:
                  forbidden_parents = wrong_connections.get(
                      current_operation
                  )
                  if forbidden_parents:
                      parents = set(
                          parent.operation.operation_type
                          for parent in node.nodes_from
                      )
                      raise_error = set(forbidden_parents) & parents
          if raise_error:
              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 6 for calling a global function with example usage: has_no_data_flow_conflicts_in_ts_pipeline(pipeline) and returns: True