code: def offset_period(
      time_granularity: TimeGranularity,
  ) -> pd.offsets.DateOffset:
      """Offset object to use for adjusting by one granularity period."""
      # The type checker is throwing errors for some of those arguments, but they are valid.
      if time_granularity is TimeGranularity.DAY:
          return pd.offsets.DateOffset(days=1)  # type: ignore
      elif time_granularity is TimeGranularity.WEEK:
          return pd.offsets.DateOffset(weeks=1)  # type: ignore
      elif time_granularity is TimeGranularity.MONTH:
          return pd.offsets.DateOffset(months=1)
      elif time_granularity is TimeGranularity.QUARTER:
          return pd.offsets.DateOffset(months=3)
      elif time_granularity is TimeGranularity.YEAR:
          return pd.offsets.DateOffset(years=1)  # type: ignore
      else:
          assert_values_exhausted(time_granularity)
  
imports: from __future__ import annotations
  from datetime import date
  from typing import Union
  import pandas
  from dbt_semantic_interfaces.enum_extension import ExtendedEnum, assert_values_exhausted
  from dbt_semantic_interfaces.type_enums.time_granularity import TimeGranularity
label_desc: Use image node_id 1 for calling a global function with example usage: offset_period(time_granularity) and returns: pd, pd, pd, pd, pd