text:
// Type definitions for Leaflet.js 1.0.0-rc3
// Project: https://github.com/Leaflet/Leaflet
// Definitions by: Alejandro Sánchez <https://github.com/alejo90>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped

/// <reference path="../geojson/geojson.d.ts" />

declare namespace L {
    export interface CRS {
        latLngToPoint(latlng: LatLng, zoom: number): Point;
        latLngToPoint(latlng: LatLngLiteral, zoom: number): Point;
        latLngToPoint(latlng: LatLngTuple, zoom: number): Point;
        pointToLatLng(point: Point): LatLng;
        pointToLatLng(point: PointTuple): LatLng;
        project(latlng: LatLng): Point;
        project(latlng: LatLngLiteral): Point;
        project(latlng: LatLngTuple): Point;
        unproject(point: Point): LatLng;
        unproject(point: PointTuple): LatLng;
        scale(zoom: number): number;
        zoom(scale: number): number;
        getProjectedBounds(zoom: number): Bounds;
        distance(latlng1: LatLng, latlng2: LatLng): number;
        distance(latlng1: LatLngLiteral, latlng2: LatLngLiteral): number;
        distance(latlng1: LatLngTuple, latlng2: LatLngTuple): number;
        wrapLatLng(latlng: LatLng): LatLng;
        wrapLatLng(latlng: LatLngLiteral): LatLng;
        wrapLatLng(latlng: LatLngTuple): LatLng;

        code: string;
        wrapLng: [number, number];
        wrapLat: [number, number];
        infinite: boolean;
    }

    export namespace CRS {
        export const EPSG3395: CRS;
        export const EPSG3857: CRS;
        export const EPSG4326: CRS;
        export const Earth: CRS;
        export const Simple: CRS;
    }

    export interface Projection {
        project(latlng: LatLng): Point;
        project(latlng: LatLngLiteral): Point;
        project(latlng: LatLngTuple): Point;
        unproject(point: Point): LatLng;
        unproject(point: PointTuple): LatLng;

        bounds: LatLngBounds;
    }

    export namespace Projection {
        export const LonLat: Projection;
        export const Mercator: Projection;
        export const SphericalMercator: Projection;
    }

    export interface LatLng {
        equals(otherLatLng: LatLng, maxMargin?: number): boolean;
        equals(otherLatLng: LatLngLiteral, maxMargin?: number): boolean;
        equals(otherLatLng: LatLngTuple, maxMargin?: number): boolean;
        toString(): string;
        distanceTo(otherLatLng: LatLng): number;
        distanceTo(otherLatLng: LatLngLiteral): number;
        distanceTo(otherLatLng: LatLngTuple): number;
        wrap(): LatLng;
        toBounds(sizeInMeters: number): LatLngBounds;

        lat: number;
        lng: number;
        alt: number;
    }

    export interface LatLngLiteral {
        lat: number;
        lng: number;
    }

    export type LatLngTuple = [number, number];

    type LatLngExpression = LatLng | LatLngLiteral | LatLngTuple;

    export function latLng(latitude: number, longitude: number, altitude?: number): LatLng;

    export function latLng(coords: LatLngTuple): LatLng;

    export function latLng(coords: [number, number, number]): LatLng;

    export function latLng(coords: LatLngLiteral): LatLng;

    export function latLng(coords: {lat: number, lng: number, alt: number}): LatLng;

    export interface LatLngBounds {
        extend(latlng: LatLng): this;
        extend(latlng: LatLngLiteral): this;
        extend(latlng: LatLngTuple): this;
        extend(otherBounds: LatLngBounds): this;
        extend(otherBounds: LatLngBoundsLiteral): this;
        pad(bufferRatio: number): LatLngBounds; // does this modify the current instance or does it return a new one?
        getCenter(): LatLng;
        getSouthWest(): LatLng;
        getNorthEast(): LatLng;
        getNorthWest(): LatLng;
        getSouthEast(): LatLng;
        getWest(): number;
        getSouth(): number;
        getEast(): number;
        getNorth(): number;
        contains(otherBounds: LatLngBounds): boolean;
        contains(otherBounds: LatLngBoundsLiteral): boolean;
        contains(latlng: LatLng): boolean;
        contains(latlng: LatLngLiteral): boolean;
        contains(latlng: LatLngTuple): boolean;
        intersects(otherBounds: LatLngBounds): boolean;
        intersects(otherBounds: LatLngLiteral): boolean;
        overlaps(otherBounds: Bounds): boolean; // investigate if this is really bounds and not latlngbounds
        overlaps(otherBounds: BoundsLiteral): boolean;
        toBBoxString(): string;
        equals(otherBounds: LatLngBounds): boolean;
        equals(otherBounds: LatLngBoundsLiteral): boolean;
        isValid(): boolean;
    }

    export type LatLngBoundsLiteral = Array<LatLngTuple>;

    type LatLngBoundsExpression = LatLngBounds | LatLngBoundsLiteral;

    export function latLngBounds(southWest: LatLng, northEast: LatLng): LatLngBounds;

    export function latLngBounds(southWest: LatLngLiteral, northEast: LatLngLiteral): LatLngBounds;

    export function latLngBounds(southWest: LatLngTuple, northEast: LatLngTuple): LatLngBounds;

    export function latLngBounds(latlngs: LatLngBoundsLiteral): LatLngBounds;

    export type PointTuple = [number, number];

    export interface Point {
        clone(): Point;
        add(otherPoint: Point): Point; // investigate if this mutates or returns a new instance
        add(otherPoint: PointTuple): Point;
        subtract(otherPoint: Point): Point;
        subtract(otherPoint: PointTuple): Point;
        divideBy(num: number): Point;
        multiplyBy(num: number): Point;
        scaleBy(scale: Point): Point;
        scaleBy(scale: PointTuple): Point;
        unscaleBy(scale: Point): Point;
        unscaleBy(scale: PointTuple): Point;
        round(): Point;
        floor(): Point;
        ceil(): Point;
        distanceTo(otherPoint: Point): Point;
        distanceTo(otherPoint: PointTuple): Point;
        equals(otherPoint: Point): boolean;
        equals(otherPoint: PointTuple): boolean;
        contains(otherPoint: Point): boolean;
        contains(otherPoint: PointTuple): boolean;
        toString(): string;
    }

    type PointExpression = Point | PointTuple;

    export function point(x: number, y: number, round?: boolean): Point;

    export function point(coords: PointTuple): Point;

    export function point(coords: {x: number, y: number}): Point;

    export type BoundsLiteral = Array<PointTuple>;

    export interface Bounds {
        extend(point: Point): this;
        extend(point: PointTuple): this;
        getCenter(round?: boolean): Point;
        getBottomLeft(): Point;
        getTopRight(): Point;
        getSize(): Point;
        contains(otherBounds: Bounds): boolean;
        contains(otherBounds: BoundsLiteral): boolean;
        contains(point: Point): boolean;
        contains(point: PointTuple): boolean;
        intersects(otherBounds: Bounds): boolean;
        intersects(otherBounds: BoundsLiteral): boolean;
        overlaps(otherBounds: Bounds): boolean;
        overlaps(otherBounds: BoundsLiteral): boolean;

        min: Point;
        max: Point;
    }

    type BoundsExpression = Bounds | BoundsLiteral;

    export function bounds(topLeft: Point, bottomRight: Point): Bounds;

    export function bounds(topLeft: PointTuple, bottomRight: PointTuple): Bounds;

    export function bounds(points: Array<Point>): Bounds;

    export function bounds(points: BoundsLiteral): Bounds;

    export type EventHandlerFn = (event: Event) => void;

    export type EventHandlerFnMap = {[type: string]: EventHandlerFn};

    /**
     * A set of methods shared between event-powered classes (like Map and Marker).
     * Generally, events allow you to execute some function when something happens
     * with an object (e.g. the user clicks on the map, causing the map to fire
     * 'click' event).
     */
    export interface Evented {
        /**
         * Adds a listener function (fn) to a particular event type of the object.
         * You can optionally specify the context of the listener (object the this
         * keyword will point to). You can also pass several space-separated types
         * (e.g. 'click dblclick').
         */
        on(type: string, fn: EventHandlerFn, context?: Object): this;

        /**
         * Adds a set of type/listener pairs, e.g. {click: onClick, mousemove: onMouseMove}
         */
        on(eventMap: EventHandlerFnMap): this;

        /**
         * Removes a previously added listener function. If no function is specified,
         * it will remove all the listeners of that particular event from the object.
         * Note that if you passed a custom context to on, you must pass the same context
         * to off in order to remove the listener.
         */
        off(type: string, fn?: EventHandlerFn, context?: Object): this;

        /**
         * Removes a set of type/listener pairs.
         */
        off(eventMap: EventHandlerFnMap): this;

        /**
         * Removes all listeners to all events on the object.
         */
        off(): this;

        /**
         * Fires an event of the specified type. You can optionally provide a data
         * object — the first argument of the listener function will contain its properties.
         * The event might can optionally be propagated to event parents.
         */
        fire(type: string, data?: Object, propagate?: boolean): this;

        /**
         * Returns true if a particular event type has any listeners attached to it.
         */
        listens(type: string): boolean;

        /**
         * Behaves as on(...), except the listener will only get fired once and then removed.
         */
        once(type: string, fn: EventHandlerFn, context?: Object): this;

        /**
         * Behaves as on(...), except the listener will only get fired once and then removed.
         */
        once(eventMap: EventHandlerFnMap): this;

        /**
         * Adds an event parent - an Evented that will receive propagated events
         */
        addEventParent(obj: Evented): this;

        /**
         * Removes an event parent, so it will stop receiving propagated events
         */
        removeEventParent(obj: Evented): this;

        /**
         * Alias for on(...)
         *
         * Adds a listener function (fn) to a particular event type of the object.
         * You can optionally specify the context of the listener (object the this
         * keyword will point to). You can also pass several space-separated types
         * (e.g. 'click dblclick').
         */
        addEventListener(type: string, fn: EventHandlerFn, context?: Object): this;

        /**
         * Alias for on(...)
         *
         * Adds a set of type/listener pairs, e.g. {click: onClick, mousemove: onMouseMove}
         */
        addEventListener(eventMap: EventHandlerFnMap): this;

        /**
         * Alias for off(...)
         *
         * Removes a previously added listener function. If no function is specified,
         * it will remove all the listeners of that particular event from the object.
         * Note that if you passed a custom context to on, you must pass the same context
         * to off in order to remove the listener.
         */
        removeEventListener(type: string, fn: EventHandlerFn, context?: Object): this;

        /**
         * Alias for off(...)
         *
         * Removes a set of type/listener pairs.
         */
        removeEventListener(eventMap: EventHandlerFnMap): this;

        /**
         * Alias for off()
         *
         * Removes all listeners to all events on the object.
         */
        clearAllEventListeners(): this;

        /**
         * Alias for once(...)
         *
         * Behaves as on(...), except the listener will only get fired once and then removed.
         */
        addOneTimeEventListener(type: string, fn: EventHandlerFn, context?: Object): this;

        /**
         * Alias for once(...)
         *
         * Behaves as on(...), except the listener will only get fired once and then removed.
         */
        addOneTimeEventListener(eventMap: EventHandlerFnMap): this;

        /**
         * Alias for fire(...)
         *
         * Fires an event of the specified type. You can optionally provide a data
         * object — the first argument of the listener function will contain its properties.
         * The event might can optionally be propagated to event parents.
         */
        fireEvent(type: string, data?: Object, propagate?: boolean): this;

        /**
         * Alias for listens(...)
         *
         * Returns true if a particular event type has any listeners attached to it.
         */
        hasEventListeners(type: string): boolean;
    }

    interface LayerOptions {
        pane?: string;
    }

    interface InteractiveLayerOptions extends LayerOptions {
        interactive?: boolean;
    }

    export interface Layer extends Evented {
        addTo(map: Map): this;
        remove(): this;
        removeFrom(map: Map): this;
        getPane(name?: string): HTMLElement;

        // Popup methods
        bindPopup(content: string, options?: PopupOptions): this;
        bindPopup(content: HTMLElement, options?: PopupOptions): this;
        bindPopup(content: (layer: Layer) => Content, options?: PopupOptions): this;
        bindPopup(content: Popup): this;
        unbindPopup(): this;
        openPopup(): this;
        openPopup(latlng: LatLng): this;
        openPopup(latlng: LatLngLiteral): this;
        openPopup(latlng: LatLngTuple): this;
        closePopup(): this;
        togglePopup(): this;
        isPopupOpen(): boolean;
        setPopupContent(content: string): this;
        setPopupContent(content: HTMLElement): this;
        setPopupContent(content: Popup): this;
        getPopup(): Popup;

        // Tooltip methods
        bindTooltip(content: string, options?: TooltipOptions): this;
        bindTooltip(content: HTMLElement, options?: TooltipOptions): this;
        bindTooltip(content: (layer: Layer) => Content, options?: TooltipOptions): this;
        bindTooltip(content: Tooltip, options?: TooltipOptions): this;
        unbindTooltip(): this;
        openTooltip(): this;
        openTooltip(latlng: LatLng): this;
        openTooltip(latlng: LatLngLiteral): this;
        openTooltip(latlng: LatLngTuple): this;
        closeTooltip(): this;
        toggleTooltip(): this;
        isTooltipOpen(): boolean;
        setTooltipContent(content: string): this;
        setTooltipContent(content: HTMLElement): this;
        setTooltipContent(content: Tooltip): this;
        getTooltip(): Tooltip;

        // Extension methods
        onAdd(map: Map): this;
        onRemove(map: Map): this;
        getEvents(): {[name: string]: (event: Event) => void};
        getAttribution(): string;
        beforeAdd(map: Map): this;
    }

    export interface GridLayerOptions {
        tileSize?: number | Point;
        opacity?: number;
        updateWhenIdle?: boolean;
        updateWhenZooming?: boolean;
        updateInterval?: number;
        attribution?: string;
        zIndex?: number;
        bounds?: LatLngBoundsExpression;
        minZoom?: number;
        maxZoom?: number;
        noWrap?: boolean;
        pane?: string;
        className?: string;
        keepBuffer?: number;
    }

    export interface GridLayer extends Layer {
        bringToFront(): this;
        bringToBack(): this;
        getAttribution(): string;
        getContainer(): HTMLElement;
        setOpacity(opacity: number): this;
        setZIndex(zIndex: number): this;
        isLoading(): boolean;
        redraw(): this;
        getTileSize(): Point;
    }

    export function gridLayer(options?: GridLayerOptions): GridLayer;

    export interface TileLayerOptions extends GridLayerOptions {
        minZoom?: number;
        maxZoom?: number;
        maxNativeZoom?: number;
        subdomains?: string | Array<string>;
        errorTileUrl?: string;
        zoomOffset?: number;
        tms?: boolean;
        zoomReverse?: boolean;
        detectRetina?: boolean;
        crossOrigin?: boolean;
        [name: string]: any;
    }

    export interface TileLayer extends GridLayer {
        setUrl(url: string, noRedraw?: boolean): this;
    }

    export function tileLayer(urlTemplate: string, options?: TileLayerOptions): TileLayer;

    export interface WMSOptions extends TileLayerOptions {
        layers: string;
        styles?: string;
        format?: string;
        transparent?: boolean;
        version?: string;
        crs?: CRS;
        uppercase?: boolean;
    }

    export interface WMS extends TileLayer {
        setParams(params: Object, noRedraw?: boolean): this;
    }

    export namespace tileLayer {
        export function wms(baseUrl: string, options: WMSOptions): WMS;
    }

    export interface ImageOverlayOptions extends LayerOptions {
        opacity?: number;
        alt?: string;
        interactive?: boolean;
        attribution?: string;
        crossOrigin?: boolean;
    }

    export interface ImageOverlay extends Layer {
        setOpacity(opacity: number): this;
        bringToFront(): this;
        bringToBack(): this;
        setUrl(url: string): this;
    }

    export function imageOverlay(imageUrl: string, bounds: LatLngBoundsExpression, options?: ImageOverlayOptions): ImageOverlay;

    export type LineCapShape = 'butt' | 'round' | 'square' | 'inherit';

    export type LineJoinShape = 'miter' | 'round' | 'bevel' | 'inherit';

    export type FillRule = 'nonzero' | 'evenodd' | 'inherit';

    export interface PathOptions extends InteractiveLayerOptions {
        stroke?: boolean;
        color?: string;
        weight?: number;
        opacity?: number;
        lineCap?: LineCapShape;
        lineJoin?: LineJoinShape;
        dashArray?: string;
        dashOffset?: string;
        fill?: boolean;
        fillColor?: string;
        fillOpacity?: number;
        fillRule?: FillRule;
        renderer?: Renderer;
        className?: string;
    }

    export interface Path extends Layer {
        redraw(): this;
        setStyle(style: PathOptions): this;
        bringToFront(): this;
        bringToBack(): this;
    }

    export interface PolylineOptions extends PathOptions {
        smoothFactor?: number;
        noClip?: boolean;
    }

    interface InternalPolyline extends Path {
        getLatLngs(): Array<LatLng>;
        setLatLngs(latlngs: Array<LatLng>): this;
        setLatLngs(latlngs: Array<LatLngLiteral>): this;
        setLatLngs(latlngs: Array<LatLngTuple>): this;
        isEmpty(): boolean;
        getCenter(): LatLng;
        getBounds(): LatLngBounds;
        addLatLng(latlng: LatLng): this;
        addLatLng(latlng: LatLngLiteral): this;
        addLatLng(latlng: LatLngTuple): this;
        addLatLng(latlng: Array<LatLng>): this; // these three overloads aren't explicitly noted in the docs
        addLatLng(latlng: Array<LatLngLiteral>): this;
        addLatLng(latlng: Array<LatLngTuple>): this;
    }

    export interface Polyline extends InternalPolyline {
        toGeoJSON(): GeoJSON.LineString | GeoJSON.MultiLineString;
    }

    export function polyline(latlngs: Array<LatLng>, options?: PolylineOptions): Polyline;

    export function polyline(latlngs: Array<LatLngLiteral>, options?: PolylineOptions): Polyline;

    export function polyline(latlngs: Array<LatLngTuple>, options?: PolylineOptions): Polyline;

    export function polyline(latlngs: Array<Array<LatLng>>, options?: PolylineOptions): Polyline;

    export function polyline(latlngs: Array<Array<LatLngLiteral>>, options?: PolylineOptions): Polyline;

    export function polyline(latlngs: Array<Array<LatLngTuple>>, options?: PolylineOptions): Polyline;

    export interface Polygon extends InternalPolyline {
        toGeoJSON(): GeoJSON.Polygon | GeoJSON.MultiPolygon;
    }

    export function polygon(latlngs: Array<LatLng>, options?: PolylineOptions): Polygon;

    export function polygon(latlngs: Array<LatLngLiteral>, options?: PolylineOptions): Polygon;

    export function polygon(latlngs: Array<LatLngTuple>, options?: PolylineOptions): Polygon;

    export function polygon(latlngs: Array<Array<LatLng>>, options?: PolylineOptions): Polygon;

    export function polygon(latlngs: Array<Array<LatLngLiteral>>, options?: PolylineOptions): Polygon;

    export function polygon(latlngs: Array<Array<LatLngTuple>>, options?: PolylineOptions): Polygon;

    export interface Rectangle extends Polygon {
        setBounds(latLngBounds: LatLngBounds): this;
        setBounds(latLngBounds: LatLngBoundsLiteral): this;
    }

    export function rectangle(latLngBounds: LatLngBounds, options?: PolylineOptions): Rectangle;

    export function rectangle(latLngBounds: LatLngBoundsLiteral, options?: PolylineOptions): Rectangle;

    export interface CircleMarkerOptions extends PathOptions {
        radius?: number;
    }

    export interface CircleMarker extends Path {
        toGeoJSON(): GeoJSON.Point;
        setLatLng(latLng: LatLng): this;
        setLatLng(latLng: LatLngLiteral): this;
        setLatLng(latLng: LatLngTuple): this;
        getLatLng(): LatLng;
        setRadius(radius: number): this;
        getRadius(): number;
    }

    export function circleMarker(latlng: LatLng, options?: CircleMarkerOptions): CircleMarker;

    export function circleMarker(latlng: LatLngLiteral, options?: CircleMarkerOptions): CircleMarker;

    export function circleMarker(latlng: LatLngLiteral, options?: CircleMarkerOptions): CircleMarker;

    export interface CircleOptions extends PathOptions {
        radius?: number;
    }

    export interface Circle extends CircleMarker {
        setRadius(radius: number): this;
        getRadius(): number;
        getBounds(): LatLngBounds;
    }

    export function circle(latlng: LatLng, options?: CircleOptions): Circle;

    export function circle(latlng: LatLngLiteral, options?: CircleOptions): Circle;

    export function circle(latlng: LatLngTuple, options?: CircleOptions): Circle;

    export function circle(latlng: LatLng, radius: number, options?: CircleOptions): Circle;

    export function circle(latlng: LatLngLiteral, radius: number, options?: CircleOptions): Circle;

    export function circle(latlng: LatLngTuple, radius: number, options?: CircleOptions): Circle;

    export interface RendererOptions extends LayerOptions {
        padding?: number;
    }

    export interface Renderer extends Layer {}

    export interface SVG extends Renderer {}

    export namespace SVG {
        export function create(name: string): SVGElement;

        export function pointsToPath(rings: Array<Point>, close: boolean): string;

        export function pointsToPath(rings: Array<PointTuple>, close: boolean): string;
    }

    export function svg(options?: RendererOptions): SVG;

    export interface Canvas extends Renderer {}

    export function canvas(options?: RendererOptions): Canvas;

    /**
     * Used to group several layers and handle them as one.
     * If you add it to the map, any layers added or removed from the group will be
     * added/removed on the map as well. Extends Layer.
     */
    export interface LayerGroup extends Layer {
        /**
         * Returns a GeoJSON representation of the layer group (as a GeoJSON GeometryCollection).
         */
        toGeoJSON(): GeoJSON.GeometryCollection;

        /**
         * Adds the given layer to the group.
         */
        addLayer(layer: Layer): this;

        /**
         * Removes the given layer from the group.
         */
        removeLayer(layer: Layer): this;

        /**
         * Removes the layer with the given internal ID from the group.
         */
        removeLayer(id: number): this;

        /**
         * Returns true if the given layer is currently added to the group.
         */
        hasLayer(layer: Layer): boolean;

        /**
         * Removes all the layers from the group.
         */
        clearLayers(): this;

        /**
         * Calls methodName on every layer contained in this group, passing any additional parameters.
         * Has no effect if the layers contained do not implement methodName.
         */
        invoke(methodName: string, ...params: Array<any>): this;

        /**
         * Iterates over the layers of the group,
         * optionally specifying context of the iterator function.
         */
        eachLayer(fn: (layer: Layer) => void, context?: Object): this;

        /**
         * Returns the layer with the given internal ID.
         */
        getLayer(id: number): Layer;

        /**
         * Returns an array of all the layers added to the group.
         */
        getLayers(): Array<Layer>;

        /**
         * Calls setZIndex on every layer contained in this group, passing the z-index.
         */
        setZIndex(zIndex: number): this;

        /**
         * Returns the internal ID for a layer
         */
        getLayerId(layer: Layer): number;
    }

    /**
     * Create a layer group, optionally given an initial set of layers.
     */
    export function layerGroup(layers: Array<Layer>): LayerGroup;

    /**
     * Extended LayerGroup that also has mouse events (propagated from
     * members of the group) and a shared bindPopup method.
     */
    export interface FeatureGroup extends LayerGroup {
        /**
         * Sets the given path options to each layer of the group that has a setStyle method.
         */
        setStyle(style: PathOptions): this;

        /**
         * Brings the layer group to the top of all other layers
         */
        bringToFront(): this;

        /**
         * Brings the layer group to the top [sic] of all other layers
         */
        bringToBack(): this;

        /**
         * Returns the LatLngBounds of the Feature Group (created from
         * bounds and coordinates of its children).
         */
        getBounds(): LatLngBounds;
    }

    /**
     * Create a feature group, optionally given an initial set of layers.
     */
    export function featureGroup(layers?: Array<Layer>): FeatureGroup;

    type StyleFunction = (feature: GeoJSON.Feature<GeoJSON.GeometryObject>) => PathOptions;

    export interface GeoJSONOptions extends LayerOptions {
        /**
         * A Function defining how GeoJSON points spawn Leaflet layers.
         * It is internally called when data is added, passing the GeoJSON point
         * feature and its LatLng.
         *
         * The default is to spawn a default Marker:
         *
         * ```
         * function(geoJsonPoint, latlng) {
         *     return L.marker(latlng);
         * }
         * ```
         */
        pointToLayer?: (geoJsonPoint: GeoJSON.Point, latlng: LatLng) => Layer; // should import GeoJSON typings

        /**
         * A Function defining the Path options for styling GeoJSON lines and polygons,
         * called internally when data is added.
         *
         * The default value is to not override any defaults:
         *
         * ```
         * function (geoJsonFeature) {
         *     return {}
         * }
         * ```
         */
        style?: StyleFunction;

        /**
         * A Function that will be called once for each created Feature, after it
         * has been created and styled. Useful for attaching events and popups to features.
         *
         * The default is to do nothing with the newly created layers:
         *
         * ```
         * function (feature, layer) {}
         * ```
         */
        onEachFeature?: (feature: GeoJSON.Feature<GeoJSON.GeometryObject>, layer: Layer) => void;

        /**
         * A Function that will be used to decide whether to show a feature or not.
         *
         * The default is to show all features:
         *
         * ```
         * function (geoJsonFeature) {
         *     return true;
         * }
         * ```
         */
        filter?: (geoJsonFeature: GeoJSON.Feature<GeoJSON.GeometryObject>) => boolean;

        /**
         * A Function that will be used for converting GeoJSON coordinates to LatLngs.
         * The default is the coordsToLatLng static method.
         */
        coordsToLatLng?: (coords: [number, number] | [number, number, number]) => LatLng; // check if LatLng has an altitude property
    }

    /**
     * Represents a GeoJSON object or an array of GeoJSON objects.
     * Allows you to parse GeoJSON data and display it on the map. Extends FeatureGroup.
     */
    export interface GeoJSON extends FeatureGroup {
        /**
         * Adds a GeoJSON object to the layer.
         */
        addData(data: GeoJSON.GeoJsonObject): Layer;

        /**
         * Resets the given vector layer's style to the original GeoJSON style,
         * useful for resetting style after hover events.
         */
        resetStyle(layer: Layer): Layer;

        /**
         * Changes styles of GeoJSON vector layers with the given style function.
         */
        setStyle(style: StyleFunction): this;

        /**
         * Creates a Layer from a given GeoJSON feature. Can use a custom pointToLayer
         * and/or coordsToLatLng functions if provided as options.
         */
        geometryToLayer(featureData: GeoJSON.Feature<GeoJSON.GeometryObject>, options?: GeoJSONOptions): Layer;

        /**
         * Creates a LatLng object from an array of 2 numbers (longitude, latitude) or
         * 3 numbers (longitude, latitude, altitude) used in GeoJSON for points.
         */
        coordsToLatLng(coords: [number, number]): LatLng;

        coordsToLatLng(coords: [number, number, number]): LatLng;

        /**
         * Creates a multidimensional array of LatLngs from a GeoJSON coordinates array.
         * levelsDeep specifies the nesting level (0 is for an array of points, 1 for an array of
         * arrays of points, etc., 0 by default).
         * Can use a custom coordsToLatLng function.
         */
        coordsToLatLngs(coords: Array<number>, levelsDeep?: number, coordsToLatLng?: (coords: [number, number] | [number, number, number]) => LatLng): LatLng[]; // Not entirely sure how to define arbitrarily nested arrays

        /**
         * Reverse of coordsToLatLng
         */
        latLngToCoords(latlng: LatLng): [number, number] | [number, number, number];

        /**
         * Reverse of coordsToLatLngs closed determines whether the first point should be
         * appended to the end of the array to close the feature, only used when levelsDeep is 0.
         * False by default.
         */
        latLngsToCoords(latlngs: Array<LatLng>, levelsDeep?: number, closed?: boolean): [number, number] | [number, number, number];

        /**
         * Normalize GeoJSON geometries/features into GeoJSON features.
         */
        asFeature(geojson: GeoJSON.GeometryObject): GeoJSON.Feature<GeoJSON.GeometryObject>;

        asFeature(geojson: GeoJSON.Feature<GeoJSON.GeometryObject>): GeoJSON.Feature<GeoJSON.GeometryObject>;
    }

    /**
     * Creates a GeoJSON layer.
     *
     * Optionally accepts an object in GeoJSON format to display on the
     * map (you can alternatively add it later with addData method) and
     * an options object.
     */
    export function geoJSON(geojson?: GeoJSON.GeoJsonObject, options?: GeoJSONOptions): GeoJSON;

    type Zoom = boolean | 'center';

    export interface MapOptions {
        preferCanvas?: boolean;

        // Control options
        attributionControl?: boolean;
        zoomControl?: boolean;

        // Interaction options
        closePopupOnClick?: boolean;
        zoomSnap?: number;
        zoomDelta?: number;
        trackResize?: boolean;
        boxZoom?: boolean;
        doubleClickZoom?: Zoom;
        dragging?: boolean;

        // Map state options
        crs?: CRS;
        center?: LatLngExpression;
        zoom?: number;
        minZoom?: number;
        maxZoom?: number;
        layers?: Array<Layer>;
        maxBounds?: LatLngBoundsExpression;
        renderer?: Renderer;

        // Animation options
        fadeAnimation?: boolean;
        markerZoomAnimation?: boolean;
        transform3DLimit?: number;
        zoomAnimation?: boolean;
        zoomAnimationThreshold?: number;

        // Panning inertia options
        inertia?: boolean;
        inertiaDeceleration?: number;
        inertiaMaxSpeed?: number;
        easeLinearity?: number;
        worldCopyJump?: boolean;
        maxBoundsViscosity?: number;

        // Keyboard navigation options
        keyboard?: boolean;
        keyboardPanDelta?: number;

        // Mousewheel options
        scrollWheelZoom?: Zoom;
        wheelDebounceTime?: number;
        wheelPxPerZoomLevel?: number;

        // Touch interaction options
        tap?: boolean;
        tapTolerance?: number;
        touchZoom?: Zoom;
        bounceAtZoomLimits?: boolean;
    }

    export type ControlPosition = 'topleft' | 'topright' | 'bottomleft' | 'bottomright';

    export interface ControlOptions {
        position?: ControlPosition;
    }

    export interface Control {
        getPosition(): ControlPosition;
        setPosition(position: ControlPosition): this;
        getContainer(): HTMLElement;
        addTo(map: Map): this;
        remove(): this;

        // Extension methods
        onAdd(map: Map): HTMLElement;
        onRemove(map: Map): void;
    }

    export namespace Control {
        export interface ZoomOptions extends ControlOptions {
            zoomInText?: string;
            zoomInTitle?: string;
            zoomOutText?: string;
            zoomOutTitle?: string;
        }

        export interface Zoom extends Control {}

        export interface AttributionOptions extends ControlOptions {
            prefix?: string | boolean;
        }

        export interface Attribution extends Control {
            setPrefix(prefix: string): this;
            addAttribution(text: string): this;
            removeAttribution(text: string): this;
        }

        export interface LayersOptions extends ControlOptions {
            collapsed?: boolean;
            autoZIndex?: boolean;
            hideSingleBase?: boolean;
        }

        export interface Layers extends Control {
            addBaseLayer(layer: Layer, name: string): this;
            addOverlay(layer: Layer, name: string): this;
            removeLayer(layer: Layer): this;
            expand(): this;
            collapse(): this;
        }

        export interface ScaleOptions extends ControlOptions {
            maxWidth?: number;
            metric?: boolean;
            imperial?: boolean;
            updateWhenIdle?: boolean;
        }

        export interface Scale extends Control {}
    }

    export namespace control {
        export function zoom(options: Control.ZoomOptions): Control.Zoom;

        export function attribution(options: Control.AttributionOptions): Control.Attribution;

        type LayersObject = {[name: string]: Layer};

        export function layers(baseLayers?: LayersObject, overlays?: LayersObject, options?: Control.LayersOptions): Control.Layers;

        export function scale(options?: Control.ScaleOptions): Control.Scale;
    }

    interface DivOverlayOptions {
        offset?: PointExpression;
        zoomAnimation?: boolean;
        className?: string;
        pane?: string;
    }

    export interface PopupOptions extends DivOverlayOptions {
        maxWidth?: number;
        minWidth?: number;
        maxHeight?: number;
        autoPan?: boolean;
        autoPanPaddingTopLeft?: PointExpression;
        autoPanPaddingBottomRight?: PointExpression;
        autoPanPadding?: PointExpression;
        keepInView?: boolean;
        closeButton?: boolean;
        autoClose?: boolean;
    }

    type Content = string | HTMLElement;

    export interface Popup extends Layer {
        getLatLng(): LatLng;
        setLatLng(latlng: LatLngExpression): this;
        getContent(): Content;
        setContent(htmlContent: string): this;
        setContent(htmlContent: HTMLElement): this;
        setContent(htmlContent: (source: Layer) => Content): this;
        getElement(): Content;
        update(): void;
        isOpen(): boolean;
        bringToFront(): this;
        bringToBack(): this;
        openOn(map: Map): this;
    }

    export function popup(options?: PopupOptions, source?: Layer): Popup;

    export type Direction = 'right' | 'left' | 'top' | 'bottom' | 'center' | 'auto';

    export interface TooltipOptions extends DivOverlayOptions {
        pane?: string;
        offset?: PointExpression;
        direction?: Direction;
        permanent?: boolean;
        sticky?: boolean;
        interactive?: boolean;
        opacity?: number;
    }

    export interface Tooltip extends Layer {}

    export function tooltip(options?: TooltipOptions, source?: Layer): Tooltip;

    export interface ZoomOptions {
        animate?: boolean;
    }

    export interface PanOptions {
        animate?: boolean;
        duration?: number;
        easeLinearity?: number;
        noMoveStart?: boolean;
    }

    export interface ZoomPanOptions extends ZoomOptions, PanOptions {}

    export interface FitBoundsOptions extends ZoomOptions, PanOptions {
        paddingTopLeft?: PointExpression;
        paddingBottomRight?: PointExpression;
        padding?: PointExpression;
        maxZoom?: number;
    }

    export interface LocateOptions {
        watch?: boolean;
        setView?: boolean;
        maxZoom?: number;
        timeout?: number;
        maximumAge?: number;
        enableHighAccuracy?: boolean;
    }

    export interface Handler {
        enable(): this;
        disable(): this;
        enabled(): boolean;

        // Extension methods
        addHooks(): void;
        removeHooks(): void;
    }

    export interface Event {
        type: string;
        target: any; // should this be Object and have users cast?
    }

    export interface MouseEvent extends Event {
        latlng: LatLng;
        layerPoint: Point;
        containerPoint: Point;
        originalEvent: MouseEvent; // how can I reference the global MouseEvent?
    }

    export interface LocationEvent extends Event {
        latlng: LatLng;
        bounds: LatLngBounds;
        accuracy: number;
        altitude: number;
        altitudeAccuracy: number;
        heading: number;
        speed: number;
        timestamp: number;
    }

    export interface ErrorEvent extends Event {
        message: string;
        code: number;
    }

    export interface LayerEvent extends Event {
        layer: Layer;
    }

    export interface LayersControlEvent extends LayerEvent {
        name: string;
    }

    export interface TileEvent extends Event {
        tile: HTMLImageElement;
        coords: Point; // apparently not a normal point, since docs say it has z (zoom)
    }

    export interface TileErrorEvent extends TileEvent {
        error: Error;
    }

    export interface ResizeEvent extends Event {
        oldSize: Point;
        newSize: Point;
    }

    export interface GeoJSONEvent extends Event {
        layer: Layer;
        properties: any; // any or Object?
        geometryType: string;
        id: string;
    }

    export interface PopupEvent extends Event {
        popup: Popup;
    }

    export interface TooltipEvent extends Event {
        tooltip: Tooltip;
    }

    export interface DragEndEvent extends Event {
        distance: number;
    }

    interface DefaultMapPanes {
        mapPane: HTMLElement;
        tilePane: HTMLElement;
        overlayPane: HTMLElement;
        shadowPane: HTMLElement;
        markerPane: HTMLElement;
        tooltipPane: HTMLElement;
        popupPane: HTMLElement;
    }

    export interface Map extends Evented {
        getRenderer(layer: Path): Renderer;

        // Methods for layers and controls
        addControl(control: Control): this;
        removeControl(control: Control): this;
        addLayer(layer: Layer): this;
        removeLayer(layer: Layer): this;
        hasLayer(layer: Layer): boolean;
        eachLayer(fn: (layer: Layer) => void, context?: Object): this;
        openPopup(popup: Popup): this;
        openPopup(content: string, latlng: LatLng, options?: PopupOptions): this;
        openPopup(content: string, latlng: LatLngLiteral, options?: PopupOptions): this;
        openPopup(content: string, latlng: LatLngTuple, options?: PopupOptions): this;
        openPopup(content: HTMLElement, latlng: LatLng, options?: PopupOptions): this;
        openPopup(content: HTMLElement, latlng: LatLngLiteral, options?: PopupOptions): this;
        openPopup(content: HTMLElement, latlng: LatLngTuple, options?: PopupOptions): this;
        closePopup(popup?: Popup): this;
        openTooltip(tooltip: Tooltip): this;
        openTooltip(content: string, latlng: LatLng, options?: TooltipOptions): this;
        openTooltip(content: string, latlng: LatLngLiteral, options?: TooltipOptions): this;
        openTooltip(content: string, latlng: LatLngTuple, options?: TooltipOptions): this;
        openTooltip(content: HTMLElement, latlng: LatLng, options?: TooltipOptions): this;
        openTooltip(content: HTMLElement, latlng: LatLngLiteral, options?: TooltipOptions): this;
        openTooltip(content: HTMLElement, latlng: LatLngTuple, options?: TooltipOptions): this;
        closeTooltip(tooltip?: Tooltip): this;

        // Methods for modifying map state
        setView(center: LatLng, zoom: number, options?: ZoomPanOptions): this;
        setView(center: LatLngLiteral, zoom: number, options?: ZoomPanOptions): this;
        setView(center: LatLngTuple, zoom: number, options?: ZoomPanOptions): this;
        setZoom(zoom: number, options: ZoomPanOptions): this;
        zoomIn(delta?: number, options?: ZoomOptions): this;
        zoomOut(delta?: number, options?: ZoomOptions): this;
        setZoomAround(latlng: LatLng, zoom: number, options: ZoomOptions): this;
        setZoomAround(latlng: LatLngLiteral, zoom: number, options: ZoomOptions): this;
        setZoomAround(latlng: LatLngTuple, zoom: number, options: ZoomOptions): this; // will the latlng version using tuple take precedence or will the point tuple version?
        setZoomAround(offset: Point, zoom: number, options: ZoomOptions): this;
        fitBounds(bounds: LatLngBounds, options: FitBoundsOptions): this;
        fitBounds(bounds: LatLngBoundsLiteral, options: FitBoundsOptions): this;
        fitWorld(options?: FitBoundsOptions): this;
        panTo(latlng: LatLng, options?: PanOptions): this;
        panTo(latlng: LatLngLiteral, options?: PanOptions): this;
        panTo(latlng: LatLngTuple, options?: PanOptions): this;
        panBy(offset: Point): this;
        panBy(offset: PointTuple): this;
        setMaxBounds(bounds: LatLngBounds): this;
        setMaxBounds(bounds: LatLngBoundsLiteral): this;
        setMinZoom(zoom: number): this;
        setMaxZoom(zoom: number): this;
        panInsideBounds(bounds: LatLngBounds, options?: PanOptions): this;
        panInsideBounds(bounds: LatLngBoundsLiteral, options?: PanOptions): this;
        invalidateSize(options: ZoomPanOptions): this;
        invalidateSize(animate: boolean): this;
        stop(): this;
        flyTo(latlng: LatLng, zoom?: number, options?: ZoomPanOptions): this;
        flyTo(latlng: LatLngLiteral, zoom?: number, options?: ZoomPanOptions): this;
        flyTo(latlng: LatLngTuple, zoom?: number, options?: ZoomPanOptions): this;
        flyToBounds(bounds: LatLngBounds, options?: FitBoundsOptions): this;
        flyToBounds(bounds: LatLngBoundsLiteral, options?: FitBoundsOptions): this;

        // Other methods
        addHandler(name: string, HandlerClass: () => Handler): this; // HandlerClass is actually a constructor function, is this the right way?
        remove(): this;
        createPane(name: string, container?: HTMLElement): HTMLElement;
        getPane(pane: string): HTMLElement;
        getPane(pane: HTMLElement): HTMLElement;
        getPanes(): {[name: string]: HTMLElement} & DefaultMapPanes;
        getContainer(): HTMLElement;
        whenReady(fn: () => void, context?: Object): this;

        // Methods for getting map state
        getCenter(): LatLng;
        getZoom(): number;
        getBounds(): LatLngBounds;
        getMinZoom(): number;
        getMaxZoom(): number;
        getBoundsZoom(bounds: LatLngBounds, inside?: boolean): number;
        getBoundsZoom(bounds: LatLngBoundsLiteral, inside?: boolean): number;
        getSize(): Point;
        getPixelBounds(): Bounds;
        getPixelOrigin(): Point;
        getPixelWorldBounds(zoom?: number): Bounds;

        // Conversion methods
        getZoomScale(toZoom: number, fromZoom: number): number;
        getScaleZoom(scale: number, fromZoom: number): number;
        project(latlng: LatLng, zoom: number): Point;
        project(latlng: LatLngLiteral, zoom: number): Point;
        project(latlng: LatLngTuple, zoom: number): Point;
        unproject(point: Point, zoom: number): LatLng;
        unproject(point: PointTuple, zoom: number): LatLng;
        layerPointToLatLng(point: Point): LatLng;
        layerPointToLatLng(point: PointTuple): LatLng;
        latLngToLayerPoint(latlng: LatLng): Point;
        latLngToLayerPoint(latlng: LatLngLiteral): Point;
        latLngToLayerPoint(latlng: LatLngTuple): Point;
        wrapLatLng(latlng: LatLng): LatLng;
        wrapLatLng(latlng: LatLngLiteral): LatLng;
        wrapLatLng(latlng: LatLngTuple): LatLng;
        distance(latlng1: LatLng, latlng2: LatLng): number;
        distance(latlng1: LatLngLiteral, latlng2: LatLngLiteral): number;
        distance(latlng1: LatLngTuple, latlng2: LatLngTuple): number;
        containerPointToLayerPoint(point: Point): Point;
        containerPointToLayerPoint(point: PointTuple): Point;
        layerPointToContainerPoint(point: Point): Point;
        layerPointToContainerPoint(point: PointTuple): Point;
        latLngToContainerPoint(latlng: LatLng): Point;
        latLngToContainerPoint(latlng: LatLngLiteral): Point;
        latLngToContainerPoint(latlng: LatLngTuple): Point;
        mouseEventToContainerPoint(ev: MouseEvent): Point;
        mouseEventToLayerPoint(ev: MouseEvent): Point;
        mouseEventToLatLng(ev: MouseEvent): LatLng;

        // Geolocation methods
        locate(options?: LocateOptions): this;
        stopLocate(): this;

        // Properties
        boxZoom: Handler;
        doubleClickZoom: Handler;
        dragging: Handler;
        keyboard: Handler;
        scrollWheelZoom: Handler;
        tap: Handler;
        touchZoom: Handler;
    }

    export function map(id: string, options?: MapOptions): Map;

    export function map(el: HTMLElement, options?: MapOptions): Map;

    export interface IconOptions extends LayerOptions {
        iconUrl: string;
        iconRetinaUrl?: string;
        iconSize?: PointExpression;
        iconAnchor?: PointExpression;
        popupAnchor?: PointExpression;
        shadowUrl?: string;
        shadowRetinaUrl?: string;
        shadowSize?: PointExpression;
        shadowAnchor?: PointExpression;
        className?: string;
    }

    export interface Icon extends Layer {
        createIcon(oldIcon?: HTMLElement): HTMLElement;
        createShadow(oldIcon?: HTMLElement): HTMLElement;
    }

    export namespace Icon {
        export const Default: Icon;
    }

    export function icon(options: IconOptions): Icon;

    export interface DivIconOptions extends LayerOptions {
        html?: string;
        bgPos?: PointExpression;
        iconSize?: PointExpression;
        iconAnchor?: PointExpression;
        popupAnchor?: PointExpression;
        className?: string;
    }

    export interface DivIcon extends Icon {}

    export function divIcon(options: DivIconOptions): DivIcon;

    export interface MarkerOptions extends InteractiveLayerOptions {
        icon?: Icon;
        draggable?: boolean;
        keyboard?: boolean;
        title?: string;
        alt?: string;
        zIndexOffset?: number;
        opacity?: number;
        riseOnHover?: boolean;
        riseOffset?: number;
    }

    export interface Marker extends Layer {
        getLatLng(): LatLng;
        setLatLng(latlng: LatLng): this;
        setLatLng(latlng: LatLngLiteral): this;
        setLatLng(latlng: LatLngTuple): this;
        setZIndexOffset(offset: number): this;
        setIcon(icon: Icon): this;
        setOpacity(opacity: number): this;

        // Properties
        dragging: Handler;
    }

    export function marker(latlng: LatLng, options?: MarkerOptions): Marker;

    export function marker(latlng: LatLngLiteral, options?: MarkerOptions): Marker;

    export function marker(latlng: LatLngTuple, options?: MarkerOptions): Marker;

    export namespace Browser {
        export const ie: boolean;
        export const ielt9: boolean;
        export const edge: boolean;
        export const webkit: boolean;
        export const gecko: boolean;
        export const android: boolean;
        export const android23: boolean;

        export const chrome: boolean;

        export const safari: boolean;

        export const win: boolean;

        export const ie3d: boolean;

        export const webkit3d: boolean;

        export const gecko3d: boolean;

        export const opera12: boolean;

        export const any3d: boolean;

        export const mobile: boolean;

        export const mobileWebkit: boolean;

        export const mobiWebkit3d: boolean;

        export const mobileOpera: boolean;

        export const mobileGecko: boolean;

        export const touch: boolean;

        export const msPointer: boolean;

        export const pointer: boolean;

        export const retina: boolean;

        export const canvas: boolean;

        export const vml: boolean;

        export const svg: boolean;
    }
}

declare module 'leaflet' {
    export = L;
}


text:
class SensoroBeaconManagerListener
  def initialize(callback)
    @callback = callback
    @cache = {}
  end

  def onNewBeacon(beacon)
    @callback.call :beacon_found, _beacon(beacon)
  end

  def onGoneBeacon(beacon)
    @callback.call :beacon_lost, _beacon(beacon)
  end

  def onUpdateBeacon(beacons)
    # TODO: refresh beacon sensors info
  end

  def _beacon(beacon)
    @cache[beacon.serialNumber] ||= begin
      obj = SensoroBeacon.new
      obj.uuid = beacon.getProximityUUID
      obj.major = beacon.getMajor
      obj.minor = beacon.getMinor
      obj.serial_number = beacon.getSerialNumber
      obj.battery_level = beacon.getBatteryLevel
      obj.firmware_version = beacon.getFirmwareVersion
      obj.temperature = beacon.getTemperature
      obj.light = beacon.getLight
      obj.accelerometer_count = beacon.getAccelerometerCount
      obj.accuracy = beacon.getAccuracy
      obj.rssi = beacon.getRssi
      obj.model_name = beacon.getHardwareModelName
      obj
    end
  end
end

class SensoroBeaconManager
  def self.context=(context)
    @sensoroManager = Com::Sensoro::Cloud::SensoroManager.getInstance(context)
  end

  def self._sensoroManager
    @sensoroManager or raise "Set `#{self}.context = self' in your main activity file."
  end

  def self.enabled?
    _sensoroManager.isBluetoothEnabled
  end

  def self.start_listening(&callback)
    _sensoroManager.setBeaconManagerListener(SensoroBeaconManagerListener.new(callback))
    _sensoroManager.startService
  end

  def self.stop_listening
    _sensoroManager.stopService
  end
end

redpajama_set_name: RedPajamaGithub


text:
"""
This file contains experimental results related to the baseline.

Usage:
From top level (/path/to/repo/icgauge), issue the command
     `python -m experiments.baseline`
"""

import json
from collections import defaultdict
from matplotlib import pyplot as plt

import scipy
import numpy as np

import icgauge
from icgauge import experiment_frameworks
from icgauge import feature_extractors

run_experiment = True

if run_experiment:
  corr, alpha, conf_matrix, details = experiment_frameworks.experiment_features_iterated(
      train_reader=icgauge.data_readers.train_and_dev,
      assess_reader=icgauge.data_readers.test_official,
      train_size=0.7,
      phi_list=[
                 icgauge.feature_extractors.baseline_features
               ],
      class_func=icgauge.label_transformers.identity_class_func, #ternary_class_func
      train_func=icgauge.training_functions.fit_logistic_at,#_with_crossvalidation,
      score_func=scipy.stats.stats.pearsonr,
      verbose=False,
      iterations=1)

  # Print out the results
  print "\n-- AFTER COMPLETION --"
  print "Averaged correlation (95% CI): "
  print np.round(np.mean(corr),2), "+/-", np.round(np.std(corr),2)
  print "All correlations:"
  print corr
  print
  print "Averaged Cronbach's alpha (95% CI): "
  print np.round(np.mean(alpha),2), "+/-", np.round(np.std(alpha),2)
  print "All alphas:"
  print alpha
  print
  print "Confusion matrix:"
  print conf_matrix

  # Store the results to disk -- "truth"/"prediction"/"example"
  with open("results.json", "w") as fp:
      json.dump(details, fp, indent=4)

"""""""""""""""""""""
Experimental results.

* train + dev
* 7-point scale

Investigate the right parameters using crossvalidation first:
  alpha = 0.2, 0.2, 0.8, 0.4, 1.0, 0.4, 0.2, 0.2, 0.2, 0.2
On average: 0.4 is closest, but there isn't a ton of consistency here...

#######################
Test

Correlation
0.34

Cronbach's alpha
0.36

Confusion
[[ 1 55  3  0  0  0  0]
 [ 0 66  9  0  0  0  0]
 [ 0 32 12  0  0  0  0]
 [ 0  1  6  0  0  0  0]
 [ 0  4  1  0  0  0  0]
 [ 0  1  0  0  0  0  0]
 [ 0  0  1  0  0  0  0]]

#######################
Test - Official

Correlation
0.29

Cronbach's alpha
0.27

Confusion
[[0 5 0 0 0 0 0]
 [0 6 2 0 0 0 0]
 [0 5 2 0 0 0 0]
 [0 1 4 0 0 0 0]
 [0 3 0 0 0 0 0]
 [0 1 0 0 0 0 0]
 [0 0 1 0 0 0 0]]

"""""""""""""""""""""


text:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

  <title>JavaScript unit test file</title>
  <meta http-equiv="content-type" content="text/html; charset=utf-8" />

  <link rel="stylesheet" href="../assets/unittest.css" type="text/css" />

JavaScript unit test file

      This file tests node.js.


text:
package client

import (
	"encoding/json"
	"net/url"

	"github.com/docker/docker/api/types"
	"golang.org/x/net/context"
)

// CheckpointList returns the volumes configured in the docker host.
func (cli *Client) CheckpointList(ctx context.Context, container string, options types.CheckpointListOptions) ([]types.Checkpoint, error) {
	var checkpoints []types.Checkpoint

	query := url.Values{}
	if options.CheckpointDir != "" {
		query.Set("dir", options.CheckpointDir)
	}

	resp, err := cli.get(ctx, "/containers/"+container+"/checkpoints", query, nil)
	if err != nil {
		return checkpoints, err
	}

	err = json.NewDecoder(resp.body).Decode(&checkpoints)
	ensureReaderClosed(resp)
	return checkpoints, err
}


text:
<?php

namespace WA\BoBundle\Form;

use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolverInterface;

class CommentsType extends AbstractType
{
    /**
     * @param FormBuilderInterface $builder
     * @param array $options
     */
    public function buildForm(FormBuilderInterface $builder, array $options)
    {
        $builder
            ->add('note', null, array("attr" => array('class'=> "form-control")))
            ->add('content', 'textarea', array("attr" => array('class'=> "form-control")))
            ->add('state', null, array("attr" => array('class'=> "form-control")))
            ->add('dateCreated', 'datetime')
            ->add('user', null, array("attr" => array('class'=> "form-control")))
            ->add('movies', null, array("attr" => array('class'=> "form-control")))
        ;
    }

    /**
     * @param OptionsResolverInterface $resolver
     */
    public function setDefaultOptions(OptionsResolverInterface $resolver)
    {
        $resolver->setDefaults(array(
            'data_class' => 'WA\BoBundle\Entity\Comments',
            'validation_groups' => array('fullform'),
        ));
    }

    /**
     * @return string
     */
    public function getName()
    {
        return 'wa_bobundle_comments';
    }
}


text:
<link href="../../bower_components/polymer/polymer.html" rel="import">
<link href="../../bower_components/core-icon/core-icon.html" rel="import">
<link href="../paper-button/paper-button-base.html" rel="import">
<link href="../paper-tab/paper-ripple.html" rel="import">
<link href="../paper-shadow/paper-shadow.html" rel="import">

<polymer-element name="paper-fab" extends="paper-button-base" attributes="src icon mini" role="button">

  <template>

    <template if="{{raised}}">
      <paper-shadow id="shadow" fit animated></paper-shadow>
    </template>

    <core-icon relative id="icon" src="{{src}}" icon="{{icon}}"></core-icon>

  </template>

</polymer-element>


text:
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) AutoRest Code Generator.

package com.azure.resourcemanager.authorization.fluent.models;

import com.azure.core.annotation.Fluent;
import com.fasterxml.jackson.annotation.JsonAnyGetter;
import com.fasterxml.jackson.annotation.JsonAnySetter;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.UUID;

/** calendarGroup. */
@Fluent
public final class MicrosoftGraphCalendarGroup extends MicrosoftGraphEntity {
    /*
     * Identifies the version of the calendar group. Every time the calendar group is changed, ChangeKey changes as
     * well. This allows Exchange to apply changes to the correct version of the object. Read-only.
     */
    @JsonProperty(value = "changeKey")
    private String changeKey;

    /*
     * The class identifier. Read-only.
     */
    @JsonProperty(value = "classId")
    private UUID classId;

    /*
     * The group name.
     */
    @JsonProperty(value = "name")
    private String name;

    /*
     * The calendars in the calendar group. Navigation property. Read-only. Nullable.
     */
    @JsonProperty(value = "calendars")
    private List<MicrosoftGraphCalendar> calendars;

    /*
     * calendarGroup
     */
    @JsonIgnore private Map<String, Object> additionalProperties;

    /** Creates an instance of MicrosoftGraphCalendarGroup class. */
    public MicrosoftGraphCalendarGroup() {
    }

    /**
     * Get the changeKey property: Identifies the version of the calendar group. Every time the calendar group is
     * changed, ChangeKey changes as well. This allows Exchange to apply changes to the correct version of the object.
     * Read-only.
     *
     * @return the changeKey value.
     */
    public String changeKey() {
        return this.changeKey;
    }

    /**
     * Set the changeKey property: Identifies the version of the calendar group. Every time the calendar group is
     * changed, ChangeKey changes as well. This allows Exchange to apply changes to the correct version of the object.
     * Read-only.
     *
     * @param changeKey the changeKey value to set.
     * @return the MicrosoftGraphCalendarGroup object itself.
     */
    public MicrosoftGraphCalendarGroup withChangeKey(String changeKey) {
        this.changeKey = changeKey;
        return this;
    }

    /**
     * Get the classId property: The class identifier. Read-only.
     *
     * @return the classId value.
     */
    public UUID classId() {
        return this.classId;
    }

    /**
     * Set the classId property: The class identifier. Read-only.
     *
     * @param classId the classId value to set.
     * @return the MicrosoftGraphCalendarGroup object itself.
     */
    public MicrosoftGraphCalendarGroup withClassId(UUID classId) {
        this.classId = classId;
        return this;
    }

    /**
     * Get the name property: The group name.
     *
     * @return the name value.
     */
    public String name() {
        return this.name;
    }

    /**
     * Set the name property: The group name.
     *
     * @param name the name value to set.
     * @return the MicrosoftGraphCalendarGroup object itself.
     */
    public MicrosoftGraphCalendarGroup withName(String name) {
        this.name = name;
        return this;
    }

    /**
     * Get the calendars property: The calendars in the calendar group. Navigation property. Read-only. Nullable.
     *
     * @return the calendars value.
     */
    public List<MicrosoftGraphCalendar> calendars() {
        return this.calendars;
    }

    /**
     * Set the calendars property: The calendars in the calendar group. Navigation property. Read-only. Nullable.
     *
     * @param calendars the calendars value to set.
     * @return the MicrosoftGraphCalendarGroup object itself.
     */
    public MicrosoftGraphCalendarGroup withCalendars(List<MicrosoftGraphCalendar> calendars) {
        this.calendars = calendars;
        return this;
    }

    /**
     * Get the additionalProperties property: calendarGroup.
     *
     * @return the additionalProperties value.
     */
    @JsonAnyGetter
    public Map<String, Object> additionalProperties() {
        return this.additionalProperties;
    }

    /**
     * Set the additionalProperties property: calendarGroup.
     *
     * @param additionalProperties the additionalProperties value to set.
     * @return the MicrosoftGraphCalendarGroup object itself.
     */
    public MicrosoftGraphCalendarGroup withAdditionalProperties(Map<String, Object> additionalProperties) {
        this.additionalProperties = additionalProperties;
        return this;
    }

    @JsonAnySetter
    void withAdditionalProperties(String key, Object value) {
        if (additionalProperties == null) {
            additionalProperties = new HashMap<>();
        }
        additionalProperties.put(key, value);
    }

    /** {@inheritDoc} */
    @Override
    public MicrosoftGraphCalendarGroup withId(String id) {
        super.withId(id);
        return this;
    }

    /**
     * Validates the instance.
     *
     * @throws IllegalArgumentException thrown if the instance is not valid.
     */
    @Override
    public void validate() {
        super.validate();
        if (calendars() != null) {
            calendars().forEach(e -> e.validate());
        }
    }
}


text:
require_relative "base"

module Makita
  module Filter
    class Bitmask < Base
      def apply relation
        relation = relation
          .public_send("with_#{name}", *in_values) if in_values.present?
        relation = relation
          .public_send("without_#{name}", *out_values) if out_values.present?
        relation
      end

      private

      def in_values
        values.reject{|value| value[/^~/]}
      end

      def out_values
        values
          .select{|value| value[/^~/]}
          .map{|value| value[1..-1]}
      end
    end
  end
end


text:
/* eslint-disable global-require */

const path = require('path');
const webpack = require('webpack');
const AssetsPlugin = require('assets-webpack-plugin');
const pkg = require('./package.json');

const isDebug = global.DEBUG === false ? false : !process.argv.includes('--release');
const isVerbose = process.argv.includes('--verbose') || process.argv.includes('-v');
const useHMR = !!global.HMR; // Hot Module Replacement (HMR)
const babelConfig = Object.assign({}, pkg.babel, {
  babelrc: false,
  cacheDirectory: useHMR,
});

// Webpack configuration (client/main.js => public/dist/main.{hash}.js)
// http://webpack.github.io/docs/configuration.html
const config = {

  // The base directory for resolving the entry option
  context: path.resolve(__dirname, './client'),

  // The entry point for the bundle
  entry: [
    /* Material Design Lite (https://getmdl.io) */
    '!!style-loader!css-loader!react-mdl/extra/material.min.css',
    'react-mdl/extra/material.min.js',
    /* The main entry point of your JavaScript application */
    './main.js',
  ],

  // Options affecting the output of the compilation
  output: {
    path: path.resolve(__dirname, './public/dist'),
    publicPath: '/dist/',
    filename: isDebug ? '[name].js?[hash]' : '[name].[hash].js',
    chunkFilename: isDebug ? '[id].js?[chunkhash]' : '[id].[chunkhash].js',
    sourcePrefix: '  ',
  },

  // Developer tool to enhance debugging, source maps
  // http://webpack.github.io/docs/configuration.html#devtool
  devtool: isDebug ? 'source-map' : false,

  // What information should be printed to the console
  stats: {
    colors: true,
    reasons: isDebug,
    hash: isVerbose,
    version: isVerbose,
    timings: true,
    chunks: isVerbose,
    chunkModules: isVerbose,
    cached: isVerbose,
    cachedAssets: isVerbose,
  },

  // The list of plugins for Webpack compiler
  plugins: [
    new webpack.optimize.OccurrenceOrderPlugin(),
    new webpack.DefinePlugin({
      'process.env.NODE_ENV': isDebug ? '"development"' : '"production"',
      __DEV__: isDebug,
    }),
    // Emit a JSON file with assets paths
    // https://github.com/sporto/assets-webpack-plugin#options
    new AssetsPlugin({
      path: path.resolve(__dirname, './public/dist'),
      filename: 'assets.json',
      prettyPrint: true,
    }),
  ],
  // Options affecting the normal modules
  module: {
    rules: [
      {
        test: /\.jsx?$/,
        include: [
          path.resolve(__dirname, './client'),
        ],
        loader: `babel-loader?${JSON.stringify(babelConfig)}`,
      },
      {
        test: /\.css/,
        loaders: [
          'style-loader',
          `css-loader?${JSON.stringify({
            sourceMap: isDebug,
            // CSS Modules https://github.com/css-modules/css-modules
            modules: true,
            localIdentName: isDebug ? '[name]_[local]_[hash:base64:3]' : '[hash:base64:4]',
            // CSS Nano http://cssnano.co/options/
            minimize: !isDebug,
          })}`,
          //https://github.com/postcss/postcss-loader/issues/209
          {loader: 'postcss-loader', options: { plugins: () => [
          // Transfer @import rule by inlining content, e.g. @import 'normalize.css'
          // https://github.com/postcss/postcss-import
          // require('postcss-import')({ addDependencyTo: bundler }),
          // W3C variables, e.g. :root { --color: red; } div { background: var(--color); }
          // https://github.com/postcss/postcss-custom-properties
          require('postcss-custom-properties'),
          // W3C CSS Custom Media Queries, e.g. @custom-media --small-viewport (max-width: 30em);
          // https://github.com/postcss/postcss-custom-media
          require('postcss-custom-media'),
          // CSS4 Media Queries, e.g. @media screen and (width >= 500px) and (width <= 1200px) { }
          // https://github.com/postcss/postcss-media-minmax
          require('postcss-media-minmax'),
          // W3C CSS Custom Selectors, e.g. @custom-selector :--heading h1, h2, h3, h4, h5, h6;
          // https://github.com/postcss/postcss-custom-selectors
          require('postcss-custom-selectors'),
          // W3C calc() function, e.g. div { height: calc(100px - 2em); }
          // https://github.com/postcss/postcss-calc
          require('postcss-calc'),
          // Allows you to nest one style rule inside another
          // https://github.com/jonathantneal/postcss-nesting
          require('postcss-nesting'),
          // W3C color() function, e.g. div { background: color(red alpha(90%)); }
          // https://github.com/postcss/postcss-color-function
          require('postcss-color-function'),
          // Convert CSS shorthand filters to SVG equivalent, e.g. .blur { filter: blur(4px); }
          // https://github.com/iamvdo/pleeease-filters
          require('pleeease-filters'),
          // Generate pixel fallback for "rem" units, e.g. div { margin: 2.5rem 2px 3em 100%; }
          // https://github.com/robwierzbowski/node-pixrem
          require('pixrem'),
          // W3C CSS Level4 :matches() pseudo class, e.g. p:matches(:first-child, .special) { }
          // https://github.com/postcss/postcss-selector-matches
          require('postcss-selector-matches'),
          // Transforms :not() W3C CSS Level 4 pseudo class to :not() CSS Level 3 selectors
          // https://github.com/postcss/postcss-selector-not
          require('postcss-selector-not'),
          // Add vendor prefixes to CSS rules using values from caniuse.com
          // https://github.com/postcss/autoprefixer
          require('autoprefixer')
            ] }},

        ],
      },
      {
        test: /\.json$/,
        exclude: [
          path.resolve(__dirname, './client/routes.json'),
        ],
        loader: 'json-loader',
      },
      {
        test: /\.json$/,
        include: [
          path.resolve(__dirname, './client/routes.json'),
        ],
        loaders: [
          `babel-loader?${JSON.stringify(babelConfig)}`,
          path.resolve(__dirname, './client/utils/routes-loader.js'),
        ],
      },
      {
        test: /\.md$/,
        loader: path.resolve(__dirname, './client/utils/markdown-loader.js'),
      },
      {
        test: /\.(png|jpg|jpeg|gif|svg|woff|woff2)(\?.*)$/,
        loader: 'url-loader?limit=10000',
      },
      {
        test: /\.(eot|ttf|wav|mp3)(\?.*)$/,
        loader: 'file-loader',
      },
    ],
  },
};

// Integrate Webpack 2.x (disable ES2015 modules)
babelConfig.presets[babelConfig.presets.indexOf('latest')] = ['latest', {
  es2015: {
    modules: false,
  },
}];

// Optimize the bundle in release (production) mode
if (!isDebug) {
  config.plugins.push(new webpack.optimize.UglifyJsPlugin({
    compress: {
      warnings: isVerbose,
    },
  }));
  config.plugins.push(new webpack.optimize.AggressiveMergingPlugin());
}

// Hot Module Replacement (HMR) + React Hot Reload
if (isDebug && useHMR) {
  babelConfig.plugins.unshift('react-hot-loader/babel');
  config.entry.unshift('react-hot-loader/patch', 'webpack-hot-middleware/client');
  config.plugins.push(new webpack.HotModuleReplacementPlugin());
  config.plugins.push(new webpack.NoEmitOnErrorsPlugin());
}

module.exports = config;


text:
package application.GUIfeatures;

import application.Controller;

/**
 * All GUI buttons must implement some behavior to be set on action. We chose to
 * use an interface so that all GUI Features can also extend GenericGUIFeature.
 *
 * @author Wesley Valentine
 * @author Nick Balkisoon
 *
 */
public interface GUIButtonFeature {
	public abstract void behavior();
}


text:
<userConfiguration id="lmsingletermsmartuser">

	<queryGenerator class="SingleTermQueryGenerator">
		<attribute name="stopword_file" type="string" value="../example_data/terms/stopwords.txt" is_argument="true" />
	</queryGenerator>

	<textClassifiers>
		<snippetClassifier class="LMTextClassifier">
            <attribute name="stopword_file" type="string" value="../example_data/terms/stopwords.txt" is_argument="true" />
            <attribute name="background_file" type="string" value="../example_data/terms/vocab.txt" is_argument="true" />
            <attribute name="threshold" type="float" value="-0.1" is_argument="false" />
            <attribute name="lam" type="float" value="0.1" is_argument="false" />
            <attribute name="updating" type="boolean" value="false" is_argument="false" />
		</snippetClassifier>

		<documentClassifier class="LMTextClassifier">
            <attribute name="stopword_file" type="string" value="../example_data/terms/stopwords.txt" is_argument="true" />
            <attribute name="background_file" type="string" value="../example_data/terms/vocab.txt" is_argument="true" />
            <attribute name="threshold" type="float" value="-0.1" is_argument="false" />
            <attribute name="lam" type="float" value="0.1" is_argument="false" />
            <attribute name="updating" type="boolean" value="false" is_argument="false" />
		</documentClassifier>
	</textClassifiers>

	<stoppingDecisionMaker class="SequentialNonrelDecisionMakerSkip">
        <attribute name="nonrelevant_threshold" type="integer" value="3" is_argument="true" />
	</stoppingDecisionMaker>

	<logger class="FixedCostLogger">
		<attribute name="time_limit" type="integer" value="600" is_argument="true" />
		<attribute name="query_cost" type="integer" value="10" is_argument="true" />
		<attribute name="document_cost" type="integer" value="20" is_argument="true" />
		<attribute name="snippet_cost" type="integer" value="3" is_argument="true" />
		<attribute name="serp_results_cost" type="integer" value="5" is_argument="true" />
		<attribute name="mark_document_cost" type="integer" value="3" is_argument="true" />
	</logger>

	<searchContext class="SearchContext">
		<attribute name="relevance_revision" type="integer" value="1" is_argument="false" />
	</searchContext>

		<serpImpression class="SimpleSERPImpression">
		<attribute name="qrel_file" type="string" value="../example_data/qrels/trec2005.qrels.all" is_argument="true" />
	</serpImpression>

</userConfiguration>


text:
package com.amazonaws.services.pinpoint;

import javax.annotation.Generated;

import com.amazonaws.services.pinpoint.model.*;
import com.amazonaws.*;

/**
 * Abstract implementation of {@code AmazonPinpoint}. Convenient method forms pass through to the corresponding overload
 * that takes a request object, which throws an {@code UnsupportedOperationException}.
 */
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class AbstractAmazonPinpoint implements AmazonPinpoint {

    protected AbstractAmazonPinpoint() {
    }

    @Override
    public void setEndpoint(String endpoint) {
        throw new java.lang.UnsupportedOperationException();
    }

    @Override
    public void setRegion(com.amazonaws.regions.Region region) {
        throw new java.lang.UnsupportedOperationException();
    }

    @Override
    public CreateAppResult createApp(CreateAppRequest request) {
        throw new java.lang.UnsupportedOperationException();
    }

    @Override
    public CreateCampaignResult createCampaign(CreateCampaignRequest request) {
        throw new java.lang.UnsupportedOperationException();
    }

    @Override
    public CreateExportJobResult createExportJob(CreateExportJobRequest request) {
        throw new java.lang.UnsupportedOperationException();
    }

    @Override
    public CreateImportJobResult createImportJob(CreateImportJobRequest request) {
        throw new java.lang.UnsupportedOperationException();
    }

    @Override
    public CreateSegmentResult createSegment(CreateSegmentRequest request) {
        throw new java.lang.UnsupportedOperationException();
    }

    @Override
    public DeleteAdmChannelResult deleteAdmChannel(DeleteAdmChannelRequest request) {
        throw new java.lang.UnsupportedOperationException();
    }

    @Override
    public DeleteApnsChannelResult deleteApnsChannel(DeleteApnsChannelRequest request) {
        throw new java.lang.UnsupportedOperationException();
    }

    @Override
    public DeleteApnsSandboxChannelResult deleteApnsSandboxChannel(DeleteApnsSandboxChannelRequest request) {
        throw new java.lang.UnsupportedOperationException();
    }

    @Override
    public DeleteApnsVoipChannelResult deleteApnsVoipChannel(DeleteApnsVoipChannelRequest request) {
        throw new java.lang.UnsupportedOperationException();
    }

    @Override
    public DeleteApnsVoipSandboxChannelResult deleteApnsVoipSandboxChannel(DeleteApnsVoipSandboxChannelRequest request) {
        throw new java.lang.UnsupportedOperationException();
    }

    @Override
    public DeleteAppResult deleteApp(DeleteAppRequest request) {
        throw new java.lang.UnsupportedOperationException();
    }

    @Override
    public DeleteBaiduChannelResult deleteBaiduChannel(DeleteBaiduChannelRequest request) {
        throw new java.lang.UnsupportedOperationException();
    }

    @Override
    public DeleteCampaignResult deleteCampaign(DeleteCampaignRequest request) {
        throw new java.lang.UnsupportedOperationException();
    }

    @Override
    public DeleteEmailChannelResult deleteEmailChannel(DeleteEmailChannelRequest request) {
        throw new java.lang.UnsupportedOperationException();
    }

    @Override
    public DeleteEndpointResult deleteEndpoint(DeleteEndpointRequest request) {
        throw new java.lang.UnsupportedOperationException();
    }

    @Override
    public DeleteEventStreamResult deleteEventStream(DeleteEventStreamRequest request) {
        throw new java.lang.UnsupportedOperationException();
    }

    @Override
    public DeleteGcmChannelResult deleteGcmChannel(DeleteGcmChannelRequest request) {
        throw new java.lang.UnsupportedOperationException();
    }

    @Override
    public DeleteSegmentResult deleteSegment(DeleteSegmentRequest request) {
        throw new java.lang.UnsupportedOperationException();
    }

    @Override
    public DeleteSmsChannelResult deleteSmsChannel(DeleteSmsChannelRequest request) {
        throw new java.lang.UnsupportedOperationException();
    }

    @Override
    public DeleteUserEndpointsResult deleteUserEndpoints(DeleteUserEndpointsRequest request) {
        throw new java.lang.UnsupportedOperationException();
    }

    @Override
    public DeleteVoiceChannelResult deleteVoiceChannel(DeleteVoiceChannelRequest request) {
        throw new java.lang.UnsupportedOperationException();
    }

    @Override
    public GetAdmChannelResult getAdmChannel(GetAdmChannelRequest request) {
        throw new java.lang.UnsupportedOperationException();
    }

    @Override
    public GetApnsChannelResult getApnsChannel(GetApnsChannelRequest request) {
        throw new java.lang.UnsupportedOperationException();
    }

    @Override
    public GetApnsSandboxChannelResult getApnsSandboxChannel(GetApnsSandboxChannelRequest request) {
        throw new java.lang.UnsupportedOperationException();
    }

    @Override
    public GetApnsVoipChannelResult getApnsVoipChannel(GetApnsVoipChannelRequest request) {
        throw new java.lang.UnsupportedOperationException();
    }

    @Override
    public GetApnsVoipSandboxChannelResult getApnsVoipSandboxChannel(GetApnsVoipSandboxChannelRequest request) {
        throw new java.lang.UnsupportedOperationException();
    }

    @Override
    public GetAppResult getApp(GetAppRequest request) {
        throw new java.lang.UnsupportedOperationException();
    }

    @Override
    public GetApplicationDateRangeKpiResult getApplicationDateRangeKpi(GetApplicationDateRangeKpiRequest request) {
        throw new java.lang.UnsupportedOperationException();
    }

    @Override
    public GetApplicationSettingsResult getApplicationSettings(GetApplicationSettingsRequest request) {
        throw new java.lang.UnsupportedOperationException();
    }

    @Override
    public GetAppsResult getApps(GetAppsRequest request) {
        throw new java.lang.UnsupportedOperationException();
    }

    @Override
    public GetBaiduChannelResult getBaiduChannel(GetBaiduChannelRequest request) {
        throw new java.lang.UnsupportedOperationException();
    }

    @Override
    public GetCampaignResult getCampaign(GetCampaignRequest request) {
        throw new java.lang.UnsupportedOperationException();
    }

    @Override
    public GetCampaignActivitiesResult getCampaignActivities(GetCampaignActivitiesRequest request) {
        throw new java.lang.UnsupportedOperationException();
    }

    @Override
    public GetCampaignDateRangeKpiResult getCampaignDateRangeKpi(GetCampaignDateRangeKpiRequest request) {
        throw new java.lang.UnsupportedOperationException();
    }

    @Override
    public GetCampaignVersionResult getCampaignVersion(GetCampaignVersionRequest request) {
        throw new java.lang.UnsupportedOperationException();
    }

    @Override
    public GetCampaignVersionsResult getCampaignVersions(GetCampaignVersionsRequest request) {
        throw new java.lang.UnsupportedOperationException();
    }

    @Override
    public GetCampaignsResult getCampaigns(GetCampaignsRequest request) {
        throw new java.lang.UnsupportedOperationException();
    }

    @Override
    public GetChannelsResult getChannels(GetChannelsRequest request) {
        throw new java.lang.UnsupportedOperationException();
    }

    @Override
    public GetEmailChannelResult getEmailChannel(GetEmailChannelRequest request) {
        throw new java.lang.UnsupportedOperationException();
    }

    @Override
    public GetEndpointResult getEndpoint(GetEndpointRequest request) {
        throw new java.lang.UnsupportedOperationException();
    }

    @Override
    public GetEventStreamResult getEventStream(GetEventStreamRequest request) {
        throw new java.lang.UnsupportedOperationException();
    }

    @Override
    public GetExportJobResult getExportJob(GetExportJobRequest request) {
        throw new java.lang.UnsupportedOperationException();
    }

    @Override
    public GetExportJobsResult getExportJobs(GetExportJobsRequest request) {
        throw new java.lang.UnsupportedOperationException();
    }

    @Override
    public GetGcmChannelResult getGcmChannel(GetGcmChannelRequest request) {
        throw new java.lang.UnsupportedOperationException();
    }

    @Override
    public GetImportJobResult getImportJob(GetImportJobRequest request) {
        throw new java.lang.UnsupportedOperationException();
    }

    @Override
    public GetImportJobsResult getImportJobs(GetImportJobsRequest request) {
        throw new java.lang.UnsupportedOperationException();
    }

    @Override
    public GetSegmentResult getSegment(GetSegmentRequest request) {
        throw new java.lang.UnsupportedOperationException();
    }

    @Override
    public GetSegmentExportJobsResult getSegmentExportJobs(GetSegmentExportJobsRequest request) {
        throw new java.lang.UnsupportedOperationException();
    }

    @Override
    public GetSegmentImportJobsResult getSegmentImportJobs(GetSegmentImportJobsRequest request) {
        throw new java.lang.UnsupportedOperationException();
    }

    @Override
    public GetSegmentVersionResult getSegmentVersion(GetSegmentVersionRequest request) {
        throw new java.lang.UnsupportedOperationException();
    }

    @Override
    public GetSegmentVersionsResult getSegmentVersions(GetSegmentVersionsRequest request) {
        throw new java.lang.UnsupportedOperationException();
    }

    @Override
    public GetSegmentsResult getSegments(GetSegmentsRequest request) {
        throw new java.lang.UnsupportedOperationException();
    }

    @Override
    public GetSmsChannelResult getSmsChannel(GetSmsChannelRequest request) {
        throw new java.lang.UnsupportedOperationException();
    }

    @Override
    public GetUserEndpointsResult getUserEndpoints(GetUserEndpointsRequest request) {
        throw new java.lang.UnsupportedOperationException();
    }

    @Override
    public GetVoiceChannelResult getVoiceChannel(GetVoiceChannelRequest request) {
        throw new java.lang.UnsupportedOperationException();
    }

    @Override
    public ListTagsForResourceResult listTagsForResource(ListTagsForResourceRequest request) {
        throw new java.lang.UnsupportedOperationException();
    }

    @Override
    public PhoneNumberValidateResult phoneNumberValidate(PhoneNumberValidateRequest request) {
        throw new java.lang.UnsupportedOperationException();
    }

    @Override
    public PutEventStreamResult putEventStream(PutEventStreamRequest request) {
        throw new java.lang.UnsupportedOperationException();
    }

    @Override
    public PutEventsResult putEvents(PutEventsRequest request) {
        throw new java.lang.UnsupportedOperationException();
    }

    @Override
    public RemoveAttributesResult removeAttributes(RemoveAttributesRequest request) {
        throw new java.lang.UnsupportedOperationException();
    }

    @Override
    public SendMessagesResult sendMessages(SendMessagesRequest request) {
        throw new java.lang.UnsupportedOperationException();
    }

    @Override
    public SendUsersMessagesResult sendUsersMessages(SendUsersMessagesRequest request) {
        throw new java.lang.UnsupportedOperationException();
    }

    @Override
    public TagResourceResult tagResource(TagResourceRequest request) {
        throw new java.lang.UnsupportedOperationException();
    }

    @Override
    public UntagResourceResult untagResource(UntagResourceRequest request) {
        throw new java.lang.UnsupportedOperationException();
    }

    @Override
    public UpdateAdmChannelResult updateAdmChannel(UpdateAdmChannelRequest request) {
        throw new java.lang.UnsupportedOperationException();
    }

    @Override
    public UpdateApnsChannelResult updateApnsChannel(UpdateApnsChannelRequest request) {
        throw new java.lang.UnsupportedOperationException();
    }

    @Override
    public UpdateApnsSandboxChannelResult updateApnsSandboxChannel(UpdateApnsSandboxChannelRequest request) {
        throw new java.lang.UnsupportedOperationException();
    }

    @Override
    public UpdateApnsVoipChannelResult updateApnsVoipChannel(UpdateApnsVoipChannelRequest request) {
        throw new java.lang.UnsupportedOperationException();
    }

    @Override
    public UpdateApnsVoipSandboxChannelResult updateApnsVoipSandboxChannel(UpdateApnsVoipSandboxChannelRequest request) {
        throw new java.lang.UnsupportedOperationException();
    }

    @Override
    public UpdateApplicationSettingsResult updateApplicationSettings(UpdateApplicationSettingsRequest request) {
        throw new java.lang.UnsupportedOperationException();
    }

    @Override
    public UpdateBaiduChannelResult updateBaiduChannel(UpdateBaiduChannelRequest request) {
        throw new java.lang.UnsupportedOperationException();
    }

    @Override
    public UpdateCampaignResult updateCampaign(UpdateCampaignRequest request) {
        throw new java.lang.UnsupportedOperationException();
    }

    @Override
    public UpdateEmailChannelResult updateEmailChannel(UpdateEmailChannelRequest request) {
        throw new java.lang.UnsupportedOperationException();
    }

    @Override
    public UpdateEndpointResult updateEndpoint(UpdateEndpointRequest request) {
        throw new java.lang.UnsupportedOperationException();
    }

    @Override
    public UpdateEndpointsBatchResult updateEndpointsBatch(UpdateEndpointsBatchRequest request) {
        throw new java.lang.UnsupportedOperationException();
    }

    @Override
    public UpdateGcmChannelResult updateGcmChannel(UpdateGcmChannelRequest request) {
        throw new java.lang.UnsupportedOperationException();
    }

    @Override
    public UpdateSegmentResult updateSegment(UpdateSegmentRequest request) {
        throw new java.lang.UnsupportedOperationException();
    }

    @Override
    public UpdateSmsChannelResult updateSmsChannel(UpdateSmsChannelRequest request) {
        throw new java.lang.UnsupportedOperationException();
    }

    @Override
    public UpdateVoiceChannelResult updateVoiceChannel(UpdateVoiceChannelRequest request) {
        throw new java.lang.UnsupportedOperationException();
    }

    @Override
    public void shutdown() {
        throw new java.lang.UnsupportedOperationException();
    }

    @Override
    public com.amazonaws.ResponseMetadata getCachedResponseMetadata(com.amazonaws.AmazonWebServiceRequest request) {
        throw new java.lang.UnsupportedOperationException();
    }

}


text:
#ifndef _CEGUIOgreMacros_h_
#define _CEGUIOgreMacros_h_

#include <OgrePrerequisites.h>

//New shared ptr API introduced in 1.10.1
#if OGRE_VERSION >= 0x10A01
#define OGRE_RESET(_sharedPtr) ((_sharedPtr).reset())
#define OGRE_ISNULL(_sharedPtr) (!(_sharedPtr))
#else
#define OGRE_RESET(_sharedPtr) ((_sharedPtr).setNull())
#define OGRE_ISNULL(_sharedPtr) ((_sharedPtr).isNull())
#endif

#endif //_CEGUIOgreMacros_h_


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace CSquared
{
    public partial class UnaryOperationExpression : IExpression
    {
        public ILexeme UnaryOperator { get; set; }
        public IExpression Expression { get; set; }
    }
}


text:
package support

import scala.xml.Node
import scala.xml.NodeSeq
import scala.xml.PrettyPrinter

object PrettyXml {

  implicit class nodeSeqToString(xml: NodeSeq) {

    val pp = new PrettyPrinter(80, 4)

    def prettify: String = xml match {
        case x: Node => pp.format(x);
        case x: NodeSeq => xml.foldLeft("") { (str, node) =>
          val sep = if (str.isEmpty) "" else "\n"
          str + sep + node.prettify
        }
      }
  }

}


text:
from datetime import timedelta
from typing import Optional

from selenium.common.exceptions import TimeoutException, WebDriverException
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.support.ui import WebDriverWait

from SeleniumLibrary.base import keyword, LibraryComponent
from SeleniumLibrary.utils import secs_to_timestr

class AlertKeywords(LibraryComponent):
    ACCEPT = "ACCEPT"
    DISMISS = "DISMISS"
    LEAVE = "LEAVE"
    _next_alert_action = ACCEPT

    @keyword
    def input_text_into_alert(
        self, text: str, action: str = ACCEPT, timeout: Optional[timedelta] = None
    ):
        """Types the given ``text`` into an input field in an alert.

        The alert is accepted by default, but that behavior can be controlled
        by using the ``action`` argument same way as with `Handle Alert`.

        ``timeout`` specifies how long to wait for the alert to appear.
        If it is not given, the global default `timeout` is used instead.

        New in SeleniumLibrary 3.0.
        """
        alert = self._wait_alert(timeout)
        alert.send_keys(text)
        self._handle_alert(alert, action)

    @keyword
    def alert_should_be_present(
        self,
        text: str = "",
        action: str = ACCEPT,
        timeout: Optional[timedelta] = None,
    ):
        """Verifies that an alert is present and by default, accepts it.

        Fails if no alert is present. If ``text`` is a non-empty string,
        then it is used to verify alert's message. The alert is accepted
        by default, but that behavior can be controlled by using the
        ``action`` argument same way as with `Handle Alert`.

        ``timeout`` specifies how long to wait for the alert to appear.
        If it is not given, the global default `timeout` is used instead.

        ``action`` and ``timeout`` arguments are new in SeleniumLibrary 3.0.
        In earlier versions, the alert was always accepted and a timeout was
        hardcoded to one second.
        """
        message = self.handle_alert(action, timeout)
        if text and text != message:
            raise AssertionError(
                f"Alert message should have been '{text}' but it " f"was '{message}'."
            )

    @keyword
    def alert_should_not_be_present(
        self, action: str = ACCEPT, timeout: Optional[timedelta] = None
    ):
        """Verifies that no alert is present.

        If the alert actually exists, the ``action`` argument determines
        how it should be handled. By default, the alert is accepted, but
        it can be also dismissed or left open the same way as with the
        `Handle Alert` keyword.

        ``timeout`` specifies how long to wait for the alert to appear.
        By default, is not waited for the alert at all, but a custom time can
        be given if alert may be delayed. See the `time format` section
        for information about the syntax.

        New in SeleniumLibrary 3.0.
        """
        try:
            alert = self._wait_alert(timeout)
        except AssertionError:
            return
        text = self._handle_alert(alert, action)
        raise AssertionError(f"Alert with message '{text}' present.")

    @keyword
    def handle_alert(self, action: str = ACCEPT, timeout: Optional[timedelta] = None):
        """Handles the current alert and returns its message.

        By default, the alert is accepted, but this can be controlled
        with the ``action`` argument that supports the following
        case-insensitive values:

        - ``ACCEPT``: Accept the alert i.e. press ``Ok``. Default.
        - ``DISMISS``: Dismiss the alert i.e. press ``Cancel``.
        - ``LEAVE``: Leave the alert open.

        The ``timeout`` argument specifies how long to wait for the alert
        to appear. If it is not given, the global default `timeout` is used
        instead.

        Examples:
        | Handle Alert |                |       | # Accept alert.  |
        | Handle Alert | action=DISMISS |       | # Dismiss alert. |
        | Handle Alert | timeout=10 s   |       | # Use custom timeout and accept alert.  |
        | Handle Alert | DISMISS        | 1 min | # Use custom timeout and dismiss alert. |
        | ${message} = | Handle Alert   |       | # Accept alert and get its message.     |
        | ${message} = | Handle Alert   | LEAVE | # Leave alert open and get its message. |

        New in SeleniumLibrary 3.0.
        """
        self.info(f"HANDLE::{type(timeout)}::{timeout}")
        alert = self._wait_alert(timeout)
        return self._handle_alert(alert, action)

    def _handle_alert(self, alert, action):
        action = action.upper()
        text = " ".join(alert.text.splitlines())
        if action == self.ACCEPT:
            alert.accept()
        elif action == self.DISMISS:
            alert.dismiss()
        elif action != self.LEAVE:
            raise ValueError(f"Invalid alert action '{action}'.")
        return text

    def _wait_alert(self, timeout=None):
        timeout = self.get_timeout(timeout)
        wait = WebDriverWait(self.driver, timeout)
        try:
            return wait.until(EC.alert_is_present())
        except TimeoutException:
            raise AssertionError(f"Alert not found in {secs_to_timestr(timeout)}.")
        except WebDriverException as err:
            raise AssertionError(f"An exception occurred waiting for alert: {err}")


text:
import { Component } from '@angular/core';

@Component({
  selector: 'app-dashboard',
  templateUrl: './dashboard.template.html'
})
export class DashboardComponent {}