code: def mock_device_fixture(monkeypatch):
      with monkeypatch.context() as m:
          m.setattr(qml.Device, "__abstractmethods__", frozenset())
          m.setattr(
              qml.Device,
              "_capabilities",
              {"supports_tensor_observables": True, "model": "qubit"},
          )
          m.setattr(
              qml.Device,
              "operations",
              ["RX", "RY", "Rot", "CNOT", "Hadamard", "StatePrep"],
          )
          m.setattr(
              qml.Device,
              "observables",
              ["PauliX", "PauliY", "PauliZ", "Hadamard", "Hermitian"],
          )
          m.setattr(qml.Device, "short_name", "MockDevice")
          m.setattr(qml.Device, "expval", lambda self, x, y, z: 1)
          m.setattr(qml.Device, "var", lambda self, x, y, z: 2)
          m.setattr(qml.Device, "sample", lambda self, x, y, z: 3)
          m.setattr(qml.Device, "apply", lambda self, x, y, z: None)
  
          def get_device(wires=1):
              return qml.Device(
                  wires=wires
              )  # pylint:disable=abstract-class-instantiated
  
          yield get_device
  
imports: import copy
  import numpy
  import pytest
  import pennylane
  from pennylane import numpy
label_desc: Use image node_id 6 for calling a global function with example usage: mock_device_fixture(monkeypatch) and returns: qml