def is_modifier(key):
if _is_str(key):<EOL><INDENT>return key in all_modifiers<EOL><DEDENT>else:<EOL><INDENT>if not _modifier_scan_codes:<EOL><INDENT>scan_codes = (key_to_scan_codes(name, False) for name in all_modifiers) <EOL>_modifier_scan_codes.update(*scan_codes)<EOL><DEDENT>return key in _modifier_scan_codes<EOL><DEDENT>
Returns True if `key` is a scan code or name of a modifier key.