code: def test_pd_categorical_variable():
      x_order = ["ch5", "ch4", "ch2", "ch1"]
      x = ["ch4", "ch5", "ch1", "ch2"]
      df = DataFrame({"v": x})
      df["v"] = Categorical(df.v, categories=x_order, ordered=True)
      data_meta = get_data_meta(df)
      expected_factor_levels = [
          {
              "column": "v",
              "factor_levels": ["ch5", "ch4", "ch2", "ch1"],
              "order": None,
          }
      ]
      assert expected_factor_levels == data_meta["series_annotations"]
  
file_path: lets-plot/python-package/test/plot/test_series_annotations.py
imports: from datetime import datetime
  from pandas import DataFrame, Categorical
  from lets_plot import aes
  from lets_plot.mapping import as_discrete
  from lets_plot.plot.util import as_annotated_data
label_desc: Use image node_id 12 for calling a global function with example usage: test_pd_categorical_variable() without return types