code: def test_cat_to_local_missing_values() -> None:
      with pl.StringCache():
          _ = pl.Series(["a", "b"], dtype=pl.Categorical)
          s = pl.Series(["c", "b", None, "d"], dtype=pl.Categorical)
  
      out = s.cat.to_local()
      assert out.to_physical().to_list() == [0, 1, None, 2]
  
file_path: polars/py-polars/tests/unit/namespaces/test_categorical.py
imports: import polars
  from polars.testing import assert_frame_equal
label_desc: Use image node_id 6 for calling a global function with example usage: test_cat_to_local_missing_values() without return types