def _CopyTimeFromStringISO8601(self, time_string):
if time_string.endswith('<STR_LIT>'):<EOL><INDENT>time_string = time_string[:-<NUM_LIT:1>]<EOL><DEDENT>time_string_length = len(time_string)<EOL>if time_string_length < <NUM_LIT:2>:<EOL><INDENT>raise ValueError('<STR_LIT>')<EOL><DEDENT>try:<EOL><INDENT>hours = int(time_string[<NUM_LIT:0>:<NUM_LIT:2>], <NUM_LIT:10>)<EOL><DEDENT>except ValueError:<EOL><INDENT>raise ValueError('<STR_LIT>')<EOL><DEDENT>if hours not in range(<NUM_LIT:0>, <NUM_LIT>):<EOL><INDENT>raise ValueError('<STR_LIT>'.format(hours))<EOL><DEDENT>minutes = None<EOL>seconds = None<EOL>microseconds = None<EOL>time_zone_offset = None<EOL>time_string_index = <NUM_LIT:2><EOL>if (time_string_index + <NUM_LIT:1> < time_string_length and<EOL>time_string[time_string_index] not in ('<STR_LIT:.>', '<STR_LIT:U+002C>')):<EOL><INDENT>if time_string[time_string_index] == '<STR_LIT::>':<EOL><INDENT>time_string_index += <NUM_LIT:1><EOL><DEDENT>if time_string_index + <NUM_LIT:2> > time_string_length:<EOL><INDENT>raise ValueError('<STR_LIT>')<EOL><DEDENT>try:<EOL><INDENT>minutes = time_string[time_string_index:time_string_index + <NUM_LIT:2>]<EOL>minutes = int(minutes, <NUM_LIT:10>)<EOL><DEDENT>except ValueError:<EOL><INDENT>raise ValueError('<STR_LIT>')<EOL><DEDENT>time_string_index += <NUM_LIT:2><EOL><DEDENT>if (time_string_index + <NUM_LIT:1> < time_string_length and<EOL>time_string[time_string_index] not in ('<STR_LIT:.>', '<STR_LIT:U+002C>')):<EOL><INDENT>if time_string[time_string_index] == '<STR_LIT::>':<EOL><INDENT>time_string_index += <NUM_LIT:1><EOL><DEDENT>if time_string_index + <NUM_LIT:2> > time_string_length:<EOL><INDENT>raise ValueError('<STR_LIT>')<EOL><DEDENT>try:<EOL><INDENT>seconds = time_string[time_string_index:time_string_index + <NUM_LIT:2>]<EOL>seconds = int(seconds, <NUM_LIT:10>)<EOL><DEDENT>except ValueError:<EOL><INDENT>raise ValueError('<STR_LIT>')<EOL><DEDENT>time_string_index += <NUM_LIT:2><EOL><DEDENT>time_zone_string_index = time_string_index<EOL>while time_zone_string_index < time_string_length:<EOL><INDENT>if time_string[time_zone_string_index] in ('<STR_LIT:+>', '<STR_LIT:->'):<EOL><INDENT>break<EOL><DEDENT>time_zone_string_index += <NUM_LIT:1><EOL><DEDENT>if time_zone_string_index == time_string_length - <NUM_LIT:1>:<EOL><INDENT>time_zone_string_index += <NUM_LIT:1><EOL><DEDENT>if (time_string_length > time_string_index and<EOL>time_string[time_string_index] in ('<STR_LIT:.>', '<STR_LIT:U+002C>')):<EOL><INDENT>time_string_index += <NUM_LIT:1><EOL>time_fraction_length = time_zone_string_index - time_string_index<EOL>try:<EOL><INDENT>time_fraction = time_string[time_string_index:time_zone_string_index]<EOL>time_fraction = int(time_fraction, <NUM_LIT:10>)<EOL>time_fraction = (<EOL>decimal.Decimal(time_fraction) /<EOL>decimal.Decimal(<NUM_LIT:10> ** time_fraction_length))<EOL><DEDENT>except ValueError:<EOL><INDENT>raise ValueError('<STR_LIT>')<EOL><DEDENT>if minutes is None:<EOL><INDENT>time_fraction *= <NUM_LIT><EOL>minutes = int(time_fraction)<EOL>time_fraction -= minutes<EOL><DEDENT>if seconds is None:<EOL><INDENT>time_fraction *= <NUM_LIT><EOL>seconds = int(time_fraction)<EOL>time_fraction -= seconds<EOL><DEDENT>time_fraction *= definitions.MICROSECONDS_PER_SECOND<EOL>microseconds = int(time_fraction)<EOL><DEDENT>if minutes is not None and minutes not in range(<NUM_LIT:0>, <NUM_LIT>):<EOL><INDENT>raise ValueError('<STR_LIT>'.format(minutes))<EOL><DEDENT>if seconds is not None and seconds not in range(<NUM_LIT:0>, <NUM_LIT>):<EOL><INDENT>raise ValueError('<STR_LIT>'.format(seconds))<EOL><DEDENT>if time_zone_string_index < time_string_length:<EOL><INDENT>if (time_string_length - time_zone_string_index != <NUM_LIT:6> or<EOL>time_string[time_zone_string_index + <NUM_LIT:3>] != '<STR_LIT::>'):<EOL><INDENT>raise ValueError('<STR_LIT>')<EOL><DEDENT>try:<EOL><INDENT>hours_from_utc = int(time_string[<EOL>time_zone_string_index + <NUM_LIT:1>:time_zone_string_index + <NUM_LIT:3>])<EOL><DEDENT>except ValueError:<EOL><INDENT>raise ValueError('<STR_LIT>')<EOL><DEDENT>if hours_from_utc not in range(<NUM_LIT:0>, <NUM_LIT:15>):<EOL><INDENT>raise ValueError('<STR_LIT>')<EOL><DEDENT>try:<EOL><INDENT>minutes_from_utc = int(time_string[<EOL>time_zone_string_index + <NUM_LIT:4>:time_zone_string_index + <NUM_LIT:6>])<EOL><DEDENT>except ValueError:<EOL><INDENT>raise ValueError('<STR_LIT>')<EOL><DEDENT>if minutes_from_utc not in range(<NUM_LIT:0>, <NUM_LIT>):<EOL><INDENT>raise ValueError('<STR_LIT>')<EOL><DEDENT>time_zone_offset = (hours_from_utc * <NUM_LIT>) + minutes_from_utc<EOL>if time_string[time_zone_string_index] != '<STR_LIT:->':<EOL><INDENT>time_zone_offset = -time_zone_offset<EOL><DEDENT><DEDENT>return hours, minutes, seconds, microseconds, time_zone_offset<EOL>
Copies a time from an ISO 8601 date and time string.

        Args:
          time_string (str): time value formatted as:
              hh:mm:ss.######[+-]##:##

              Where # are numeric digits ranging from 0 to 9 and the seconds
              fraction can be either 3 or 6 digits. The faction of second and
              time zone offset are optional.

        Returns:
          tuple[int, int, int, int, int]: hours, minutes, seconds, microseconds,
              time zone offset in minutes.

        Raises:
          ValueError: if the time string is invalid or not supported.