code: def _get_remote_op_to_immediate_dep(
      node_name_to_node_def: Mapping[str, tf.compat.v1.NodeDef]
  ) -> Dict[str, List[str]]:
      """Gets the execution dependencies between remote ops.
  
      The remote op immediate dependencies must be executed before executing
      a remote op.
  
      Args:
        node_name_to_node_def: A mapping from node names to `NodeDef` protos.
  
      Returns:
        A mapping from a remote op name to a set of remote op immediate
        dependencies' names.
      """
      remote_op_to_immediate_dep = {}
  
      for node in node_name_to_node_def.values():
          if _is_remote_op(node):
              remote_op_to_immediate_dep[
                  node.name
              ] = _get_remote_op_immediate_dep(
                  node.name, node_name_to_node_def
              )
  
      return remote_op_to_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 7 for calling a global function with example usage: _get_remote_op_to_immediate_dep(node_name_to_node_def) and returns: remote_op_to_immediate_dep