Did I find the right examples for you? yes no

All Samples(82124)  |  Call(82124)  |  Derive(0)  |  Import(0)
max(iterable[, key=func]) -> value
max(a, b, c, ...[, key=func]) -> value

With a single iterable argument, return its largest item.
With two or more arguments, return the largest argument.

src/d/e/deap-1.0.1/examples/eda/pbil.py   deap(Download)
    def update(self, population):
        best = max(population, key=lambda ind: ind.fitness)
 
        for i, value in enumerate(best):
            # Update the probability vector

src/s/h/shedskin-HEAD/examples/genetic2.py   shedskin(Download)
    def get_best_individual(self):
        """Get the best individual of this pool."""
        return max(self.population, key=fitness)
 
 

src/c/v/cvxpy-HEAD/examples/extensions/mixed_integer/permutation.py   cvxpy(Download)
    def get_largest(self, ind_val, chosen):
        # The final list will have 1 entry per row/col.
        if len(ind_val) == 0:
            return chosen
        largest = max(ind_val, key=lambda tup: abs(tup[2]))

src/a/u/audiolazy-HEAD/examples/dft_pitch.py   audiolazy(Download)
def dft_pitch(sig, size=2048, hop=None):
  for blk in Stream(sig).blocks(size=size, hop=hop):
    dft_data = rfft(blk)
    idx, vmax = max(enumerate(dft_data),
                    key=lambda el: abs(el[1]) / (2 * el[0] / size + 1)

src/p/y/python-stdnet-HEAD/examples/spelling/spelling.py   python-stdnet(Download)
def correct(word):
    candidates = (known([word]) or known(edits1(word)) or known_edits2(word)
                  or [word])
    return max(candidates, key=NWORDS.get)
 

src/s/n/snake-challenge-HEAD/examples/ai_halida.py   snake-challenge(Download)
 
        # return the best direction
        d = max(zip(ratings, dirs), key=lambda x: x[0])[1]
        return {'op': 'turn', 'direction': DIRECT.index(d)}
 

src/n/l/nlp-class-HEAD/quiz3/example.py   nlp-class(Download)
 
title('answer')    
print max(posteriors.keys(), key = lambda k: posteriors[k])
 
 

src/p/y/pyresample-1.1.0/pyresample/data_reduce.py   pyresample(Download)
                  lats_side4.min())
    lat_min_buffered = lat_min - float(radius_of_influence) / R
    lat_max = max(lats_side1.max(), lats_side2.max(), lats_side3.max(),
                  lats_side4.max())
    lat_max_buffered = lat_max + float(radius_of_influence) / R
 
    max_angle_s2 = max(abs(lats_side2.max()), abs(lats_side2.min()))
    max_angle_s4 = max(abs(lats_side4.max()), abs(lats_side4.min()))

src/c/r/crashplan_api_examples-HEAD/licenseAvailabilityreport.py   crashplan_api_examples(Download)
			dateList.append(d)
 
		latestDate = max(dateList,key=itemgetter(1))
		# print 'MAX Date: ' + str(latestDate)
	else:

src/d/j/django-admin-report-HEAD/example/lib/reportlab/graphics/charts/axes.py   django-admin-report(Download)
        hi = kwds.pop('hi',axis._length)
        lo = kwds.pop('lo',0)
        lo,hi=min(lo,hi),max(lo,hi)
        drawAtLimit = kwds.pop('drawAtLimit',False)
        if not scaleValue:
    def _cxLine3d(self,x,start,end,_3d_dx,_3d_dy):
        x = self._get_line_pos(x)
        y0 = self._y + start
        y1 = self._y + end
        y0, y1 = min(y0,y1),max(y0,y1)
    def _cyLine3d(self,y,start,end,_3d_dx,_3d_dy):
        y = self._get_line_pos(y)
        x0 = self._x + start
        x1 = self._x + end
        x0, x1 = min(x0,x1),max(x0,x1)
    def configure(self, multiSeries,barWidth=None):
        self._catCount = max(map(len,multiSeries))
        self._barWidth = barWidth or ((self._length-self.loPad-self.hiPad)/float(self._catCount or 1))
        self._calcTickmarkPositions()
 
                    dst = OTV[1]-OTV[0]
                elif i==3:
                    dst = max(OTV[1]-OTV[0],OTV[2]-OTV[1])
                else:
                    i >>= 1

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