def get_start_date(date_value: Union[str, datetime, date], timezone: str = "<STR_LIT>") -> datetime:
try:<EOL><INDENT>local_tz: pendulum.Timezone = pendulum.timezone(timezone)<EOL><DEDENT>except Exception as e:<EOL><INDENT>raise Exception(f"<STR_LIT>")<EOL><DEDENT>if isinstance(date_value, date):<EOL><INDENT>return datetime.combine(date=date_value, time=datetime.min.time()).replace(tzinfo=local_tz)<EOL><DEDENT>if isinstance(date_value, datetime):<EOL><INDENT>return date_value.replace(tzinfo=local_tz)<EOL><DEDENT>rel_delta: timedelta = get_time_delta(date_value)<EOL>now: datetime = (<EOL>datetime.today()<EOL>.replace(hour=<NUM_LIT:0>, minute=<NUM_LIT:0>, second=<NUM_LIT:0>, microsecond=<NUM_LIT:0>)<EOL>.replace(tzinfo=local_tz)<EOL>)<EOL>if not rel_delta:<EOL><INDENT>return now<EOL><DEDENT>return (now - rel_delta)<EOL>
Takes value from DAG config and generates valid start_date. Defaults to
today, if not a valid date or relative time (1 hours, 1 days, etc.)

:param date_value: either a datetime (or date) or a relative time as string
:type date_value: Uniont[datetime, date, str]
:param timezone: string value representing timezone for the DAG
:type timezone: str
:returns: datetime for start_date
:type: datetime.datetime