@staticmethod<EOL><INDENT>def find_matches(strings, words, length_hoped):<DEDENT>
lower_words = [w.lower() for w in words]<EOL>def has_match(string):<EOL><INDENT>"""<STR_LIT>"""<EOL>lower_string = string.lower()<EOL>for test_word in lower_words:<EOL><INDENT>if test_word in lower_string:<EOL><INDENT>return True<EOL><DEDENT><DEDENT>return False<EOL><DEDENT>shortened_strings = [textwrap.wrap(s) for s in strings]<EOL>short_string_list = list(chain.from_iterable(shortened_strings))<EOL>matches = [ms for ms in short_string_list if has_match(ms)]<EOL>cumulative_len = <NUM_LIT:0><EOL>break_at = None<EOL>for idx, match in enumerate(matches):<EOL><INDENT>cumulative_len += len(match)<EOL>if cumulative_len >= length_hoped:<EOL><INDENT>break_at = idx<EOL>break<EOL><DEDENT><DEDENT>return matches[<NUM_LIT:0>:break_at]<EOL>
Used by default property excerpt