code: def moment(samples, weights=None, order=1, tol=0):  # , _mean=None):
      """calculate the (weighted) nth-order moment for a list of points
  
      Args:
          samples (list): a list of sample points
          weights (list, default=None): a list of sample weights
          order (int, default=1): the degree, a positive integer
          tol (float, default=0.0): a tolerance, where any ``mean <= tol`` is zero
  
      Returns:
          the weighted nth-order moment for a list of sample points"""
      if order == 0:
          return 1.0  # XXX: error if order < 0
      if order == 1:
          return 0.0
      # if _mean is None:
      _mean = mean(samples, weights)
      mom = [
          (s - _mean) ** order for s in samples
      ]  # XXX: abs(s - _mean) ???
      return mean(mom, weights, tol)
  
imports: from mystic.math.stats import *
  from mystic.math.samples import *
  from mystic.math.integrate import *
  from mystic.symbolic import generate_solvers, generate_constraint, solve
  from mystic.symbolic import generate_conditions, generate_penalty
  from mystic.math import almostEqual
  from mystic.math.distance import Lnorm
  from numpy import asarray
label_desc: Use image node_id 17 for calling a global function with example usage: moment(samples, weights, order, tol) and returns: mean, int, int