@staticmethod<EOL><INDENT>def clean_attribute(attribute):<DEDENT>
<EOL>attribute = {<EOL>'<STR_LIT>': '<STR_LIT:class>',<EOL>'<STR_LIT>': '<STR_LIT:class>',<EOL>'<STR_LIT>': '<STR_LIT:class>',<EOL>'<STR_LIT>': '<STR_LIT>',<EOL>'<STR_LIT>': '<STR_LIT>',<EOL>'<STR_LIT>': '<STR_LIT>',<EOL>}.get(attribute, attribute)<EOL>if attribute[<NUM_LIT:0>] == '<STR_LIT:_>':<EOL><INDENT>attribute = attribute[<NUM_LIT:1>:]<EOL><DEDENT>if attribute in set(['<STR_LIT>']) or attribute.startswith('<STR_LIT>'):<EOL><INDENT>attribute = attribute.replace('<STR_LIT:_>', '<STR_LIT:->').lower()<EOL><DEDENT>if attribute.split('<STR_LIT:_>')[<NUM_LIT:0>] in ('<STR_LIT>', '<STR_LIT>', '<STR_LIT>'):<EOL><INDENT>attribute = attribute.replace('<STR_LIT:_>', '<STR_LIT::>', <NUM_LIT:1>).lower()<EOL><DEDENT>return attribute<EOL>
Normalize attribute names for shorthand and work arounds for limitations
in Python's syntax