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/h/u/hunch-sample-app-HEAD/django/contrib/gis/geos/mutable_list.py   hunch-sample-app(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/s/psutil-2.1.1/examples/nettop.py   psutil(Download)
    print_line("")
    nic_names = list(pnic_after.keys())
    nic_names.sort(key=lambda x: sum(pnic_after[x]), reverse=True)
    for name in nic_names:
        stats_before = pnic_before[name]

src/p/s/psutil-HEAD/examples/nettop.py   psutil(Download)
    print_line("")
    nic_names = list(pnic_after.keys())
    nic_names.sort(key=lambda x: sum(pnic_after[x]), reverse=True)
    for name in nic_names:
        stats_before = pnic_before[name]

src/p/e/pexpect-HEAD/examples/topip.py   pexpect(Download)
    sdsq = sum([(i-avg)**2 for i in r])
    s = list(r)
    s.sort()
    return dict(list(zip(['med', 'avg', 'stddev', 'min', 'max'] , (s[len(s)//2], avg, (sdsq/len(r))**.5, min(r), max(r)))))
 
        if verbose: print('Warning: no networks connections worth looking at.')
        return 0
    ip_list.sort(key=lambda x:x[1])
 
    # generate some stats for the ip addresses found.

src/i/p/ipython-py3k-HEAD/docs/examples/newparallel/davinci/wordfreq.py   ipython-py3k(Download)
    words, counts = list(freqs.keys()), list(freqs.values())
    items = list(zip(counts, words))
    items.sort(reverse=True)
    for (count, word) in items[:n]:
        print(word, count)
    sizes = [v[1] for v in list(worddict.values())]
    items = list(zip(alphas, sizes, words))
    items.sort(reverse=True)
    for alpha, size, word in items[:n]:
        # xpos = random.normalvariate(0.5, 0.3)

src/p/e/pexpect-3.2/examples/topip.py   pexpect(Download)
        if verbose: print('Warning: no networks connections worth looking at.')
        return 0
    ip_list.sort(key=lambda x:x[1])
 
    # generate some stats for the ip addresses found.

src/e/c/ecspy-1.1/examples/cgp_example.py   ecspy(Download)
 
        population = list(population)
        population.sort(reverse=True)
        worst_fit = population[-1].fitness
        best_fit = population[0].fitness
def generate_initial_population(generator, n, sel, fitness_function):
    indexes = list(xrange(n))
    candidates = [generator(None, None) for _ in indexes]
    fitness = fitness_function(candidates, {})
    indexes.sort(key=lambda i: fitness[i])

src/t/r/traits-HEAD/traits/trait_handlers.py   traits(Download)
        def sort ( self, cmp = None, key = None, reverse = False ):
            removed = self[:]
            list.sort( self, cmp = cmp, key = key, reverse = reverse )
            self._sort_common(removed)
    else:
        def sort ( self, key = None, reverse = False ):
            removed = self[:]
            list.sort( self, key = key, reverse = reverse )

src/t/r/traits-4.4.0/traits/trait_handlers.py   traits(Download)
    def sort ( self, cmp = None, key = None, reverse = False ):
        removed = self[:]
        list.sort( self, cmp = cmp, key = key, reverse = reverse )
 
        if (getattr(self, 'name_items', None) is not None and

src/e/c/ecspy-1.1/examples/smcgp_parity_example.py   ecspy(Download)
    def screen_observer(population, num_generations, num_evaluations, args):
        import numpy
 
        population = list(population)
        population.sort(reverse=True)

  1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9  Next