code: def get_read_var_ops(var_op, exclude_snapshot=False):
      """
      Given a resource handle op, get all its read variable ops.
  
      Args:
          var_op (Operation): VarHandleOp for ResourceVariable, VariableV2 or Variable for RefVariable
          exclude_snapshot (bool): whether to skip the default ReadVariableOp bundled (i.e. "/Read/ReadVariableOp").
              no extra snapshot to exclude for RefVariable, even if `exclude_snapshot=True`.
  
      Returns:
          List[Operation]: List of read var ops of it.
      """
      read_var_ops = {
          consumer
          for consumer in get_consumers(var_op)
          if is_read_var_op(consumer)
      }
      if exclude_snapshot:
          read_var_ops = {
              op
              for op in read_var_ops
              if not op.name.endswith("/Read/ReadVariableOp")
          }
      return read_var_ops
  
file_path: autodist/autodist/kernel/common/variable_utils.py
imports: from tensorflow.python.eager import context, tape
  from tensorflow.python.ops import gen_resource_variable_ops, array_ops
  from tensorflow.python.ops.resource_variable_ops import _maybe_set_handle_data
  from autodist.kernel.common.utils import get_consumers
label_desc: Use image node_id 2 for calling a global function with example usage: get_read_var_ops(var_op, exclude_snapshot) and returns: read_var_ops