code: def active() -> bool:
      """Check whether the caller is inside a :func:`~.qjit` evaluation context.
  
      This helper function may be used during implementation
      to allow differing logic for circuits or operations that are
      just-in-time compiled versus those that are not.
  
      Returns:
          bool: ``True`` if the caller is inside a QJIT evaluation context
  
      **Example**
  
      For example, you can use this method in your hybrid program to execute it
      conditionally whether called inside :func:`~.qjit` or not.
  
      .. code-block:: python
  
          dev = qml.device("lightning.qubit", wires=2)
  
          @qml.qnode(dev)
          def circuit(phi, theta):
              if qml.compiler.active():
                  qml.RX(phi, wires=0)
              qml.CNOT(wires=[0, 1])
              qml.PhaseShift(theta, wires=0)
              return qml.expval(qml.PauliZ(0))
  
      >>> circuit(np.pi, np.pi / 2)
      1.0
      >>> qml.qjit(circuit)(np.pi, np.pi / 2)
      -1.0
      """
  
      return active_compiler() is not None
  
file_path: pennylane/pennylane/compiler/compiler.py
imports: from typing import List, Optional
  from sys import version_info
  from importlib import reload, metadata
  from collections import defaultdict
  import dataclasses
  import re
  from semantic_version import Version
label_desc: Use image node_id 7 for calling a global function with example usage: active() and returns: unknown