code: def test_casting_to_an_enum_oob_from_integer() -> None:
      dtype = pl.Enum(["a", "b", "c"])
      s = pl.Series([None, 1, 0, 5], dtype=pl.UInt32)
      with pytest.raises(
          pl.OutOfBoundsError,
          match=("index 5 is bigger than the number of categories 3"),
      ):
          s.cast(dtype)
  
imports: import operator
  from datetime import date
  from textwrap import dedent
  from typing import Any, Callable
  import pytest
  import polars
  from polars import StringCache
  from polars.testing import assert_series_equal
label_desc: Use image node_id 9 for calling a global function with example usage: test_casting_to_an_enum_oob_from_integer() without return types