code: def testRoundTripInsertMultiThreadedReadOnceSorts(self):
      # We need each thread to keep its own device stack or the device scopes
      # won't be properly nested.
      ops.get_default_graph().switch_to_thread_local()
      with self.cached_session() as sess:
          q = data_flow_ops.PriorityQueue(
              2000, (dtypes.string, dtypes.string), ((), ())
          )
          elem = np.random.randint(-5, 5, size=100).astype(np.int64)
          side_value_0 = np.random.rand(100).astype(bytes)
          side_value_1 = np.random.rand(100).astype(bytes)
  
          enqueue_ops = [
              q.enqueue(
                  (
                      e,
                      constant_op.constant(v0),
                      constant_op.constant(v1),
                  )
              )
              for e, v0, v1 in zip(elem, side_value_0, side_value_1)
          ]
  
          # Run one producer thread for each element in elems.
          def enqueue(enqueue_op):
              self.evaluate(enqueue_op)
  
          dequeue_op = q.dequeue_many(100)
  
          enqueue_threads = [
              self.checkedThread(target=enqueue, args=(op,))
              for op in enqueue_ops
          ]
  
          for t in enqueue_threads:
              t.start()
  
          deq_elem, deq_value_0, deq_value_1 = self.evaluate(dequeue_op)
  
          for t in enqueue_threads:
              t.join()
  
          allowed = {}
          missed = set()
          for e, v0, v1 in zip(elem, side_value_0, side_value_1):
              if e not in allowed:
                  allowed[e] = set()
              allowed[e].add((v0, v1))
              missed.add((v0, v1))
  
          self.assertAllEqual(deq_elem, sorted(elem))
          for e, dv0, dv1 in zip(deq_elem, deq_value_0, deq_value_1):
              self.assertTrue((dv0, dv1) in allowed[e])
              missed.remove((dv0, dv1))
          self.assertEqual(missed, set())
  
imports: import copy
  import random
  import threading
  import numpy
  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 ops
  from tensorflow.python.framework import test_util
  from tensorflow.python.ops import array_ops
  from tensorflow.python.ops import data_flow_ops
  import tensorflow.python.ops.nn_grad
  from tensorflow.python.platform import test
label_desc: Use image node_id 2 for calling the PriorityQueueTest obj's underlying member method code with example usage: obj.testRoundTripInsertMultiThreadedReadOnceSorts() without return types