Home
last modified time | relevance | path

Searched refs:fromkeys (Results 1 – 25 of 80) sorted by relevance

1234

/external/python/cpython2/Lib/test/
Dtest_dict.py211 self.assertEqual(dict.fromkeys('abc'), {'a':None, 'b':None, 'c':None})
213 self.assertIsNot(d.fromkeys('abc'), d)
214 self.assertEqual(d.fromkeys('abc'), {'a':None, 'b':None, 'c':None})
215 self.assertEqual(d.fromkeys((4,5),0), {4:0, 5:0})
216 self.assertEqual(d.fromkeys([]), {})
219 self.assertEqual(d.fromkeys(g()), {1:None})
220 self.assertRaises(TypeError, {}.fromkeys, 3)
222 self.assertEqual(dictlike.fromkeys('a'), {'a':None})
223 self.assertEqual(dictlike().fromkeys('a'), {'a':None})
224 self.assertIsInstance(dictlike.fromkeys('a'), dictlike)
[all …]
Dmapping_tests.py441 self.assertEqual(self.type2test.fromkeys('abc'), {'a':None, 'b':None, 'c':None})
443 self.assertTrue(not(d.fromkeys('abc') is d))
444 self.assertEqual(d.fromkeys('abc'), {'a':None, 'b':None, 'c':None})
445 self.assertEqual(d.fromkeys((4,5),0), {4:0, 5:0})
446 self.assertEqual(d.fromkeys([]), {})
449 self.assertEqual(d.fromkeys(g()), {1:None})
450 self.assertRaises(TypeError, {}.fromkeys, 3)
452 self.assertEqual(dictlike.fromkeys('a'), {'a':None})
453 self.assertEqual(dictlike().fromkeys('a'), {'a':None})
454 self.assertTrue(dictlike.fromkeys('a').__class__ is dictlike)
[all …]
Dtest_userdict.py40 self.assertEqual(UserDict.UserDict.fromkeys('one two'.split()), d4)
41 self.assertEqual(UserDict.UserDict().fromkeys('one two'.split()), d4)
42 self.assertEqual(UserDict.UserDict.fromkeys('one two'.split(), 1), d5)
43 self.assertEqual(UserDict.UserDict().fromkeys('one two'.split(), 1), d5)
44 self.assertTrue(u1.fromkeys('one two'.split()) is not u1)
45 self.assertIsInstance(u1.fromkeys('one two'.split()), UserDict.UserDict)
46 self.assertIsInstance(u2.fromkeys('one two'.split()), UserDict.IterableUserDict)
277 def fromkeys(cls, keys, value=None): member in SeqDict
Dtest_iterlen.py133 d = dict.fromkeys(xrange(n))
140 d = dict.fromkeys(xrange(n))
147 d = dict.fromkeys(xrange(n))
Dtest_set.py47 self.d = dict.fromkeys(word)
78 for C in set, frozenset, dict.fromkeys, str, unicode, list, tuple:
107 for C in set, frozenset, dict.fromkeys, str, unicode, list, tuple:
127 for C in set, frozenset, dict.fromkeys, str, unicode, list, tuple:
153 for C in set, frozenset, dict.fromkeys, str, unicode, list, tuple:
180 for C in set, frozenset, dict.fromkeys, str, unicode, list, tuple:
314 d = dict.fromkeys(map(HashCountingInt, xrange(n)))
323 d2 = dict.fromkeys(set(d))
325 d3 = dict.fromkeys(frozenset(d))
327 d3 = dict.fromkeys(frozenset(d), 123)
[all …]
Dtest_ordered_dict.py218 od = OrderedDict.fromkeys('abc')
266 od = OrderedDict.fromkeys(s)
/external/python/cpython3/Lib/test/
Dmapping_tests.py424 self.assertEqual(self.type2test.fromkeys('abc'), {'a':None, 'b':None, 'c':None})
426 self.assertTrue(not(d.fromkeys('abc') is d))
427 self.assertEqual(d.fromkeys('abc'), {'a':None, 'b':None, 'c':None})
428 self.assertEqual(d.fromkeys((4,5),0), {4:0, 5:0})
429 self.assertEqual(d.fromkeys([]), {})
432 self.assertEqual(d.fromkeys(g()), {1:None})
433 self.assertRaises(TypeError, {}.fromkeys, 3)
435 self.assertEqual(dictlike.fromkeys('a'), {'a':None})
436 self.assertEqual(dictlike().fromkeys('a'), {'a':None})
437 self.assertTrue(dictlike.fromkeys('a').__class__ is dictlike)
[all …]
Dtest_userdict.py39 self.assertEqual(collections.UserDict.fromkeys('one two'.split()), d4)
40 self.assertEqual(collections.UserDict().fromkeys('one two'.split()), d4)
41 self.assertEqual(collections.UserDict.fromkeys('one two'.split(), 1), d5)
42 self.assertEqual(collections.UserDict().fromkeys('one two'.split(), 1), d5)
43 self.assertTrue(u1.fromkeys('one two'.split()) is not u1)
44 self.assertIsInstance(u1.fromkeys('one two'.split()), collections.UserDict)
45 self.assertIsInstance(u2.fromkeys('one two'.split()), collections.UserDict)
Dtest_dict.py216 self.assertEqual(dict.fromkeys('abc'), {'a':None, 'b':None, 'c':None})
218 self.assertIsNot(d.fromkeys('abc'), d)
219 self.assertEqual(d.fromkeys('abc'), {'a':None, 'b':None, 'c':None})
220 self.assertEqual(d.fromkeys((4,5),0), {4:0, 5:0})
221 self.assertEqual(d.fromkeys([]), {})
224 self.assertEqual(d.fromkeys(g()), {1:None})
225 self.assertRaises(TypeError, {}.fromkeys, 3)
227 self.assertEqual(dictlike.fromkeys('a'), {'a':None})
228 self.assertEqual(dictlike().fromkeys('a'), {'a':None})
229 self.assertIsInstance(dictlike.fromkeys('a'), dictlike)
[all …]
Dtest_ordered_dict.py124 od = OrderedDict.fromkeys('abc')
126 od = OrderedDict.fromkeys('abc', value=None)
128 od = OrderedDict.fromkeys('abc', value=0)
182 od = OrderedDict.fromkeys('abc')
353 od = OrderedDict.fromkeys('abc')
406 od = OrderedDict.fromkeys('abcde')
425 od = OrderedDict.fromkeys('abc')
431 od = OrderedDict.fromkeys('abc')
448 od = OrderedDict.fromkeys(s)
721 od = OrderedDict.fromkeys('abcde')
Dtest_iterlen.py118 d = dict.fromkeys(range(n))
125 d = dict.fromkeys(range(n))
132 d = dict.fromkeys(range(n))
Dtest_set.py48 self.d = dict.fromkeys(word)
79 for C in set, frozenset, dict.fromkeys, str, list, tuple:
108 for C in set, frozenset, dict.fromkeys, str, list, tuple:
128 for C in set, frozenset, dict.fromkeys, str, list, tuple:
154 for C in set, frozenset, dict.fromkeys, str, list, tuple:
181 for C in set, frozenset, dict.fromkeys, str, list, tuple:
336 d = dict.fromkeys(map(HashCountingInt, range(n)))
345 d2 = dict.fromkeys(set(d))
347 d3 = dict.fromkeys(frozenset(d))
349 d3 = dict.fromkeys(frozenset(d), 123)
[all …]
Dtest_pprint.py633 self.assertEqual(clean(pprint.pformat(dict.fromkeys(keys))),
642 self.assertEqual(pprint.pformat(dict.fromkeys(keys, 0)),
660 self.assertEqual(pprint.pformat(dict.fromkeys([b, a]), width=1),
662 self.assertEqual(pprint.pformat(dict.fromkeys([a, b]), width=1),
Dtest_contains.py79 constructors = list, tuple, dict.fromkeys, set, frozenset, deque
Dtest_weakset.py31 self.d = dict.fromkeys(self.items)
68 for C in set, frozenset, dict.fromkeys, list, tuple:
90 for C in set, frozenset, dict.fromkeys, list, tuple:
/external/autotest/frontend/tko/
Dpreconfigs.py27 self._preconfigs['metrics'] = dict.fromkeys(
29 self._preconfigs['qual'] = dict.fromkeys(
/external/autotest/client/cros/video/
Darc_device_capability.py52 arc_caps = dict.fromkeys(self.MEDIA_CODEC_TO_CAPABILITY.values(), 'no')
Ddevice_capability.py71 autotest_caps = dict.fromkeys(managed_caps, 'no')
/external/tensorflow/tensorflow/contrib/quantize/python/
Dcommon.py60 return list(collections.OrderedDict.fromkeys(bns))
/external/python/cpython3/Doc/howto/
Ddescriptor.rst410 :func:`dict.fromkeys` creates a new dictionary from a list of keys. The pure
415 def fromkeys(klass, iterable, value=None):
421 fromkeys = classmethod(fromkeys)
425 >>> Dict.fromkeys('abracadabra')
/external/autotest/client/tests/ltp/
Dparse_ltp_out.py75 filter_accumulator = dict.fromkeys(test_filters.keys(), 0)
/external/autotest/client/site_tests/kernel_LTP/
Dparse_ltp_out.py71 filter_accumulator = dict.fromkeys(test_filters.keys(), 0)
/external/python/cpython3/Lib/collections/
D__init__.py285 def fromkeys(cls, iterable, value=None): member in OrderedDict
611 def fromkeys(cls, iterable, v=None): member in Counter
940 def fromkeys(cls, iterable, *args): member in ChainMap
942 return cls(dict.fromkeys(iterable, *args))
1050 def fromkeys(cls, iterable, value=None): member in UserDict
/external/python/cpython2/Doc/howto/
Ddescriptor.rst406 :func:`dict.fromkeys` creates a new dictionary from a list of keys. The pure
411 def fromkeys(klass, iterable, value=None):
417 fromkeys = classmethod(fromkeys)
421 >>> Dict.fromkeys('abracadabra')
/external/python/cpython2/Lib/
Dcollections.py209 def fromkeys(cls, iterable, value=None): member in OrderedDict
522 def fromkeys(cls, iterable, v=None): member in Counter

1234