edef extract_num(s, begin, end): Given string s, and "begin" is the index of the first of one or more digits, and "end" is the index one beyond the last digit. Parse out and return the int value of the number, accounting for possible 's' and 'a', Return -1 if the number should be skipped. >>> extract_nun('xx123$, 2, 5) 321 >>> # add Doctests here 29 def. parse line(s): Given a string s, parse the ints out of it and return them as a list of int values. >>> parse_line( '12x76$') [12, 67) >>>> # Add Doctests here ANN pass a. extract_num(s, begin, end) The trickiest part of this problem is this: we have found one or more digits in a string, and we need to extract that number properly or decide to omit it. The extract num() function is decomposed out to focus on that sub-problem. def extract_num(s, begin, end): an!" Given string s, and "begin" is the index of the first of one or more digits, and "end" is the index one beyond the last digit. Parse out and return the int value of the number, accounting for possible 's' and '*'. Return -1 if the number should be skipped. >>> extract_num('xx123$', 2, 5) 321 b. parse_line(s) Given a string, such as a line from a data file, extract all the numbers as described above from the line and return them in order in a list. If the line contains no numbers, return the empty list. One test is provided. Add tests so there are at least five tests. The helper function extract_num() has its own tests, so here you can focus on pulling out a series of numbers. You may find that you need to go back and debug extract_num() more if a flaw is exposed at this stage. When you are feeling brave, add a test made from the first example: 8001)176-b006$ (46$*#632*16$*06$25 If you have a reverse(s) function from HW4, you can paste it in to this file and use it here as a helper. Later we'll see how to share functions across files, but for now just paste the helper function in. Any helper functions, such as reverse(), should have Pydoc and Doctests. Each number is represented by some text starting with a digit, following these rules: 1. The numbers are non-negative integers, like 123 2. The first char of each number is always a digit. 3. If a 's' char appears immediately after a number, its digits are backwards. So 211$' is the number 112. 4. If a W char appears immediately after a number, it's as if that number is not present in the data, and it is omitted from the output. So for example '176' would be omitted. 5. The numbers are separated from each other by random chars which are not " or 'S' or digits. Here is the first example line: 8001)176b006$ (46$*#632*16$ 06$25 What are the numbers in there? 1800, 600, 64, 63, 61, 601 This looks rather impossible at first. But with some Python and little decomposition. you can boil that mess down to some nice clean numbers