code: def smooth(self, y, x=None, weights=None):
      if self.method == "target_df":
          if hasattr(self, "pen"):
              self.fit(y, x=x, weights=weights, pen=self.pen)
          else:
              self.fit_target_df(
                  y, x=x, weights=weights, df=self.target_df
              )
      elif self.method == "optimize_gcv":
          self.fit_optimize_gcv(y, x=x, weights=weights)
  
imports: import numpy
  import numpy.linalg
  from scipy.linalg import solveh_banded
  from scipy.optimize import golden
  from models import _hbspline
  import warnings
label_desc: Use image node_id 2 for calling the SmoothingSpline obj's underlying member method code with example usage: obj.smooth(y, x, weights) without return types