code: def fit(self, xdata, ydata):
      self.params, _ = leastsq(
          errfunc,
          [max(ydata), -1, -0.5],
          args=(xdata, ydata),
          maxfev=500,
      )
      return self
  
file_path: scattertext/scattertext/smoothing/power_law.py
imports: import numpy
  from scipy.optimize import leastsq
label_desc: Use image node_id 2 for calling the PowerLaw obj's underlying member method code with example usage: obj.fit(xdata, ydata) and returns: self