code: def test_cat_is_local() -> None:
      s = pl.Series(["a", "c", "a", "b"], dtype=pl.Categorical)
      assert s.cat.is_local()
  
      with pl.StringCache():
          s2 = pl.Series(["a", "b", "a"], dtype=pl.Categorical)
      assert not s2.cat.is_local()
  
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 8 for calling a global function with example usage: test_cat_is_local() without return types