code: def sampled_variance(
      f, lb, ub, npts=10000, map=None
  ):  # XXX: could be improved
      """
      use random sampling to calculate the variance of a function
  
      Inputs:
          f -- a function that takes a list and returns a number
          lb -- a list of lower bounds
          ub -- a list of upper bounds
          npts -- the number of points to sample [Default is npts=10000]
          map -- the mapping function [Default is builtins.map]"""
      pts = _random_samples(lb, ub, npts)
      return _variance_given_samples(f, pts, map)
  
file_path: mystic/mystic/math/samples.py
label_desc: Use image node_id 5 for calling a global function with example usage: sampled_variance(f, lb, ub, npts, map) and returns: _variance_given_samples