def METHOD_NAME(df_factory, auto_encode):
    df = df_factory(x=np.array([0, 1, 2, 0], dtype='uint8'))
    df = df.categorize('x', labels=['a', 'b', 'c'])
    df = df._future() if auto_encode else df
    if auto_encode:
        assert df['x'].tolist() == ['a', 'b', 'c', 'a']
        assert str(df.x == 'a') == '(index_values(x) == 0)'
        assert df[df.x == 'a'].x.tolist() == ['a', 'a']
        with pytest.raises(ValueError):
            assert str(df.x == 'x') == '(x == 0)'
    else:
        # assert df['x'].tolist() == [0, 1, 2, 0]
        # # assert str(df.x == 'a') == '(x == 0)'
        assert df['x'].tolist() == [0, 1, 2, 0]
        assert str(df.x == 0) == '(x == 0)'
        assert df[df.x == 0].x.tolist() == [0, 0]