code: def _visit_pipeline_nodes_recursively(
      p: pipeline_pb2.Pipeline,
      visitor: Callable[[pipeline_pb2.PipelineNode], None],
  ):
      """Helper function to visit every node inside a possibly nested pipeline."""
      for pipeline_or_node in p.nodes:
          if pipeline_or_node.WhichOneof("node") == "pipeline_node":
              visitor(pipeline_or_node.pipeline_node)
          else:
              _visit_pipeline_nodes_recursively(
                  pipeline_or_node.sub_pipeline, visitor
              )
  
imports: import copy
  import threading
  from typing import Callable, Optional
  from absl import flags
  from absl import logging
  from tfx.orchestration import metadata
  from tfx.orchestration.experimental.core import pipeline_ops
  from tfx.orchestration.experimental.core import pipeline_state
  from tfx.orchestration.experimental.core import task
  from tfx.orchestration.experimental.core import task_scheduler
  from tfx.orchestration.portable.mlmd import context_lib
  from tfx.orchestration.portable.mlmd import execution_lib
  from tfx.proto.orchestration import pipeline_pb2
  from tfx.utils import status
  from ml_metadata.proto import metadata_store_pb2
label_desc: Use image node_id 1 for calling a global function with example usage: _visit_pipeline_nodes_recursively(p, visitor) without return types