code: def test_import_pyzx(monkeypatch):
      """Test if an ImportError is raised by to_zx function."""
  
      with monkeypatch.context() as m:
          m.setitem(sys.modules, "pyzx", None)
  
          with pytest.raises(
              ImportError, match="This feature requires PyZX."
          ):
              qml.transforms.to_zx(qml.PauliX(wires=0))
  
          with pytest.raises(
              ImportError, match="This feature requires PyZX."
          ):
              qml.transforms.to_zx(
                  QuantumScript(
                      [qml.PauliX(wires=0), qml.PauliZ(wires=1)]
                  )
              )
  
imports: import sys
  from functools import partial
  import numpy
  import pytest
  import pennylane
  from pennylane.tape import QuantumScript
  from pennylane.transforms.op_transforms import OperationTransformError
label_desc: Use image node_id 1 for calling a global function with example usage: test_import_pyzx(monkeypatch) without return types