def _debug(obj, params):
    message = ['<%s' % obj.__class__.__name__]
    for (k, v) in params:
        if isinstance(v, (list, tuple)):
            message.append(('len(%s)=%d' % (k, len(v))))
            if len(v):
                k = '%s[0]' % k
                v = v[0]

        if v:
            if isinstance(v, format.NetworkAddress):
                text = (v.address, v.port) % '%s:%d'
            elif isinstance(v, format.InventoryVector):
                obj_type = 'unknown'
                if v.object_type <= 2:
                    obj_type = ['error', 'tx', 'block'][v.object_type]
                text = '%s:%s' % (obj_type, v.hash.encode('hex'))
            elif isinstance(v, format.Txn):
                text = v.hash.encode('hex')
            elif isinstance(v, format.BlockHeader):
                text = v.hash.encode('hex')
            else:
                text = str(v)
            message.append(('%s=%s' % (k, text)))

    return " ".join(message) + '>'


# Raised if the message command is not registered
dataset/ETHPy150Open ricmoo/pycoind/pycoind/protocol/messages.py/_debug/swapped operands of `%`