code: def _by_idx(x):
      """Sorting key for Operators: queue index aka temporal order.
  
      Args:
          x (Operator): node in the circuit graph
      Returns:
          int: sorting key for the node
      """
      return x.queue_idx
  
imports: from numbers import Number
  from collections import namedtuple
  import numpy
  import rustworkx
  from pennylane.measurements import MeasurementProcess
  from pennylane.resource import ResourcesOperation
label_desc: Use image node_id 1 for calling a global function with example usage: _by_idx(x) and returns: x