code: def make_qscript(
      fn, shots: Optional[Union[int, Sequence, Shots]] = None
  ):
      """Returns a function that generates a qscript from a quantum function without any
      operation queuing taking place.
  
      This is useful when you would like to manipulate or transform
      the qscript created by a quantum function without evaluating it.
  
      Args:
          fn (function): the quantum function to generate the qscript from
          shots (None, int, Sequence[int], ~.Shots): number and/or
              batches of executions
  
      Returns:
          function: The returned function takes the same arguments as the quantum
          function. When called, it returns the generated quantum script
          without any queueing occuring.
  
      **Example**
  
      Consider the following quantum function:
  
      .. code-block:: python
  
          def qfunc(x):
              qml.Hadamard(wires=0)
              qml.CNOT(wires=[0, 1])
              qml.RX(x, wires=0)
  
      We can use ``make_qscript`` to extract the qscript generated by this
      quantum function, without any of the operations being queued by
      any existing queuing contexts:
  
      >>> with qml.queuing.AnnotatedQueue() as active_queue:
      ...     _ = qml.RY(1.0, wires=0)
      ...     qs = make_qscript(qfunc)(0.5)
      >>> qs.operations
      [Hadamard(wires=[0]), CNOT(wires=[0, 1]), RX(0.5, wires=[0])]
  
      Note that the currently recording queue did not queue any of these quantum operations:
  
      >>> active_queue.queue
      [RY(1.0, wires=[0])]
      """
  
      def wrapper(*args, **kwargs):
          with AnnotatedQueue() as q:
              fn(*args, **kwargs)
  
          return QuantumScript.from_queue(q, shots)
  
      return wrapper
  
imports: import contextlib
  import copy
  from collections import Counter
  from typing import List, Union, Optional, Sequence
  from warnings import warn
  import pennylane
  from pennylane.measurements import ClassicalShadowMP, CountsMP, MeasurementProcess, ProbabilityMP, SampleMP, ShadowExpvalMP, StateMP, Shots
  from pennylane.typing import TensorLike
  from pennylane.operation import Observable, Operator, Operation, _UNSET_BATCH_SIZE
  from pennylane.pytrees import register_pytree
  from pennylane.queuing import AnnotatedQueue, process_queue
  from pennylane.wires import Wires
label_desc: Use image node_id 1 for calling a global function with example usage: make_qscript(fn, shots) and returns: wrapper, QuantumScript