code: def _relative_degree(z, p):
      """
      Return relative degree of transfer function from zeros and poles
      """
      degree = len(p) - len(z)
      if degree < 0:
          raise ValueError(
              "Improper transfer function. "
              "Must have at least as many poles as zeros."
          )
      else:
          return degree
  
imports: import warnings
  import math
  from math import pi, prod
  import cupy
  from cupyx.scipy.special import binom
  import cupyx.scipy.special
  from cupyx.scipy.signal import _optimize
  from cupyx.scipy.signal._polyutils import roots, poly
  from cupyx.scipy.signal._lti_conversion import abcd_normalize
label_desc: Use image node_id 9 for calling a global function with example usage: _relative_degree(z, p) and returns: degree