MCPcopy Index your code
hub / github.com/python/cpython / _get_sortkey

Function _get_sortkey

Tools/c-analyzer/cpython/_capi.py:414–437  ·  view source on GitHub ↗
(sort, _groupby, _columns)

Source from the content-addressed store, hash-verified

412
413
414def _get_sortkey(sort, _groupby, _columns):
415 if sort is True or sort is None:
416 # For now:
417 def sortkey(item):
418 return (
419 item.level == 'private',
420 LEVELS.index(item.level),
421 KINDS.index(item.kind),
422 os.path.dirname(item.file),
423 os.path.basename(item.file),
424 item.name,
425 )
426 return sortkey
427
428 sortfields = 'not-private level kind dirname basename name'.split()
429 elif isinstance(sort, str):
430 sortfields = sort.replace(',', ' ').strip().split()
431 elif callable(sort):
432 return sort
433 else:
434 raise NotImplementedError
435
436 # XXX Build a sortkey func from sortfields.
437 raise NotImplementedError
438
439
440##################################

Callers 2

render_tableFunction · 0.85
render_fullFunction · 0.85

Calls 3

splitMethod · 0.45
stripMethod · 0.45
replaceMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…