parameters: (
      precision: DateTimePrecision)
docstring: Returns a timedelta reflecting the minimum unit based on precision.
docstring_summary: Returns a timedelta reflecting the minimum unit based on precision.
docstring_tokens: Returns a timedelta reflecting the minimum unit based on precision .
function: def get_duration_from_precision(
      precision: DateTimePrecision) -> datetime.timedelta:
    """Returns a timedelta reflecting the minimum unit based on precision."""
    # TODO: Handle YEAR and MONTH precision properly
    if precision == DateTimePrecision.YEAR:
      return datetime.timedelta(days=366)
    elif precision == DateTimePrecision.MONTH:
      return datetime.timedelta(days=31)
    elif precision == DateTimePrecision.DAY:
      return datetime.timedelta(hours=24)
    elif precision == DateTimePrecision.SECOND:
      return datetime.timedelta(seconds=1)
    elif precision == DateTimePrecision.MILLISECOND:
      return datetime.timedelta(milliseconds=1)
    elif precision == DateTimePrecision.MICROSECOND:
      return datetime.timedelta(microseconds=1)
    else:
      raise ValueError(
          f'Unsupported datetime precision: {DateTimePrecision(precision)!r}.')
function_tokens: def get_duration_from_precision ( precision : DateTimePrecision ) -> datetime . timedelta : # TODO: Handle YEAR and MONTH precision properly if precision == DateTimePrecision . YEAR : return datetime . timedelta ( days = 366 ) elif precision == DateTimePrecision . MONTH : return datetime . timedelta ( days = 31 ) elif precision == DateTimePrecision . DAY : return datetime . timedelta ( hours = 24 ) elif precision == DateTimePrecision . SECOND : return datetime . timedelta ( seconds = 1 ) elif precision == DateTimePrecision . MILLISECOND : return datetime . timedelta ( milliseconds = 1 ) elif precision == DateTimePrecision . MICROSECOND : return datetime . timedelta ( microseconds = 1 ) else : raise ValueError ( f'Unsupported datetime precision: {DateTimePrecision(precision)!r}.' )