code: def _parse_min_date(
      min_value: SingleDateValue,
      parsed_dates: Sequence[date] | None,
  ) -> date:
      parsed_min_date: date
      if isinstance(min_value, datetime):
          parsed_min_date = min_value.date()
      elif isinstance(min_value, date):
          parsed_min_date = min_value
      elif min_value is None:
          if parsed_dates:
              parsed_min_date = parsed_dates[
                  0
              ] - relativedelta.relativedelta(years=10)
          else:
              parsed_min_date = (
                  date.today() - relativedelta.relativedelta(years=10)
              )
      else:
          raise StreamlitAPIException(
              "DateInput min should either be a date/datetime or None"
          )
      return parsed_min_date
  
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 2 for calling a global function with example usage: _parse_min_date(min_value, parsed_dates) and returns: parsed_min_date