code: def test_truncated_index(self):
      # see: https://github.com/scikit-learn-contrib/categorical-encoding/issues/152
      data = pd.DataFrame(
          data={"x": ["A", "B", "C", "A", "B"], "y": [1, 0, 1, 0, 1]}
      )
      data = data.iloc[2:5]
      data2 = pd.DataFrame(data={"x": ["C", "A", "B"], "y": [1, 0, 1]})
      for encoder_name in set(encoders.__all__) - {"HashingEncoder"}:
          with self.subTest(encoder_name=encoder_name):
              enc = getattr(encoders, encoder_name)()
              result = enc.fit_transform(data.x, data.y)
              enc2 = getattr(encoders, encoder_name)()
              result2 = enc2.fit_transform(data2.x, data2.y)
              self.assertTrue(
                  (result.to_numpy() == result2.to_numpy()).all()
              )
  
imports: import warnings
  from datetime import timedelta
  import numpy
  from numpy.testing import assert_array_equal
  import pandas
  import sklearn
  import tests.helpers
  from sklearn.utils.estimator_checks import check_transformer_general, check_transformers_unfitted, check_n_features_in
  from sklearn.compose import ColumnTransformer
  from unittest import TestCase
  from copy import deepcopy
  import category_encoders
label_desc: Use image node_id 33 for calling the TestEncoders obj's underlying member method code with example usage: obj.test_truncated_index() without return types