/external/python/cpython3/Lib/test/ |
D | test_sort.py | 4 from functools import cmp_to_key 18 raw.sort(key=cmp_to_key(compare)) 103 s.sort(key=cmp_to_key(lambda a, b: int(random.random() * 3) - 1)) 160 self.assertRaises(ValueError, L.sort, key=cmp_to_key(mutating_cmp)) 165 self.assertRaises(ValueError, L.sort, key=cmp_to_key(mutating_cmp)) 180 copy.sort(key=cmp_to_key(my_cmp)) 256 data.sort(key=cmp_to_key(my_cmp), reverse=True) 257 copy1.sort(key=cmp_to_key(my_cmp_reversed)) 349 [cmp_to_key(lambda x,y: x<y)(x) for x in range(100)]]
|
D | list_tests.py | 7 from functools import cmp_to_key 467 u.sort(key=cmp_to_key(revcmp)) 480 z.sort(key=cmp_to_key(myComparison)) 493 key=cmp_to_key(selfmodifyingComparison))
|
D | test_functools.py | 865 key = self.cmp_to_key(cmp1) 872 key = self.cmp_to_key(cmp2) 881 key = self.cmp_to_key(mycmp=cmp1) 889 key = self.cmp_to_key() # too few args 891 key = self.cmp_to_key(cmp1, None) # too many args 892 key = self.cmp_to_key(cmp1) 901 key = self.cmp_to_key(cmp1) 916 key = self.cmp_to_key(mycmp=cmp1) 922 self.assertEqual(sorted(range(5), key=self.cmp_to_key(mycmp)), 930 values = sorted(values, key=self.cmp_to_key(mycmp)) [all …]
|
/external/selinux/python/sepolgen/src/sepolgen/ |
D | util.py | 148 def cmp_to_key(mycmp): function 167 from functools import cmp_to_key
|
D | output.py | 134 rules.sort(key=util.cmp_to_key(rule_cmp)) 158 ras.sort(key=util.cmp_to_key(role_type_cmp))
|
/external/python/cpython3/Doc/howto/ |
D | sorting.rst | 239 def cmp_to_key(mycmp): 262 from functools import cmp_to_key 266 >>> sorted([5, 2, 4, 1, 3], key=cmp_to_key(reverse_numeric)) 269 In Python 3.2, the :func:`functools.cmp_to_key` function was added to the
|
/external/scapy/scapy/ |
D | compat.py | 21 def cmp_to_key(mycmp): function
|
D | utils6.py | 76 cset.sort(key=cmp_to_key(cset_sort)) # Sort with global addresses first 156 candidate_set.sort(key=cmp_to_key(rfc3484_cmp), reverse=True)
|
D | automaton.py | 446 v.sort(key=cmp_to_key(lambda t1_f1,t2_f2: cmp(t1_f1[0],t2_f2[0]))) 451 v.sort(key=cmp_to_key(lambda c1,c2: cmp(c1.atmt_prio,c2.atmt_prio))) 453 … actlst.sort(key=cmp_to_key(lambda c1,c2: cmp(c1.atmt_cond[condname], c2.atmt_cond[condname])))
|
/external/python/cpython2/Lib/ |
D | functools.py | 85 def cmp_to_key(mycmp): function
|
D | pstats.py | 28 from functools import cmp_to_key 234 stats_list.sort(key=cmp_to_key(TupleComp(sort_tuple).compare))
|
/external/python/cpython2/Doc/howto/ |
D | sorting.rst | 239 def cmp_to_key(mycmp): 262 from functools import cmp_to_key 266 >>> sorted([5, 2, 4, 1, 3], key=cmp_to_key(reverse_numeric)) 269 In Python 2.7, the :func:`functools.cmp_to_key` function was added to the
|
/external/python/cpython2/Doc/library/ |
D | functools.rst | 23 .. function:: cmp_to_key(func) 39 sorted(iterable, key=cmp_to_key(locale.strcoll)) # locale-aware sort order
|
/external/libxml2/python/ |
D | generator.py | 807 def cmp_to_key(mycmp): function 944 flist = sorted(flist, key=cmp_to_key(functionCompare)) 1078 flist = sorted(flist, key=cmp_to_key(functionCompare))
|
/external/llvm-project/lldb/third_party/Python/module/unittest2/unittest2/ |
D | loader.py | 155 key=functools.cmp_to_key(
|
/external/python/cpython2/Lib/unittest/ |
D | loader.py | 9 from functools import cmp_to_key as _CmpToKey
|
/external/python/cpython3/Lib/ |
D | functools.py | 206 def cmp_to_key(mycmp): function 226 from _functools import cmp_to_key
|
D | pstats.py | 30 from functools import cmp_to_key 268 stats_list.sort(key=cmp_to_key(TupleComp(sort_tuple).compare))
|
/external/python/cpython2/Lib/test/ |
D | test_functools.py | 493 self.assertEqual(sorted(range(5), key=functools.cmp_to_key(mycmp)), 499 key = functools.cmp_to_key(mycmp)
|
/external/python/cpython3/Lib/unittest/ |
D | loader.py | 239 testFnNames.sort(key=functools.cmp_to_key(self.sortTestMethodsUsing))
|
/external/python/cpython3/Doc/library/ |
D | functools.rst | 103 .. function:: cmp_to_key(func) 119 sorted(iterable, key=cmp_to_key(locale.strcoll)) # locale-aware sort order
|
D | functions.rst | 1527 Use :func:`functools.cmp_to_key` to convert an old-style *cmp* function to a
|
/external/libabigail/tools/ |
D | fedabipkgdiff | 765 key=functools.cmp_to_key(cmp_nvr),
|
/external/python/cpython2/Misc/NEWS.d/ |
D | 2.7b1.rst | 204 The functools module also adds cmp_to_key() as a tool to transition
|
/external/python/cpython3/Doc/whatsnew/ |
D | 3.2.rst | 824 * To aid in porting programs from Python 2, the :func:`functools.cmp_to_key` 829 >>> sorted(iterable, key=cmp_to_key(locale.strcoll)) # doctest: +SKIP
|