code: def test_ordered_cats(precalculated_catboost_regression_explainer):
      assert precalculated_catboost_regression_explainer.ordered_cats(
          "Sex"
      ) == ["NOT_ENCODED", "Sex_female", "Sex_male"]
      assert precalculated_catboost_regression_explainer.ordered_cats(
          "Deck", topx=2, sort="alphabet"
      ) == ["Deck_A", "Deck_B"]
  
      assert isinstance(
          precalculated_catboost_regression_explainer.ordered_cats(
              "Deck", sort="freq"
          ),
          list,
      )
      assert isinstance(
          precalculated_catboost_regression_explainer.ordered_cats(
              "Deck", topx=3, sort="freq"
          ),
          list,
      )
      assert isinstance(
          precalculated_catboost_regression_explainer.ordered_cats(
              "Deck", sort="shap"
          ),
          list,
      )
      assert isinstance(
          precalculated_catboost_regression_explainer.ordered_cats(
              "Deck", topx=3, sort="shap"
          ),
          list,
      )
  
imports: import pandas
  import numpy
  from pandas.api.types import is_categorical_dtype, is_numeric_dtype
  import plotly.graph_objs
label_desc: Use image node_id 9 for calling a global function with example usage: test_ordered_cats(precalculated_catboost_regression_explainer) without return types