def test_impl(keys1, values1, keys2, values2): a_dict = ConcurrentDict.from_arrays(keys1, values1) other_dict = ConcurrentDict.from_arrays(keys2, values2) r1 = len(a_dict) a_dict.update(other_dict) r2 = len(a_dict) check_keys = np.array([k in a_dict for k in keys2]) return r1, r2, np.all(check_keys)
def test_impl(keys, values): a_dict = ConcurrentDict.from_arrays(keys, values) dict_iter = iter(a_dict) r1 = next(dict_iter) r2 = next(dict_iter) r3 = next(dict_iter) return r1, r2, r3
def test_impl(key, value): a_dict = ConcurrentDict.from_arrays( np.array([ key, ]), np.array([ value, ]), ) return key in a_dict, 2 * key in a_dict
def test_impl(key, value): a_dict = ConcurrentDict.from_arrays( np.array([ key, ]), np.array([ value, ]), ) a_dict.pop(key) return len(a_dict), a_dict.get(key, None)
def test_impl(key, value, new_value): a_dict = ConcurrentDict.from_arrays( np.array([ key, ]), np.array([ value, ]), ) a_dict[key] = new_value return a_dict[key]
def test_impl(key, value, default): a_dict = ConcurrentDict.from_arrays( np.array([ key, ]), np.array([ value, ]), ) r1 = a_dict.get(key, None) r2 = a_dict.get(2 * key, default) r3 = a_dict.get(2 * key) return r1, r2, r3
def test_impl(keys, values): a_dict = ConcurrentDict.from_arrays(keys, values) res = [] for k, v in a_dict.items(): res.append((k, v)) return res
def test_impl(keys, values): a_dict = ConcurrentDict.from_arrays(keys, values) res = [] for k in a_dict.keys(): res.append(k) return res
def test_impl(keys, values): a_dict = ConcurrentDict.from_arrays(keys, values) r1 = len(a_dict) a_dict.clear() r2 = len(a_dict) return r1, r2
def test_impl(keys, values): a_dict = ConcurrentDict.from_arrays(keys, values) res = list(a_dict.items()) # this relies on working iterator return res