code: def test_errors():
      if not matplotlib:
          skip("Matplotlib not the default backend")
  
      # Invalid `system` check
      tfm = TransferFunctionMatrix([[tf6, tf5], [tf5, tf6]])
      expr = 1 / (s**2 - 1)
      raises(NotImplementedError, lambda: pole_zero_plot(tfm))
      raises(
          NotImplementedError, lambda: pole_zero_numerical_data(expr)
      )
      raises(NotImplementedError, lambda: impulse_response_plot(expr))
      raises(
          NotImplementedError,
          lambda: impulse_response_numerical_data(tfm),
      )
      raises(NotImplementedError, lambda: step_response_plot(tfm))
      raises(
          NotImplementedError,
          lambda: step_response_numerical_data(expr),
      )
      raises(NotImplementedError, lambda: ramp_response_plot(expr))
      raises(
          NotImplementedError, lambda: ramp_response_numerical_data(tfm)
      )
      raises(NotImplementedError, lambda: bode_plot(tfm))
  
      # More than 1 variables
      tf_a = TransferFunction(a, s + 1, s)
      raises(ValueError, lambda: pole_zero_plot(tf_a))
      raises(ValueError, lambda: pole_zero_numerical_data(tf_a))
      raises(ValueError, lambda: impulse_response_plot(tf_a))
      raises(ValueError, lambda: impulse_response_numerical_data(tf_a))
      raises(ValueError, lambda: step_response_plot(tf_a))
      raises(ValueError, lambda: step_response_numerical_data(tf_a))
      raises(ValueError, lambda: ramp_response_plot(tf_a))
      raises(ValueError, lambda: ramp_response_numerical_data(tf_a))
      raises(ValueError, lambda: bode_plot(tf_a))
  
      # lower_limit > 0 for response plots
      raises(
          ValueError, lambda: impulse_response_plot(tf1, lower_limit=-1)
      )
      raises(
          ValueError, lambda: step_response_plot(tf1, lower_limit=-0.1)
      )
      raises(
          ValueError,
          lambda: ramp_response_plot(tf1, lower_limit=-4 / 3),
      )
  
      # slope in ramp_response_plot() is negative
      raises(ValueError, lambda: ramp_response_plot(tf1, slope=-0.1))
  
      # incorrect frequency or phase unit
      raises(ValueError, lambda: bode_plot(tf1, freq_unit="hz"))
      raises(ValueError, lambda: bode_plot(tf1, phase_unit="degree"))
  
imports: from math import isclose
  from sympy.core.numbers import I
  from sympy.core.symbol import Dummy
  from sympy.functions.elementary.complexes import Abs, arg
  from sympy.functions.elementary.exponential import log
  from sympy.abc import s, p, a
  from sympy.external import import_module
  from sympy.physics.control.control_plots import pole_zero_numerical_data, pole_zero_plot, step_response_numerical_data, step_response_plot, impulse_response_numerical_data, impulse_response_plot, ramp_response_numerical_data, ramp_response_plot, bode_magnitude_numerical_data, bode_phase_numerical_data, bode_plot
  from sympy.physics.control.lti import TransferFunction, Series, Parallel, TransferFunctionMatrix
  from sympy.testing.pytest import raises, skip
label_desc: Use image node_id 4 for calling a global function with example usage: test_errors() without return types