code: def test_overwrite():
      X = np.array([0, 1, 2, 3])[:, None]
      X_before = X.copy()
  
      est = KBinsDiscretizer(n_bins=3, encode="ordinal")
      Xt = est.fit_transform(X)
      assert_array_equal(X, X_before)
  
      Xt_before = Xt.copy()
      Xinv = est.inverse_transform(Xt)
      assert_array_equal(Xt, Xt_before)
      assert_array_equal(Xinv, np.array([[0.5], [1.5], [2.5], [2.5]]))
  
imports: import warnings
  import numpy
  import pytest
  import scipy.sparse
  from sklearn import clone
  from sklearn.preprocessing import KBinsDiscretizer, OneHotEncoder
  from sklearn.utils._testing import assert_allclose, assert_allclose_dense_sparse, assert_array_almost_equal, assert_array_equal
label_desc: Use image node_id 15 for calling a global function with example usage: test_overwrite() without return types