Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(7646)  |  Call(7646)  |  Derive(0)  |  Import(0)
L.sort(cmp=None, key=None, reverse=False) -- stable sort *IN PLACE*;
cmp(x, y) -> -1, 0, 1

src/s/y/sympy-0.7.5/sympy/series/gruntz.py   sympy(Download)
 
    nodes = build_expression_tree(Omega, rewrites)
    Omega.sort(key=lambda x: nodes[x[1]].ht(), reverse=True)
 
    # make sure we know the sign of each exp() term; after the loop,

src/k/d/KDVS-2.0.0/kdvs/fw/impl/report/L1L2.py   KDVS(Download)
                    freqs.append(rec)
                # sort according to frequencies
                freqs.sort(key=operator.itemgetter(1), reverse=True)
                # produce report content
                rcontent = list()
 
        # sort based on number of DOFs (we begin permuting with longer DOF lists)
        dofs_across_categories.sort(key=operator.itemgetter(3), reverse=True)
 
        # re--index gathered information to facilitate generating permutation IDs later

src/a/n/antisocial-HEAD/ve/lib/python2.7/site-packages/django/contrib/gis/geos/mutable_list.py   antisocial(Download)
    def sort(self, cmp=None, key=None, reverse=False):
        "Standard list sort method"
        if key:
            temp = [(key(v),v) for v in self]
            temp.sort(key=lambda x: x[0], reverse=reverse)
            self[:] = [v[1] for v in temp]
        else:
            temp = list(self)
            if cmp is not None:
                temp.sort(cmp=cmp, reverse=reverse)
                temp.sort(cmp=cmp, reverse=reverse)
            else:
                temp.sort(reverse=reverse)
            self[:] = temp
 

src/g/o/google-app-engine-HEAD/lib/django-1.5/django/contrib/gis/geos/mutable_list.py   google-app-engine(Download)
    def sort(self, cmp=None, key=None, reverse=False):
        "Standard list sort method"
        if key:
            temp = [(key(v),v) for v in self]
            temp.sort(key=lambda x: x[0], reverse=reverse)
            self[:] = [v[1] for v in temp]
        else:
            temp = list(self)
            if cmp is not None:
                temp.sort(cmp=cmp, reverse=reverse)
                temp.sort(cmp=cmp, reverse=reverse)
            else:
                temp.sort(reverse=reverse)
            self[:] = temp
 

src/c/a/calibre-HEAD/src/calibre/gui2/actions/choose_library.py   calibre(Download)
    def write_stats(self):
        locs = list(self.stats.keys())
        locs.sort(cmp=lambda x, y: cmp(self.stats[x], self.stats[y]),
                reverse=True)
        for key in locs[500:]:
        limit = tweaks['many_libraries']
        key = sort_key if len(locs) > limit else lambda x:self.stats[x]
        locs.sort(key=key, reverse=len(locs)<=limit)
        for loc in locs:
            yield self.pretty(loc), loc

src/s/a/sage-HEAD/src/sage/geometry/fan.py   sage(Download)
                top_cones = list(levels[-1])
                if len(top_cones) == self.ngenerating_cones():
                    top_cones.sort(key=lambda cone:
                                            cone.star_generator_indices()[0])
                levels[-1] = top_cones
            if len(levels) >= 2: # We have rays
                rays = list(levels[1])
                rays.sort(key=lambda cone: cone.ambient_ray_indices()[0])
    # Convert to a list or make a copy, so that the input is unchanged.
    cones = list(cones)
    cones.sort(key=lambda cone: cone.dim(), reverse=True)
    generators = []
    for cone in cones:

src/r/o/rolf-HEAD/ve/lib/python2.7/site-packages/django/contrib/gis/geos/mutable_list.py   rolf(Download)
    def sort(self, cmp=None, key=None, reverse=False):
        "Standard list sort method"
        if key:
            temp = [(key(v),v) for v in self]
            temp.sort(key=lambda x: x[0], reverse=reverse)
            self[:] = [v[1] for v in temp]
        else:
            temp = list(self)
            if cmp is not None:
                temp.sort(cmp=cmp, reverse=reverse)
                temp.sort(cmp=cmp, reverse=reverse)
            else:
                temp.sort(reverse=reverse)
            self[:] = temp
 

src/p/y/pyjs-HEAD/examples/libtest/SetTest.py   pyjs(Download)
    def test_copy(self):
        dup = self.set.copy()
        dup_list = list(dup);
        dup_list.sort()
        set_list = list(self.set);
        set_list.sort()
    def test_deep_copy(self):
        dup = copy.deepcopy(self.set)
        ##print type(dup), repr(dup)
        dup_list = list(dup);
        dup_list.sort()
        set_list = list(self.set);
        set_list.sort()

src/a/n/antisocial-HEAD/ve/lib/python2.7/site-packages/fuzzywuzzy/process.py   antisocial(Download)
        sl.append(tuple)
 
    sl.sort(key=lambda i: i[1], reverse=True)
    return sl[:limit]
 

src/t/e/TEES-HEAD/ExampleBuilders/FeatureBuilders/FeatureBuilder.py   TEES(Download)
                            annTypes.add(eType)
            annTypes = list(annTypes)
            annTypes.sort()
            if self.maximum:
                return annTypes[0:2]

Previous  6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14  Next