MCPcopy Create free account
hub / github.com/apple/axlearn / test_sort

Method test_sort

axlearn/cloud/common/utils_test.py:372–383  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

370 table.get_col("c")
371
372 def test_sort(self):
373 table = utils.Table(headings=["a", "b"], rows=[[1, 4], [3, 2]])
374 table.sort(key=lambda row: row[-1])
375 self.assertEqual(
376 utils.Table(headings=["a", "b"], rows=[[3, 2], [1, 4]]),
377 table,
378 )
379 table.sort(key=lambda row: row[-1], reverse=True)
380 self.assertEqual(
381 utils.Table(headings=["a", "b"], rows=[[1, 4], [3, 2]]),
382 table,
383 )
384
385
386class FlagConfigurableTest(parameterized.TestCase):

Callers

nothing calls this directly

Calls 1

sortMethod · 0.95

Tested by

no test coverage detected