def msgDict(d,matching=None,sep1="<STR_LIT:=>",sep2="<STR_LIT:\n>",sort=True,cantEndWith=None):
msg="<STR_LIT>"<EOL>if "<STR_LIT>" in str(type(d)):<EOL><INDENT>keys=d.dtype.names<EOL><DEDENT>else:<EOL><INDENT>keys=d.keys()<EOL><DEDENT>if sort:<EOL><INDENT>keys=sorted(keys)<EOL><DEDENT>for key in keys:<EOL><INDENT>if key[<NUM_LIT:0>]=="<STR_LIT:_>":<EOL><INDENT>continue<EOL><DEDENT>if matching:<EOL><INDENT>if not key in matching:<EOL><INDENT>continue<EOL><DEDENT><DEDENT>if cantEndWith and key[-len(cantEndWith)]==cantEndWith:<EOL><INDENT>continue<EOL><DEDENT>if '<STR_LIT:float>' in str(type(d[key])):<EOL><INDENT>s="<STR_LIT>"%d[key]<EOL><DEDENT>else:<EOL><INDENT>s=str(d[key])<EOL><DEDENT>if "<STR_LIT:object>" in s:<EOL><INDENT>s='<STR_LIT>'<EOL><DEDENT>msg+=key+sep1+s+sep2<EOL><DEDENT>return msg.strip()<EOL>
convert a dictionary to a pretty formatted string.