code: def mock_device(monkeypatch):
      """A mock instance of the abstract Device class"""
  
      with monkeypatch.context() as m:
          dev = qml.Device
          m.setattr(dev, "__abstractmethods__", frozenset())
          m.setattr(dev, "short_name", "mock_device")
          m.setattr(dev, "capabilities", lambda cls: {"model": "qubit"})
          m.setattr(
              dev, "operations", {"RX", "RY", "RZ", "CNOT", "SWAP"}
          )
          yield qml.Device(wires=2)
  
imports: import os
  import pathlib
  import numpy
  import pytest
  import pennylane
  from pennylane.devices import DefaultGaussian
label_desc: Use image node_id 20 for calling a global function with example usage: mock_device(monkeypatch) without return types