parameters: (name, estimator_orig,
                                        readonly_memmap=False)
docstring: Check if self is returned when calling fit
docstring_summary: Check if self is returned when calling fit
docstring_tokens: Check if self is returned when calling fit
function: def check_estimators_fit_returns_self(name, estimator_orig,
                                        readonly_memmap=False):
      """Check if self is returned when calling fit"""
      if _safe_tags(estimator_orig, 'binary_only'):
          n_centers = 2
      else:
          n_centers = 3
      X, y = make_blobs(random_state=0, n_samples=21, centers=n_centers)
      # some want non-negative input
      X -= X.min()
      X = _pairwise_estimator_convert_X(X, estimator_orig)
  
      estimator = clone(estimator_orig)
      y = _enforce_estimator_tags_y(estimator, y)
  
      if readonly_memmap:
          X, y = create_memmap_backed_data([X, y])
  
      set_random_state(estimator)
      assert estimator.fit(X, y) is estimator
function_tokens: def check_estimators_fit_returns_self ( name , estimator_orig , readonly_memmap = False ) : if _safe_tags ( estimator_orig , 'binary_only' ) : n_centers = 2 else : n_centers = 3 X , y = make_blobs ( random_state = 0 , n_samples = 21 , centers = n_centers ) # some want non-negative input X -= X . min ( ) X = _pairwise_estimator_convert_X ( X , estimator_orig ) estimator = clone ( estimator_orig ) y = _enforce_estimator_tags_y ( estimator , y ) if readonly_memmap : X , y = create_memmap_backed_data ( [ X , y ] ) set_random_state ( estimator ) assert estimator . fit ( X , y ) is estimator