def dump_packet(data):
    
    def is_ascii(data):
        if byte2int(data) >= 65 and byte2int(data) <= 122: #data.isalnum():
            return data
        return '.'
    
    try:
        print "packet length %d" % len(data)
        print "method call[1]: %s" % sys._getframe(1).f_code.co_name
        print "method call[2]: %s" % sys._getframe(2).f_code.co_name
        print "method call[3]: %s" % sys._getframe(3).f_code.co_name
        print "method call[4]: %s" % sys._getframe(4).f_code.co_name
        print "method call[5]: %s" % sys._getframe(5).f_code.co_name
        print "-" * 88
    except __HOLE__: pass
    dump_data = [data[i:i+16] for i in xrange(len(data)) if i%16 == 0]
    for d in dump_data:
        print ' '.join(map(lambda x:"%02X" % byte2int(x), d)) + \
                '   ' * (16 - len(d)) + ' ' * 2 + \
                ' '.join(map(lambda x:"%s" % is_ascii(x), d))
    print "-" * 88
    print ""
dataset/ETHPy150Open uwdata/termite-data-server/web2py/gluon/contrib/pymysql/connections.py/dump_packet