def apply_types(use_types, guess_type, line):
new_line = {}<EOL>for k, v in list(line.items()):<EOL><INDENT>if k in use_types:<EOL><INDENT>new_line[k] = force_type(use_types[k], v)<EOL><DEDENT>elif guess_type:<EOL><INDENT>new_line[k] = determine_type(v)<EOL><DEDENT>else:<EOL><INDENT>new_line[k] = v<EOL><DEDENT><DEDENT>return new_line<EOL>
Apply the types on the elements of the line