Trio of functions taken from Peter Michaux's article: http://peter.michaux.ca/articles/feature-detection-state-of-the-art-browser-scripting
502757
function isHostMethod(o, p) {
        var t = typeof o[p];
        return t == FUNCTION || (!!(t == OBJECT && o[p])) || t == "unknown";
    }
176126
function(io) {
    var feature_hashes = [];
    var uri, feature_hash, current_step_or_hook;

    this.done = function() {
        io.write(JSON.stringify(feature_hashes, null, 2));
    };

    this.uri = function(_uri) {
        uri = _uri;
    };
    
    this.feature = function(feature) {
        feature_hash = feature;
        feature_hash['uri'] = uri;
        feature_hashes.push(feature_hash);
    };

    this.background = function(background) {
        feature_elements().push(background);
    };
    
    this.scenario = function(scenario) {
        feature_elements().push(scenario);
    };

    this.scenario_outline = function(scenario_outline) {
        feature_elements().push(scenario_outline);
    };

    this.examples = function(examples) {
        all_examples().push(examples);
    };

    this.step = function(step) {
        current_step_or_hook = step;
        steps().push(current_step_or_hook);
    }
    
    this.match = function(match) {
        current_step_or_hook['match'] = match;
    }

    this.result = function(result) {
        current_step_or_hook['result'] = result;
    }

    this.before = function(match, result) {
        add_hook(match, result, "before");
    }

    this.after = function(match, result) {
        add_hook(match, result, "after");
    }

    this.embedding = function(mime_type, data) {
        embeddings().push({'mime_type': mime_type, 'data': encode64s(data)})
    }

    this.write = function(text) {
        output().push(text);
    };

    this.eof = function() {};

    this.append_duration = function(timestamp) {
        if (current_step_or_hook['result']) {
            timestamp = timestamp * 1000000000
            rshash = current_step_or_hook['result']
            rshash['duration'] = timestamp
            current_step_or_hook['result'] = rshash
        }
    }

    // "private" methods

    function add_hook(match, result, hook) {
        if(!feature_element()[hook]) {
            feature_element()[hook] = [];
        }
        var hooks = feature_element()[hook];
        hooks.push({'match': match, 'result': result});
    }

    function feature_elements() {
        if(!feature_hash['elements']) {
            feature_hash['elements'] = [];
        }
        return feature_hash['elements'];
    }

    function feature_element() {
        return feature_elements()[feature_elements().length - 1];
    }

    function all_examples() {
        if(!feature_element()['examples']) {
            feature_element()['examples'] = [];
        }
        return feature_element()['examples'];
    }

    function steps() {
        if(!feature_element()['steps']) {
            feature_element()['steps'] = [];
        }
        return feature_element()['steps'];
    }

    function embeddings() {
        if(!current_step_or_hook['embeddings']) {
            current_step_or_hook['embeddings'] = [];
        }
        return current_step_or_hook['embeddings'];
    }

    function output() {
        if(!current_step_or_hook['output']) {
            current_step_or_hook['output'] = [];
        }
        return current_step_or_hook['output'];
    }
    
    // http://gitorious.org/javascript-base64/javascript-base64/blobs/master/base64.js
    function encode64s(input) {
        var swaps = ["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","0","1","2","3","4","5","6","7","8","9","+","/"];
        var input_binary = "";
        var output = "";
        var temp_binary;
        var index;
        for (index=0; index < input.length; index++) {
            temp_binary = input.charCodeAt(index).toString(2);
            while (temp_binary.length < 8) {
                temp_binary = "0"+temp_binary;
            }
            input_binary = input_binary + temp_binary;
            while (input_binary.length >= 6) {
                output = output + swaps[parseInt(input_binary.substring(0,6),2)];
                input_binary = input_binary.substring(6);
            }
        }
        if (input_binary.length == 4) {
            temp_binary = input_binary + "00";
            output = output + swaps[parseInt(temp_binary,2)];
            output = output + "=";
        }
        if (input_binary.length == 2) {
            temp_binary = input_binary + "0000";
            output = output + swaps[parseInt(temp_binary,2)];
            output = output + "==";
        }
        return output;
    }
}
642106
def feature_selection(self, data, labels, weights, num_features, method):
        """"""
        if method == 'none':
            return np.array(range(data.shape[1]))
        elif method == 'forward_selection':
            return self.forward_selection(data, labels, weights, num_features)
        elif method == 'highest_weights':
            clf = Ridge(alpha=0, fit_intercept=True,
                        random_state=self.random_state)
            clf.fit(data, labels, sample_weight=weights)
            feature_weights = sorted(zip(range(data.shape[0]),
                                         clf.coef_ * data[0]),
                                     key=lambda x: np.abs(x[1]),
                                     reverse=True)
            return np.array([x[0] for x in feature_weights[:num_features]])
        elif method == 'lasso_path':
            weighted_data = ((data - np.average(data, axis=0, weights=weights))
                             * np.sqrt(weights[:, np.newaxis]))
            weighted_labels = ((labels - np.average(labels, weights=weights))
                               * np.sqrt(weights))
            nonzero = range(weighted_data.shape[1])
            _, coefs = self.generate_lars_path(weighted_data,
                                               weighted_labels)
            for i in range(len(coefs.T) - 1, 0, -1):
                nonzero = coefs.T[i].nonzero()[0]
                if len(nonzero) <= num_features:
                    break
            used_features = nonzero
            return used_features
        elif method == 'auto':
            if num_features <= 6:
                n_method = 'forward_selection'
            else:
                n_method = 'highest_weights'
            return self.feature_selection(data, labels, weights,
                                          num_features, n_method)
814179
function (ctx, scale, layers, styles, zoom, minX, maxX, minY) {
  // background first
  styles.forEach(function(style) {
    if (cartoSelectorIsMatch(style, null, null, zoom)) {
      style.rules.forEach(function(rule) {
        if (rule.name === "background-color") {
          ctx.fillStyle = rule.value.toString();
        }
        else if (rule.name === "background-image") {
          if (!(rule.value instanceof Canvas.Image)) {
            var content = rule.value.toString();
            var img = new Canvas.Image();
            var imagePath = path.normalize(__dirname + "/../static/images/" + content);
            img.src = fs.readFileSync(imagePath);
            rule.value = img;
          }
        
          img = rule.value;
          ctx.fillStyle = ctx.createPattern(img, "repeat");
        }
      });
      ctx.fillRect(0,0,ctx.canvas.width, ctx.canvas.height);
    }
  });
  
  // create list of attachments (in order) so that we can walk through and render them together for each layer
  // TODO: should be able to do this as part of the processing stage
  var attachments = styles.reduce(function(attachmentList, style) {
    if (style.attachment !== "__default__" && attachmentList.indexOf(style.attachment) === -1) {
      attachmentList.push(style.attachment);
    }
    return attachmentList;
  }, []);
  attachments.push("__default__");
  
  layers.forEach(function(layer, i) {
    var source = layer.source;
    var features = layer.features || layer;
    
    attachments.forEach(function(attachment) {
      
      features.forEach(function(feature) {
        // get all the drawing rules for this attachment and feature
        var collapsedStyle = {};
        var instanceOrder = [];
        styles.forEach(function(style) {
          if (style.attachment === attachment && cartoSelectorIsMatch(style, feature, source, zoom)) {
            style.rules.forEach(function(rule) {
              if (!collapsedStyle[rule.instance]) {
                collapsedStyle[rule.instance] = {};
                instanceOrder.push(rule.instance);
              }
              if (!collapsedStyle[rule.instance].hasOwnProperty(rule.name)) {
                collapsedStyle[rule.instance][rule.name] = rule.value;
              }
            });
          }
        });
        
        var renderInstance = function(instanceName) {
          var instanceStyle = collapsedStyle[instanceName];
          
          ctx.save();
  
          var shouldFill = false,
              shouldStroke = false,
              shouldMark = false,
              shouldPoint = false,
              shouldText = false,
              dashedStroke = false;
          for (var key in instanceStyle) {
            var rawValue = instanceStyle[key],
                value = rawValue.toString();
            
            if (key === "background-color" || key === "polygon-fill") {
              ctx.fillStyle = value;
              shouldFill = true;
            }
            else if (key === "background-image" || key === "polygon-pattern-file") {
              if (rawValue) {
                ctx.fillStyle = ctx.createPattern(rawValue, "repeat");
                shouldFill = true;
              }
            }
            else if (key === "line-width") {
              ctx.lineWidth = parseInt(value);
            }
            else if (key === "line-color") {
              ctx.strokeStyle = value;
              shouldStroke = true;
            }
            else if (key === "line-opacity") {
              // handled at stroke time below
            }
            else if (key === "line-join") {
              ctx.lineJoin = value;
            }
            else if (key === "line-cap") {
              ctx.lineCap = value;
            }
            else if (key === "line-miterlimit") {
              ctx.miterLimit = value;
            }
            else if (key === "line-dasharray") {
              // TODO: dasharray support
              // console.log("Dasharray: ", value);
              var dashedStroke = value.split(",").map(parseFloat);
              // console.log("    now: ", dashArray);
              // ctx.dash = dashArray;
              // ctx.lineDash = dashArray;
            }
            else if (key === "polygon-opacity") {
              // handled at fill time below
            }
            else if (key === "line-pattern-file") {
              if (rawValue) {
                ctx.strokeStyle = ctx.createPattern(rawValue, "repeat");
                shouldStroke = true;
              }
            }
            else if (key.indexOf("marker") === 0) {
              shouldMark = true;
            }
            else if (key === "point-file") {
              shouldPoint = true;
            }
            else if (key === "text-name") {
              shouldText = true;
            }
          }
          
          if (shouldFill || shouldStroke || shouldMark || shouldPoint || shouldText) {
            ctx.beginPath();
            var shape = feature.geometry || feature;
            var coordinates = shape.coordinates;
            renderPath[shape.type].call(ctx, coordinates, scale);
            if (shouldFill) {
              ctx.globalAlpha = parseFloat(instanceStyle["polygon-opacity"]) || 1.0;
              var fillColor = instanceStyle["polygon-fill"];
              var fillPattern = instanceStyle["polygon-pattern-file"]
              if (fillColor) {
                ctx.fillStyle = fillColor.toString();
                ctx.fill();
              }
              if (fillPattern) {
                ctx.fillStyle = ctx.createPattern(fillPattern, "repeat");;
                ctx.fill();
              }
            }
            if (shouldStroke) {
              ctx.globalAlpha = parseFloat(instanceStyle["line-opacity"]) || 1.0;
              if (dashedStroke) {
                // since canvas doesn't yet have dashed line support, we have to draw a dashed path :(
                ctx.closePath();
                ctx.beginPath();
                renderDashedPath[shape.type].call(ctx, dashedStroke, coordinates);
              }
              ctx.stroke();
            }
            ctx.closePath();
            
            if (shouldMark) {
              if (instanceStyle["marker-file"]) {
                renderImage[shape.type].call(ctx, instanceStyle["marker-file"], coordinates);
              }
              else {
                // we only support the "ellipse" type
                // we only support circles, not ellipses right now :\
                var radius = instanceStyle["marker-width"] || instanceStyle["marker-height"];
                radius = (radius ? radius.value : 10) / 2;

                var shouldFillMarker = false;
                var shouldStrokeMarker = false;
                if (instanceStyle["marker-fill"]) {
                  ctx.fillStyle = instanceStyle["marker-fill"].toString();
                  shouldFillMarker = true;
                }
                if (instanceStyle["marker-line-color"]) {
                  ctx.strokeStyle = instanceStyle["marker-line-color"].toString();
                  shouldStrokeMarker = true;
                }
                if (instanceStyle["marker-line-width"]) {
                  var lineWidth = instanceStyle["marker-line-width"].value;
                  ctx.lineWidth = lineWidth;
                  shouldStrokeMarker = !!lineWidth;
                }
                
                ctx.beginPath();
                renderDot[shape.type].call(ctx, radius, coordinates);
                if (shouldFillMarker) {
                  ctx.fill();
                }
                if (shouldStrokeMarker) {
                  ctx.stroke();
                }
                ctx.closePath();
              }
            }
            
            if (shouldPoint && instanceStyle["point-file"]) {
              renderImage[shape.type].call(ctx, instanceStyle["point-file"], coordinates);
            }
            
            if (shouldText) {
              var text = instanceStyle["text-name"];
              if (text.is === "propertyLookup") {
                text = text.toString(feature);
              }
              
              if (text) {
                var textSize = (instanceStyle["text-size"] || "10").toString();
                var textFace = (instanceStyle["text-face-name"] || "sans-serif").toString();
                ctx.font = textSize + "px '" + textFace + "'";
                
                var textInfo = {
                  text: text
                };
                
                // offsetting
                textInfo.offset = {
                  x: instanceStyle["text-dx"] ? instanceStyle["text-dx"].value : 0,
                  y: instanceStyle["text-dy"] ? instanceStyle["text-dy"].value : 0
                };
                
                // vertical alignment
                var verticalAlign = instanceStyle["text-vertical-alignment"];
                if (verticalAlign && verticalAlign.value !== "auto") {
                  ctx.textBaseline = {
                    top: "top",
                    middle: "middle",
                    bottom: "alphabetic"
                  }[verticalAlign];
                }
                else {
                  ctx.textBaseline = textInfo.offset.y === 0 ? "middle" : (textInfo.offset.y < 0 ? "top" : "alphabetic");
                }
                
                // horizontal alignment
                var textHorizontalAlignment = instanceStyle["text-horizontal-alignment"];
                if (textHorizontalAlignment) {
                  ctx.textAlign = textHorizontalAlignment.toString();
                }
                else {
                  // default to center
                  ctx.textAlign = "center";
                }
                textInfo.align = ctx.textAlign;
                
                // text-transform
                var textTransform = instanceStyle["text-transform"];
                textTransform = textTransform && textTransform.toString();
                if (textTransform === "uppercase") {
                  textInfo.text = text.toUpperCase();
                }
                if (textTransform === "lowercase") {
                  textInfo.text = text.toLowerCase();
                }
                if (textTransform === "capitalize") {
                  textInfo.text = text.replace(/\b(\w)/g, function(match, character) {
                    return character.toUpperCase();
                  });
                }
                
                // text-placement
                var placement = instanceStyle["text-placement"];
                textInfo.placement = placement ? placement.toString() : "point";
                
                // TODO: text-placement-type (currently like "dummy")
                // TODO: text-align (this is alignment within the text *box*)
                // We don't have anything that generates a box right now, so we dont' support this
                
                if (instanceStyle["text-halo-fill"]) {
                  ctx.strokeStyle = instanceStyle["text-halo-fill"].toString();
                  if (instanceStyle["text-halo-radius"]) {
                    ctx.lineWidth = instanceStyle["text-halo-radius"].value * 2;
                  }
                  
                  // definitely DON'T leave this set to miter :P
                  ctx.lineJoin = "round";
                  textInfo.stroke = true;
                  renderText[shape.type].call(ctx, textInfo, coordinates);
                }
              
                if (instanceStyle["text-fill"]) {
                  ctx.fillStyle = instanceStyle["text-fill"].toString();
                }
                
                textInfo.stroke = false;
                renderText[shape.type].call(ctx, textInfo, coordinates);
              }
            }
          }
          
          ctx.restore();
        };
      
        instanceOrder.forEach(function(instanceName) {
          if (instanceName !== "__default__") {
            renderInstance(instanceName);
          }
        });
      
        if (collapsedStyle["__default__"]) {
          renderInstance("__default__");
        }
      
      });
      
    });
  });
}
335578
function exactIntersect(a, b, c, d) {
  
  if(!robustIntersect(a, b, c, d)) {
    return [ [0], [0], [0] ]
  }

  var x1 = robustSum([c[1]], [-d[1]])
  var y1 = robustSum([-c[0]], [d[0]])
  var denom = robustSum(
      robustSum(
        robustScale(y1, a[1]),
        robustScale(y1, -b[1])),
      robustSum(
        robustScale(x1, a[0]),
        robustScale(x1, -b[0])))

  var w0 = robustSum(twoProduct(-a[0], b[1]), twoProduct(a[1], b[0]))
  var w1 = robustSum(twoProduct(-c[0], d[1]), twoProduct(c[1], d[0]))

  //Calculate nX, nY
  var nX = robustSum(
    robustSum(
      robustScale(w1, a[0]),
      robustScale(w1, -b[0])),
    robustSum(
      robustScale(w0, -c[0]),
      robustScale(w0, d[0])))

  var nY = robustSum(
    robustSum(
      robustScale(w1, a[1]),
      robustScale(w1, -b[1])),
    robustSum(
      robustScale(w0, -c[1]),
      robustScale(w0, d[1])))

  return [ compress(nX), compress(nY), compress(denom) ]
}
928584
def _check_feature(self, feature, info, mode):
        

        op = dict(
            before=operator.gt,
            after=operator.lt
        )[mode]

        feature_pos = self.get_feature_position(feature)

        if feature_pos is not None:
            # only proceed if the the feature exists in the current feature list

            for other in info.get(mode, []):
                other_pos = self.get_feature_position(other)

                if other_pos is not None:
                    # only proceed if the the other feature exists in the current feature list
                    if op(feature_pos, other_pos):
                        message = '{feature} (pos {feature_pos}) must be {mode} feature {other} (pos {other_pos}) but isn\'t.'.format(
                            feature=feature,
                            feature_pos=feature_pos,
                            other=other,
                            other_pos=other_pos,
                            mode=mode.upper()
                        )
                        self.violations.append((feature, message))
1225725
protected void detectOctave( II integral , int skip , int ...featureSize ) {

		int w = integral.width/skip;
		int h = integral.height/skip;

		// resize the output intensity image taking in account subsampling
		for( int i = 0; i < intensity.length; i++ ) {
			intensity[i].reshape(w,h);
		}

		// compute feature intensity in each level
		for( int i = 0; i < featureSize.length; i++ ) {
			GIntegralImageFeatureIntensity.hessian(integral,skip,featureSize[i],intensity[spaceIndex]);

			spaceIndex++;
			if( spaceIndex >= 3 )
				spaceIndex = 0;

			// find maximum in scale space
			if( i >= 2 ) {
				findLocalScaleSpaceMax(featureSize,i-1,skip);
			}
		}
	}
649313
function (e, origin, xy, mouseIs, render, rgb, hsv) { // this func gets/stores mouse coordinates and calculates all colors
    var CP = colorPicker.CP,
      xyz; //s=CP.mode=='H'?2:CP.mode=='S'?14:26; // CP = scope shifting
    if (!mouseIs) { // correct mousepos to stay inside boundries
      xyz = getMousePos(e, origin);
      xyz[1] = xyz[1] < 0 ? 255 : xyz[1] * sX * sZ > 255 ? 0 : 255 - xyz[1] * sX * sZ;
      if (xy) {
        CP.xyz[0] = xyz[0] < 0 ? 0 : xyz[0] * sX > 255 ? 255 : xyz[0] * sX;
        CP.xyz[1] = xyz[1]
      } else CP.xyz[2] = xyz[1]; //; s+=6}
    } else CP.xyz = mouseIs; // { s=(s-2)/2+38}
    if (cPM == 'RGB') { // store colors
      if (rgb) CP.rgb = rgb;
      else {
        CP.rgb[x] = CP.xyz[0];
        CP.rgb[y] = CP.xyz[1];
        CP.rgb[z] = CP.xyz[2]
      }
      CP.hsv = hsv ? hsv : RGB2HSV(CP.rgb[0], CP.rgb[1], CP.rgb[2]);
    } else {
      // CP.hsv = hsv?hsv:[CP[HX[HX[s++]]][HX[s++]],CP[HX[HX[s++]]][HX[s++]],CP[HX[HX[s++]]][HX[s]]]; // useing wicked pattern ;o)
      if (hsv) CP.hsv = hsv;
      else {
        CP.hsv[x] = CP.xyz[0];
        CP.hsv[y] = CP.xyz[1];
        CP.hsv[z] = CP.xyz[2]
      }
      CP.rgb = rgb ? rgb : HSV2RGB(CP.hsv[0], CP.hsv[1], CP.hsv[2], true);
    }
    CP.rgbRND = [Math.round(CP.rgb[0]), Math.round(CP.rgb[1]), Math.round(CP.rgb[2])];
    CP.cmyk = RGB2CMYK(CP.rgb[0], CP.rgb[1], CP.rgb[2]);
    CP.cmyk = [Math.round(CP.cmyk[0] * 100), Math.round(CP.cmyk[1] * 100), Math.round(CP.cmyk[2] * 100), Math.round((1 - CP.cmyk[3]) * 100)];
    CP.hex = RGB2HEX(CP.rgbRND[0], CP.rgbRND[1], CP.rgbRND[2]);

    if (!rSpeed || render) doRender(xy, mouseIs);
  }
245812
function detectIntersection(a, b) {
  if (a instanceof Sphere) {
    if (b instanceof Sphere) {
      return sphereCollisionDetection.sphereVsSphere(a, b);
    } else if (b instanceof Aabb) {
      return sphereCollisionDetection.sphereVsAabb(a, b);
    } else if (b instanceof Capsule) {
      return sphereCollisionDetection.sphereVsCapsule(a, b);
    } else if (b instanceof Obb) {
      return sphereCollisionDetection.sphereVsObb(a, b);
    } else {
      return sphereCollisionDetection.sphereVsPoint(a, b);
    }
  } else if (a instanceof Aabb) {
    if (b instanceof Sphere) {
      return aabbCollisionDetection.aabbVsSphere(a, b);
    } else if (b instanceof Aabb) {
      return aabbCollisionDetection.aabbVsAabb(a, b);
    } else if (b instanceof Capsule) {
      return aabbCollisionDetection.aabbVsCapsule(a, b);
    } else if (b instanceof Obb) {
      return aabbCollisionDetection.aabbVsObb(a, b);
    } else {
      return aabbCollisionDetection.aabbVsPoint(a, b);
    }
  } else if (a instanceof Capsule) {
    if (b instanceof Sphere) {
      return capsuleCollisionDetection.capsuleVsSphere(a, b);
    } else if (b instanceof Aabb) {
      return capsuleCollisionDetection.capsuleVsAabb(a, b);
    } else if (b instanceof Capsule) {
      return capsuleCollisionDetection.capsuleVsCapsule(a, b);
    } else if (b instanceof Obb) {
      return capsuleCollisionDetection.capsuleVsObb(a, b);
    } else {
      return capsuleCollisionDetection.capsuleVsPoint(a, b);
    }
  } else if (a instanceof Obb) {
    if (b instanceof Sphere) {
      return obbCollisionDetection.obbVsSphere(a, b);
    } else if (b instanceof Aabb) {
      return obbCollisionDetection.obbVsAabb(a, b);
    } else if (b instanceof Capsule) {
      return obbCollisionDetection.obbVsCapsule(a, b);
    } else if (b instanceof Obb) {
      return obbCollisionDetection.obbVsObb(a, b);
    } else {
      return obbCollisionDetection.obbVsPoint(a, b);
    }
  } else {
    if (b instanceof Sphere) {
      return sphereCollisionDetection.sphereVsPoint(b, a);
    } else if (b instanceof Aabb) {
      return aabbCollisionDetection.aabbVsPoint(b, a);
    } else if (b instanceof Capsule) {
      return capsuleCollisionDetection.capsuleVsPoint(b, a);
    } else if (b instanceof Obb) {
      return obbCollisionDetection.obbVsPoint(b, a);
    } else {
      return false;
    }
  }
}
850936
function autoDetectRenderer(c, width, height, options) {
         try {
           return new me.WebGLRenderer(c, width, height, options);
         } catch (e) {
           return new me.CanvasRenderer(c, width, height, options);
         }
       }
120267
def detect(self, obj):
        """"""
        links = obj.get(LINKS_KEY, {})

        for detector in [LATEST, DRAFT_3]:
            if detector.draft.curies_rel in links:
                return detector.detect(obj)

        return LATEST.detect(obj)
436808
async function detectFaces(inputFile) {
  // Make a call to the Vision API to detect the faces
  const request = {image: {source: {filename: inputFile}}};
  const results = await client.faceDetection(request);
  const faces = results[0].faceAnnotations;
  const numFaces = faces.length;
  console.log(`Found ${numFaces} face${numFaces === 1 ? '' : 's'}.`);
  return faces;
}
903841
function runListFeatures(callback) {
  var rect = new messages.Rectangle();
  var lo = new messages.Point();
  lo.setLatitude(400000000);
  lo.setLongitude(-750000000);
  rect.setLo(lo);
  var hi = new messages.Point();
  hi.setLatitude(420000000);
  hi.setLongitude(-730000000);
  rect.setHi(hi);
  console.log('Looking for features between 40, -75 and 42, -73');
  var call = client.listFeatures(rect);
  call.on('data', function(feature) {
      console.log('Found feature called "' + feature.getName() + '" at ' +
          feature.getLocation().getLatitude()/COORD_FACTOR + ', ' +
          feature.getLocation().getLongitude()/COORD_FACTOR);
  });
  call.on('end', callback);
}
795632
function isOutside (feature, poly) {
  var a = feature.bbox = feature.bbox || extent(feature)
  var b = poly.bbox = poly.bbox || extent(poly)
  return a[2] < b[0] || a[0] > b[2] || a[3] < b[1] || a[1] > b[3]
}
231299
function detectFaces(img, faceSize = 150) {
      return locateFaces(img)
        .then(rects => getFacesFromLocations(img, rects.map(mmodRect => mmodRect.rect), faceSize))
    }
153693
function roundedCorners(side, radius) {
  if (!radius) {
    radius = side || 10;
    side   = 'all';
  }
  if (side == 'all') {
    if (browserInfo().msie) {
      return {
        'border-radius': radius,
        behavior:        'url(border-radius-ie.htc)',
        visibility:      'hidden'
      }
    } else if (browserInfo().mozilla) {
      return {
        '-moz-border-radius': radius
      }

    } else {
      return {
        'border-radius':         radius,
        '-webkit-border-radius': radius
      }
    }
  } else {
    var rules = {};
    if (side == 'tl' || side == 'top' || side == 'left') {
      rules['-moz-border-radius-topleft']     = radius;
      rules['-webkit-border-top-left-radius'] = radius;
      rules['border-top-left-radius']         = radius;
    }
    if (side == 'tr' || side == 'top' || side == 'right') {
      rules['-webkit-border-top-right-radius'] = radius;
      rules['-moz-border-radius-topright']     = radius;
      rules['border-top-right-radius']         = radius;
    }
    if (side == 'bl' || side == 'bottom' || side == 'left') {
      rules['-webkit-border-bottom-left-radius'] = radius;
      rules['-moz-border-radius-bottomleft']     = radius;
      rules['border-bottom-left-radius']         = radius;
    }
    if (side == 'br' || side == 'bottom' || side == 'right') {
      rules['-webkit-border-bottom-right-radius'] = radius;
      rules['-moz-border-radius-bottomright']     = radius;
      rules['border-bottom-right-radius']         = radius;
    }
    return rules;
  }
}
182692
function (featureStringCommaSeparated) {
  var arrayFeatures = featureStringCommaSeparated
    .split(',')
    .filter(function (x) { return x.length })
    .map(function (x) { return x.replace(/[\*\/]/g, '') }); // Eliminate XSS vuln
  var arrayUnsupportedFeatures = [];
  for (var i = 0; i < arrayFeatures.length; i++) {
    var supportedFeature = true;
    var fullFeature = arrayFeatures[i];
    if (contains(fullFeature, "~")) {
      if (contains(fullFeature, "Intl.~locale")) {
        supportedFeature = checkIntlLocale(window, fullFeature);
      } else {
        console.warn('Feature ' + fullFeature + ' can not be detected because it has not JavaScript API.');
      }
    } else {
      // Get the feature and the container Object
      var featureString = fullFeature.substring(fullFeature.lastIndexOf('.') + 1);
      if (contains(featureString, "@@")) {
        console.warn('Feature ' + featureString + ' can not be detected because it depends on Symbol.');
      } else {
        var objectString = fullFeature.substring(0, fullFeature.lastIndexOf('.'));
        var object = getDescendantProp(window, objectString);
        if (object !== undefined) {
          //if ((object.hasOwnProperty(featureString)) === false) {
          if ((featureString in object) === false) {
            supportedFeature = false;
          }
        } else {
          supportedFeature = false;
        }
      }
    }
    // If the feature is not supported by the browser, then add it to polyfill it
    if (supportedFeature === false) {
      arrayUnsupportedFeatures.push(fullFeature);
    }
  }
  return arrayUnsupportedFeatures;
}