code: def _to_python_datetime(
      value: int | float,
      time_unit: TimeUnit | None = "ns",
      time_zone: str | None = None,
  ) -> datetime:
      """Convert polars int64 timestamp to Python datetime."""
      if not time_zone:
          if time_unit == "us":
              return EPOCH + timedelta(microseconds=value)
          elif time_unit == "ns":
              return EPOCH + timedelta(microseconds=value // 1_000)
          elif time_unit == "ms":
              return EPOCH + timedelta(milliseconds=value)
          else:
              raise ValueError(
                  f"`time_unit` must be one of {{'ns', 'us', 'ms'}}, got {time_unit!r}"
              )
      elif _ZONEINFO_AVAILABLE:
          if time_unit == "us":
              dt = EPOCH_UTC + timedelta(microseconds=value)
          elif time_unit == "ns":
              dt = EPOCH_UTC + timedelta(microseconds=value // 1_000)
          elif time_unit == "ms":
              dt = EPOCH_UTC + timedelta(milliseconds=value)
          else:
              raise ValueError(
                  f"`time_unit` must be one of {{'ns', 'us', 'ms'}}, got {time_unit!r}"
              )
          return _localize(dt, time_zone)
      else:
          raise ImportError(
              "install polars[timezone] to handle datetimes with time zone information"
          )
  
imports: from __future__ import annotations
  import sys
  from datetime import datetime, time, timedelta, timezone
  from decimal import Context
  from functools import lru_cache
  from typing import TYPE_CHECKING, Any, Callable, Sequence, TypeVar, overload
  from polars.dependencies import _ZONEINFO_AVAILABLE, zoneinfo
label_desc: Use image node_id 13 for calling a global function with example usage: _to_python_datetime(value, time_unit, time_zone) and returns: unknown, _localize, unknown, unknown