def extract_keypairs(lines, regexer):
updates = {}<EOL>for line in lines:<EOL><INDENT>match = regexer.match(line.strip())<EOL>if not match:<EOL><INDENT>continue<EOL><DEDENT>k_v = match.groupdict()<EOL>updates[k_v[Constants.KEY_GROUP]] = k_v[Constants.VALUE_GROUP]<EOL><DEDENT>return updates<EOL>
Given some lines of text, extract key-value pairs from them