code: def _get_remote_op_immediate_dep(
      remote_op_name: str,
      node_name_to_node_def: Mapping[str, tf.compat.v1.NodeDef],
  ) -> List[str]:
      """Finds the remote op immediate dependencies for a remote op.
  
      Args:
        remote_op_name: The name of the child remote op.
        node_name_to_node_def: A mapping from node names to `NodeDef` protos.
  
      Returns:
        A list of remote op immediate dependencies' names.
      """
      queue = collections.deque([remote_op_name])
      visited = set([remote_op_name])
      remote_op_immediate_dep = []
  
      while queue:
          current_node_name = queue.popleft()
  
          for input_node_name in node_name_to_node_def[
              current_node_name
          ].input:
              if input_node_name not in visited:
                  visited.add(input_node_name)
                  input_node = node_name_to_node_def[input_node_name]
  
                  # Stop traversing when reaching a remote op.
                  if _is_remote_op(input_node):
                      remote_op_immediate_dep.append(input_node_name)
                  else:
                      queue.append(input_node_name)
  
      return remote_op_immediate_dep
  
imports: import collections
  from typing import Dict, List, Mapping, Set
  import tensorflow
  from tfx.dsl.io import fileio
  from tfx.experimental.distributed_inference.graphdef_experiments.subgraph_partitioning import execution_spec
label_desc: Use image node_id 8 for calling a global function with example usage: _get_remote_op_immediate_dep(remote_op_name, node_name_to_node_def) and returns: remote_op_immediate_dep