code: def Lnorm(weights, p=1, axis=None):
      """calculate L-p norm of weights
  
      Args:
          weights (array(float)): an array of weights
          p (int, default=1): the power of the p-norm, where ``p in [0,inf]``
          axis (int, default=None): axis used to take the norm along
  
      Returns:
          a float distance norm for the weights"""
      from numpy import asarray, seterr, inf, abs, max, sum, expand_dims
  
      weights = asarray(weights, dtype=float)
      if not p:
          w = sum(
              weights != 0.0, dtype=float, axis=axis
          )  # number of nonzero elements
      elif p == inf:
          w = max(abs(weights), axis=axis)
      elif p == -inf:  # XXX: special case, as p in [0,inf]
          w = min(abs(weights), axis=axis)
      else:
          orig = seterr(over="raise", invalid="raise")
          try:
              w = sum(abs(weights**p), axis=axis) ** (1.0 / p)
          except FloatingPointError:  # use the infinity norm
              w = max(abs(weights), axis=axis)
          seterr(**orig)
      return (
          w
          if (axis is None or not w.shape)
          else expand_dims(w, axis=axis)
      )
  
file_path: mystic/mystic/math/distance.py
label_desc: Use image node_id 1 for calling a global function with example usage: Lnorm(weights, p, axis) and returns: unknown