code: def test_to_datetime_use_earliest(exact: bool) -> None:
      result = (
          pl.Series(["2020-10-25 01:00"])
          .str.to_datetime(
              time_zone="Europe/London",
              ambiguous="earliest",
              exact=exact,
          )
          .item()
      )
      expected = datetime(
          2020, 10, 25, 1, fold=0, tzinfo=ZoneInfo("Europe/London")
      )
      assert result == expected
      result = (
          pl.Series(["2020-10-25 01:00"])
          .str.to_datetime(
              time_zone="Europe/London", ambiguous="latest", exact=exact
          )
          .item()
      )
      expected = datetime(
          2020, 10, 25, 1, fold=1, tzinfo=ZoneInfo("Europe/London")
      )
      assert result == expected
      with pytest.raises(pl.ComputeError):
          pl.Series(["2020-10-25 01:00"]).str.to_datetime(
              time_zone="Europe/London",
              exact=exact,
          ).item()
  
imports: from __future__ import annotations
  import contextlib
  from datetime import date, datetime, time, timedelta, timezone
  from typing import TYPE_CHECKING
  import pytest
  import polars
  from polars.exceptions import ComputeError, TimeZoneAwareConstructorWarning
  from polars.testing import assert_series_equal
label_desc: Use image node_id 33 for calling a global function with example usage: test_to_datetime_use_earliest(exact) without return types