code: def normalize(b, a):
      """Normalize numerator/denominator of a continuous-time transfer function.
  
      If values of `b` are too close to 0, they are removed. In that case, a
      BadCoefficients warning is emitted.
  
      Parameters
      ----------
      b: array_like
          Numerator of the transfer function. Can be a 2-D array to normalize
          multiple transfer functions.
      a: array_like
          Denominator of the transfer function. At most 1-D.
  
      Returns
      -------
      num: array
          The numerator of the normalized transfer function. At least a 1-D
          array. A 2-D array if the input `num` is a 2-D array.
      den: 1-D array
          The denominator of the normalized transfer function.
  
      Notes
      -----
      Coefficients for both the numerator and denominator should be specified in
      descending exponent order (e.g., ``s^2 + 3s + 5`` would be represented as
      ``[1, 3, 5]``).
  
      See Also
      --------
      scipy.signal.normalize
  
      """
      num, den = b, a
  
      den = cupy.atleast_1d(den)
      num = cupy.atleast_2d(_align_nums(num))
  
      if den.ndim != 1:
          raise ValueError(
              "Denominator polynomial must be rank-1 array."
          )
      if num.ndim > 2:
          raise ValueError(
              "Numerator polynomial must be rank-1 or" " rank-2 array."
          )
      if cupy.all(den == 0):
          raise ValueError(
              "Denominator must have at least on nonzero element."
          )
  
      # Trim leading zeros in denominator, leave at least one.
      den = _trim_zeros(den, "f")
  
      # Normalize transfer function
      num, den = num / den[0], den / den[0]
  
      # Count numerator columns that are all zero
      leading_zeros = 0
      for col in num.T:
          if cupy.allclose(col, 0, atol=1e-14):
              leading_zeros += 1
          else:
              break
  
      # Trim leading zeros of numerator
      if leading_zeros > 0:
          warnings.warn(
              "Badly conditioned filter coefficients (numerator): the "
              "results may be meaningless",
              BadCoefficients,
          )
          # Make sure at least one column remains
          if leading_zeros == num.shape[1]:
              leading_zeros -= 1
          num = num[:, leading_zeros:]
  
      # Squeeze first dimension if singular
      if num.shape[0] == 1:
          num = num[0, :]
  
      return num, den
  
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 8 for calling a global function with example usage: normalize(b, a) and returns: num,  den