text:
<?php

declare(strict_types=1);

namespace EnumType;

use WsdlToPhp\PackageBase\AbstractStructEnumBase;

/**
 * This class stands for ParticipantActivityRole EnumType
 * @package Ews
 * @subpackage Enumerations
 * @author WsdlToPhp <contact@wsdltophp.com>
 */
class EwsParticipantActivityRole extends AbstractStructEnumBase
{
    /**
     * Constant for value 'Organizer'
     * @return string 'Organizer'
     */
    const VALUE_ORGANIZER = 'Organizer';
    /**
     * Constant for value 'Attendee'
     * @return string 'Attendee'
     */
    const VALUE_ATTENDEE = 'Attendee';
    /**
     * Constant for value 'Presenter'
     * @return string 'Presenter'
     */
    const VALUE_PRESENTER = 'Presenter';
    /**
     * Return allowed values
     * @uses self::VALUE_ORGANIZER
     * @uses self::VALUE_ATTENDEE
     * @uses self::VALUE_PRESENTER
     * @return string[]
     */
    public static function getValidValues(): array
    {
        return [
            self::VALUE_ORGANIZER,
            self::VALUE_ATTENDEE,
            self::VALUE_PRESENTER,
        ];
    }
}


text:
package ru.stqa.pft.soap;

import net.webservicex.GeoIP;
import org.testng.Assert;
import org.testng.annotations.Test;
import net.webservicex.GeoIPService;

import static org.testng.Assert.assertEquals;

/**
 * Created by Alexander on 23.07.2016.
 */
public class GeoIpServiceTests {

    @Test
    public void testMyIp() {
        GeoIP geoIP = new GeoIPService().getGeoIPServiceSoap12().getGeoIP("188.242.144.9");
        assertEquals(geoIP.getCountryCode(), "RUS");
    }
}

redpajama_set_name: RedPajamaGithub


text:
#import <Foundation/Foundation.h>

#import "AWSService.h"
#import "AWSNetworking.h"
#import "AWSCredentialsProvider.h"
#import "AWSValidation.h"
#import "AWSURLRequestSerialization.h"
#import "AWSURLResponseSerialization.h"
#import "AWSCategory.h"
#import "AWSLogging.h"

#import "STS.h"
#import "CognitoIdentity.h"
#import "MobileAnalytics.h"

#import "Bolts.h"


text:
package com.pinterest.deployservice.email;

import org.apache.commons.lang.StringUtils;
import org.slf4j.LoggerFactory;

import javax.mail.*;
import javax.mail.internet.InternetAddress;
import javax.mail.internet.MimeMessage;
import java.util.Properties;

public class SMTPMailManagerImpl implements MailManager {
    private static final org.slf4j.Logger LOG = LoggerFactory.getLogger(SMTPMailManagerImpl.class);

    private String userName;

    private String password;

    /**
     * The e-mail address that Teletraan puts to "From:" field in outgoing e-mails.
     * Null if not configured.
     */
    private String adminAddress;

    /**
     * The SMTP server to use for sending e-mail. Null for default to the environment,
     * which is usually <tt>localhost</tt>.
     */
    private String host;
    /**
     * The SMTP port to use for sending e-mail. Null for default to the environment,
     * which is usually <tt>25</tt>.
     */
    private String port;

    private Properties properties;

    public SMTPMailManagerImpl(String host, String port, String userName, String password,
        String adminAddress, boolean sslEnabled) {
        this.host = host;
        this.port = port;
        this.userName = userName;
        this.password = password;
        this.adminAddress = adminAddress;

        properties = new Properties();
        properties.setProperty("mail.transport.protocol", "smtp");
        if (!StringUtils.isEmpty(host)) {
            properties.setProperty("mail.smtp.host", host);
        }
        if (!StringUtils.isEmpty(port)) {
            properties.setProperty("mail.smtp.port", port);
        }
        if (!StringUtils.isEmpty(userName)) {
            properties.setProperty("mail.smtp.security", "true");
        } else {
            properties.setProperty("mail.smtp.security", "false");
        }

        if (sslEnabled) {
            properties.setProperty("mail.smtp.starttls.enable", "true");
        }
    }

    private Authenticator getAuthenticator() {
        if (!StringUtils.isEmpty(userName)) {
            return new Authenticator() {
                @Override
                protected PasswordAuthentication getPasswordAuthentication() {
                    return new PasswordAuthentication(userName, password);
                }
            };
        } else {
            return null;
        }
    }

    public void send(String to, String title, String message) throws Exception {
        Session session = Session.getDefaultInstance(properties, getAuthenticator());
        // Create a default MimeMessage object.
        MimeMessage mimeMessage = new MimeMessage(session);
        // Set From: header field of the header.
        mimeMessage.setFrom(new InternetAddress(adminAddress));
        // Set To: header field of the header.
        mimeMessage.addRecipient(Message.RecipientType.TO, new InternetAddress(to));
        // Set Subject: header field
        mimeMessage.setSubject(title);
        // Now set the actual message
        mimeMessage.setText(message);
        // Send message
        Transport.send(mimeMessage);
    }
}


text:
import numpy as np
from nn_object_detection.object_detectors import NNObjectDetector
from rick.utils import plot_bbox
import tensorflow as tf

PATH_TO_CKPT = "/home/dlrc/projects/DLRCev3/object_detection/nn_object_detection/tf_train_dir/models/faster_rcnn_resnet_lego_v1/train/frozen_inference_graph.pb"
PATH_TO_LABELS = "/home/dlrc/projects/DLRCev3/object_detection/nn_object_detection/tf_train_dir/data/label_map.pbtxt"

import cv2
cap = cv2.VideoCapture('/home/dlrc/Videos/Webcam/2017-10-04-145623.webm')
detector = NNObjectDetector(PATH_TO_CKPT, PATH_TO_LABELS)
fgbg = cv2.bgsegm.createBackgroundSubtractorMOG()
while(1):
    tensors = [n.name for n in detector.detection_graph.as_graph_def().node]
    print(tensors)
    break
    ret, frame = cap.read()
    #fgmask = fgbg.apply(frame)

    bboxes = detector.detect_with_threshold(frame)
    for bbox, score in  bboxes:
        plot_bbox(frame, bbox, score)

    cv2.imshow('frame',frame)
    k = cv2.waitKey(30) & 0xff
    if k == 27:
        break
cap.release()
cv2.destroyAllWindows()


text:
<?php
namespace p3k;

class Geocoder {

  public static function adrFromLocation($lat, $lng) {
    $response = self::_reverse($lat, $lng);

    if(!$response)
      return false;

    if(!property_exists($response, 'address'))
      return false;

    $address = $response->address;

    $result = new geocode\Result;

    $result->latitude = $lat;
    $result->longitude = $lng;

    if(property_exists($address, 'Postal'))
      $result->postalCode = $address->Postal;

    if(property_exists($address, 'Region'))
      $result->regionName = $address->Region;

    if(property_exists($address, 'City'))
      $result->localityName = $address->City;
    elseif(property_exists($address, 'Subregion'))
      $result->localityName = $address->Subregion;
    elseif(property_exists($address, 'Neighborhood'))
      $result->localityName = $address->Neighborhood;

    if(property_exists($address, 'CountryCode'))
      $result->countryName = $address->CountryCode;

    return $result;
  }

  public static function geocode($input) {
    $response = self::_geocode($input);

    if(!$response || !property_exists($response, 'locations') || count($response->locations) == 0)
      return false;

    $location = $response->locations[0];
    $attributes = $location->feature->attributes;
    $geometry = $location->feature->geometry;

    $result = new geocode\Result;

    if($geometry) {
      $result->latitude = $geometry->y;
      $result->longitude = $geometry->x;
    }

    if($attributes->City)
      $result->localityName = $attributes->City;

    if($attributes->Region)
      $result->regionName = $attributes->Region;

    if($attributes->Country)
      $result->countryName = $attributes->Country;

    if($attributes->Postal) {
      $result->postalCode = $attributes->Postal;
    } else {
      // If no postal code is returned, but there was coordinates, then reverse geocode to find the postal code
      if($geometry) {
        $rev = self::_reverse($result->latitude, $result->longitude);
        if($rev && property_exists($rev->address, 'Postal')) {
          $result->postalCode = $rev->address->Postal;
        }
      }
    }

    if($location->name)
      $result->fullAddress = $location->name;

    return $result;
  }

  private static function _reverse($lat, $lng) {
    $ch = curl_init();
    curl_setopt($ch, CURLOPT_URL, 'https://geocode.arcgis.com/arcgis/rest/services/World/GeocodeServer/reverseGeocode?location='.$lng.'%2C'.$lat.'&outSR=4326&f=json&distance=10000');
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
    // curl_setopt($ch, CURLOPT_USERAGENT, '');
    curl_setopt($ch, CURLOPT_TIMEOUT, 5);
    $result = curl_exec($ch);

    if($result == FALSE)
      return FALSE;

    return json_decode($result);
  }

  private static function _geocode($input) {
    $ch = curl_init();

    $params = [
      'f' => 'json',
      'outSR' => 4326,
      'text' => $input,
      'outFields' => 'City,Region,Country,Postal',
    ];

    curl_setopt($ch, CURLOPT_URL, 'https://geocode.arcgis.com/arcgis/rest/services/World/GeocodeServer/find?' . http_build_query($params));
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
    // curl_setopt($ch, CURLOPT_USERAGENT, '');
    curl_setopt($ch, CURLOPT_TIMEOUT, 5);
    $result = curl_exec($ch);

    if($result == FALSE)
      return FALSE;

    return json_decode($result);
  }

}


text:
'use strict';

goog.require('cheat.application.Directive.ToDoList');
goog.require('cheat.application.Directive.CheatsList');
goog.require('cheat.application.Service.TokenService');
goog.require('cheat.application.Service.DataService');

/**
 * @ngdoc overview
 * @name cheatApp
 * @description
 * # cheatApp
 *
 * Main module of the application.
 */
angular
  .module('cheatApp', [
    'ngAnimate',
    'ngCookies',
    'ngRoute',
    'ngSanitize',
    'ngTouch',
    'ui.sortable'
  ])
  .config(function ($routeProvider) {
    $routeProvider
      .when('/', {
        templateUrl: 'views/main.html'
      })
      .otherwise({
        redirectTo: '/'
      });
  })
  .service('TokenService', cheat.application.Service.TokenService)
  .service('DataService', cheat.application.Service.DataService)
  .directive('todo', cheat.application.Directive.ToDoList.factory)
  .directive('cheats', cheat.application.Directive.CheatsList.factory);


text:
const reduce = require("lodash/reduce")
const map = require("lodash/map")
const reject = require("lodash/reject")
const isUndefined = require("lodash/isUndefined")

export class Utils {
  static guidCounter = 0

  static guid(prefix=""){
    let id = ++Utils.guidCounter
    return prefix.toString() + id
  }

  static collapse(collection, seed){
    const reducer = (current, fn)=> fn(current)
    return reduce(collection, reducer, seed)
  }

  static instanceOf(klass){
    return (val)=> val instanceof klass
  }

  static interpolate(str, interpolations){
    return str.replace(
  		/{([^{}]*)}/g,
  		(a, b) => {
  			var r = interpolations[b];
  			return typeof r === 'string' || typeof r === 'number' ? r : a;
  		}
    )
  }

  static translate(key, interpolations?){
    if(interpolations){
      return Utils.interpolate(key, interpolations)
    } else {
      return key
    }
  }

  static computeOptionKeys(options, fields, defaultKey){
    return map(options, (option)=> {
      return Utils.generateKeyFromFields(option, fields, defaultKey)
    })
  }

  static generateKeyFromFields(ob, fields, defaultKey){
    if(ob.key){
      return ob
    }
    let fieldValues = reject(map(fields, (field)=> ob[field]), isUndefined)
    if(fieldValues.length > 0){
      ob.key = fieldValues.join("_")
    } else {
      ob.key = defaultKey
    }
    return ob
  }
}


text:
define( 'argumenta/widgets/Argument',
[
    "require-jquery",
    "argumenta/widgets/Base",
    "text!./Argument/template.html.mustache",
    "argumenta/widgets/Discussion",
    "argumenta/widgets/DiscussionEditor",
    "argumenta/widgets/Proposition",
    "argumenta/sandbox"
],
function( $, Base, Template, Discussion, DiscussionEditor, Proposition, Sandbox ) {

    /**
     * @class Argument
     *
     * Widget options may be set in a combination of four ways:
     *
     *   1. As a module default on the prototype.
     *   2. As instance options.
     *   3. As individual custom `data-<option>` attributes in HTML.
     *   4. As bundle of JSON properties in a `data-<moduleID>` HTML attribute.
     *
     * Example JS for module defaults:
     *
     *     Argument.prototype.defaultOptions = {option: value};
     *
     * Example JS for instance options:
     *
     *     var argument = new Argument({
     *         sha1: <sha1>,
     *         show_propositions: true
     *     });
     *
     * Example HTML with individual attributes:
     *
     *     <div class="argument-widget"
     *          data-sha1="<sha1>"
     *          data-show_propositions="true" >
     *

     *
     * Example HTML with options bundle in a `data-<moduleID>` attribute:
     *
     *     <div class="argument-widget"
     *          data-argument="{sha1: <sha1>, show_propositions: true}" >
     *

     *
     * @param opts {Object} Argument widget options.
     * @param opts.sha1 {String} The argument's sha1.
     * @param opts.repo {String} The argument's repo. (Example: "user/repo")
     * @param opts.show_discussions {Boolean} Whether to show discussions initially.
     * @param opts.show_propositions {Boolean} Whether to show propositions initially.
     * @param opts.propositions {Array<Object>} An array of argument propositions data.
     * @note Propositions may be set as options, or loaded via AJAX.
     */
    var Argument = Base.module( {

        moduleID: 'Argument',
        template: Template,

        defaults: {
            show_discussions: false,
            show_propositions: true
        },

        init: function( options ) {
            var self = this;
            self.initArgument( options );
        },

        prototype: {

            // Inits this argument widget.
            initArgument: function() {
                var self = this;
                self.propositionWidgets = [];
                self.propositionsVisible = false;
                self._initData();
                if (self.options.show_discussions) {
                    var onComplete = function() {
                        if (self.discussions.length == 0) {
                            self.toggleDiscussions();
                            self.startDiscussion();
                        }
                    };
                    self.toggleDiscussions(onComplete);
                }
            },

            // Gets the object type.
            getType: function() {
                return this.options.object_type;
            },

            // Gets the object sha1.
            getSha1: function() {
                return this.options.sha1;
            },

            // Gets the committer, if set.
            getCommitter: function() {
                return this.options.commit
                    ? this.options.commit.committer
                    : '';
            },

            // Sets propositions data, and inits elements.
            setPropositions: function( props ) {
                var self = this;
                self.propositions = props;
                self._initPropositionElements();
            },

            // Gets child proposition widgets.
            getPropositionWidgets: function() {
                var self = this;
                return self.propositionWidgets;
            },

            // Sets discussions data for this argument.
            setDiscussions: function(discussions) {
                var self = this;
                self.discussions = [];
                self.discussionsCount.text(discussions.length);
                self.discussionsContainer.empty();
                for (var i = 0; i < discussions.length; i++) {
                    var discussion = new Discussion(discussions[i]);
                    self.discussions.push(discussion);
                    self.discussionsContainer.append(discussion.element);
                }
                self.options.discussions = discussions;
                self.options.discussions_count = discussions.length;
            },

            // Toggles argument details for widget.
            toggleArgumentDetails: function() {
                var self = this;
                self.togglePropositions();
            },

            // Toggle discussions for widget.
            toggleDiscussions: function(onComplete) {
                var self = this;
                if ( self.discussions ) {
                    self.discussionsPanel.toggle(300);
                }
                else {
                    self._initDiscussions(onComplete);
                    self.discussionsPanel.css({ display: 'block' });
                    self.discussionsPanel.show(300);
                }
            },

            // Toggle propositions for widget.
            togglePropositions: function() {
                var self = this;
                if ( self.propositions ) {
                    self.content.toggle(300);
                    self.propositionsVisible = !self.propositionsVisible;
                }
                else {
                    self._initPropositions();
                }
            },

            // Starts a new discussion.
            startDiscussion: function() {
                var self = this;
                if (self.discussionEditor.length == 0) {
                    self._initDiscussionEditor();
                }
                else {
                    self.discussionContainer.toggle(300);
                }
            },

            // Binds UI events, extending Base behavior.
            _bindUI: function() {
                var self = this;

                // Save reference to inner container and menu.
                self.container = self.element.children(".argument-container");
                self.main = self.container.children(".argument-main");
                self.title = self.main.children('.argument-title');
                self.menu = self.container.find('.argument-menu').first();
                self.deleteButton = self.menu.find('.action-delete');
                self.editButton = self.menu.find('.action-edit');
                self.content = self.container.children('.argument-content');
                self.propositionsContainer = self.content.children('.propositions-container');
                self.footer = self.content.children('.argument-footer');
                self.discuss = self.footer.children('.argument-discuss');
                self.discussionContainer = self.footer.children('.discussion-container');
                self.discussionEditor = self.discussionContainer.children('.discussion-editor');
                self.discussionsPanel = self.footer.children('.discussions-panel');
                self.discussionsHeader = self.discussionsPanel.children('.discussions-header');
                self.discussionsCount = self.discussionsHeader.children('.discussions-count');
                self.discussionsContainer = self.discussionsPanel.children('.discussions-container');
                self.showDiscussions = self.footer.children('.show-discussions');

                // Enable the delete menu action if logged in and owner.
                var username = Sandbox.username();
                var committer = self.getCommitter();
                if (username && username == committer) {
                    self.deleteButton.parent().removeClass('disabled');
                }

                // Edit menu action.
                self.editButton.click(function() {
                    var base = self.options.base_url;
                    var sha1 = self.getSha1();
                    var path = '/arguments/' + sha1 + '/edit';
                    var url = base + path;
                    window.location.href = url;
                });
                if (username != committer) {
                    self.editButton.text("Fork Repo");
                }

                // Click behavior for title.
                self.title.children('a').on('click', function( event ) {
                    event.stopPropagation();
                });

                // Click behavior for discuss.
                self.discuss.on('click', function( event ) {
                    event.preventDefault();
                    self.discuss.blur();
                    self.startDiscussion();
                });

                // Click behavior for show discussions.
                self.showDiscussions.on('click', function( event ) {
                    event.preventDefault();
                    self.showDiscussions.blur();
                    self.toggleDiscussions();
                });

                // Click behavior for menu.
                self.menu.on('click', function( event ) {
                    self.element.temporaryClass('menu-just-clicked', 300);
                });

                // Click behavior for `Delete Repo`.
                self.deleteButton.on('click', function( event ) {
                    var name = self.options.commit.committer;
                    var repo = self.options.repo;
                    var base = self.options.base_url;
                    var path = '/' + name + '/' + repo + '.json';
                    var url  = base + path;
                    var settings = {
                        type: 'DELETE'
                      , url: url
                    };
                    var success = function( data, textStatus, jqXHR ) {
                        Sandbox.notify( data.message );
                        self.element.remove();
                    };
                    var error = function( data ) {
                        Sandbox.error(data);
                    };
                    $.ajax(settings).done(success).fail(error);
                });

                // Click behavior for main panel.
                self.container.children(".argument-main").on('click', function( event ) {

                    // Don't expand on mouse release after drag.
                    if ( self.element.hasClass('ui-state-just-dragged') )
                        return;

                    // Don't expand on mouse release after menu click.
                    if ( self.element.hasClass('menu-just-clicked') )
                        return;

                    // Don't interfere with links.
                    if ($(event.target).is('a'))
                        return;

                    // Toggle details on click.
                    self.toggleArgumentDetails();
                } );

                // Make draggable.
                self.element.draggable( {
                    helper: 'clone',
                    appendTo: $('.drag-container')[0] || $('body'),
                    revert: true,
                    cancel: 'input',
                    handle: self.container.children(".argument-main"),
                    cursor: 'move',

                    start: function(event, ui) {

                        // Add drag class to body.
                        $('body').addClass('argumenta-drag');

                        // Prevent other actions on drag.
                        ui.helper.addClass('ui-state-just-dragged drag');

                        // Fix clone size.
                        ui.helper.css( {
                            'height': self.element.height() + 'px',
                            'width': self.element.width() + 'px'
                        } );

                        // Hide original.
                        self.element.css('visibility', "hidden");
                    },

                    stop: function(event, ui) {

                        // Remove drag class from body.
                        $('body').removeClass('argumenta-drag');

                        // Prevent other actions on drag, then cleanup.
                        setTimeout(function() {
                            ui.helper.removeClass('ui-state-just-dragged');
                        }, 300);

                        // Reveal original.
                        self.element.css('visibility', "");
                    }
                } );
            },

            // Inits widget data.
            _initData: function() {
                var self = this;
                if ( !self.options.title ||
                     !self.options.premises ||
                     !self.options.conclusion )
                {
                    self._loadData();
                }
                else if (self.options.show_propositions) {
                    self._initPropositions();
                }
            },

            // Loads argument data by API.
            _loadData: function() {
                var self = this;
                var sha1 = self.options.sha1;
                var repo = self.options.repo;
                if (sha1) {
                    self._loadDataBySha1();
                }
                else if (repo && typeof repo == 'string') {
                    var matches = repo.match(/(.+)\/(.+)/);
                    var username = matches[1];
                    var reponame = matches[2];
                    self._loadDataByRepo(username, reponame);
                }
            },

            // Loads argument data by repo.
            _loadDataByRepo: function(username, reponame) {
                var self = this;
                var repo = username + '/' + encodeURIComponent(reponame);
                var base = self.options.base_url;
                var path = '/' + repo + '.json';
                var url  = base + path;
                var success = function( data ) {
                    var argument = data.repo.target;
                    argument.commit = data.repo.commit;
                    $.extend(self.options, argument);

                    self._refresh();
                    if ( self.options.show_propositions ) {
                        self._initPropositions();
                    }
                };
                var error = function( data ) {
                    Sandbox.error(data);
                };
                $.ajax(url).done(success).fail(error);
            },

            // Loads argument data by SHA-1.
            _loadDataBySha1: function() {
                var self = this;
                var sha1 = self.options.sha1;
                var base = self.options.base_url;
                var path = '/arguments/' + sha1 + '.json';
                var url  = base + path;
                var success = function( data ) {
                    $.extend(self.options, data.argument);
                    self._refresh();
                    if ( self.options.show_propositions ) {
                        self._initPropositions();
                    }
                };
                var error = function( data ) {
                    Sandbox.error(data);
                };
                $.ajax(url).done(success).fail(error);
            },

            // Inits discussion editor.
            _initDiscussionEditor: function() {
                var self = this;
                var update = function() {
                    self._updateDiscussions();
                    self.discussionsPanel.show(300);
                    self.discussionContainer.empty();
                    self.discussionEditor = null;
                };
                var discussionEditor = new DiscussionEditor({
                    target_type: self.getType(),
                    target_sha1: self.getSha1(),
                    on_create: update
                });
                self.discussionContainer.append(discussionEditor.element);
                self.discussionEditor = discussionEditor.element;
            },

            // Inits discussions.
            _initDiscussions: function(onComplete) {
                var self = this;
                self._updateDiscussions(onComplete);
            },

            // Updates discussions.
            _updateDiscussions: function(onComplete) {
                var self = this;
                var base = self.options.base_url;
                var sha1 = self.getSha1();
                var path = '/arguments/' + sha1 + '/discussions.json';
                var url = base + path;
                var success = function(data) {
                    self.setDiscussions(data.discussions);
                };
                var error = function(data) {
                    Sandbox.error(data);
                };
                $.get(url).done(success).fail(error).always(onComplete);
            },

            // Inits propositions data and elements.
            _initPropositions: function() {
                var self = this;

                if ( self.options.propositions ) {
                    self.setPropositions( self.options.propositions );
                }
                else {
                    var sha1 = this.options.sha1;
                    var base = self.options.base_url;
                    var path = '/arguments/' + sha1 + '/propositions.json';
                    var url  = base + path;
                    var success = function( data ) {
                        self.setPropositions( data.propositions );
                    }
                    var error = function( data ) {
                        Sandbox.error(data);
                    }
                    $.ajax(url).done(success).fail(error);
                }
            },

            // Inits proposition elements.
            _initPropositionElements: function() {
                var self = this;
                var container = self.propositionsContainer;

                // Hide container.
                container.hide();

                // Clear any current propositions.
                container.empty();
                self.propositionWidgets.length = 0;

                // Create the new proposition elements.
                for ( var i=0, len=self.propositions.length; i<len; i++ ) {
                    var data = self.propositions[i];
                    var position = i + 1;
                    var role = (position < len) ? 'premise' : 'conclusion';
                    var index = (role === 'premise') ? position : 'C';

                    // Extend proposition data with its argument index.
                    data = $.extend( {}, data, { 'index': index } );

                    // Create a widget from the proposition data.
                    var proposition = new Proposition( data );

                    // Add a class for this proposition's role.
                    proposition.element.addClass( role );

                    // Append the proposition and save a reference.
                    container.append( proposition.element );
                    self.propositionWidgets.push( proposition );
                }
                // Reveal container.
                container.show();
                self.content.css({ display: 'block' });
                self.content.show();
                self.propositionsVisible = true;
            },

            // Gets view options for template, extending Base behavior.
            _getViewOptions: function() {
                var self = this;
                var base      = self.options.base_url;
                var sha1      = self.options.sha1 || '';
                var reponame  = self.options.repo;
                var committer = self.getCommitter();
                var repoUrl   = base + '/' + committer + '/' + encodeURIComponent(reponame);
                var viewOptions = {
                    partial_sha1: sha1.substr(0, 20),
                    repo_url: repoUrl,
                    argument_desc:
                        'Argument Repo\r\n'
                        + committer + ' / ' + self.options.repo,
                    object_desc:
                        'Argument Object\r\n'
                        + 'SHA1: ' + sha1
                };
                return $.extend( viewOptions, self.options );
            }
        },

        static: {
        }
    } );

    return Argument;
} );


text:
package com.adobe.epubcheck.opf;

import static com.google.common.base.Preconditions.checkNotNull;

import java.util.Set;

import com.adobe.epubcheck.api.EPUBProfile;
import com.adobe.epubcheck.api.FeatureReport;
import com.adobe.epubcheck.api.OptionSet;
import com.adobe.epubcheck.api.OptionSet.OptionSetBuilder;
import com.adobe.epubcheck.api.Report;
import com.adobe.epubcheck.ocf.OCFPackage;
import com.adobe.epubcheck.util.EPUBVersion;
import com.adobe.epubcheck.util.GenericResourceProvider;
import com.adobe.epubcheck.vocab.Property;
import com.google.common.base.Optional;
import com.google.common.base.Preconditions;
import com.google.common.base.Predicate;
import com.google.common.base.Strings;
import com.google.common.collect.ImmutableSet;

/**
 * Holds various contextual objects used during validation. This validation
 * context is used by both {@link ContentChecker} and {@link DocumentValidator}
 * instances.
 *
 */
public final class ValidationContext
{
  /**
   * The path to the validated resource. Guaranteed non-null.
   */
  public final String path;
  /**
   * The media type of the validated resource. Guaranteed non-null.
   */
  public final String mimeType;
  /**
   * The EPUB version being used for validation. Guaranteed non-null.
   */
  public final EPUBVersion version;
  /**
   * The validation profile in use (e.g. DEFAULT, EDUPUB, etc.). Guaranteed
   * non-null.
   */
  public final EPUBProfile profile;
  /**
   * The report object used to log validation messages. Guaranteed non-null.
   */
  public final Report report;
  /**
   * Used to report some features of the validated resource, without logging.
   * Guaranteed non-null.
   */
  public final FeatureReport featureReport;

  /**
   * Used to open resource streams. Guaranteed non-null.
   */
  public final GenericResourceProvider resourceProvider;
  /**
   * The OCF Package the resource being validated belongs to. Is absent for
   * single-file validations.
   */
  public final Optional<OCFPackage> ocf;
  /**
   * The cross-reference checker, absent for single-file validation.
   */
  public final Optional<XRefChecker> xrefChecker;
  /**
   * The set of 'dc:type' values declared at the OPF level. Guaranteed non-null,
   * can be empty.
   */
  public final Set<String> pubTypes;
  /**
   * The set of properties associated to the resource being validated.
   */
  public final Set<Property> properties;
  /**
   * The options set for the validation. Guaranteed non-null, can be empty.
   */
  public final OptionSet options;

  private ValidationContext(String path, String mimeType, EPUBVersion version, EPUBProfile profile,
      Report report, FeatureReport featureReport, GenericResourceProvider resourceProvider,
      Optional<OCFPackage> ocf, Optional<XRefChecker> xrefChecker, Set<String> pubTypes,
      Set<Property> properties, OptionSet options)
  {
    super();
    this.path = path;
    this.mimeType = mimeType;
    this.version = version;
    this.profile = profile;
    this.report = report;
    this.featureReport = featureReport;
    this.resourceProvider = resourceProvider;
    this.ocf = ocf;
    this.xrefChecker = xrefChecker;
    this.pubTypes = pubTypes;
    this.properties = properties;
    this.options = options;
  }

  /**
   * Builds a new {@link ValidationContext} from various member objects or by
   * copying a parent context.
   *
   */
  public static final class ValidationContextBuilder
  {
    private String path = null;
    private String mimeType = null;
    private EPUBVersion version = null;
    private EPUBProfile profile = null;
    private Report report = null;
    private FeatureReport featureReport = null;

    private GenericResourceProvider resourceProvider = null;
    private OCFPackage ocf = null;
    private XRefChecker xrefChecker = null;
    private Set<String> pubTypes = null;
    private ImmutableSet.Builder<Property> properties = ImmutableSet.<Property> builder();
    private OptionSet options = null;

    public ValidationContextBuilder()
    {
    }

    public ValidationContextBuilder(ValidationContext context)
    {
      copy(context);
    }

    public ValidationContextBuilder copy(ValidationContext context)
    {
      path = context.path;
      mimeType = context.mimeType;
      version = context.version;
      profile = context.profile;
      report = context.report;
      featureReport = context.featureReport;
      resourceProvider = context.resourceProvider;
      ocf = context.ocf.orNull();
      xrefChecker = context.xrefChecker.orNull();
      pubTypes = context.pubTypes;
      properties = ImmutableSet.<Property> builder().addAll(context.properties);
      options = context.options;
      return this;
    }

    public ValidationContextBuilder path(String path)
    {
      this.path = path;
      return this;
    }

    public ValidationContextBuilder mimetype(String mimetype)
    {
      this.mimeType = mimetype;
      return this;
    }

    public ValidationContextBuilder version(EPUBVersion version)
    {
      this.version = version;
      return this;
    }

    public ValidationContextBuilder profile(EPUBProfile profile)
    {
      this.profile = profile;
      return this;
    }

    public ValidationContextBuilder report(Report report)
    {
      this.report = report;
      return this;
    }

    public ValidationContextBuilder featureReport(FeatureReport featureReport)
    {
      this.featureReport = featureReport;
      return this;
    }

    public ValidationContextBuilder resourceProvider(GenericResourceProvider resourceProvider)
    {
      this.resourceProvider = resourceProvider;
      return this;
    }

    public ValidationContextBuilder ocf(OCFPackage ocf)
    {
      this.ocf = ocf;
      return this;
    }

    public ValidationContextBuilder xrefChecker(XRefChecker xrefChecker)
    {
      this.xrefChecker = xrefChecker;
      return this;
    }

    public ValidationContextBuilder pubTypes(Set<String> pubTypes)
    {
      this.pubTypes = pubTypes;
      return this;
    }

    public ValidationContextBuilder properties(Set<Property> properties)
    {
      this.properties = ImmutableSet.builder();
      if (properties != null)
      {
        this.properties.addAll(properties);
      }
      return this;
    }

    public ValidationContextBuilder addProperty(Property property)
    {
      properties.add(Preconditions.checkNotNull(property));
      return this;
    }

    public ValidationContextBuilder options(OptionSet options)
    {
      if (options != null)
      {
        this.options = options;
      }
      return this;
    }

    public ValidationContext build()
    {
      resourceProvider = (resourceProvider == null && ocf != null) ? ocf : resourceProvider;
      checkNotNull(resourceProvider);
      checkNotNull(report);
      return new ValidationContext(Strings.nullToEmpty(path), Strings.nullToEmpty(mimeType),
          version != null ? version : EPUBVersion.Unknown,
          profile != null ? profile : EPUBProfile.DEFAULT, report,
          featureReport != null ? featureReport : new FeatureReport(), resourceProvider,
          Optional.fromNullable(ocf), Optional.fromNullable(xrefChecker),
          pubTypes != null ? ImmutableSet.copyOf(pubTypes) : ImmutableSet.<String> of(),
          properties.build(), options != null ? options : new OptionSetBuilder().build());
    }
  }

  /**
   * Utility to create {@link Predicate}s applying to {@link ValidationContext}
   * instances.
   *
   */
  public static final class ValidationContextPredicates
  {

    /**
     * Returns a predicate that evaluates to true if the given
     * property is declared in the context being tested.
     */
    public static Predicate<ValidationContext> hasProp(final Property property)
    {
      return new Predicate<ValidationContext>()
      {
        @Override
        public boolean apply(ValidationContext input)
        {
          return input.properties.contains(property);
        }
      };
    }

    /**
     * Returns a predicate that evaluates to true if the given
     * publication dc:type is declared in the context being tested.
     */
    public static Predicate<ValidationContext> hasPubType(final String type)
    {
      return new Predicate<ValidationContext>()
      {
        @Override
        public boolean apply(ValidationContext input)
        {
          return input.pubTypes.contains(type);
        }
      };
    }

    /**
     * Returns a predicate that evaluates to true if the context
     * being tested has the given media type.
     */
    public static Predicate<ValidationContext> mimetype(final String mimetype)
    {
      return new Predicate<ValidationContext>()
      {
        @Override
        public boolean apply(ValidationContext input)
        {
          return input.mimeType.equals(mimetype);
        }
      };
    }

    /**
     * Returns a predicate that evaluates to true if the context
     * being tested has the given path.
     */
    public static Predicate<ValidationContext> path(final String path)
    {
      return new Predicate<ValidationContext>()
      {
        @Override
        public boolean apply(ValidationContext input)
        {
          return input.path.equals(path);
        }
      };
    }

    /**
     * Returns a predicate that evaluates to true if the context
     * being tested declares the given validation profile.
     */
    public static Predicate<ValidationContext> profile(final EPUBProfile profile)
    {
      return new Predicate<ValidationContext>()
      {
        @Override
        public boolean apply(ValidationContext input)
        {
          return input.profile.equals(profile);
        }
      };
    }

    /**
     * Returns a predicate that evaluates to true if the context
     * being tested declares the given EPUB version.
     */
    public static Predicate<ValidationContext> version(final EPUBVersion version)
    {
      return new Predicate<ValidationContext>()
      {
        @Override
        public boolean apply(ValidationContext input)
        {
          return input.version.equals(version);
        }
      };
    }

    private ValidationContextPredicates()
    {
    }
  }

}


text:
"""
    storage.py
    Contains functions pertaining to saving/loading data files.
"""

import os
import gzip
import bz2
import argparse

try:
    import cPickle as pickle
except:
    import pickle

def save(obj, fname):
    """
        Saves the given object to the given file
        using pickle and gzip (if the file name
        in .gz)
    """
    ext = os.path.splitext(fname)[1]
    if ext == '.gz':
        file = gzip.GzipFile(fname, 'wb')
    elif ext == '.bz2':
        file = bz2.BZ2File(fname, 'wb')
    else:
        file = open(fname, 'wb')

    # Use highest pickle protocol
    pickle.dump(obj, file, -1)
    file.close()

def load(fname):
    """
        Loads the object pickled in fname.
        Decompresses a gzipped file if it
        ends in .gz
    """
    ext = os.path.splitext(fname)[1]
    if ext == '.gz':
        file = gzip.GzipFile(fname, 'rb')
    elif ext == '.bz2':
        file = bz2.BZ2File(fname, 'rb')
    else:
        file = open(fname, 'rb')

    obj = pickle.load(file)

    file.close()

    if isinstance(obj, list) and len(obj) == 1:
        obj = obj[0]

    return obj


text:
from datetime import date, datetime, timedelta
import json

from django.core.cache import cache

from nose.tools import eq_

from kitsune.customercare.tests import reply
from kitsune.kpi.cron import update_contributor_metrics
from kitsune.kpi.models import (
    Metric, AOA_CONTRIBUTORS_METRIC_CODE, KB_ENUS_CONTRIBUTORS_METRIC_CODE,
    KB_L10N_CONTRIBUTORS_METRIC_CODE, L10N_METRIC_CODE,
    SUPPORT_FORUM_CONTRIBUTORS_METRIC_CODE, VISITORS_METRIC_CODE,
    EXIT_SURVEY_YES_CODE, EXIT_SURVEY_NO_CODE, EXIT_SURVEY_DONT_KNOW_CODE)
from kitsune.kpi.tests import metric, metric_kind
from kitsune.products.tests import product
from kitsune.sumo.helpers import urlparams
from kitsune.sumo.tests import TestCase
from kitsune.sumo.urlresolvers import reverse
from kitsune.questions.tests import answer, answervote, question
from kitsune.users.tests import user
from kitsune.wiki.tests import document, revision, helpful_vote

class KpiApiTests(TestCase):
    def _make_elastic_metric_kinds(self):
        click_kind = metric_kind(code='search clickthroughs:elastic:clicks',
                                 save=True)
        search_kind = metric_kind(code='search clickthroughs:elastic:searches',
                                  save=True)
        return click_kind, search_kind

    def _make_contributor_metric_kinds(self):
        metric_kind(code=AOA_CONTRIBUTORS_METRIC_CODE, save=True)
        metric_kind(code=KB_ENUS_CONTRIBUTORS_METRIC_CODE, save=True)
        metric_kind(code=KB_L10N_CONTRIBUTORS_METRIC_CODE, save=True)
        metric_kind(code=SUPPORT_FORUM_CONTRIBUTORS_METRIC_CODE, save=True)

    def _get_api_result(self, name, **kwargs):
        """Helper to make API calls, parse the json and return the result."""
        url = reverse(name)
        url = urlparams(url, format='json', **kwargs)
        response = self.client.get(url)
        eq_(200, response.status_code)
        return json.loads(response.content)

    def test_questions(self):
        """Test questions API call."""
        # A question with a solution:
        a = answer(save=True)
        a.question.solution = a
        a.question.save()
        # A question with an answer:
        answer(save=True)
        # A question without answers:
        question(save=True)
        # A locked question that shouldn't be counted for anything
        question(is_locked=True, save=True)

        r = self._get_api_result('api.kpi.questions')
        eq_(r['objects'][0]['solved'], 1)
        eq_(r['objects'][0]['responded_24'], 2)
        eq_(r['objects'][0]['responded_72'], 2)
        eq_(r['objects'][0]['questions'], 3)

    def test_questions_by_locale(self):
        """Test locale filtering of questions API call."""
        # An en-US question with a solution:
        q = question(locale='en-US', save=True)
        a = answer(question=q, save=True)
        q.solution = a
        q.save()
        # An en-US question with an answer:
        q = question(locale='en-US', save=True)
        answer(question=q, save=True)
        # An en-US question without answers:
        question(locale='en-US', save=True)

        # A pt-BR question without answers:
        question(locale='pt-BR', save=True)

        # Verify no locale filtering:
        r = self._get_api_result('api.kpi.questions')
        eq_(r['objects'][0]['solved'], 1)
        eq_(r['objects'][0]['responded_24'], 2)
        eq_(r['objects'][0]['responded_72'], 2)
        eq_(r['objects'][0]['questions'], 4)

        # Verify locale=en-US
        r = self._get_api_result('api.kpi.questions', locale='en-US')
        eq_(r['objects'][0]['solved'], 1)
        eq_(r['objects'][0]['responded_24'], 2)
        eq_(r['objects'][0]['responded_72'], 2)
        eq_(r['objects'][0]['questions'], 3)

        # Verify locale=pt-BR
        r = self._get_api_result('api.kpi.questions', locale='pt-BR')
        eq_(r['objects'][0]['questions'], 1)
        assert 'solved' not in r['objects'][0]
        assert 'responded_24' not in r['objects'][0]
        assert 'responded_72' not in r['objects'][0]

    def test_questions_by_product(self):
        """Test product filtering of questions API call."""
        firefox_os = product(slug='firefox-os', save=True)
        firefox = product(slug='firefox', save=True)

        # A Firefox OS question with a solution:
        q = question(save=True)
        q.products.add(firefox_os)
        a = answer(question=q, save=True)
        q.solution = a
        q.save()

        # A Firefox OS question with an answer:
        q = question(save=True)
        q.products.add(firefox_os)
        answer(question=q, save=True)

        # A Firefox OS question without answers:
        q = question(save=True)
        q.products.add(firefox_os)

        # A Firefox question without answers:
        q = question(locale='pt-BR', save=True)
        q.products.add(firefox)

        # Verify no product filtering:
        r = self._get_api_result('api.kpi.questions')
        eq_(r['objects'][0]['solved'], 1)
        eq_(r['objects'][0]['responded_24'], 2)
        eq_(r['objects'][0]['responded_72'], 2)
        eq_(r['objects'][0]['questions'], 4)

        # Verify product=firefox-os
        r = self._get_api_result('api.kpi.questions', product='firefox-os')
        eq_(r['objects'][0]['solved'], 1)
        eq_(r['objects'][0]['responded_24'], 2)
        eq_(r['objects'][0]['responded_72'], 2)
        eq_(r['objects'][0]['questions'], 3)

        # Verify product=firefox
        r = self._get_api_result('api.kpi.questions', product='firefox')
        eq_(r['objects'][0]['questions'], 1)
        assert 'solved' not in r['objects'][0]
        assert 'responded_24' not in r['objects'][0]
        assert 'responded_72' not in r['objects'][0]

    def test_questions_inactive_user(self):
        """Verify questions from inactive users aren't counted."""
        # Two questions for an inactive user.
        # They shouldn't show up in the count.
        u = user(is_active=False, save=True)
        question(creator=u, save=True)
        question(creator=u, save=True)

        r = self._get_api_result('api.kpi.questions')
        eq_(len(r['objects']), 0)

        # Activate the user, now the questions should count.
        u.is_active = True
        u.save()
        cache.clear()  # We need to clear the cache for new results.

        url = reverse('api.kpi.questions')
        response = self.client.get(url + '?format=json')
        eq_(200, response.status_code)
        r = json.loads(response.content)
        eq_(r['objects'][0]['questions'], 2)

    def test_vote(self):
        """Test vote API call."""
        r = revision(save=True)
        helpful_vote(revision=r, save=True)
        helpful_vote(revision=r, save=True)
        helpful_vote(revision=r, helpful=True, save=True)

        a = answer(save=True)
        answervote(answer=a, save=True)
        answervote(answer=a, helpful=True, save=True)
        answervote(answer=a, helpful=True, save=True)

        r = self._get_api_result('api.kpi.votes')
        eq_(r['objects'][0]['kb_helpful'], 1)
        eq_(r['objects'][0]['kb_votes'], 3)
        eq_(r['objects'][0]['ans_helpful'], 2)
        eq_(r['objects'][0]['ans_votes'], 3)

    def test_kb_vote(self):
        """Test vote API call."""
        r1 = revision(document=document(locale='en-US', save=True), save=True)
        r2 = revision(document=document(locale='es', save=True), save=True)
        r3 = revision(document=document(locale='es', save=True), save=True)
        for r in [r1, r2, r3]:
            helpful_vote(revision=r, save=True)
            helpful_vote(revision=r, save=True)
            helpful_vote(revision=r, helpful=True, save=True)

        # Assign 2 documents to Firefox OS and 1 to Firefox
        firefox_os = product(slug='firefox-os', save=True)
        firefox = product(slug='firefox', save=True)
        r1.document.products.add(firefox_os)
        r2.document.products.add(firefox_os)
        r3.document.products.add(firefox)

        # All votes should be counted if we don't specify a locale
        r = self._get_api_result('api.kpi.kb-votes')
        eq_(r['objects'][0]['kb_helpful'], 3)
        eq_(r['objects'][0]['kb_votes'], 9)

        # Only en-US votes:
        r = self._get_api_result('api.kpi.kb-votes', locale='en-US')
        eq_(r['objects'][0]['kb_helpful'], 1)
        eq_(r['objects'][0]['kb_votes'], 3)

        # Only es votes:
        r = self._get_api_result('api.kpi.kb-votes', locale='es')
        eq_(r['objects'][0]['kb_helpful'], 2)
        eq_(r['objects'][0]['kb_votes'], 6)

        # Only Firefox OS votes:
        r = self._get_api_result('api.kpi.kb-votes', product='firefox-os')
        eq_(r['objects'][0]['kb_helpful'], 2)
        eq_(r['objects'][0]['kb_votes'], 6)

        # Only Firefox votes:
        r = self._get_api_result('api.kpi.kb-votes', product='firefox')
        eq_(r['objects'][0]['kb_helpful'], 1)
        eq_(r['objects'][0]['kb_votes'], 3)

        # Only Firefox OS + es votes:
        r = self._get_api_result(
            'api.kpi.kb-votes', product='firefox-os', locale='es')
        eq_(r['objects'][0]['kb_helpful'], 1)
        eq_(r['objects'][0]['kb_votes'], 3)

    def test_active_contributors(self):
        """Test active contributors API call."""
        # 2 en-US revisions by 2 contributors:
        r1 = revision(creator=user(save=True), save=True)
        r2 = revision(creator=user(save=True), save=True)
        # A translation with 2 contributors (translator + reviewer):
        d = document(parent=r1.document, locale='es', save=True)
        revision(document=d, reviewed=datetime.now(),
                 reviewer=r1.creator, creator=r2.creator, save=True)
        # 1 active support forum contributor:
        # A user with 10 answers
        u1 = user(save=True)
        for x in range(10):
            answer(save=True, creator=u1)
        # A user with 9 answers
        u2 = user(save=True)
        for x in range(9):
            answer(save=True, creator=u2)
        # A user with 1 answer
        u3 = user(save=True)
        answer(save=True, creator=u3)

        # An AoA reply (1 contributor):
        reply(save=True)

        # Create metric kinds and update metrics for tomorrow (today's
        # activity shows up tomorrow).
        self._make_contributor_metric_kinds()
        update_contributor_metrics(day=date.today() + timedelta(days=1))

        r = self._get_api_result('api.kpi.contributors')

        eq_(r['objects'][0]['en_us'], 2)
        eq_(r['objects'][0]['non_en_us'], 2)
        eq_(r['objects'][0]['support_forum'], 1)
        eq_(r['objects'][0]['aoa'], 1)

    def test_asker_replies_arent_a_contribution(self):
        """Verify that replies posted by the question creator aren't counted.

        If a user has 10 replies to their own question, they aren't counted as
        a contributor.
        """
        # A user with 10 answers to own question.
        q = question(save=True)
        u = q.creator
        for x in range(10):
            answer(creator=u, question=q, save=True)

        # Create metric kinds and update metrics for tomorrow (today's
        # activity shows up tomorrow).
        self._make_contributor_metric_kinds()
        update_contributor_metrics(day=date.today() + timedelta(days=1))

        r = self._get_api_result('api.kpi.contributors')
        eq_(r['objects'][0]['support_forum'], 0)

        # Change the question creator, now we should have 1 contributor.
        q.creator = user(save=True)
        q.save()
        cache.clear()  # We need to clear the cache for new results.

        Metric.objects.all().delete()
        update_contributor_metrics(day=date.today() + timedelta(days=1))

        r = self._get_api_result('api.kpi.contributors')
        eq_(r['objects'][0]['support_forum'], 1)

    def test_elastic_clickthrough_get(self):
        """Test elastic clickthrough read API."""
        click_kind, search_kind = self._make_elastic_metric_kinds()
        metric(kind=click_kind,
               start=date(2000, 1, 1),
               value=1,
               save=True)
        metric(kind=search_kind,
               start=date(2000, 1, 1),
               value=10,
               save=True)
        metric(kind=click_kind,
               start=date(2000, 1, 9),
               value=2,
               save=True)
        metric(kind=search_kind,
               start=date(2000, 1, 9),
               value=20,
               save=True)

        url = reverse('api.kpi.search-ctr')
        response = self.client.get(url + '?format=json')
        data = json.loads(response.content)
        eq_(data['objects'], [
            {'clicks': 2, 'searches': 20,
             'start': u'2000-01-09'},
            {'clicks': 1, 'searches': 10,
             'start': u'2000-01-01'}])

        # Test filtering by start date:
        response = self.client.get(url + '?format=json&min_start=2000-01-09')
        data = json.loads(response.content)
        eq_(data['objects'], [{u'searches': 20, u'start': u'2000-01-09',
                               u'clicks': 2}])

    def test_visitors(self):
        """Test unique visitors API call."""
        # Create the metric.
        kind = metric_kind(code=VISITORS_METRIC_CODE, save=True)
        metric(kind=kind, start=date.today(), end=date.today(), value=42,
               save=True)

        # There should be 42 visitors.
        r = self._get_api_result('api.kpi.visitors')
        eq_(r['objects'][0]['visitors'], 42)

    def test_l10n_coverage(self):
        """Test l10n coverage API call."""
        # Create the metrics
        kind = metric_kind(code=L10N_METRIC_CODE, save=True)
        metric(kind=kind, start=date.today(), end=date.today(), value=56,
               save=True)

        # The l10n coverage should be 56%.
        r = self._get_api_result('api.kpi.l10n-coverage')
        eq_(r['objects'][0]['coverage'], 56)

    def test_exit_survey_results(self):
        """Test the exist survey results API call."""
        # Create the metrics
        kind = metric_kind(code=EXIT_SURVEY_YES_CODE, save=True)
        metric(kind=kind, start=date.today(), end=date.today(), value=1337,
               save=True)
        kind = metric_kind(code=EXIT_SURVEY_NO_CODE, save=True)
        metric(kind=kind, start=date.today(), end=date.today(), value=42,
               save=True)
        kind = metric_kind(code=EXIT_SURVEY_DONT_KNOW_CODE, save=True)
        metric(kind=kind, start=date.today(), end=date.today(), value=777,
               save=True)

        # Verify the results returned from the API
        r = self._get_api_result('api.kpi.exit-survey')
        eq_(r['objects'][0]['yes'], 1337)
        eq_(r['objects'][0]['no'], 42)
        eq_(r['objects'][0]['dont_know'], 777)


text:
namespace content {

class MediaCaptureDevicesImpl : public MediaCaptureDevices {
 public:
  static MediaCaptureDevicesImpl* GetInstance();

  // Overriden from MediaCaptureDevices
  const MediaStreamDevices& GetAudioCaptureDevices() override;
  const MediaStreamDevices& GetVideoCaptureDevices() override;

  // Called by MediaStreamManager to notify the change of media capture
  // devices, these 2 methods are called in IO thread.
  void OnAudioCaptureDevicesChanged(const MediaStreamDevices& devices);
  void OnVideoCaptureDevicesChanged(const MediaStreamDevices& devices);

 private:
  friend struct base::DefaultSingletonTraits<MediaCaptureDevicesImpl>;
  MediaCaptureDevicesImpl();
  ~MediaCaptureDevicesImpl() override;

  void UpdateAudioDevicesOnUIThread(const content::MediaStreamDevices& devices);
  void UpdateVideoDevicesOnUIThread(const content::MediaStreamDevices& devices);

  // Flag to indicate if device enumeration has been done/doing.
  // Only accessed on UI thread.
  bool devices_enumerated_;

  // A list of cached audio capture devices.
  MediaStreamDevices audio_devices_;

  // A list of cached video capture devices.
  MediaStreamDevices video_devices_;

  DISALLOW_COPY_AND_ASSIGN(MediaCaptureDevicesImpl);
};

}  // namespace content

#endif  // CONTENT_BROWSER_RENDERER_HOST_MEDIA_MEDIA_CAPTURE_DEVICES_IMPL_H_


text:
otherbirds
==========

otherbirds website


text:
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:mvc="http://www.springframework.org/schema/mvc"
	xmlns:context="http://www.springframework.org/schema/context"
	xmlns:security="http://www.springframework.org/schema/security"
	xsi:schemaLocation="http://www.springframework.org/schema/mvc
	http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd
	http://www.springframework.org/schema/beans
	http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
	http://www.springframework.org/schema/context
	http://www.springframework.org/schema/context/spring-context-3.0.xsd
	http://www.springframework.org/schema/security
	http://www.springframework.org/schema/security/spring-security-3.2.xsd">

	<mvc:resources location="/resources/" mapping="/resources/**" />
	<mvc:annotation-driven />

	<bean
		class="org.springframework.web.servlet.view.InternalResourceViewResolver">
		<property name="viewClass"
			value="org.springframework.web.servlet.view.JstlView" />
		<property name="prefix" value="/WEB-INF/views/" />
		<property name="suffix" value=".jsp" />
	</bean>

	<!-- <bean id="datastoreServiceFactory" class="com.google.appengine.api.datastore.DatastoreServiceFactory"
		/> -->

	<bean id="datastoreService"
		class="com.google.appengine.api.datastore.DatastoreServiceFactory"
		factory-method="getDatastoreService" />

	<context:component-scan base-package="in.appdoor" />
</beans>


text:
namespace cc {
class BeginFrameSource;
class CompositorFrame;
class Surface;
class SurfaceFactoryClient;

class CC_SURFACES_EXPORT SurfaceManager {
 public:
  SurfaceManager();
  ~SurfaceManager();

  void RegisterSurface(Surface* surface);
  void DeregisterSurface(const SurfaceId& surface_id);

  // Destroy the Surface once a set of sequence numbers has been satisfied.
  void Destroy(std::unique_ptr<Surface> surface);

  Surface* GetSurfaceForId(const SurfaceId& surface_id);

  void AddObserver(SurfaceObserver* obs) { observer_list_.AddObserver(obs); }

  void RemoveObserver(SurfaceObserver* obs) {
    observer_list_.RemoveObserver(obs);
  }

  bool SurfaceModified(const SurfaceId& surface_id);

  // Called when a CompositorFrame is submitted to a SurfaceFactory for a given
  // |surface_id| for the first time.
  void SurfaceCreated(const SurfaceId& surface_id,
                      const gfx::Size& frame_size,
                      float device_scale_factor);

  // A frame for a surface satisfies a set of sequence numbers in a particular
  // id namespace.
  void DidSatisfySequences(const FrameSinkId& frame_sink_id,
                           std::vector<uint32_t>* sequence);

  void RegisterFrameSinkId(const FrameSinkId& frame_sink_id);

  // Invalidate a frame_sink_id that might still have associated sequences,
  // possibly because a renderer process has crashed.
  void InvalidateFrameSinkId(const FrameSinkId& frame_sink_id);

  // SurfaceFactoryClient, hierarchy, and BeginFrameSource can be registered
  // and unregistered in any order with respect to each other.
  //
  // This happens in practice, e.g. the relationship to between ui::Compositor /
  // DelegatedFrameHost is known before ui::Compositor has a surface/client).
  // However, DelegatedFrameHost can register itself as a client before its
  // relationship with the ui::Compositor is known.

  // Associates a SurfaceFactoryClient with the surface id frame_sink_id it
  // uses.
  // SurfaceFactoryClient and surface namespaces/allocators have a 1:1 mapping.
  // Caller guarantees the client is alive between register/unregister.
  // Reregistering the same namespace when a previous client is active is not
  // valid.
  void RegisterSurfaceFactoryClient(const FrameSinkId& frame_sink_id,
                                    SurfaceFactoryClient* client);
  void UnregisterSurfaceFactoryClient(const FrameSinkId& frame_sink_id);

  // Associates a |source| with a particular namespace.  That namespace and
  // any children of that namespace with valid clients can potentially use
  // that |source|.
  void RegisterBeginFrameSource(BeginFrameSource* source,
                                const FrameSinkId& frame_sink_id);
  void UnregisterBeginFrameSource(BeginFrameSource* source);

  // Register a relationship between two namespaces.  This relationship means
  // that surfaces from the child namespace will be displayed in the parent.
  // Children are allowed to use any begin frame source that their parent can
  // use.
  void RegisterFrameSinkHierarchy(const FrameSinkId& parent_frame_sink_id,
                                  const FrameSinkId& child_frame_sink_id);
  void UnregisterFrameSinkHierarchy(const FrameSinkId& parent_frame_sink_id,
                                    const FrameSinkId& child_frame_sink_id);

 private:
  void RecursivelyAttachBeginFrameSource(const FrameSinkId& frame_sink_id,
                                         BeginFrameSource* source);
  void RecursivelyDetachBeginFrameSource(const FrameSinkId& frame_sink_id,
                                         BeginFrameSource* source);
  // Returns true if |child namespace| is or has |search_frame_sink_id| as a
  // child.
  bool ChildContains(const FrameSinkId& child_frame_sink_id,
                     const FrameSinkId& search_frame_sink_id) const;

  void GarbageCollectSurfaces();

  using SurfaceMap = std::unordered_map<SurfaceId, Surface*, SurfaceIdHash>;
  SurfaceMap surface_map_;
  base::ObserverList<SurfaceObserver> observer_list_;
  base::ThreadChecker thread_checker_;

  // List of surfaces to be destroyed, along with what sequences they're still
  // waiting on.
  using SurfaceDestroyList = std::list<std::unique_ptr<Surface>>;
  SurfaceDestroyList surfaces_to_destroy_;

  // Set of SurfaceSequences that have been satisfied by a frame but not yet
  // waited on.
  std::unordered_set<SurfaceSequence, SurfaceSequenceHash> satisfied_sequences_;

  // Set of valid surface ID namespaces. When a namespace is removed from
  // this set, any remaining sequences with that namespace are considered
  // satisfied.
  std::unordered_set<FrameSinkId, FrameSinkIdHash> valid_frame_sink_ids_;

  // Begin frame source routing. Both BeginFrameSource and SurfaceFactoryClient
  // pointers guaranteed alive by callers until unregistered.
  struct FrameSinkSourceMapping {
    FrameSinkSourceMapping();
    FrameSinkSourceMapping(const FrameSinkSourceMapping& other);
    ~FrameSinkSourceMapping();
    bool is_empty() const { return !client && children.empty(); }
    // The client that's responsible for creating this namespace.  Never null.
    SurfaceFactoryClient* client;
    // The currently assigned begin frame source for this client.
    BeginFrameSource* source;
    // This represents a dag of parent -> children mapping.
    std::vector<FrameSinkId> children;
  };
  std::unordered_map<FrameSinkId, FrameSinkSourceMapping, FrameSinkIdHash>
      frame_sink_source_map_;
  // Set of which sources are registered to which namespace.  Any child
  // that is implicitly using this namespace must be reachable by the
  // parent in the dag.
  std::unordered_map<BeginFrameSource*, FrameSinkId> registered_sources_;

  DISALLOW_COPY_AND_ASSIGN(SurfaceManager);
};

}  // namespace cc

#endif  // CC_SURFACES_SURFACE_MANAGER_H_


text:
/* global NexT, CONFIG */
$(document).ready(function () {
  function initScrollSpy() {
    var tocSelector = '.post-toc';
    var $tocElement = $(tocSelector);
    var activeCurrentSelector = '.active-current';

    function removeCurrentActiveClass() {
      $(tocSelector + ' ' + activeCurrentSelector)
        .removeClass(activeCurrentSelector.substring(1));
    }
    $tocElement
      .on('activate.bs.scrollspy', function () {
        var $currentActiveElement = $(tocSelector + ' .active').last();
        removeCurrentActiveClass();
        $currentActiveElement.addClass('active-current');
        // Scrolling to center active TOC element if TOC content is taller then viewport.
        $tocElement.scrollTop($currentActiveElement.offset().top -
          $tocElement.offset().top + $tocElement.scrollTop() - (
            $tocElement.height() / 2));
      })
      .on('clear.bs.scrollspy', removeCurrentActiveClass);
    $('body').scrollspy({
      target: tocSelector
    });
  }
  initScrollSpy();
});
$(document).ready(function () {
  var html = $('html');
  var TAB_ANIMATE_DURATION = 200;
  var hasVelocity = $.isFunction(html.velocity);
  $('.sidebar-nav li').on('click', function () {
    var item = $(this);
    var activeTabClassName = 'sidebar-nav-active';
    var activePanelClassName = 'sidebar-panel-active';
    if (item.hasClass(activeTabClassName)) {
      return;
    }
    var currentTarget = $('.' + activePanelClassName);
    var target = $('.' + item.data('target'));
    hasVelocity
      ?
      currentTarget.velocity('transition.slideUpOut',
        TAB_ANIMATE_DURATION,
        function () {
          target
            .velocity('stop')
            .velocity('transition.slideDownIn', TAB_ANIMATE_DURATION)
            .addClass(activePanelClassName);
        }) :
      currentTarget.animate({
        opacity: 0
      }, TAB_ANIMATE_DURATION, function () {
        currentTarget.hide();
        target
          .stop()
          .css({
            'opacity': 0,
            'display': 'block'
          })
          .animate({
            opacity: 1
          }, TAB_ANIMATE_DURATION, function () {
            currentTarget.removeClass(activePanelClassName);
            target.addClass(activePanelClassName);
          });
      });
    item.siblings().removeClass(activeTabClassName);
    item.addClass(activeTabClassName);
  });
  // TOC item animation navigate & prevent #item selector in adress bar.
  $('.post-toc a').on('click', function (e) {
    e.preventDefault();
    var targetSelector = NexT.utils.escapeSelector(this.getAttribute(
      'href'));
    var offset = $(targetSelector).offset().top;
    hasVelocity
      ?
      html.velocity('stop').velocity('scroll', {
        offset: offset + 'px',
        mobileHA: false
      }) :
      $('html, body').stop().animate({
        scrollTop: offset
      }, 500);
  });
  // Expand sidebar on post detail page by default, when post has a toc.
  var $tocContent = $('.post-toc-content');
  var display = CONFIG.page.sidebar;
  if (typeof display !== 'boolean') {
    // There's no definition sidebar in the page front-matter
    var isSidebarCouldDisplay = CONFIG.sidebar.display === 'post' ||
      CONFIG.sidebar.display === 'always';
    var hasTOC = $tocContent.length > 0 && $tocContent.html().trim().length >
      0;
    display = isSidebarCouldDisplay && hasTOC;
  }
  if (display) {
    CONFIG.motion.enable ?
      NexT.motion.middleWares.sidebar = function () {
        NexT.utils.displaySidebar();
      } :
      NexT.utils.displaySidebar();
  }
});


text:
using NMF.Collections.Generic;
using NMF.Collections.ObjectModel;
using NMF.Expressions;
using NMF.Expressions.Linq;
using NMF.Models;
using NMF.Models.Collections;
using NMF.Models.Expressions;
using NMF.Models.Meta;
using NMF.Models.Repository;
using NMF.Serialization;
using NMF.Utilities;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.Diagnostics;
using System.Linq;
using TTC2017.SmartGrids.CIM.IEC61968.LoadControl;
using TTC2017.SmartGrids.CIM.IEC61968.Metering;
using TTC2017.SmartGrids.CIM.IEC61968.WiresExt;
using TTC2017.SmartGrids.CIM.IEC61970.Core;
using TTC2017.SmartGrids.CIM.IEC61970.Generation.GenerationDynamics;
using TTC2017.SmartGrids.CIM.IEC61970.Generation.Production;
using TTC2017.SmartGrids.CIM.IEC61970.Informative.EnergyScheduling;
using TTC2017.SmartGrids.CIM.IEC61970.Informative.InfAssets;
using TTC2017.SmartGrids.CIM.IEC61970.Informative.InfLoadControl;
using TTC2017.SmartGrids.CIM.IEC61970.Informative.MarketOperations;
using TTC2017.SmartGrids.CIM.IEC61970.LoadModel;
using TTC2017.SmartGrids.CIM.IEC61970.Meas;
using TTC2017.SmartGrids.CIM.IEC61970.Outage;
using TTC2017.SmartGrids.CIM.IEC61970.Protection;
using TTC2017.SmartGrids.CIM.IEC61970.StateVariables;

namespace TTC2017.SmartGrids.CIM.IEC61970.Wires
{

    public class TransformerWindingFrom_WindingTestCollection : ObservableOppositeOrderedSet<ITransformerWinding, IWindingTest>
    {

        public TransformerWindingFrom_WindingTestCollection(ITransformerWinding parent) :
                base(parent)
        {
        }

        private void OnItemDeleted(object sender, System.EventArgs e)
        {
            this.Remove(((IWindingTest)(sender)));
        }

        protected override void SetOpposite(IWindingTest item, ITransformerWinding parent)
        {
            if ((parent != null))
            {
                item.Deleted += this.OnItemDeleted;
                item.From_TransformerWinding = parent;
            }
            else
            {
                item.Deleted -= this.OnItemDeleted;
                if ((item.From_TransformerWinding == this.Parent))
                {
                    item.From_TransformerWinding = parent;
                }
            }
        }
    }
}


text:
require "log4r"

require "vagrant/util/subprocess"
require "vagrant/util/which"

require_relative "helper"

module VagrantPlugins
  module SyncedFolderRSyncPull
    class SyncedFolder < Vagrant.plugin("2", :synced_folder)
      include Vagrant::Util

      def initialize(*args)
        super

        @logger = Log4r::Logger.new("vagrant_rsync_pull")
      end

      def usable?(machine, raise_error=false)
        rsync_path = Which.which("rsync")
        return true if rsync_path
        return false if !raise_error
        raise Vagrant::Errors::RSyncNotFound
      end

      def prepare(machine, folders, opts)
      end

      def enable(machine, folders, opts)
        if machine.guest.capability?(:rsync_installed)
          installed = machine.guest.capability(:rsync_installed)
          if !installed
            can_install = machine.guest.capability?(:rsync_install)
            raise Vagrant::Errors::RSyncNotInstalledInGuest if !can_install
            machine.ui.info I18n.t("vagrant.rsync_installing")
            machine.guest.capability(:rsync_install)
          end
        end

        ssh_info = machine.ssh_info

        if ssh_info[:private_key_path].empty? && ssh_info[:password]
          machine.ui.warn(I18n.t("vagrant.rsync_ssh_password"))
        end

        folders.each do |id, folder_opts|
          RsyncPullHelper.rsync_single(machine, folder_opts)
        end
      end
    end
  end
end


text:
package jme3dae.utilities;

import jme3dae.DAENode;
import jme3dae.collada14.ColladaSpec141.Names;
import jme3dae.transformers.ValueTransformer;

import java.util.function.Function;
import java.util.function.IntFunction;
import java.util.regex.Pattern;
import java.util.stream.Stream;

/**
 * Transforms a node to an array of element T
 *
 * @author Angel Chang
 */
public class ArrayTransformer<T> implements TransformerPack<DAENode, T[]> {
  protected Function<String,T> transfomerFunction;
  protected ValueTransformer<String,T> transformer;
  protected IntFunction<T[]> arrayCreator;

  public ArrayTransformer(ValueTransformer<String,T> transformer, IntFunction<T[]> arrayCreator) {
    this.transformer = transformer;
    this.arrayCreator = arrayCreator;
    this.transfomerFunction = s -> transformer.transform(s).get();
  }

  private static final Pattern whitespacePattern = Pattern.compile("\\w+");
  @Override
  public TransformedValue<T[]> transform(DAENode node) {
    TransformedValue<String> text = node.getContent(TEXT);
    TransformedValue<Integer> count = node.getAttribute(Names.COUNT, INTEGER);
    Stream<String> stream = whitespacePattern.splitAsStream(text.get());
    T[] elements = stream.map(transfomerFunction).toArray(arrayCreator);
    return TransformedValue.create(elements);
  }
}


text:
// (C) Copyright 2002-2003 by Autodesk, Inc.
//
// Permission to use, copy, modify, and distribute this software in
// object code form for any purpose and without fee is hereby granted,
// provided that the above copyright notice appears in all copies and
// that both that copyright notice and the limited warranty and
// restricted rights notice below appear in all supporting
// documentation.
//
// AUTODESK PROVIDES THIS PROGRAM "AS IS" AND WITH ALL FAULTS.
// AUTODESK SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTY OF
// MERCHANTABILITY OR FITNESS FOR A PARTICULAR USE.  AUTODESK, INC.
// DOES NOT WARRANT THAT THE OPERATION OF THE PROGRAM WILL BE
// UNINTERRUPTED OR ERROR FREE.
//
// Use, duplication, or disclosure by the U.S. Government is subject to
// restrictions set forth in FAR 52.227-19 (Commercial Computer
// Software - Restricted Rights) and DFAR 252.227-7013(c)(1)(ii)
// (Rights in Technical Data and Computer Software), as applicable.
//

//-----------------------------------------------------------------------------
//----- PieSectorImage.h : Declaration of the CPieSectorImage
//-----------------------------------------------------------------------------
#pragma once

#include "resource.h"

#include "DeepPropInspectorUI.h"
#include "DynPropBase.h"
#include "../DeepPropInspector/AsdkPie.h"

//-----------------------------------------------------------------------------
class ATL_NO_VTABLE CPieSectorImage :
	public CComObjectRootEx<CComSingleThreadModel>,
	public CComCoClass<CPieSectorImage, &CLSID_PieSectorImage>,
	public ISupportErrorInfo,
	public IDispatchImpl<IPieSectorImage, &IID_IPieSectorImage, &LIBID_AsdkDeepPropInspectorUILib, /*wMajor =*/ 1, /*wMinor =*/ 0>,
	public DynPropBaseImpl<CPieSectorImage>
{
protected:
	IDynamicPropertyNotify2 *m_pNotify ;

public:
	CPieSectorImage () {}

	DECLARE_REGISTRY_RESOURCEID(IDR_PIESECTORIMAGE)
	DECLARE_PROTECT_FINAL_CONSTRUCT()

	BEGIN_COM_MAP(CPieSectorImage)
		COM_INTERFACE_ENTRY(IPieSectorImage)
		COM_INTERFACE_ENTRY(IDispatch)
		COM_INTERFACE_ENTRY(ISupportErrorInfo)
		COM_INTERFACE_ENTRY(ICategorizeProperties)
		COM_INTERFACE_ENTRY(IAcPiPropertyDisplay)
		COM_INTERFACE_ENTRY(IDynamicProperty2)
	END_COM_MAP()

	BEGIN_PERPROPDISPLAY_MAP()
		PROP_DISP_ENTRY(0, _T("DeepPropInspectorUI.AsdkSpinner.1"), NULL, IDB_I_BMP, NULL, IDB_E_BMP, RGB(0, 0, 0), true, 4, 0)
	END_PERPROPDISPLAY_MAP()

	//- ISupportsErrorInfo
	STDMETHOD(InterfaceSupportsErrorInfo) (REFIID riid) ;

	HRESULT FinalConstruct () {
		return (S_OK) ;
	}

	void FinalRelease () {
	}

public:
	//- IDynamicProperty2
	STDMETHOD(GetGUID) (GUID *propGUID) ;
	STDMETHOD(GetDisplayName) (BSTR *bstrName) ;
	STDMETHOD(IsPropertyEnabled)(IUnknown *pUnk, BOOL *pbEnabled) ;
	STDMETHOD(IsPropertyReadOnly) (BOOL *pbReadonly) ;
	STDMETHOD(GetDescription) (BSTR *bstrName) ;
	STDMETHOD(GetCurrentValueName) (BSTR *pbstrName) ;
	STDMETHOD(GetCurrentValueType) (VARTYPE *pVarType) ;
	STDMETHOD(GetCurrentValueData) (IUnknown *pUnk, VARIANT *pvarData) ;
	STDMETHOD(SetCurrentValueData) (IUnknown *pUnk, const VARIANT varData) ;
	STDMETHOD(Connect) (IDynamicPropertyNotify2 *pSink) ;
	STDMETHOD(Disconnect) () ;

	//- IPerPropertyDisplay
	STDMETHOD(GetCustomPropertyCtrl) (VARIANT varId, LCID lcid, BSTR *pProgId) ;

	//- IPieSectorImage

} ;

//-----------------------------------------------------------------------------
OBJECT_ENTRY_AUTO(__uuidof(PieSectorImage), CPieSectorImage)
//- See DynPropOrder.h for details
//OPM_DYNPROP_OBJECT_ENTRY_AUTO(CPieSectorImage, AsdkPie)
#include "DynPropOrder.h"


text:
require.config(
    {
        paths: {
            'jquery': ['../../lib/jquery.min'],
            'paging': '../../paging',
        },
        waitSeconds: 90
    }

);

require(['jquery', 'paging'], function($, Paging){

    var paging = new Paging();
    window.paging = paging;

    paging.makeLeftEndBtn = function(isActive) {
        var me = this;
        if (isActive) {
            return '';
        } else {
            if (!me.isAbleHide) {
                return '';
            }

            if ((me.currPage - me.leftNum) === me.pageStartFrom) {
                return '';
            }

            return ''+me.pageStartFrom+'...';
        }
    };
    paging.makeRightEndBtn = function(isActive) {
        var me = this;
        if (isActive) {
            return '';
        } else {
            if (!me.isAbleHide) {
                return '';
            }

            if ((me.currPage + me.rightNum) === me.maxPage) {
                return '';
            }

            return '...'+me.maxPage+'';
        }
    };

    paging.makeNextBtn = function(isActive) {
        if (isActive) {
            return '下一页';
        } else {
            return '下一页';
        }
    };

    paging.makePrevBtn = function(isActive) {
        if (isActive) {
            return '上一页';
        } else {
            return '上一页';
        }
    };
    paging.init({

        $parDom: $('#J-paging'),
        sortConf: 'prevBtn|leftEndBtn|leftNumBtn|currBtn|rightNumBtn|rightEndBtn|nextBtn',

    });

    paging.repaint();
});


text:
<?php

namespace Application\MyNotesBundle\Entity;

use Doctrine\ORM\Mapping as ORM;

/**
 * NotesColor
 *
 * @ORM\Table(name="notes_color")
 * @ORM\Entity(repositoryClass="Application\MyNotesBundle\Entity\NotesColorRepository")
 */

class NotesColor
{
    /**
     * @var integer
     *
     * @ORM\Column(name="id", type="integer", nullable=false)
     * @ORM\Id
     * @ORM\GeneratedValue(strategy="IDENTITY")
     */
    private $id;

    /**
     * @var string
     *
     * @ORM\Column(name="nom", type="string", length=20, nullable=false)
     */
    private $nom;

    public function __toString() {
        return $this->getNom();
    }

    /**
     * Get id
     *
     * @return integer
     */
    public function getId()
    {
        return $this->id;
    }

    /**
     * Set nom
     *
     * @param string $nom
     * @return NotesColor
     */
    public function setNom($nom)
    {
        $this->nom = $nom;

        return $this;
    }

    /**
     * Get nom
     *
     * @return string
     */
    public function getNom()
    {
        return $this->nom;
    }
}


text:
package kieker.monitoring.core.configuration;

/**
 * If this file changes, the default config file has to be adjusted! Ideally it
 * would be created using this file! (#151)
 *
 * @author Andre van Hoorn, Jan Waller
 * @author Reiner Jung -- changed to ConfigurationConstants
 *
 * @since 1.3
 */
public final class ConfigurationConstants {
	/** prefix used for all kieker.monitoring components. */
	public static final String PREFIX = "kieker.monitoring.";

	/** Location of the custom properties file (in classpath). */
	public static final String CUSTOM_PROPERTIES_LOCATION_CLASSPATH = "META-INF/" + ConfigurationConstants.PREFIX
			+ "properties";
	/** Location of the default properties file (in classpath). */
	public static final String DEFAULT_PROPERTIES_LOCATION_CLASSPATH = "META-INF/" + ConfigurationConstants.PREFIX
			+ "default.properties";

	/** JVM-parameter to specify a custom properties file. */
	public static final String CUSTOM_PROPERTIES_LOCATION_JVM = ConfigurationConstants.PREFIX + "configuration";

	// these MUST be declared in the file DEFAULT_PROPERTIES_LOCATION_CLASSPATH

	// Monitoring Controller
	public static final String MONITORING_ENABLED = ConfigurationConstants.PREFIX + "enabled";
	public static final String CONTROLLER_NAME = ConfigurationConstants.PREFIX + "name";
	public static final String HOST_NAME = ConfigurationConstants.PREFIX + "hostname";
	public static final String EXPERIMENT_ID = ConfigurationConstants.PREFIX + "initialExperimentId";
	public static final String APPLICATION_NAME = ConfigurationConstants.PREFIX + "applicationName";
	public static final String USE_SHUTDOWN_HOOK = ConfigurationConstants.PREFIX + "useShutdownHook";
	public static final String DEBUG = ConfigurationConstants.PREFIX + "debug";
	public static final String META_DATA = ConfigurationConstants.PREFIX + "metadata";

	// JMX Controller
	public static final String ACTIVATE_JMX = ConfigurationConstants.PREFIX + "jmx";
	public static final String ACTIVATE_JMX_DOMAIN = ConfigurationConstants.PREFIX + "jmx.domain";
	public static final String ACTIVATE_JMX_CONTROLLER = ConfigurationConstants.PREFIX + "jmx.MonitoringController";
	public static final String ACTIVATE_JMX_CONTROLLER_NAME = ConfigurationConstants.PREFIX
			+ "jmx.MonitoringController.name";
	public static final String ACTIVATE_JMX_REMOTE = ConfigurationConstants.PREFIX + "jmx.remote";
	public static final String ACTIVATE_JMX_REMOTE_PORT = ConfigurationConstants.PREFIX + "jmx.remote.port";
	public static final String ACTIVATE_JMX_REMOTE_NAME = ConfigurationConstants.PREFIX + "jmx.remote.name";
	public static final String ACTIVATE_JMX_REMOTE_FALLBACK = ConfigurationConstants.PREFIX + "jmx.remote.fallback";

	// TCP Controller
	public static final String ACTIVATE_TCP = ConfigurationConstants.PREFIX + "tcp";
	public static final String ACTIVATE_TCP_DOMAIN = ConfigurationConstants.PREFIX + "tcp.domain";
	public static final String ACTIVATE_TCP_REMOTE = ConfigurationConstants.PREFIX + "tcp.remote";
	public static final String ACTIVATE_TCP_REMOTE_PORT = ConfigurationConstants.PREFIX + "tcp.remote.port";

	// Writer Controller
	public static final String AUTO_SET_LOGGINGTSTAMP = ConfigurationConstants.PREFIX + "setLoggingTimestamp";
	public static final String WRITER_CLASSNAME = ConfigurationConstants.PREFIX + "writer";

	// TimeSource Controller
	public static final String TIMER_CLASSNAME = ConfigurationConstants.PREFIX + "timer";

	// Sampling Controller
	public static final String PERIODIC_SENSORS_EXECUTOR_POOL_SIZE = ConfigurationConstants.PREFIX
			+ "periodicSensorsExecutorPoolSize";

	// Probe Controller
	public static final String ADAPTIVE_MONITORING_ENABLED = ConfigurationConstants.PREFIX
			+ "adaptiveMonitoring.enabled";
	public static final String ADAPTIVE_MONITORING_CONFIG_FILE = ConfigurationConstants.PREFIX
			+ "adaptiveMonitoring.configFile";
	public static final String ADAPTIVE_MONITORING_CONFIG_FILE_UPDATE = ConfigurationConstants.PREFIX
			+ "adaptiveMonitoring.updateConfigFile";
	public static final String ADAPTIVE_MONITORING_CONFIG_FILE_READ_INTERVALL = ConfigurationConstants.PREFIX
			+ "adaptiveMonitoring.readInterval";
	public static final String ADAPTIVE_MONITORING_MAX_CACHE_SIZE = ConfigurationConstants.PREFIX
			+ "adaptiveMonitoring.maxCacheSize";
	public static final String ADAPTIVE_MONITORING_BOUNDED_CACHE_BEHAVIOUR = ConfigurationConstants.PREFIX
			+ "adaptiveMonitoring.boundedCacheBehaviour";

	/**
	 * Factory class. Avoid instantiation.
	 */
	private ConfigurationConstants() {}
}