code: def trapz(y, x=None, dx=1.0, axis=-1):
      """An alias of `trapezoid`.
  
      `trapz` is kept for backwards compatibility. For new code, prefer
      `trapezoid` instead.
      """
      msg = (
          "'scipy.integrate.trapz' is deprecated in favour of "
          "'scipy.integrate.trapezoid' and will be removed in SciPy 1.14.0"
      )
      warnings.warn(msg, DeprecationWarning, stacklevel=2)
      return trapezoid(y, x=x, dx=dx, axis=axis)
  
imports: from __future__ import annotations
  from typing import TYPE_CHECKING, Callable, Any, cast
  import numpy
  import numpy.typing
  import math
  import warnings
  from collections import namedtuple
  from scipy.special import roots_legendre
  from scipy.special import gammaln, logsumexp
  from scipy._lib._util import _rng_spawn
  from scipy._lib.deprecation import _NoValue, _deprecate_positional_args, _deprecated
label_desc: Use image node_id 2 for calling a global function with example usage: trapz(y, x, dx, axis) and returns: trapezoid