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(keys1, values1, keys2, values2): a_dict = ConcurrentDict.fromkeys(keys1, values1[0]) for k, v in zip(keys1, values1): a_dict[k] = v other_dict = ConcurrentDict.fromkeys(keys2, values2[0]) for k, v in zip(keys2, values2): other_dict[k] = v 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_type, value_type, keys, values): a_dict = ConcurrentDict.empty(key_type, value_type) for i in prange(len(keys)): a_dict[keys[i]] = values[i] res = list(a_dict.items()) # this relies on working iterator return res
def test_impl(tdict, key_type, value_type): a_dict = ConcurrentDict.empty(key_type, value_type) for k, v in tdict.items(): a_dict[k] = v res = list(a_dict.items()) # this relies on working iterator return res
def test_impl(keys, values): a_dict = ConcurrentDict.fromkeys(keys, values[0]) for k, v in zip(keys, values): a_dict[k] = v res = [] for k in a_dict: res.append(k) return res
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(keys, values): a_dict = ConcurrentDict.fromkeys(keys, values[0]) for k, v in zip(keys, values): a_dict[k] = v 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, ]), ) 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, value): a_dict = ConcurrentDict.fromkeys(keys, value) check_keys = np.array([k in a_dict for k in keys]) return len(a_dict), np.all(check_keys)
def test_impl(keys, values): a_dict = ConcurrentDict.from_arrays(keys, values) res = list(a_dict.items()) # this relies on working iterator return res
def test_impl(key, value, default): a_dict = ConcurrentDict.fromkeys([key], 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.fromkeys(keys, values[0]) r1 = len(a_dict) a_dict.clear() r2 = len(a_dict) return r1, r2
def test_impl(key, value): a_dict = ConcurrentDict.fromkeys([key], value) r1 = a_dict.pop(2 * key) r2 = a_dict.pop(2 * key, 2 * value) return r1, r2
def concurrent_dict_fromkeys_impl(cls, keys, value): res = ConcurrentDict.empty(dict_key_type, dict_value_type) for k in keys: res[k] = value return res
def test_impl(key, value, new_value): a_dict = ConcurrentDict.fromkeys([key], value) a_dict[key] = new_value return a_dict[key]
def test_impl(key_type, value_type, key, value): a_dict = ConcurrentDict.empty(key_type, value_type) a_dict[key] = value return len(a_dict), a_dict[key]
def concurrent_dict_fromkeys_impl(cls, keys, value): res = ConcurrentDict.empty(dict_key_type, dict_value_type) for i in numba.prange(len(keys)): res[keys[i]] = value return res
def test_impl(key_type, value_type): a_dict = ConcurrentDict.empty(key_type, value_type) return len(a_dict)
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, value): a_dict = ConcurrentDict.empty(types.int64, types.float64) res = a_dict.fromkeys(keys, value) check_keys = np.array([k in res for k in keys]) return len(res), np.all(check_keys), len(a_dict)
def test_impl(key_type, value_type, keys, values): a_dict = ConcurrentDict.empty(key_type, value_type) for k, v in zip(keys, values): a_dict[k] = v return len(a_dict)
def test_impl(key, value): a_dict = ConcurrentDict.fromkeys([key], value) return key in a_dict, 2 * key in a_dict
def wrapper_impl(self, keys, value): return ConcurrentDict.fromkeys(keys, value)
def test_impl(key, value): a_dict = ConcurrentDict.fromkeys([key], value) r1 = a_dict.pop(key) return r1, len(a_dict), a_dict.get(key, None)