Home
last modified time | relevance | path

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

12

/third_party/python/Lib/test/
Dtest_operator.py388 f = operator.itemgetter(2)
393 f = operator.itemgetter(10)
399 self.assertRaises(SyntaxError, operator.itemgetter(42), C())
401 f = operator.itemgetter('name')
403 self.assertRaises(TypeError, operator.itemgetter)
406 f = operator.itemgetter('key')
408 f = operator.itemgetter('nonkey')
413 getcount = operator.itemgetter(1)
420 self.assertEqual(operator.itemgetter(2,10,5)(data), ('2', '10', '5'))
421 self.assertRaises(TypeError, operator.itemgetter(2, 'x', 5), data)
[all …]
Dtest_heapq.py10 from operator import itemgetter
188 for key in [None, itemgetter(0), itemgetter(1), itemgetter(1, 0)]:
Dtest_collections.py585 newt = t._replace(itemgetter=10, property=20, self=30, cls=40, tuple=50)
/third_party/python/Doc/library/
Doperator.rst14 from operator import itemgetter, iadd
294 .. function:: itemgetter(item)
295 itemgetter(*items)
301 * After ``f = itemgetter(2)``, the call ``f(r)`` returns ``r[2]``.
303 * After ``g = itemgetter(2, 5, 3)``, the call ``g(r)`` returns
308 def itemgetter(*items):
322 >>> itemgetter(1)('ABCDEFG')
324 >>> itemgetter(1, 3, 5)('ABCDEFG')
326 >>> itemgetter(slice(2, None))('ABCDEFG')
329 >>> itemgetter('rank')(soldier)
[all …]
Dbisect.rst201 >>> data.sort(key=lambda r: r[1]) # Or use operator.itemgetter(1).
Ditertools.rst913 return map(next, map(operator.itemgetter(1), groupby(iterable, key)))
/third_party/python/Tools/scripts/
Danalyze_dxp.py92 result.sort(key=operator.itemgetter(2), reverse=True)
112 result.sort(key=operator.itemgetter(2), reverse=True)
/third_party/python/Doc/howto/
Dsorting.rst105 :mod:`operator` module has :func:`~operator.itemgetter`,
112 >>> from operator import itemgetter, attrgetter
114 >>> sorted(student_tuples, key=itemgetter(2))
125 >>> sorted(student_tuples, key=itemgetter(1,2))
140 >>> sorted(student_tuples, key=itemgetter(2), reverse=True)
156 >>> sorted(data, key=itemgetter(0))
322 >>> standard_way = sorted(data, key=itemgetter(0), reverse=True)
323 >>> double_reversed = list(reversed(sorted(reversed(data), key=itemgetter(0))))
/third_party/python/Tools/ssl/
Dmake_ssl_data.py119 args.reasons = sorted(reasons, key=operator.itemgetter(0, 3))
/third_party/python/Lib/
Dstatistics.py139 from operator import itemgetter
600 maxcount, mode_items = next(groupby(counts, key=itemgetter(1)), (0, []))
601 return list(map(itemgetter(0), mode_items))
Doperator.py265 class itemgetter: class
/third_party/skia/third_party/externals/jinja2/
Dlexer.py10 from operator import itemgetter
263 lineno, type, value = (property(itemgetter(x)) for x in range(3))
/third_party/node/tools/inspector_protocol/jinja2/
Dlexer.py19 from operator import itemgetter
235 lineno, type, value = (property(itemgetter(x)) for x in range(3))
/third_party/node/deps/v8/third_party/jinja2/
Dlexer.py10 from operator import itemgetter
263 lineno, type, value = (property(itemgetter(x)) for x in range(3))
/third_party/skia/third_party/externals/swiftshader/third_party/subzero/bloat/
Dbloat.py293 key=operator.itemgetter(1))[0])
/third_party/python/Misc/NEWS.d/
D3.5.0b1.rst284 attrgetter, itemgetter and methodcaller objects in the operator module now
D3.5.2rc1.rst743 itemgetter, attrgetter and methodcaller objects no longer silently ignore
D3.6.0a1.rst1165 itemgetter, attrgetter and methodcaller objects no longer silently ignore
/third_party/python/Doc/whatsnew/
D2.4.rst1199 ``attrgetter(attr)`` and ``itemgetter(index)``. Both functions return
1205 >>> map(operator.itemgetter(0), L)
1207 >>> map(operator.itemgetter(1), L)
1209 >>> sorted(L, key=operator.itemgetter(1)) # Sort list by second tuple item
/third_party/python/Tools/stringbench/
Dstringbench.py1436 operator.itemgetter(0)):
/third_party/python/Lib/email/
D_header_value_parser.py74 from operator import itemgetter
744 parts = sorted(parts, key=itemgetter(0))
/third_party/python/Lib/collections/
D__init__.py37 from operator import itemgetter as _itemgetter
/third_party/python/Lib/lib2to3/tests/
Dtest_fixers.py6 from operator import itemgetter
1841 a = "import %s" % ", ".join(map(itemgetter(0), changes))
/third_party/skia/third_party/externals/brotli/research/
Dbrotlidump.py12 from operator import itemgetter, methodcaller
/third_party/python/Doc/
Dglossary.rst694 :func:`~operator.attrgetter`, :func:`~operator.itemgetter`, and

12