def parse_timezone(tzstring, default_timezone=UTC):
if tzstring == "<STR_LIT>":<EOL><INDENT>return default_timezone<EOL><DEDENT>if tzstring is None:<EOL><INDENT>return default_timezone<EOL><DEDENT>m = TIMEZONE_REGEX.match(tzstring)<EOL>prefix, hours, minutes = m.groups()<EOL>hours, minutes = int(hours), int(minutes)<EOL>if prefix == "<STR_LIT:->":<EOL><INDENT>hours = -hours<EOL>minutes = -minutes<EOL><DEDENT>return FixedOffset(hours, minutes, tzstring)<EOL>
Parses ISO 8601 time zone specs into tzinfo offsets