code: def test_to_datetime_precision_with_time_unit(
      time_unit: TimeUnit, expected: str, format: str
  ) -> None:
      s = pl.Series(["2020-01-01 00:00:00.123456789"])
      result = s.str.to_datetime(
          format, time_unit=time_unit
      ).dt.to_string("%f")[0]
      assert result == expected
  
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 4 for calling a global function with example usage: test_to_datetime_precision_with_time_unit(time_unit, expected, format) without return types