def pretty_flags(flags):
names = []<EOL>result = "<STR_LIT>" % flags<EOL>for i in range(<NUM_LIT:32>):<EOL><INDENT>flag = <NUM_LIT:1> << i<EOL>if flags & flag:<EOL><INDENT>names.append(COMPILER_FLAG_NAMES.get(flag, hex(flag)))<EOL>flags ^= flag<EOL>if not flags:<EOL><INDENT>break<EOL><DEDENT><DEDENT><DEDENT>else:<EOL><INDENT>names.append(hex(flags))<EOL><DEDENT>names.reverse()<EOL>return "<STR_LIT>" % (result, "<STR_LIT>".join(names))<EOL>
Return pretty representation of code flags.