code: def _get_resource_inputs(op):
      """Returns an iterable of resources touched by this `op`."""
      reads, writes = utils.get_read_write_resource_inputs(op)
      saturated = False
      while not saturated:
          saturated = True
          for key in _acd_resource_resolvers_registry.list():
              # Resolvers should return true if they are updating the list of
              # resource_inputs.
              # TODO(srbs): An alternate would be to just compare the old and new set
              # but that may not be as fast.
              updated = _acd_resource_resolvers_registry.lookup(key)(
                  op, reads, writes
              )
              if updated:
                  # Conservatively remove any resources from `reads` that are also writes.
                  reads = reads.difference(writes)
              saturated = saturated and not updated
  
      # Note: A resource handle that is not written to is treated as read-only. We
      # don't have a special way of denoting an unused resource.
      for t in reads:
          yield (t, ResourceType.READ_ONLY)
      for t in writes:
          yield (t, ResourceType.READ_WRITE)
  
imports: import collections
  import enum
  from tensorflow.core.framework import attr_value_pb2
  from tensorflow.python.eager import context
  from tensorflow.python.framework import auto_control_deps_utils
  from tensorflow.python.framework import dtypes
  from tensorflow.python.framework import indexed_slices
  from tensorflow.python.framework import op_def_registry
  from tensorflow.python.framework import ops
  from tensorflow.python.framework import registry
  from tensorflow.python.framework import sparse_tensor
  from tensorflow.python.ops import array_ops
  from tensorflow.python.ops import control_flow_ops
  from tensorflow.python.ops import control_flow_util
  from tensorflow.python.ops import tensor_array_ops
  from tensorflow.python.util import nest
  from tensorflow.python.util import object_identity
  from tensorflow.python.util import tf_decorator
label_desc: Use image node_id 5 for calling a global function with example usage: _get_resource_inputs(op) without return types