def needs_quotes( s ):
<EOL>if s in dot_keywords:<EOL><INDENT>return False<EOL><DEDENT>chars = [ord(c) for c in s if ord(c)><NUM_LIT> or ord(c)==<NUM_LIT:0>]<EOL>if chars and not id_re_dbl_quoted.match(s) and not id_re_html.match(s):<EOL><INDENT>return True<EOL><DEDENT>for test_re in [id_re_alpha_nums, id_re_num, id_re_dbl_quoted, id_re_html, id_re_alpha_nums_with_ports]:<EOL><INDENT>if test_re.match(s):<EOL><INDENT>return False<EOL><DEDENT><DEDENT>m = id_re_with_port.match(s)<EOL>if m:<EOL><INDENT>return needs_quotes(m.group(<NUM_LIT:1>)) or needs_quotes(m.group(<NUM_LIT:2>))<EOL><DEDENT>return True<EOL>
Checks whether a string is a dot language ID.

    It will check whether the string is solely composed
    by the characters allowed in an ID or not.
    If the string is one of the reserved keywords it will
    need quotes too but the user will need to add them
    manually.