def _parse(partial_dt):
dt = None<EOL>try:<EOL><INDENT>if isinstance(partial_dt, datetime):<EOL><INDENT>dt = partial_dt<EOL><DEDENT>if isinstance(partial_dt, date):<EOL><INDENT>dt = _combine_date_time(partial_dt, time(<NUM_LIT:0>, <NUM_LIT:0>, <NUM_LIT:0>))<EOL><DEDENT>if isinstance(partial_dt, time):<EOL><INDENT>dt = _combine_date_time(date.today(), partial_dt)<EOL><DEDENT>if isinstance(partial_dt, (int, float)):<EOL><INDENT>dt = datetime.fromtimestamp(partial_dt)<EOL><DEDENT>if isinstance(partial_dt, (str, bytes)):<EOL><INDENT>dt = parser.parse(partial_dt, default=timezone.now())<EOL><DEDENT>if dt is not None and timezone.is_naive(dt):<EOL><INDENT>dt = timezone.make_aware(dt)<EOL><DEDENT>return dt<EOL><DEDENT>except ValueError:<EOL><INDENT>return None<EOL><DEDENT>
parse a partial datetime object to a complete datetime object