

def NO(outlen, pattern, data):
    x = match(pattern, data, flatten=FLATTEN)
    assert ((not x[0]) if isinstance(x, tuple) else (not x)), x
    if FLATTEN:
        assert (isinstance(x, bool) if (outlen == 0) else (len(x[1:]) == x))
    else:
        assert (type(x[1]) is tuple)
        assert (len(x[1]) == outlen), ('length should have been %s but was %s' % (outlen, len(x[1])))

dataset/ETHPy150Open eallik/spinoff/spinoff/tests/test_pattern_matching.py NO/VarMisuse@82/90 `outlen`->`x`