def make_date(obj: Union[date, datetime, Text], timezone: tzinfo=None):
if isinstance(obj, datetime):<EOL><INDENT>if hasattr(obj, '<STR_LIT>') and timezone:<EOL><INDENT>obj = obj.astimezone(timezone)<EOL><DEDENT>return obj.date()<EOL><DEDENT>elif isinstance(obj, date):<EOL><INDENT>return obj<EOL><DEDENT>elif isinstance(obj, str):<EOL><INDENT>return make_date(parse_date(obj), timezone)<EOL><DEDENT>
A flexible method to get a date object.

It accepts either an ISO 8601 date/time string, either a Python `datetime`,
either a Python `date`.

If the input is a date/time and a timezone is specified, the resulting
date object will be in the specified time zone.