def convert_uptime_string_seconds(uptime):
regex_list = [<EOL>(<EOL>r"<STR_LIT>"<EOL>r"<STR_LIT>"<EOL>r"<STR_LIT>"<EOL>),<EOL>(<EOL>r"<STR_LIT>"<EOL>r"<STR_LIT>"<EOL>),<EOL>(<EOL>r"<STR_LIT>"<EOL>r"<STR_LIT>"<EOL>),<EOL>]<EOL>regex_list = [re.compile(x) for x in regex_list]<EOL>uptime_dict = {}<EOL>for regex in regex_list:<EOL><INDENT>match = regex.search(uptime)<EOL>if match:<EOL><INDENT>uptime_dict = match.groupdict()<EOL>break<EOL><DEDENT><DEDENT>uptime_seconds = <NUM_LIT:0><EOL>for unit, value in uptime_dict.items():<EOL><INDENT>if value is not None:<EOL><INDENT>if unit == "<STR_LIT>":<EOL><INDENT>uptime_seconds += int(value) * <NUM_LIT><EOL><DEDENT>elif unit == "<STR_LIT>":<EOL><INDENT>uptime_seconds += int(value) * <NUM_LIT><EOL><DEDENT>elif unit == "<STR_LIT>":<EOL><INDENT>uptime_seconds += int(value) * <NUM_LIT><EOL><DEDENT>elif unit == "<STR_LIT>":<EOL><INDENT>uptime_seconds += int(value) * <NUM_LIT><EOL><DEDENT>elif unit == "<STR_LIT>":<EOL><INDENT>uptime_seconds += int(value) * <NUM_LIT><EOL><DEDENT>elif unit == "<STR_LIT>":<EOL><INDENT>uptime_seconds += int(value)<EOL><DEDENT>else:<EOL><INDENT>raise Exception(<EOL>'<STR_LIT>'.format(unit, uptime)<EOL>)<EOL><DEDENT><DEDENT><DEDENT>if not uptime_dict:<EOL><INDENT>raise Exception("<STR_LIT>".format(uptime))<EOL><DEDENT>return uptime_seconds<EOL>
Convert uptime strings to seconds. The string can be formatted various ways.