code: def test_replace_enum_to_new_enum() -> None:
      s = pl.Series(
          ["a", "b", "c"], dtype=pl.Enum(["a", "b", "c", "d"])
      )
      old = ["a", "b"]
  
      new_dtype = pl.Enum(["a", "b", "c", "d", "e"])
      new = pl.Series(["c", "e"], dtype=new_dtype)
  
      result = s.replace(old, new)
  
      expected = pl.Series(["c", "e", "c"], dtype=new_dtype)
      assert_series_equal(result, expected)
  
imports: from __future__ import annotations
  import contextlib
  from typing import Any
  import pytest
  import polars
  from polars.exceptions import CategoricalRemappingWarning
  from polars.testing import assert_frame_equal, assert_series_equal
label_desc: Use image node_id 9 for calling a global function with example usage: test_replace_enum_to_new_enum() without return types