def nice_hex(v):
if v < <NUM_LIT>:<EOL><INDENT>return "<STR_LIT>" % v<EOL><DEDENT>if v < <NUM_LIT>:<EOL><INDENT>return "<STR_LIT>" % v<EOL><DEDENT>return "<STR_LIT>" % v<EOL>
>>> nice_hex(0x1)
'$01'
>>> nice_hex(0x123)
'$0123'