def bdecode(x):
    try:
        r, l = decode_func[six.indexbytes(x, 0)](x, 0)
    except (IndexError, KeyError, __HOLE__):
        raise
        raise BTFailure("not a valid bencoded string")
    if l != len(x):
        raise BTFailure("invalid bencoded value (data after valid prefix)")
    return r
dataset/ETHPy150Open JohnDoee/autotorrent/autotorrent/bencode.py/bdecode