Home
last modified time | relevance | path

Searched refs:itemgetter (Results 1 – 25 of 53) sorted by relevance

123

/external/python/cpython3/Lib/test/
Dtest_operator.py369 f = operator.itemgetter(2)
374 f = operator.itemgetter(10)
380 self.assertRaises(SyntaxError, operator.itemgetter(42), C())
382 f = operator.itemgetter('name')
384 self.assertRaises(TypeError, operator.itemgetter)
387 f = operator.itemgetter('key')
389 f = operator.itemgetter('nonkey')
394 getcount = operator.itemgetter(1)
401 self.assertEqual(operator.itemgetter(2,10,5)(data), ('2', '10', '5'))
402 self.assertRaises(TypeError, operator.itemgetter(2, 'x', 5), data)
[all …]
Dtest_heapq.py8 from operator import itemgetter
162 for key in [None, itemgetter(0), itemgetter(1), itemgetter(1, 0)]:
/external/python/cpython2/Lib/
Dheapq.py133 from operator import itemgetter
427 return map(itemgetter(0), result) # undecorate
433 return map(itemgetter(2), result) # undecorate
465 return map(itemgetter(0), result) # undecorate
471 return map(itemgetter(2), result) # undecorate
Dpyclbr.py46 from operator import itemgetter
336 methods = sorted(obj.methods.iteritems(), key=itemgetter(1))
Dcollections.py21 from operator import itemgetter as _itemgetter, eq as _eq
/external/python/cpython3/Doc/library/
Doperator.rst14 from operator import itemgetter, iadd
290 .. function:: itemgetter(item)
291 itemgetter(*items)
297 * After ``f = itemgetter(2)``, the call ``f(r)`` returns ``r[2]``.
299 * After ``g = itemgetter(2, 5, 3)``, the call ``g(r)`` returns
304 def itemgetter(*items):
318 >>> itemgetter(1)('ABCDEFG')
320 >>> itemgetter(1,3,5)('ABCDEFG')
322 >>> itemgetter(slice(2,None))('ABCDEFG')
326 >>> itemgetter('rank')(soldier)
[all …]
/external/python/cpython2/Lib/test/
Dtest_operator.py418 f = operator.itemgetter(2)
423 f = operator.itemgetter(10)
429 self.assertRaises(SyntaxError, operator.itemgetter(42), C())
431 f = operator.itemgetter('name')
433 self.assertRaises(TypeError, operator.itemgetter)
436 f = operator.itemgetter('key')
438 f = operator.itemgetter('nonkey')
443 getcount = operator.itemgetter(1)
450 self.assertEqual(operator.itemgetter(2,10,5)(data), ('2', '10', '5'))
451 self.assertRaises(TypeError, operator.itemgetter(2, 'x', 5), data)
/external/swiftshader/third_party/llvm-7.0/llvm/tools/opt-viewer/
Dopt-stats.py71 for (passname, count) in sorted(bypass.items(), key=operator.itemgetter(1),
76 for (name, count) in sorted(byname.items(), key=operator.itemgetter(1),
/external/python/cpython2/Tools/scripts/
Danalyze_dxp.py93 result.sort(key=operator.itemgetter(2), reverse=True)
113 result.sort(key=operator.itemgetter(2), reverse=True)
/external/python/cpython3/Tools/scripts/
Danalyze_dxp.py92 result.sort(key=operator.itemgetter(2), reverse=True)
112 result.sort(key=operator.itemgetter(2), reverse=True)
/external/python/cpython2/Doc/library/
Doperator.rst12 from operator import itemgetter
535 .. function:: itemgetter(item)
536 itemgetter(*items)
542 * After ``f = itemgetter(2)``, the call ``f(r)`` returns ``r[2]``.
544 * After ``g = itemgetter(2, 5, 3)``, the call ``g(r)`` returns
549 def itemgetter(*items):
563 >>> itemgetter(1)('ABCDEFG')
565 >>> itemgetter(1,3,5)('ABCDEFG')
567 >>> itemgetter(slice(2,None))('ABCDEFG')
575 Example of using :func:`itemgetter` to retrieve specific fields from a
[all …]
/external/python/cpython3/Doc/howto/
Dsorting.rst91 :mod:`operator` module has :func:`~operator.itemgetter`,
96 >>> from operator import itemgetter, attrgetter
98 >>> sorted(student_tuples, key=itemgetter(2))
107 >>> sorted(student_tuples, key=itemgetter(1,2))
120 >>> sorted(student_tuples, key=itemgetter(2), reverse=True)
134 >>> sorted(data, key=itemgetter(0))
271 >>> standard_way = sorted(data, key=itemgetter(0), reverse=True)
272 >>> double_reversed = list(reversed(sorted(reversed(data), key=itemgetter(0))))
/external/python/cpython2/Doc/howto/
Dsorting.rst92 module has :func:`operator.itemgetter`, :func:`operator.attrgetter`, and
97 >>> from operator import itemgetter, attrgetter
99 >>> sorted(student_tuples, key=itemgetter(2))
108 >>> sorted(student_tuples, key=itemgetter(1,2))
131 >>> sorted(student_tuples, key=itemgetter(2), reverse=True)
145 >>> sorted(data, key=itemgetter(0))
284 >>> standard_way = sorted(data, key=itemgetter(0), reverse=True)
285 >>> double_reversed = list(reversed(sorted(reversed(data), key=itemgetter(0))))
/external/clang/utils/analyzer/
DSumTimerInfo.py12 from operator import itemgetter
/external/llvm/utils/
Dschedcover.py34 ordered_table = sorted(table.items(), key=operator.itemgetter(0))
/external/swiftshader/third_party/llvm-7.0/llvm/utils/
Dschedcover.py39 ordered_table = sorted(table.items(), key=operator.itemgetter(0))
/external/autotest/site_utils/
Dgenerate_test_report584 tests = sorted(self._results, key=operator.itemgetter('testdir'),
586 tests = sorted(tests, key=operator.itemgetter('timestamp'))
588 tests = sorted(self._results, key=operator.itemgetter('testdir'))
/external/autotest/venv/skylab_suite/
Dswarming_lib.py70 key=operator.itemgetter(1))
/external/libchrome/third_party/jinja2/
Dlexer.py19 from operator import itemgetter
235 lineno, type, value = (property(itemgetter(x)) for x in range(3))
/external/tensorflow/tensorflow/contrib/learn/python/learn/estimators/
Ddebug_test.py91 collections.Counter(train_labels).items(), key=operator.itemgetter(1))
110 collections.Counter(train_labels).items(), key=operator.itemgetter(1))
127 collections.Counter(train_labels).items(), key=operator.itemgetter(1))
/external/python/cpython3/Lib/
Doperator.py265 class itemgetter: class
/external/swiftshader/third_party/subzero/bloat/
Dbloat.py293 key=operator.itemgetter(1))[0])
/external/autotest/client/cros/power/
Dpower_dashboard.py237 key=operator.itemgetter(1))
/external/autotest/client/common_lib/cros/network/
Diw_runner.py404 return sorted(parsed_peer_info, key=operator.itemgetter('mac'))
/external/scapy/scapy/modules/
Dsix.py638 byte2int = operator.itemgetter(0)

123