MCPcopy Create free account
hub / github.com/clips/pattern / csort

Function csort

pattern/web/pdf/utils.py:46–49  ·  view source on GitHub ↗

Order-preserving sorting function.

(objs, key=lambda x:x)

Source from the content-addressed store, hash-verified

44
45# csort
46def csort(objs, key=lambda x:x):
47 """Order-preserving sorting function."""
48 idxs = dict( (obj,i) for (i,obj) in enumerate(objs) )
49 return sorted(objs, key=lambda obj: (key(obj), idxs[obj]))
50
51# fsplit
52def fsplit(pred, objs):

Callers 4

analyzeMethod · 0.90
analyzeMethod · 0.90
analyzeMethod · 0.90
analyzeMethod · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…