The common pick-handling function.
334540
function (o) {
            // The input argument is either an Event or a TapRecognizer. Both have the same properties for determining
            // the mouse or tap location.
            var x = o.clientX,
                y = o.clientY;

            // Perform the pick. Must first convert from window coordinates to canvas coordinates, which are
            // relative to the upper left corner of the canvas rather than the upper left corner of the page.
            var pickPoint = wwd.canvasCoordinates(x, y);
            var pickList = wwd.pick(pickPoint);

            if (pickList.objects.length > 0) {
                for (var p = 0; p < pickList.objects.length; p++) {
                    if (pickList.objects[p].userObject instanceof WorldWind.SurfaceImage) {
                        if (pickList.objects[p].userObject.displayName === ($("#select-region").val())) {
                            var index = getIndexOfObjectsArrayByAttribute(
                                analyticalSurfaceObjectArray,
                                "regionName",
                                pickList.objects[p].userObject.displayName);
                            var refLat = analyticalSurfaceObjectArray[index].referenceY;
                            var refLong = analyticalSurfaceObjectArray[index].referenceX;
                            var resolution = analyticalSurfaceObjectArray[index].cellSize;
                            var numColumns = analyticalSurfaceObjectArray[index].width;

                            var terrainObject = wwd.pickTerrain(pickPoint).terrainObject();
                            var pickLat = terrainObject.position.latitude;
                            var pickLong = terrainObject.position.longitude;

                            var deltaY = refLat - pickLat;
                            var deltaX = pickLong - refLong;

                            var colNo = Math.round(deltaX / resolution);
                            var rowNo = Math.round(deltaY / resolution);

                            var indexParam = rowNo * numColumns + colNo;

                            var data = [];
                            var xLabels = [];

                            for (var i = 0; i < analyticalSurfaceObjectArray[index].imageList.length; i++) {
                                if (analyticalSurfaceObjectArray[index].imageList[i].dataArray[indexParam] ===
                                    analyticalSurfaceObjectArray[index].noDataValue) {
                                    data.push(0);
                                }
                                else {
                                    data.push(analyticalSurfaceObjectArray[index].imageList[i].dataArray[indexParam]);
                                }
                                xLabels.push(
                                    getStringDateFormat(analyticalSurfaceObjectArray[index].imageList[i].filename));
                            }

                            var m = [10, 60, 80, 60]; // margins
                            var w = 1000 - m[1] - m[3]; // width
                            var h = 300 - m[0] - m[2]; // height

                            var step = w / data.length;

                            var domainArray = [];
                            for (var i = 0; i < data.length; i++) {
                                domainArray.push(i * step);
                            }

                            var x = d3.scale.ordinal()
                                .domain(xLabels).range(domainArray);
                            var y = d3.scale.linear().domain([0, 255]).range([h, 0]);

                            var line = d3.svg.line()
                                .x(function (d, i) {
                                    return x(i);
                                })
                                .y(function (d) {
                                    return y(d);
                                });

                            d3.select("svg").remove();

                            var svg = d3.select("#graph").append("svg")
                                .attr("width", w + m[1] + m[3])
                                .attr("height", h + m[0] + m[2])
                                .append("svg:g")
                                .attr("transform", "translate(" + m[3] + "," + m[0] + ")");

                            var xAxis = d3.svg.axis().scale(x).tickSize(-h).tickSubdivide(true);

                            svg.append("svg:g")
                                .attr("class", "x axis")
                                .attr("transform", "translate(0," + h + ")")
                                .call(xAxis)
                                .selectAll("text")
                                .style("text-anchor", "end")
                                .attr("dx", "-.8em")
                                .attr("dy", ".15em")
                                .attr("transform", "rotate(-65)");

                            var yAxisLeft = d3.svg.axis().scale(y).ticks(4).orient("left");
                            svg.append("svg:g")
                                .attr("class", "y axis")
                                .attr("transform", "translate(-25,0)")
                                .call(yAxisLeft);

                            svg.append("svg:path").attr("d", line(data));
                        }
                    }
                }
            }
        }
1326133
function fieldPicker(fields)
{
  var map = {};

  if (fields instanceof Array) {
    fields.forEach(function(f) { map[f] = f; });
  } else if (typeof fields === 'object') {
    for (var key in fields) {
      map[key] = fields[key];
    }
  }

  return function(input, output) {
    var target = output || input;
    for (var key in target) {
      if (map[key] === undefined)
      delete target[key];
    }
  };
}
101582
function() {

                // If it’s already started, do nothing.
                if ( STATE && STATE.start ) return P


                // Update the picker states.
                STATE.methods = {}
                STATE.start = true
                STATE.open = false
                STATE.type = ELEMENT.type


                // Confirm focus state, convert into text input to remove UA stylings,
                // and set as readonly to prevent keyboard popup.
                ELEMENT.autofocus = ELEMENT == getActiveElement()
                ELEMENT.readOnly = !SETTINGS.editable
                ELEMENT.id = ELEMENT.id || STATE.id
                if ( ELEMENT.type != 'text' ) {
                    ELEMENT.type = 'text'
                }


                // Create a new picker component with the settings.
                P.component = new COMPONENT(P, SETTINGS)


                // Create the picker root with a holder and then prepare it.
                P.$root = $( PickerConstructor._.node('div', createWrappedComponent(), CLASSES.picker, 'id="' + ELEMENT.id + '_root" tabindex="0"') )
                prepareElementRoot()


                // If there’s a format for the hidden input element, create the element.
                if ( SETTINGS.formatSubmit ) {
                    prepareElementHidden()
                }


                // Prepare the input element.
                prepareElement()


                // Insert the root as specified in the settings.
                if ( SETTINGS.container ) $( SETTINGS.container ).append( P.$root )
                else $ELEMENT.after( P.$root )


                // Bind the default component and settings events.
                P.on({
                    start: P.component.onStart,
                    render: P.component.onRender,
                    stop: P.component.onStop,
                    open: P.component.onOpen,
                    close: P.component.onClose,
                    set: P.component.onSet
                }).on({
                    start: SETTINGS.onStart,
                    render: SETTINGS.onRender,
                    stop: SETTINGS.onStop,
                    open: SETTINGS.onOpen,
                    close: SETTINGS.onClose,
                    set: SETTINGS.onSet
                })


                // Once we’re all set, check the theme in use.
                IS_DEFAULT_THEME = isUsingDefaultTheme( P.$root.children()[ 0 ] )


                // If the element has autofocus, open the picker.
                if ( ELEMENT.autofocus ) {
                    P.open()
                }


                // Trigger queued the “start” and “render” events.
                return P.trigger( 'start' ).trigger( 'render' )
            }
117467
def dict_pick(dictionary, allowed_keys):
    
    return {key: value for key, value in viewitems(dictionary) if key in allowed_keys}
732795
def pick(seq, func, maxobj=None):
    """"""
    maxscore = None
    for obj in seq:
        score = func(obj)
        if maxscore is None or maxscore < score:
            (maxscore, maxobj) = (score, obj)
    return maxobj
1150256
void genCatch(JCCatch tree,
                      Env<GenContext> env,
                      int startpc, int endpc,
                      List<Integer> gaps) {
            if (startpc != endpc) {
                List<Pair<List<Attribute.TypeCompound>, JCExpression>> catchTypeExprs
                        = catchTypesWithAnnotations(tree);
                while (gaps.nonEmpty()) {
                    for (Pair<List<Attribute.TypeCompound>, JCExpression> subCatch1 : catchTypeExprs) {
                        JCExpression subCatch = subCatch1.snd;
                        int catchType = makeRef(tree.pos(), subCatch.type);
                        int end = gaps.head.intValue();
                        registerCatch(tree.pos(),
                                      startpc,  end, code.curCP(),
                                      catchType);
                        for (Attribute.TypeCompound tc :  subCatch1.fst) {
                                tc.position.setCatchInfo(catchType, startpc);
                        }
                    }
                    gaps = gaps.tail;
                    startpc = gaps.head.intValue();
                    gaps = gaps.tail;
                }
                if (startpc < endpc) {
                    for (Pair<List<Attribute.TypeCompound>, JCExpression> subCatch1 : catchTypeExprs) {
                        JCExpression subCatch = subCatch1.snd;
                        int catchType = makeRef(tree.pos(), subCatch.type);
                        registerCatch(tree.pos(),
                                      startpc, endpc, code.curCP(),
                                      catchType);
                        for (Attribute.TypeCompound tc :  subCatch1.fst) {
                            tc.position.setCatchInfo(catchType, startpc);
                        }
                    }
                }
                VarSymbol exparam = tree.param.sym;
                code.statBegin(tree.pos);
                code.markStatBegin();
                int limit = code.nextreg;
                code.newLocal(exparam);
                items.makeLocalItem(exparam).store();
                code.statBegin(TreeInfo.firstStatPos(tree.body));
                genStat(tree.body, env, CRT_BLOCK);
                code.endScopes(limit);
                code.statBegin(TreeInfo.endPos(tree.body));
            }
        }
25424
function pickoutValue(target, str) {
  const strDepth = str.split('.');
  const newTarget = target[strDepth[0]];
  if (newTarget === undefined) throw new Error('Cannot find the value');
  if (strDepth.length === 1) return newTarget;
  return pickoutValue(newTarget, strDepth.splice(1).join('.'));
}
1049570
function picker(iteratees) {
  iteratees = iteratees || ['name']
  return _.partial(_.pick, _, iteratees)
}
445983
def iterative_select(obj, dimensions, selects, depth=None):
    
    ndims = len(dimensions)
    depth = depth if depth is not None else ndims
    items = []
    if isinstance(selects, dict):
        for k, v in selects.items():
            items += iterative_select(obj.select(**{dimensions[ndims-depth]: k}),
                                      dimensions, v, depth-1)
    else:
        for s in selects:
            items.append((s, obj.select(**{dimensions[-1]: s[-1]})))
    return items
601102
function pick(obj, var_keys){
        var keys = typeof arguments[1] !== 'string'? arguments[1] : slice(arguments, 1),
            out = {},
            i = 0, key;
        while (key = keys[i++]) {
            out[key] = obj[key];
        }
        return out;
    }
955278
def _unpickle_collection(self, collection):
        """"""
        for mkey in collection:
            if isinstance(collection[mkey], list):
                for item in collection[mkey]:
                    item.unpickle(self)
            else:
                collection[mkey].unpickle(self)
528467
def update_picks(self, games=None, points=None):
        '''
        
        '''
        if games:
            game_dict = {g.id: g for g in self.gameset.games.filter(id__in=games)}
            game_picks = {pick.game.id: pick for pick in self.gamepicks.filter(game__id__in=games)}
            for key, winner in games.items():
                game = game_dict[key]
                if not game.has_started:
                    pick = game_picks[key]
                    pick.winner_id = winner
                    pick.save()

        if points is not None:
            self.points = points
            self.save()

        if games or points:
            self.updated_signal.send(sender=self.__class__, pickset=self, auto_pick=False)
395401
def pickable(self, value=None):
        """"""
        if value is None:
            return self.GetPickable()
        else:
            self.SetPickable(value)
            return self
572414
def p(i, sample_size, weights):
        

        # Determine the initial pick values
        weight_i = weights[i]
        weights_sum = sum(weights)

        # Build a list of weights that don't contain the weight `i`. This list will
        # be used to build the possible picks before weight `i`.
        other_weights = list(weights)
        del other_weights[i]

        # Calculate the probability
        probability_of_i = 0
        for picks in range(0, sample_size):

            # Build the list of possible permutations for this pick in the sample
            permutations = list(itertools.permutations(other_weights, picks))

            # Calculate the probability for this permutation
            permutation_probabilities = []
            for permutation in permutations:

                # Calculate the probability for each pick in the permutation
                pick_probabilities = []
                pick_weight_sum = weights_sum

                for pick in permutation:
                    pick_probabilities.append(pick / pick_weight_sum)

                    # Each time we pick we update the sum of the weight the next
                    # pick is from.
                    pick_weight_sum -= pick

                # Add the probability of picking i as the last pick
                pick_probabilities += [weight_i / pick_weight_sum]

                # Multiply all the probabilities for the permutation together
                permutation_probability = reduce(
                    lambda x, y: x * y, pick_probabilities
                    )
                permutation_probabilities.append(permutation_probability)

            # Add together all the probabilities for all permutations together
            probability_of_i += sum(permutation_probabilities)

        return probability_of_i
146364
def unpickle_args(items):
    '''
    '''
    # Technically there can be more than one _pickled value. At this point
    # we'll just use the first one
    pickled= items.pop('_pickled', None)
    if pickled is None:
        return items

    pickled_keys = pickled[0].split(',')
    ret = {}
    for key, vals in items.items():
        if key in pickled_keys:
            ret[key] = [pickle.loads(val) for val in vals]
        else:
            ret[key] = vals
    return ret
1073883
function scrape(iterator, data, params, cb) {
    var $ = artoo.$,
        scraped = [],
        loneSelector = !!data.attr || !!data.method || data.scrape ||
                       typeof data === 'string' ||
                       typeof data === 'function';

    params = params || {};

    // Transforming to selector
    var $iterator;
    if (typeof iterator === 'function')
      $iterator = $(iterator($));
    else
      $iterator = $(iterator);

    // Iteration
    $iterator.each(function(i) {
      var item = {},
          p;

      // TODO: figure iteration scope elsewhere for scrape recursivity
      if (loneSelector)
        item = (typeof data === 'object' && 'scrape' in data) ?
          scrape(
            (data.sel ? $(this).find(data.sel) : $(this))
              .find(data.scrape.iterator),
            data.scrape.data,
            data.scrape.params
          ) :
          step(data, this);
      else
        for (p in data) {
          item[p] = (typeof data[p] === 'object' && 'scrape' in data[p]) ?
            scrape(
              (data[p].sel ? $(this).find(data[p].sel) : $(this))
                .find(data[p].scrape.iterator),
              data[p].scrape.data,
              data[p].scrape.params
            ) :
            step(data[p], this);
        }

      scraped.push(item);

      // Breaking if limit i attained
      return !params.limit || i < params.limit - 1;
    });

    scraped = params.one ? scraped[0] : scraped;

    // Triggering callback
    if (typeof cb === 'function')
      cb(scraped);

    // Returning data
    return scraped;
  }
1073106
static MeasuredNode pickBest(MeasuredNode a, MeasuredNode b) {
    if (a.length == b.length) {
      return (b.isChanged()) ? a : b;
    }

    return (a.length < b.length) ? a : b;
  }