def _CopyTimeFromString(self, time_string):
time_string_length = len(time_string)<EOL>if time_string_length < <NUM_LIT:8>:<EOL><INDENT>raise ValueError('<STR_LIT>')<EOL><DEDENT>if time_string[<NUM_LIT:2>] != '<STR_LIT::>' or time_string[<NUM_LIT:5>] != '<STR_LIT::>':<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>try:<EOL><INDENT>minutes = int(time_string[<NUM_LIT:3>:<NUM_LIT:5>], <NUM_LIT:10>)<EOL><DEDENT>except ValueError:<EOL><INDENT>raise ValueError('<STR_LIT>')<EOL><DEDENT>if minutes not in range(<NUM_LIT:0>, <NUM_LIT>):<EOL><INDENT>raise ValueError('<STR_LIT>'.format(minutes))<EOL><DEDENT>try:<EOL><INDENT>seconds = int(time_string[<NUM_LIT:6>:<NUM_LIT:8>], <NUM_LIT:10>)<EOL><DEDENT>except ValueError:<EOL><INDENT>raise ValueError('<STR_LIT>')<EOL><DEDENT>if seconds not in range(<NUM_LIT:0>, <NUM_LIT>):<EOL><INDENT>raise ValueError('<STR_LIT>'.format(seconds))<EOL><DEDENT>microseconds = None<EOL>time_zone_offset = None<EOL>time_zone_string_index = <NUM_LIT:8><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 > <NUM_LIT:8> and time_string[<NUM_LIT:8>] == '<STR_LIT:.>':<EOL><INDENT>time_fraction_length = time_zone_string_index - <NUM_LIT:9><EOL>if time_fraction_length not in (<NUM_LIT:3>, <NUM_LIT:6>):<EOL><INDENT>raise ValueError('<STR_LIT>')<EOL><DEDENT>try:<EOL><INDENT>time_fraction = time_string[<NUM_LIT:9>:time_zone_string_index]<EOL>time_fraction = int(time_fraction, <NUM_LIT:10>)<EOL><DEDENT>except ValueError:<EOL><INDENT>raise ValueError('<STR_LIT>')<EOL><DEDENT>if time_fraction_length == <NUM_LIT:3>:<EOL><INDENT>time_fraction *= <NUM_LIT:1000><EOL><DEDENT>microseconds = time_fraction<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 a 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 seconds fraction 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.