code: def ptp(f, samples):
      """calculate the spread of function for the given list of points
  
      ``minimum(f,x) = max(f(x)) - min(f(x))``
  
      Args:
          f (func): a function that takes a list and returns a number
          samples (list): a list of sample points
  
      Returns:
          the spread in output value for a function at the given inputs
      """
      y = [f(x) for x in samples]  # XXX: parallel map?
      return max(y) - min(y)
  
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 8 for calling a global function with example usage: ptp(f, samples) and returns: unknown