Home
last modified time | relevance | path

Searched refs:cmp_to_key (Results 1 – 24 of 24) sorted by relevance

/external/python/cpython3/Lib/test/
Dtest_sort.py4 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))
181 self.assertRaises(ValueError, L.sort, key=cmp_to_key(mutating_cmp))
186 self.assertRaises(ValueError, L.sort, key=cmp_to_key(mutating_cmp))
201 copy.sort(key=cmp_to_key(my_cmp))
277 data.sort(key=cmp_to_key(my_cmp), reverse=True)
278 copy1.sort(key=cmp_to_key(my_cmp_reversed))
370 [cmp_to_key(lambda x,y: x<y)(x) for x in range(100)]]
Dlist_tests.py6 from functools import cmp_to_key
460 u.sort(key=cmp_to_key(revcmp))
473 z.sort(key=cmp_to_key(myComparison))
486 key=cmp_to_key(selfmodifyingComparison))
Dtest_functools.py903 key = self.cmp_to_key(cmp1)
910 key = self.cmp_to_key(cmp2)
919 key = self.cmp_to_key(mycmp=cmp1)
927 key = self.cmp_to_key() # too few args
929 key = self.cmp_to_key(cmp1, None) # too many args
930 key = self.cmp_to_key(cmp1)
939 key = self.cmp_to_key(cmp1)
954 key = self.cmp_to_key(mycmp=cmp1)
960 self.assertEqual(sorted(range(5), key=self.cmp_to_key(mycmp)),
968 values = sorted(values, key=self.cmp_to_key(mycmp))
[all …]
/external/selinux/python/sepolgen/src/sepolgen/
Doutput.py140 rules.sort(key=util.cmp_to_key(rule_cmp))
164 ras.sort(key=util.cmp_to_key(role_type_cmp))
Dutil.py148 def cmp_to_key(mycmp): function
167 from functools import cmp_to_key
/external/XNNPACK/scripts/
Dsort-filenames.py65 def cmp_to_key(mycmp): function
130 new_lines = sorted(file_lines[x[0]:x[1]+1], key=cmp_to_key(compare_strs))
/external/scapy/scapy/
Dutils6.py29 from functools import reduce, cmp_to_key
96 addrs.sort(key=cmp_to_key(cset_sort)) # Sort with global addresses first
180 candidate_set.sort(key=cmp_to_key(rfc3484_cmp), reverse=True)
/external/aws-sdk-java-v2/scripts/changelog/
Dwriter.py3 from functools import cmp_to_key
/external/libxml2/python/
Dgenerator.py960 def cmp_to_key(mycmp): function
1097 flist = sorted(flist, key=cmp_to_key(functionCompare))
1231 flist = sorted(flist, key=cmp_to_key(functionCompare))
/external/tensorflow/tensorflow/dtensor/python/
Dtpu_util.py548 permutation.sort(key=functools.cmp_to_key(_cmp_2d))
550 permutation.sort(key=functools.cmp_to_key(_cmp_3d))
/external/python/cpython3/Lib/
Dpstats.py30 from functools import cmp_to_key
267 stats_list.sort(key=cmp_to_key(TupleComp(sort_tuple).compare))
Dfunctools.py207 def cmp_to_key(mycmp): function
227 from _functools import cmp_to_key
/external/python/cpython3/Doc/howto/
Dsorting.rst270 :class:`functools.cmp_to_key` to wrap the comparison function
273 sorted(words, key=cmp_to_key(strcoll)) # locale-aware sort order
/external/python/cpython3/Lib/unittest/
Dloader.py226 testFnNames.sort(key=functools.cmp_to_key(self.sortTestMethodsUsing))
/external/pytorch/tools/test/
Dtest_test_selections.py514 sorted(sharded_tests, key=functools.cmp_to_key(comparator)),
/external/python/cpython3/Doc/library/
Dfunctools.rst128 .. function:: cmp_to_key(func)
144 sorted(iterable, key=cmp_to_key(locale.strcoll)) # locale-aware sort order
Dfunctions.rst1861 Use :func:`functools.cmp_to_key` to convert an old-style *cmp* function to a
Dstdtypes.rst1308 The :func:`functools.cmp_to_key` utility is available to convert a 2.x
/external/python/cpython3/Misc/NEWS.d/
D3.13.0b1.rst639 :func:`functools.cmp_to_key` call.
/external/python/cpython3/Doc/whatsnew/
D3.2.rst829 * To aid in porting programs from Python 2, the :func:`functools.cmp_to_key`
834 >>> sorted(iterable, key=cmp_to_key(locale.strcoll)) # doctest: +SKIP
D2.7.rst1278 New function: :func:`~functools.cmp_to_key` will take an old-style comparison
/external/pytorch/torch/_inductor/
Dscheduler.py1655 @functools.cmp_to_key
/external/pytorch/test/
Dtest_jit.py8259 return sorted(uses, key=functools.cmp_to_key(type(uses[0]).isAfter))
/external/python/cpython3/Misc/
DHISTORY9723 - functools.cmp_to_key() now works with collections.Hashable().
9838 - Issue #11707: Added a fast C version of functools.cmp_to_key().
9907 - Issue #11628: cmp_to_key generated class should use __slots__.
13598 - Add functools.total_ordering() and functools.cmp_to_key().