code: def test_factor_levels_with_ordering():
      mapping = aes(
          as_discrete("v1", order=-1),
          "v2",
          a=as_discrete("v1", levels=["foo", "bar"]),
          b=as_discrete("v2", levels=[2, 1]),
      )
      data_meta = get_data_meta(data_dict2, mapping)
      expected_factor_levels = [
          {
              "column": "v1",
              "factor_levels": ["foo", "bar"],
              "order": -1,
          },
          {"column": "v2", "factor_levels": [2, 1], "order": None},
      ]
      assert expected_factor_levels == data_meta["series_annotations"]
      assert "mapping_annotations" not in data_meta
  
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 10 for calling a global function with example usage: test_factor_levels_with_ordering() without return types