Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(2)  |  Call(1)  |  Derive(0)  |  Import(1)

        def crack_bucket(b, is_mapping):
    state = b.__getstate__()
    assert isinstance(state, tuple)
    assert 1 <= len(state) <= 2
    data = state[0]
    if not is_mapping:
        return data, []
    keys = []
    values = []
    n = len(data)
    assert n & 1 == 0
    i = 0
    for x in data:
        if i & 1:
            values.append(x)
        else:
            keys.append(x)
        i += 1
    return keys, values
        


src/b/t/BTrees-4.0.8/BTrees/tests/test_check.py   BTrees(Download)
    def _callFUT(self, obj, is_mapping):
        from BTrees.check import crack_bucket
        return crack_bucket(obj, is_mapping)
 
    def test_w_empty_set(self):