code: def _basic_simps(y, start, stop, x, dx, axis):
      nd = len(y.shape)
      if start is None:
          start = 0
      step = 2
      slice_all = (slice(None),) * nd
      slice0 = tupleset(slice_all, axis, slice(start, stop, step))
      slice1 = tupleset(
          slice_all, axis, slice(start + 1, stop + 1, step)
      )
      slice2 = tupleset(
          slice_all, axis, slice(start + 2, stop + 2, step)
      )
  
      if x is None:  # Even spaced Simpson's rule.
          result = np.sum(
              dx / 3.0 * (y[slice0] + 4 * y[slice1] + y[slice2]),
              axis=axis,
          )
      else:
          # Account for possibly different spacings.
          #    Simpson's rule changes a bit.
          h = np.diff(x, axis=axis)
          sl0 = tupleset(slice_all, axis, slice(start, stop, step))
          sl1 = tupleset(
              slice_all, axis, slice(start + 1, stop + 1, step)
          )
          h0 = h[sl0]
          h1 = h[sl1]
          hsum = h0 + h1
          hprod = h0 * h1
          h0divh1 = h0 / h1
          tmp = (
              hsum
              / 6.0
              * (
                  y[slice0] * (2 - 1.0 / h0divh1)
                  + y[slice1] * hsum * hsum / hprod
                  + y[slice2] * (2 - h0divh1)
              )
          )
          result = np.sum(tmp, axis=axis)
      return result
  
imports: from __future__ import division, print_function, absolute_import
  import numpy
  import math
  import warnings
  from numpy import trapz
  from scipy.special import roots_legendre
  from scipy.special import gammaln
  from scipy._lib.six import xrange
label_desc: Use image node_id 7 for calling a global function with example usage: _basic_simps(y, start, stop, x, dx, axis) and returns: result