code: def test_categorical_is_in_list() -> None:
      # this requires type coercion to cast.
      # we should not cast within the function as this would be expensive within a
      # group by context that would be a cast per group
      df = pl.DataFrame(
          {"a": [1, 2, 3, 1, 2], "b": ["a", "b", "c", "d", "e"]}
      ).with_columns(pl.col("b").cast(pl.Categorical))
  
      cat_list = ("a", "b", "c")
      assert df.filter(pl.col("b").is_in(cat_list)).to_dict(
          as_series=False
      ) == {
          "a": [1, 2, 3],
          "b": ["a", "b", "c"],
      }
  
imports: from __future__ import annotations
  import contextlib
  import io
  import operator
  from typing import TYPE_CHECKING, Any, Callable, Literal
  import pytest
  import polars
  from polars import StringCache
  from polars.exceptions import CategoricalRemappingWarning, StringCacheMismatchError
  from polars.testing import assert_frame_equal, assert_series_equal
label_desc: Use image node_id 4 for calling a global function with example usage: test_categorical_is_in_list() without return types