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/d/j/Django-Template-App-For-Google-App-Engine-HEAD/django/contrib/gis/geos/mutable_list.py   Django-Template-App-For-Google-App-Engine(Download)
    def sort(self, cmp=cmp, key=None, reverse=False):
        "Standard list sort method"
        if key:
            temp = [(key(v),v) for v in self]
            temp.sort(cmp=cmp, key=lambda x: x[0], reverse=reverse)
            self[:] = [v[1] for v in temp]
        else:
            temp = list(self)
            temp.sort(cmp=cmp, reverse=reverse)

src/p/h/PhoneTap-HEAD/django/contrib/gis/geos/mutable_list.py   PhoneTap(Download)
    def sort(self, cmp=cmp, key=None, reverse=False):
        "Standard list sort method"
        if key:
            temp = [(key(v),v) for v in self]
            temp.sort(cmp=cmp, key=lambda x: x[0], reverse=reverse)
            self[:] = [v[1] for v in temp]
        else:
            temp = list(self)
            temp.sort(cmp=cmp, reverse=reverse)

src/n/o/nodebox-pyobjc-HEAD/examples/Advanced/Sorting.py   nodebox-pyobjc(Download)
# The lambda function thus compares the y positions against eachother.
sorted_grobs = list(canvas)
sorted_grobs.sort(lambda v1, v2: cmp(v1.bounds[0][1], v2.bounds[0][1]))
 
# Now that we have all the graphic objects ("grobs") sorted,

src/d/j/django-1.1-HEAD/django/contrib/gis/geos/mutable_list.py   django-1.1(Download)
    def sort(self, cmp=cmp, key=None, reverse=False):
        "Standard list sort method"
        if key:
            temp = [(key(v),v) for v in self]
            temp.sort(cmp=cmp, key=lambda x: x[0], reverse=reverse)
            self[:] = [v[1] for v in temp]
        else:
            temp = list(self)
            temp.sort(cmp=cmp, reverse=reverse)

src/t/a/taskhood-HEAD/django/contrib/gis/geos/mutable_list.py   taskhood(Download)
    def sort(self, cmp=cmp, key=None, reverse=False):
        "Standard list sort method"
        if key:
            temp = [(key(v),v) for v in self]
            temp.sort(cmp=cmp, key=lambda x: x[0], reverse=reverse)
            self[:] = [v[1] for v in temp]
        else:
            temp = list(self)
            temp.sort(cmp=cmp, reverse=reverse)

src/s/k/skype4py-HEAD/examples/SkypeUsers.py   skype4py(Download)
    def fullname_lower(a, b):
      return -(a.FullName.lower() < b.FullName.lower())
    friends.sort(fullname_lower)
 
    # Add contacts to the list control.

src/g/o/Goulib-1.6.0/Goulib/table.py   Goulib(Download)
    def sort(self,by,reverse=False):
        '''sort by column'''
        i=self._i(by)
        if isinstance(i, int):
            list.sort(self,key=lambda x:x[i],reverse=reverse)
        else:
            list.sort(i,reverse=reverse)

src/w/e/weby-HEAD/lib/webob/compat.py   weby(Download)
try:
    # This will succeed on Python 2.4, and fail on Python 2.3.
 
    [].sort(key=lambda: None)
 
    def sorted(iterable, cmp=None, key=None, reverse=False):
        l = list(iterable)
        l.sort(cmp=cmp, key=key, reverse=reverse)

src/h/e/heroku-playframework-HEAD/play-1.2.2RC1/modules/scala-0.9.1/samples-and-tests/i-am-a-developer/mechanize/_opener.py   heroku-playframework(Download)
            for code, handlers in lookup.iteritems():
                handlers = list(handlers)
                handlers.sort()
                lookup[code] = handlers
        for scheme, handlers in handle_open.iteritems():
            handlers = list(handlers)
            handlers.sort()
        request_processors.update(self._any_request)
        request_processors = list(request_processors)
        request_processors.sort()
        for processor in request_processors:
            for meth_name in ["any_request", req_scheme+"_request"]:
        response_processors.update(self._any_response)
        response_processors = list(response_processors)
        response_processors.sort()
        for processor in response_processors:
            for meth_name in ["any_response", req_scheme+"_response"]:

src/l/a/landline-server-HEAD/co.whatisuplabs.ldln/lib/play/samples-and-tests/i-am-a-developer/mechanize/_opener.py   landline-server(Download)
            for code, handlers in lookup.iteritems():
                handlers = list(handlers)
                handlers.sort()
                lookup[code] = handlers
        for scheme, handlers in handle_open.iteritems():
            handlers = list(handlers)
            handlers.sort()
        request_processors.update(self._any_request)
        request_processors = list(request_processors)
        request_processors.sort()
        for processor in request_processors:
            for meth_name in ["any_request", req_scheme+"_request"]:
        response_processors.update(self._any_response)
        response_processors = list(response_processors)
        response_processors.sort()
        for processor in response_processors:
            for meth_name in ["any_response", req_scheme+"_response"]:

Previous  3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11  Next