code: def with_sample_weight(clf, sample_weight, fit_params):
      
      param_name = _get_classifier_prefix(clf) + "sample_weight"
      params = {param_name: sample_weight}
      params.update(fit_params)
      return params
docs: Return fit_params with added "sample_weight" argument.
      Unlike `fit_params['sample_weight'] = sample_weight` it
      handles a case where ``clf`` is a pipeline.