code: def _parse_date_value(
      value: DateValue | Literal["today"],
  ) -> Tuple[List[date] | None, bool]:
      parsed_dates: List[date]
      range_value: bool = False
      if value is None:
          return None, range_value
      if value == "today":
          # Set value default.
          parsed_dates = [datetime.now().date()]
      elif isinstance(value, datetime):
          parsed_dates = [value.date()]
      elif isinstance(value, date):
          parsed_dates = [value]
      elif isinstance(value, (list, tuple)):
          if not len(value) in (0, 1, 2):
              raise StreamlitAPIException(
                  "DateInput value should either be an date/datetime or a list/tuple of "
                  "0 - 2 date/datetime values"
              )
  
          parsed_dates = [
              v.date() if isinstance(v, datetime) else v for v in value
          ]
          range_value = True
      else:
          raise StreamlitAPIException(
              "DateInput value should either be an date/datetime or a list/tuple of "
              "0 - 2 date/datetime values"
          )
      return parsed_dates, range_value
  
imports: from __future__ import annotations
  import re
  from dataclasses import dataclass
  from datetime import date, datetime, time, timedelta
  from textwrap import dedent
  from typing import TYPE_CHECKING, Any, List, Literal, Sequence, Tuple, Union, cast, overload
  from dateutil import relativedelta
  from typing_extensions import TypeAlias
  from streamlit.elements.form import current_form_id
  from streamlit.elements.utils import check_callback_rules, check_session_state_rules, get_label_visibility_proto_value
  from streamlit.errors import StreamlitAPIException
  from streamlit.proto.DateInput_pb2 import DateInput
  from streamlit.proto.TimeInput_pb2 import TimeInput
  from streamlit.runtime.metrics_util import gather_metrics
  from streamlit.runtime.scriptrunner import ScriptRunContext, get_script_run_ctx
  from streamlit.runtime.state import WidgetArgs, WidgetCallback, WidgetKwargs, register_widget
  from streamlit.runtime.state.common import compute_widget_id
  from streamlit.type_util import Key, LabelVisibility, maybe_raise_label_warnings, to_key
label_desc: Use image node_id 1 for calling a global function with example usage: _parse_date_value(value) and returns: parsed_dates,  range_value, None,  range_value