code: def _timedelta_to_pl_timedelta(
      td: timedelta, time_unit: TimeUnit | None
  ) -> int:
      """Convert a Python timedelta object to a total number of subseconds."""
      microseconds = td.microseconds
      seconds = td.days * SECONDS_PER_DAY + td.seconds
      if time_unit == "ns":
          return seconds * NS_PER_SECOND + microseconds * 1_000
      elif time_unit == "us" or time_unit is None:
          return seconds * US_PER_SECOND + microseconds
      elif time_unit == "ms":
          return seconds * MS_PER_SECOND + microseconds // 1_000
  
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 9 for calling a global function with example usage: _timedelta_to_pl_timedelta(td, time_unit) and returns: unknown, unknown, unknown