code: def normalize_polynomial(coeffs, threshold=_L2_THRESHOLD):
      r
      l2_norm = polynomial_norm(coeffs)
      if l2_norm < threshold:
          return np.zeros(coeffs.shape, order="F")
  
      else:
          coeffs /= l2_norm
          return coeffs
docs: r"""Normalizes a polynomial in the :math:`L_2` sense.
  
      Does so on the interval :math:\left[0, 1\right]` via
      :func:`polynomial_norm`.
  
      Args:
          coeffs (numpy.ndarray): ``d + 1``-array of coefficients in monomial /
              power basis.
          threshold (Optional[float]): The point :math:`\tau` below which a
              polynomial will be considered to be numerically equal to zero,
              applies to all :math:`f` with :math`\| f \|_{L_2} < \tau`.
  
      Returns:
          numpy.ndarray: The normalized polynomial.