def to_unix_ts(start_time):
if isinstance(start_time, datetime):<EOL><INDENT>if is_timezone_aware(start_time):<EOL><INDENT>start_time = start_time.astimezone(pytz.utc)<EOL><DEDENT>else:<EOL><INDENT>log.warning(<EOL>"<STR_LIT>"<EOL>"<STR_LIT>"<EOL>)<EOL><DEDENT>unix_time = calendar.timegm(start_time.timetuple())<EOL><DEDENT>else:<EOL><INDENT>unix_time = start_time<EOL><DEDENT>return int(unix_time)<EOL>
Given a datetime object, returns its value as a unix timestamp