code: def fit_fn(distr, xvals, alpha, thresh):
      
      xvals = numpy.array(xvals)
      fit = fitfn_dict[distr](xvals, alpha, thresh)
      # set fitted values below threshold to 0
      numpy.putmask(fit, xvals < thresh, 0.)
      return fit
docs: The fitted function normalized to 1 above threshold
  
      To normalize to a given total count multiply by the count.
  
      Parameters
      ----------
      xvals : sequence of floats
          Values where the function is to be evaluated
      alpha : float
          The fitted parameter
      thresh : float
          Threshold value applied to fitted values
  
      Returns
      -------
      fit : array of floats
          Fitted function at the requested xvals