:param the_list: [1, 2, 3, 4, 5, 6, 1, 2, 4, 5] :param to_match: [1, 2] :return: [(0, 1), (6, 7)]
(the_list, to_match)
| 12 | |
| 13 | |
| 14 | def match_sublist(the_list, to_match): |
| 15 | """ |
| 16 | |
| 17 | :param the_list: [1, 2, 3, 4, 5, 6, 1, 2, 4, 5] |
| 18 | :param to_match: [1, 2] |
| 19 | :return: |
| 20 | [(0, 1), (6, 7)] |
| 21 | """ |
| 22 | len_to_match = len(to_match) |
| 23 | matched_list = list() |
| 24 | for index in range(len(the_list) - len_to_match): |
| 25 | if to_match == the_list[index:index + len_to_match]: |
| 26 | matched_list += [(index, index + len_to_match - 1)] |
| 27 | return matched_list |
| 28 | |
| 29 | |
| 30 | def find_bracket_position(generated_text, _type_start, _type_end): |
no outgoing calls
no test coverage detected