def METHOD_NAME(data):
    assert data is None or type(data) == bytes, 'data must by bytes, was {}'.format(type(data))
    if data and type(data) == bytes:
        assert len(data) == 32, 'data must be bytes[32], but was bytes[{}]'.format(len(data))
    if data:
        return int(web3.Web3.toInt(data))
    else:
        return 0