code: def testColocationConstraints(self):
      with ops.Graph().as_default() as g:
          c = constant_op.constant([10])
          v = variable_v1.VariableV1([3], dtype=dtypes.int32)
          i = gen_array_ops.ref_identity(v)
          a = state_ops.assign(i, c)
          train_op = ops.get_collection_ref(ops.GraphKeys.TRAIN_OP)
          train_op.append(a)
          mg = meta_graph.create_meta_graph_def(graph=g)
          grappler_item = item.Item(mg)
          groups = grappler_item.GetColocationGroups()
          self.assertEqual(len(groups), 1)
          self.assertItemsEqual(
              groups[0],
              ["Assign", "RefIdentity", "Variable", "Variable/Assign"],
          )
  
file_path: tensorflow-upstream/tensorflow/python/grappler/item_test.py
imports: from tensorflow.python.framework import constant_op
  from tensorflow.python.framework import dtypes
  from tensorflow.python.framework import errors_impl
  from tensorflow.python.framework import meta_graph
  from tensorflow.python.framework import ops
  from tensorflow.python.framework import tensor_shape
  from tensorflow.python.framework import test_util
  from tensorflow.python.grappler import item
  from tensorflow.python.ops import control_flow_ops
  from tensorflow.python.ops import gen_array_ops
  from tensorflow.python.ops import state_ops
  from tensorflow.python.ops import variable_v1
  from tensorflow.python.platform import test
label_desc: Use image node_id 5 for calling the ItemTest obj's underlying member method code with example usage: obj.testColocationConstraints() without return types