code: def _find_runtime_upstream_node_ids(
      pipeline_ctx: compiler_context.PipelineContext,
      here: base_node.BaseNode,
  ) -> List[str]:
      """Finds all upstream nodes that the current node depends on."""
      result = set()
      for up in itertools.chain(
          here.upstream_nodes,
          pipeline_ctx.implicit_upstream_nodes(here),
      ):
          if pipeline_ctx.is_async_mode and compiler_utils.is_resolver(
              up
          ):
              result.update(
                  _find_runtime_upstream_node_ids(pipeline_ctx, up)
              )
          else:
              result.add(up.id)
      # Validate that upstream nodes are present in the pipeline.
      for up_id in result:
          if up_id not in pipeline_ctx.pipeline_node_ids:
              raise ValueError(
                  f"Node {here.id} references upstream node {up_id} "
                  "which is not present in the pipeline."
              )
      # Sort result so that compiler generates consistent results.
      return sorted(result)
  
imports: import itertools
  from typing import Any, Callable, Dict, Iterator, List, Optional, Tuple, Type, cast
  from tfx import types
  from tfx.dsl.compiler import compiler_context
  from tfx.dsl.compiler import compiler_utils
  from tfx.dsl.compiler import constants
  from tfx.dsl.compiler import node_inputs_compiler
  from tfx.dsl.components.base import base_component
  from tfx.dsl.components.base import base_driver
  from tfx.dsl.components.base import base_node
  from tfx.dsl.experimental.node_execution_options import utils
  from tfx.dsl.placeholder import placeholder
  from tfx.orchestration import data_types
  from tfx.orchestration import data_types_utils
  from tfx.orchestration import pipeline
  from tfx.proto.orchestration import executable_spec_pb2
  from tfx.proto.orchestration import pipeline_pb2
  from tfx.types import channel
  from tfx.types import channel_utils
  from tfx.utils import deprecation_utils
  from tfx.utils import name_utils
label_desc: Use image node_id 9 for calling a global function with example usage: _find_runtime_upstream_node_ids(pipeline_ctx, here) and returns: sorted