text:
package com.alibaba.json.bvt.feature;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.annotation.JSONField;
import com.alibaba.fastjson.annotation.JSONType;
import com.alibaba.fastjson.parser.Feature;
import junit.framework.TestCase;

/**
 * Created by wenshao on 17/03/2017.
 */
public class DisableFieldSmartMatchTest_2 extends TestCase {
    public void test_feature() throws Exception {
        assertEquals(123, JSON.parseObject("{\"person_id\":123}", Model_for_disableFieldSmartMatchMask.class).personId);
        assertEquals(0, JSON.parseObject("{\"person_id\":123}", Model_for_disableFieldSmartMatchMask.class, Feature.DisableFieldSmartMatch).personId);
        assertEquals(123, JSON.parseObject("{\"personId\":123}", Model_for_disableFieldSmartMatchMask.class, Feature.DisableFieldSmartMatch).personId);
    }

    public void test_feature2() throws Exception {
        assertEquals(0, JSON.parseObject("{\"person_id\":123}", Model_for_disableFieldSmartMatchMask2.class).personId);
        assertEquals(123, JSON.parseObject("{\"personId\":123}", Model_for_disableFieldSmartMatchMask2.class).personId);
    }

    public static class Model_for_disableFieldSmartMatchMask {
        public int personId;
    }

    public static class Model_for_disableFieldSmartMatchMask2 {
        @JSONField(parseFeatures = Feature.DisableFieldSmartMatch)
        public int personId;
    }
}


text:
try:
    from lxml import etree as ET
except ImportError:
    try:
        # Python 2.5 cET
        import xml.etree.cElementTree as ET
    except ImportError:
        try:
        # Python 2.5 plain ET
            import xml.etree.ElementTree as ET
        except ImportError:
            try:
                # old cET
                import cElementTree as ET
            except ImportError:
                # old ET
                import elementtree.ElementTree as ET

from errors import *
from converters import *
from utils import *
from connection import *
from request import *
from response import *
import query

try:
    _register_namespace = ET.register_namespace
except AttributeError: # Old versions of ET use _namespace_map
    try:
        _namespace_map = ET._namespace_map
    except AttributeError: # Very old cET use ET module's _namespace_map
        import xml.etree.ElementTree
        _namespace_map = xml.etree.ElementTree._namespace_map
    def _register_namespace(prefix, uri):
        _namespace_map[uri] = prefix
_register_namespace("cps", "www.clusterpoint.com")

if __name__ == '__main__':
    Debug._DEBUG = True

# Doctests
    import doctest
    import errors
    import converters
    import utils
    import connection
    import request
    import response
    import query

    def doctest_a_module(module):
        Debug.warn("Running doctests on {0} module ...".format(module.__name__))
        failure_count, test_count = doctest.testmod(module)
        if failure_count:
            Debug.fail("DOCTESTS FAILED!")
            raise Exception()
        else:
            Debug.ok("DOCTESTS PASSED!")

    doctest_a_module(converters)
    doctest_a_module(query)

# Rudimentary functional tests using a CP server running on a local VBox instance.
    import re
    import subprocess

    def test(t):
        try:    # Known bug where first request is rejected
            t.status()
        except APIError:
            pass
        t.clear(type='single', timeout=10)
        t.backup('tmp.tar.gz',backup_type='incremental')
        t.insert({1: {'text': 'aste', 'title': 'lol'}, 2: '<item/>'})
        t.insert(['<page><id>3</id><text>foobar</text></page>','<page><id>4</id></page>'], fully_formed=True)
        t.insert({5: '<text>foobar</text>',6: '<text>baz</text>'})
        t.insert([{'page':{'id':7}},{'page':{'id':8}},{'page':{'id':9}}], fully_formed=True)
        t.replace({'page':{'id':3, 'title': 'one'}}, fully_formed=True)
        t.replace({4:{ 'title': 'two'}})
        t.replace({3: {'title': 'one prom'},4: {'title': 'two prim'}})
        t.partial_replace({'page':{'id':5, 'tabs': 'ss'}}, fully_formed=True)
        t.update({4: {'text':'lorem'}})
        t.update({34: {'title':'Far fetched.', 'text': 'Something.'}})
        t.delete([3,1])
        t.search(query.terms_from_dict({'title':'lorem'}))
        t.search_delete({'title':'lorem'})
        t.insert({11: {'title':'test','text':'11-test'}, 12: {'title':'test','text':'12-test'},\
                13: {'title':'test','text':'13-test'},14: {'title':'test','text':'14-test'},\
                15:{'title':'test','text':'15-test'}})
        t.search({'title':'test'}, docs=3, offset=1, list={'text':'yes', 'title': 'no'})
        t.retrieve([11,12])
        t.similar(12, 2, 1, docs=2)
        t.lookup([12,15], list={'title': 'no'})
        t.alternatives(query.term('test'), cr=1, idif=1, h=1)
        t.list_words(query.term('test'))
        t.list_last(docs=1, offset=0)
        t.list_first(list={'text':'yes'}, docs=1, offset=0)
        t.reindex()
        t.status()
        #t.restore('tmp.tar.gz',sequence_check=False)
    try:
        vbox_string = subprocess.check_output(["VBoxManage", "guestproperty", "enumerate", "CPS2"])
    except:
        Debug.fail("Can't find VBox for testing!")
    else:
        try:
            index = vbox_string.find("/VirtualBox/GuestInfo/Net/0/V4/I")
            ip_string = re.findall('(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})',vbox_string[index:])[0]
        except:
            Debug.fail("Can't find valid IP for VBox test server!")
        else:
            Debug.warn("Running functests with found VBox server on {0} ...".format(ip_string))
            t=Connection("tcp://{0}:{1}".format(ip_string,5550), 'test_storage', 'root', 'password', document_root_xpath='page')
            test(t)
            Debug.ok("FUNCTESTS PASSED!")

redpajama_set_name: RedPajamaGithub


text:
package org.ovirt.engine.core.common.vdscommands;

import org.ovirt.engine.core.common.businessentities.StorageType;
import org.ovirt.engine.core.compat.Guid;

public class CreateStoragePoolVDSCommandParameters extends VdsIdVDSCommandParametersBase {
    private Guid privateStoragePoolId = new Guid();

    public Guid getStoragePoolId() {
        return privateStoragePoolId;
    }

    private void setStoragePoolId(Guid value) {
        privateStoragePoolId = value;
    }

    private StorageType privateStorageType = StorageType.forValue(0);

    public StorageType getStorageType() {
        return privateStorageType;
    }

    private void setStorageType(StorageType value) {
        privateStorageType = value;
    }

    private String privateStoragePoolName;

    public String getStoragePoolName() {
        return privateStoragePoolName;
    }

    private void setStoragePoolName(String value) {
        privateStoragePoolName = value;
    }

    private Guid privateMasterDomainId = new Guid();

    public Guid getMasterDomainId() {
        return privateMasterDomainId;
    }

    private void setMasterDomainId(Guid value) {
        privateMasterDomainId = value;
    }

    private java.util.ArrayList<Guid> privateDomainsIdList;

    public java.util.ArrayList<Guid> getDomainsIdList() {
        return privateDomainsIdList;
    }

    private void setDomainsIdList(java.util.ArrayList<Guid> value) {
        privateDomainsIdList = value;
    }

    private int privateMasterVersion;

    public int getMasterVersion() {
        return privateMasterVersion;
    }

    private void setMasterVersion(int value) {
        privateMasterVersion = value;
    }

    public CreateStoragePoolVDSCommandParameters(Guid vdsId, StorageType storageType, Guid storagePoolId,
            String poolName, Guid masterDomainId, java.util.ArrayList<Guid> domainsIdList, int masterVersion) {
        super(vdsId);
        setStoragePoolId(storagePoolId);
        setStorageType(storageType);
        setStoragePoolName(poolName);
        setMasterDomainId(masterDomainId);
        setDomainsIdList(domainsIdList);
        setMasterVersion(masterVersion);
    }

    public CreateStoragePoolVDSCommandParameters() {
    }

    @Override
    public String toString() {
        return String.format("%s, storagePoolId=%s, storageType=%s, storagePoolName=%s, masterDomainId=%s, " +
                "domainsIdList=%s, masterVersion=%s",
                super.toString(),
                getStoragePoolId(),
                getStorageType(),
                getStoragePoolName(),
                getMasterDomainId(),
                getDomainsIdList(),
                getMasterVersion());
    }

}


text:
$.ajax({
	type: 'GET',
	url: 'http://localhost:5000/api/classification',
	dataType: 'json',
	success: function(data) {
		var typeHTML = '';

		data.map(function(superItem) {
			if (superItem.parentID === 0) {
				var idArray = '';

				data.map(function(item) {
					if (item.parentID === superItem.id) {
						data.map(function(subItem) {
							if (subItem.parentID === item.id) {
								idArray += subItem.id;
								idArray += ',';
							}
						});
					}
				});

				typeHTML += '';
				typeHTML += superItem.name;
				typeHTML += '';
			}
		});

		$('#content dl dl').eq(0).find('dd').html(typeHTML);

		$('#content dl dl:nth-child(1) a').eq(0).addClass('current');

		$('#content dl dl:nth-child(1) a').click(function() {
			$(this).addClass('current').siblings().removeClass('current');

			displayCourse();
		});

		$('#content dl dl:nth-child(2) a').click(function() {
			$(this).addClass('current').siblings().removeClass('current');

			displayCourse();
		});

		$('#content dl dl:nth-child(3) a').click(function() {
			$(this).addClass('current').siblings().removeClass('current');

			displayCourse();
		});
	}
});

function displayCourse() {
	// 获取过滤条件
	const belongArray = $('#content dl dl').eq(0).find('a.current').attr('data-id').split(',');
	belongArray.pop();

	const time = $('#content dl dl').eq(1).find('a.current').text();
	const kinds = $('#content dl dl').eq(2).find('a.current').index();

	// 获取所有课程
	$.ajax({
		type: 'GET',
		url: 'http://localhost:5000/api/course',
		dataType: 'json',
		success: function(data) {
			var courseHTML  = '';
			var teacherName = '';
			var teacherIntr = '';

			$.ajax({
				type: 'GET',
				url: 'http://localhost:5000/api/teacher',
				dataType: 'json',
				success: function(teacher) {
					var len = 0;

					data.map(function(item) {
						var skip = false;

						// 条件过滤
						belongArray.map(function(belong) {
							if (belong == item.typeID) {
								if (item.category != kinds) {
									skip = true;
								}
							}
						});

						if (skip) {
							len += 1;

							teacher.map(function(teacherItem) {
								if (teacherItem.id == item.teacherID) {
									teacherName = teacherItem.name;
									teacherIntr = teacherItem.introduction;
								}
							});

							courseHTML += '
';
							courseHTML += '';
							courseHTML += '';
							courseHTML += '选课人数:';
							courseHTML += item.studentNumber;
							courseHTML += '';
							courseHTML += '';
							courseHTML += '
老师:';
							courseHTML += teacherName;
							courseHTML += '
';
							courseHTML += '
简介:';
							courseHTML += teacherIntr;
							courseHTML += '
';
							courseHTML += '
';
						}
					});

					$('.course_list').html(courseHTML);

					pageChange(len);
				}
			});
		}
	});
}


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

using Framework.Arquitetura.DDD.InfraEstrutura.Repositorios.EF;
using Framework.Arquitetura.DDD.Dominio.Interfaces.Repositorios;
using Dominio.Entidades;
using Dominio.Interfaces.Repositorios;
using Infraestrutura.DataSource;

namespace Infraestrutura.Repositorios
{
    public class LivroRepositorio: RepositorioBase<Livro,FonteDeDados>, ILivroRepositorio
    {

    }
}


text:
package io.aos.concurrent.scale;

public class GuidedLoopHandler extends PoolLoopHandler {
    protected int minSize;

    public GuidedLoopHandler(int start, int end, int min, int threads){
        super(start, end, threads);
        minSize = min;
    }

    protected synchronized LoopRange loopGetRange() {
        if (curLoop >= endLoop)
            return null;
        LoopRange ret = new LoopRange();
        ret.start = curLoop;
        int sizeLoop = (endLoop-curLoop)/numThreads;
        curLoop += (sizeLoop>minSize)?sizeLoop:minSize;
        ret.end = (curLoop<endLoop)?curLoop:endLoop;
        return ret;
    }
}


text:
"use strict";

var itineraryBuilder = require('./itinerary_builder.js');
var createGeocoder = require('./geocoder.js');

// Mapbox Blue
// var primiaryColor = '#3BB2D0';
var primarayColor = '#3c4e5a';
//var primarayColor = '#ee8a65';
var secondaryColor = '#f1f075';

var options = {
  lrm: {
    routeWhileDragging: true,
    addWaypoints: true,
    addButtonClassName: 'mapbox-directions-button-add',
    waypointMode: 'snap',
    pointMarkerStyle: {
      radius: 6,
      color: 'black',
      fillColor: secondaryColor,
      opacity: 0.35,
      fillOpacity: 1.0,
      weight: 1,
    },
    lineOptions: {
      styles: [
        {color: 'black', opacity: 0.35, weight: 8},
        {color: 'white', opacity: 0.3, weight: 6},
        {color: primarayColor, opacity: 1.0, weight: 4}
      ],
    },
    dragStyles: [
      {color: 'black', opacity: 0.35, weight: 9},
      {color: 'white', opacity: 0.8, weight: 7},
      {color: primarayColor, opacity: 1, weight: 5, dashArray: '7,12'}
    ],
    summaryTemplate: '

{name}

{distance}, {time}

',
    containerClassName: "dark pad2",
    alternativeClassName: "mapbox-directions-instructions",
    stepClassName: "mapbox-directions-step",
    geocodersClassName: "mapbox-directions-inputs",
    createGeocoder: createGeocoder,
    itineraryBuilder: itineraryBuilder({containerClassName: "mapbox-directions-steps"}),
  },

  popup: {
    removeButtonClass: 'mapbox-directions-icon mapbox-close-light-icon',
    uturnButtonClass: 'mapbox-directions-icon mapbox-u-turn-icon',
    markerOptions: {
    }
  },

  tools: {
    popupWindowClass: "fill-dark dark",
    popupCloseButtonClass: 'mapbox-directions-icon mapbox-close-icon',
    linkButtonClass: 'mapbox-directions-icon mapbox-link-icon',
    editorButtonClass: 'mapbox-directions-icon mapbox-editor-icon',
    josmButtonClass: 'mapbox-directions-icon mapbox-josm-icon',
    localizationButtonClass: 'mapbox-directions-icon mapbox-flag-icon',
    printButtonClass: 'icon printer',
    toolsContainerClass: 'fill-dark dark',
  }
};

module.exports = {
  options: options,
  // this hides the sidebar before the first route
  setup: function(lrm) {
      lrm.hide();
      lrm.on('routeselected', function(r) { lrm.show(); });
    }
};


text:
package net.openhft.chronicle.hash.impl.stage.query;

import net.openhft.chronicle.hash.impl.stage.entry.HashLookupSearch;
import net.openhft.chronicle.hash.impl.stage.entry.KeyHashCode;
import net.openhft.sg.StageRef;
import net.openhft.sg.Staged;

@Staged
public abstract class QueryHashLookupSearch extends HashLookupSearch {

    @StageRef
    KeyHashCode h;

    void initSearchKey() {
        initSearchKey(hl().maskUnsetKey(hh.h().hashSplitting.segmentHash(h.keyHashCode())));
    }
}


text:
import {Inject, Injectable} from "@tsed/di";
import {Model, MongooseModel, MongoosePlugin} from "@tsed/mongoose";
import * as findOrCreate from "mongoose-findorcreate";
import {User} from "./User";

@Model()
@MongoosePlugin(findOrCreate)
class UserModel {
  // this isn't the complete method signature, just an example
  static findOrCreate(condition: InstanceType<User>):
    Promise<{doc: InstanceType<User>, created: boolean}>;
}

@Injectable()
class UserService {
  constructor(@Inject(UserModel) userModel: MongooseModel<UserModel>) {
    userModel
      .findOrCreate({...})
      .then(findOrCreateResult => {
        // ...
      });
  }
}


text:
package com.ibm.wsdl.extensions.soap12;

import javax.wsdl.extensions.soap12.*;
import javax.xml.namespace.*;

/**
 * Based on com.ibm.wsdl.extensions.soap.SOAPHeaderFaultImpl
 */
public class SOAP12HeaderFaultImpl implements SOAP12HeaderFault
{
  protected QName elementType = SOAP12Constants.Q_ELEM_SOAP_HEADER_FAULT;
  protected Boolean required = null;
  protected QName message = null;
  protected String part = null;
  protected String use = null;
  protected String encodingStyle = null;
  protected String namespaceURI = null;

  public static final long serialVersionUID = 1;

  /**
   * Set the type of this extensibility element.
   *
   * @param elementType the type
   */
  public void setElementType(QName elementType)
  {
    this.elementType = elementType;
  }

  /**
   * Get the type of this extensibility element.
   *
   * @return the extensibility element's type
   */
  public QName getElementType()
  {
    return elementType;
  }

  /**
   * Set whether or not the semantics of this extension
   * are required. Relates to the wsdl:required attribute.
   */
  public void setRequired(Boolean required)
  {
    this.required = required;
  }

  /**
   * Get whether or not the semantics of this extension
   * are required. Relates to the wsdl:required attribute.
   */
  public Boolean getRequired()
  {
    return required;
  }

  /**
   * Set the message for this SOAP header fault.
   *
   * @param message the desired message
   */
  public void setMessage(QName message)
  {
    this.message = message;
  }

  /**
   * Get the message for this SOAP header fault.
   */
  public QName getMessage()
  {
    return message;
  }

  /**
   * Set the part for this SOAP header fault.
   *
   * @param part the desired part
   */
  public void setPart(String part)
  {
    this.part = part;
  }

  /**
   * Get the part for this SOAP header fault.
   */
  public String getPart()
  {
    return part;
  }

  /**
   * Set the use for this SOAP header fault.
   *
   * @param use the desired use
   */
  public void setUse(String use)
  {
    this.use = use;
  }

  /**
   * Get the use for this SOAP header fault.
   */
  public String getUse()
  {
    return use;
  }

  /**
   * Set the encodingStyle for this SOAP header fault.
   *
   * @param encodingStyle the desired encodingStyle
   */
  public void setEncodingStyle(String encodingStyle)
  {
    this.encodingStyle = encodingStyle;
  }

  /**
   * Get the encodingStyle for this SOAP header fault.
   */
  public String getEncodingStyle()
  {
    return encodingStyle;
  }

  /**
   * Set the namespace URI for this SOAP header fault.
   *
   * @param namespaceURI the desired namespace URI
   */
  public void setNamespaceURI(String namespaceURI)
  {
    this.namespaceURI = namespaceURI;
  }

  /**
   * Get the namespace URI for this SOAP header fault.
   */
  public String getNamespaceURI()
  {
    return namespaceURI;
  }

  public String toString()
  {
    StringBuffer strBuf = new StringBuffer();

    strBuf.append("SOAPHeaderFault (" + elementType + "):");
    strBuf.append("\nrequired=" + required);

    if (message != null)
    {
      strBuf.append("\nmessage=" + message);
    }

    if (part != null)
    {
      strBuf.append("\npart=" + part);
    }

    if (use != null)
    {
      strBuf.append("\nuse=" + use);
    }

    if (encodingStyle != null)
    {
      strBuf.append("\nencodingStyles=" + encodingStyle);
    }

    if (namespaceURI != null)
    {
      strBuf.append("\nnamespaceURI=" + namespaceURI);
    }

    return strBuf.toString();
  }
}


text:
using System.Threading.Tasks;
using Abp.Configuration.Startup;
using poolprobase.Sessions;
using Microsoft.AspNetCore.Mvc;

namespace poolprobase.Web.Views.Shared.Components.SideBarUserArea
{
    public class SideBarUserAreaViewComponent : poolprobaseViewComponent
    {
        private readonly ISessionAppService _sessionAppService;
        private readonly IMultiTenancyConfig _multiTenancyConfig;

        public SideBarUserAreaViewComponent(ISessionAppService sessionAppService,
            IMultiTenancyConfig multiTenancyConfig)
        {
            _sessionAppService = sessionAppService;
            _multiTenancyConfig = multiTenancyConfig;
        }

        public async Task<IViewComponentResult> InvokeAsync()
        {
            var model = new SideBarUserAreaViewModel
            {
                LoginInformations = await _sessionAppService.GetCurrentLoginInformations(),
                IsMultiTenancyEnabled = _multiTenancyConfig.IsEnabled,
            };

            return View(model);
        }
    }
}


text:
package net.runelite.api;

import java.awt.Graphics2D;
import java.awt.Polygon;
import java.awt.Shape;
import java.awt.image.BufferedImage;
import javax.annotation.Nullable;
import net.runelite.api.annotations.VisibleForDevtools;
import net.runelite.api.coords.LocalPoint;
import net.runelite.api.coords.WorldArea;
import net.runelite.api.coords.WorldPoint;

/**
 * Represents a RuneScape actor/entity.
 */
public interface Actor extends Renderable
{
	/**
	 * Gets the combat level of the actor.
	 *
	 * @return the combat level
	 */
	int getCombatLevel();

	/**
	 * Gets the name of the actor.
	 *
	 * @return the name
	 */
	@Nullable
	String getName();

	/**
	 * Gets the actor being interacted with.
	 *

	 * Examples of interaction include:
	 *

	 *
A monster focusing an Actor to attack

	 *
Targetting a player to trade

	 *
Following a player

	 *

	 *
	 * @return the actor, null if no interaction is occurring
	 */
	Actor getInteracting();

	/**
	 * Gets the health of the actor in {@link #getHealthScale()} units.
	 *
	 * The server does not transmit actors' real health, only this value
	 * between zero and {@link #getHealthScale()}. Some actors may be
	 * missing this info, in which case -1 is returned.
	 */
	int getHealthRatio();

	/**
	 * Gets the maximum value {@link #getHealthRatio()} can return
	 *
	 * For actors with the default size health bar this is 30, but
	 * for bosses with a larger health bar this can be a larger number.
	 * Some actors may be missing this info, in which case -1 is returned.
	 */
	int getHealthScale();

	/**
	 * Gets the server-side location of the actor.
	 *

	 * This value is typically ahead of where the client renders and is not
	 * affected by things such as animations.
	 *
	 * @return the server location
	 */
	WorldPoint getWorldLocation();

	/**
	 * Gets the client-side location of the actor.
	 *
	 * @return the client location
	 */
	LocalPoint getLocalLocation();

	@VisibleForDevtools
	void setIdlePoseAnimation(int animation);

	@VisibleForDevtools
	void setPoseAnimation(int animation);

	/**
	 * Gets the orientation of the actor.
	 *
	 * @return the orientation
	 * @see net.runelite.api.coords.Angle
	 */
	int getOrientation();

	/**
	 * Gets the current animation the actor is performing.
	 *
	 * @return the animation ID
	 * @see AnimationID
	 */
	int getAnimation();

	/**
	 * Gets the secondary animation the actor is performing.
	 *
	 * @return the animation ID
	 * @see AnimationID
	 */
	int getPoseAnimation();

	/**
	 * If this is equal to the pose animation, the pose animation is ignored when
	 * you are doing another action.
	 *
	 * @return the animation ID
	 * @see AnimationID
	 */
	int getIdlePoseAnimation();

	/**
	 * Sets an animation for the actor to perform.
	 *
	 * @param animation the animation ID
	 * @see AnimationID
	 */
	@VisibleForDevtools
	void setAnimation(int animation);

	/**
	 * Sets the frame of the animation the actor is performing.
	 *
	 * @param actionFrame the animation frame
	 */
	@VisibleForDevtools
	void setActionFrame(int actionFrame);

	/**
	 * Gets the graphic that is currently on the player.
	 *
	 * @return the graphic of the actor
	 * @see GraphicID
	 */
	int getGraphic();

	@VisibleForDevtools
	void setGraphic(int graphic);

	@VisibleForDevtools
	void setSpotAnimFrame(int spotAnimFrame);

	/**
	 * Gets the canvas area of the current tile the actor is standing on.
	 *
	 * @return the current tile canvas area
	 */
	Polygon getCanvasTilePoly();

	/**
	 * Gets the point at which text should be drawn, relative to the
	 * current location with the given z-axis offset.
	 *
	 * @param graphics engine graphics
	 * @param text the text to draw
	 * @param zOffset the z-axis offset
	 * @return the text drawing location
	 */
	@Nullable
	Point getCanvasTextLocation(Graphics2D graphics, String text, int zOffset);

	/**
	 * Gets the point at which an image should be drawn, relative to the
	 * current location with the given z-axis offset.
	 *
	 * @param image the image to draw
	 * @param zOffset the z-axis offset
	 * @return the image drawing location
	 */
	Point getCanvasImageLocation(BufferedImage image, int zOffset);

	/**
	 * Gets the point at which a sprite should be drawn, relative to the
	 * current location with the given z-axis offset.
	 *
	 * @param sprite the sprite to draw
	 * @param zOffset the z-axis offset
	 * @return the sprite drawing location
	 */
	Point getCanvasSpriteLocation(SpritePixels sprite, int zOffset);

	/**
	 * Gets a point on the canvas of where this actors mini-map indicator
	 * should appear.
	 *
	 * @return mini-map location on canvas
	 */
	Point getMinimapLocation();

	/**
	 * Gets the logical height of the actors model.
	 *

	 * This z-axis offset is roughly where the health bar of the actor
	 * is drawn.
	 *
	 * @return the logical height
	 */
	int getLogicalHeight();

	/**
	 * Gets the convex hull of the actors model.
	 *
	 * @return the convex hull
	 * @see net.runelite.api.model.Jarvis
	 */
	Shape getConvexHull();

	/**
	 * Gets the world area that the actor occupies.
	 *
	 * @return the world area
	 */
	WorldArea getWorldArea();

	/**
	 * Gets the overhead text that is displayed above the actor
	 *
	 * @return the overhead text
	 */
	String getOverheadText();

	/**
	 * Sets the overhead text that is displayed above the actor
	 *
	 * @param overheadText the overhead text
	 */
	void setOverheadText(String overheadText);

	/**
	 * Returns true if this actor has died
	 *
	 * @return
	 */
	boolean isDead();
}


text:
"""Tests for tensorflow.kernels.edit_distance_op."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function

import numpy as np
import tensorflow as tf

def ConstantOf(x):
  x = np.asarray(x)
  # Convert to int64 if it's not a string or unicode
  if x.dtype.char not in "SU": x = np.asarray(x, dtype=np.int64)
  return tf.constant(x)

class EditDistanceTest(tf.test.TestCase):

  def _testEditDistanceST(
      self, hypothesis_st, truth_st, normalize, expected_output,
      expected_shape, expected_err_re=None):
    edit_distance = tf.edit_distance(
        hypothesis=hypothesis_st, truth=truth_st, normalize=normalize)

    if expected_err_re is None:
      self.assertEqual(edit_distance.get_shape(), expected_shape)
      output = edit_distance.eval()
      self.assertAllClose(output, expected_output)
    else:
      with self.assertRaisesOpError(expected_err_re):
        edit_distance.eval()

  def _testEditDistance(self, hypothesis, truth, normalize,
                        expected_output, expected_err_re=None):
    # Shape inference figures out the shape from the shape variables
    # Explicit tuple() needed since zip returns an iterator in Python 3.
    expected_shape = [
        max(h, t) for h, t in tuple(zip(hypothesis[2], truth[2]))[:-1]]

    # SparseTensorValue inputs.
    with tf.Graph().as_default() as g, self.test_session(g):
      # hypothesis and truth are (index, value, shape) tuples
      self._testEditDistanceST(
          hypothesis_st=tf.SparseTensorValue(
              *[ConstantOf(x) for x in hypothesis]),
          truth_st=tf.SparseTensorValue(*[ConstantOf(x) for x in truth]),
          normalize=normalize,
          expected_output=expected_output,
          expected_shape=expected_shape,
          expected_err_re=expected_err_re)

    # SparseTensor inputs.
    with tf.Graph().as_default() as g, self.test_session(g):
      # hypothesis and truth are (index, value, shape) tuples
      self._testEditDistanceST(
          hypothesis_st=tf.SparseTensor(*[ConstantOf(x) for x in hypothesis]),
          truth_st=tf.SparseTensor(*[ConstantOf(x) for x in truth]),
          normalize=normalize,
          expected_output=expected_output,
          expected_shape=expected_shape,
          expected_err_re=expected_err_re)

  def testEditDistanceNormalized(self):
    hypothesis_indices = [[0, 0], [0, 1],
                          [1, 0], [1, 1]]
    hypothesis_values = [0, 1,
                         1, -1]
    hypothesis_shape = [2, 2]
    truth_indices = [[0, 0],
                     [1, 0], [1, 1]]
    truth_values = [0,
                    1, 1]
    truth_shape = [2, 2]
    expected_output = [1.0, 0.5]

    self._testEditDistance(
        hypothesis=(hypothesis_indices, hypothesis_values, hypothesis_shape),
        truth=(truth_indices, truth_values, truth_shape),
        normalize=True,
        expected_output=expected_output)

  def testEditDistanceUnnormalized(self):
    hypothesis_indices = [[0, 0],
                          [1, 0], [1, 1]]
    hypothesis_values = [10,
                         10, 11]
    hypothesis_shape = [2, 2]
    truth_indices = [[0, 0], [0, 1],
                     [1, 0], [1, 1]]
    truth_values = [1, 2,
                    1, -1]
    truth_shape = [2, 3]
    expected_output = [2.0, 2.0]

    self._testEditDistance(
        hypothesis=(hypothesis_indices, hypothesis_values, hypothesis_shape),
        truth=(truth_indices, truth_values, truth_shape),
        normalize=False,
        expected_output=expected_output)

  def testEditDistanceProperDistance(self):
    # In this case, the values are individual characters stored in the
    # SparseTensor (type DT_STRING)
    hypothesis_indices = ([[0, i] for i, _ in enumerate("algorithm")] +
                          [[1, i] for i, _ in enumerate("altruistic")])
    hypothesis_values = [x for x in "algorithm"] + [x for x in "altruistic"]
    hypothesis_shape = [2, 11]
    truth_indices = ([[0, i] for i, _ in enumerate("altruistic")] +
                     [[1, i] for i, _ in enumerate("algorithm")])
    truth_values = [x for x in "altruistic"] + [x for x in "algorithm"]
    truth_shape = [2, 11]
    expected_unnormalized = [6.0, 6.0]
    expected_normalized = [6.0/len("altruistic"),
                           6.0/len("algorithm")]

    self._testEditDistance(
        hypothesis=(hypothesis_indices, hypothesis_values, hypothesis_shape),
        truth=(truth_indices, truth_values, truth_shape),
        normalize=False,
        expected_output=expected_unnormalized)

    self._testEditDistance(
        hypothesis=(hypothesis_indices, hypothesis_values, hypothesis_shape),
        truth=(truth_indices, truth_values, truth_shape),
        normalize=True,
        expected_output=expected_normalized)

  def testEditDistance3D(self):
    hypothesis_indices = [[0, 0, 0],
                          [1, 0, 0]]
    hypothesis_values = [0, 1]
    hypothesis_shape = [2, 1, 1]
    truth_indices = [[0, 1, 0],
                     [1, 0, 0],
                     [1, 1, 0]]
    truth_values = [0, 1, 1]
    truth_shape = [2, 2, 1]
    expected_output = [[np.inf, 1.0],  # (0,0): no truth, (0,1): no hypothesis
                       [0.0, 1.0]]     # (1,0): match,    (1,1): no hypothesis

    self._testEditDistance(
        hypothesis=(hypothesis_indices, hypothesis_values, hypothesis_shape),
        truth=(truth_indices, truth_values, truth_shape),
        normalize=True,
        expected_output=expected_output)

  def testEditDistanceZeroLengthHypothesis(self):
    hypothesis_indices = np.empty((0, 2), dtype=np.int64)
    hypothesis_values = []
    hypothesis_shape = [1, 0]
    truth_indices = [[0, 0]]
    truth_values = [0]
    truth_shape = [1, 1]
    expected_output = [1.0]

    self._testEditDistance(
        hypothesis=(hypothesis_indices, hypothesis_values, hypothesis_shape),
        truth=(truth_indices, truth_values, truth_shape),
        normalize=True,
        expected_output=expected_output)

  def testEditDistanceZeroLengthTruth(self):
    hypothesis_indices = [[0, 0]]
    hypothesis_values = [0]
    hypothesis_shape = [1, 1]
    truth_indices = np.empty((0, 2), dtype=np.int64)
    truth_values = []
    truth_shape = [1, 0]
    expected_output = [np.inf]  # Normalized, loss is 1/0 = inf

    self._testEditDistance(
        hypothesis=(hypothesis_indices, hypothesis_values, hypothesis_shape),
        truth=(truth_indices, truth_values, truth_shape),
        normalize=True,
        expected_output=expected_output)

  def testEditDistanceZeroLengthHypothesisAndTruth(self):
    hypothesis_indices = np.empty((0, 2), dtype=np.int64)
    hypothesis_values = []
    hypothesis_shape = [1, 0]
    truth_indices = np.empty((0, 2), dtype=np.int64)
    truth_values = []
    truth_shape = [1, 0]
    expected_output = [0]  # Normalized is 0 because of exact match

    self._testEditDistance(
        hypothesis=(hypothesis_indices, hypothesis_values, hypothesis_shape),
        truth=(truth_indices, truth_values, truth_shape),
        normalize=True,
        expected_output=expected_output)

if __name__ == "__main__":
  tf.test.main()


text:
Edit Service Provider

                    <form name="serviceproviderForm" class="form-horizontal" ng-submit="update(serviceproviderForm.$valid)" novalidate>
                        <fieldset>

                                Company Name
                                <input name="company_name" type="text" ng-model="serviceprovider.company_name" id="company_name" class="form-control" placeholder="Company Name" required>

Company Name is required.

                                Registration Number
                                <input name="reg_number" type="text" ng-model="serviceprovider.reg_number" id="reg_number" class="form-control" placeholder="Registration Number" required>

Registration Number is required.

                                Address
                                <input name="address" type="text" ng-model="serviceprovider.address" id="address" class="form-control" placeholder="Address" required>

Address is required.

                                Main Contact
                                <input name="main_contact" type="text" ng-model="serviceprovider.main_contact" id="main_contact" class="form-control" placeholder="Main Contact" required>

Main Contact is required.

                                Contact Number
                                <input name="contact_number" type="text" ng-model="serviceprovider.contact_number" id="contact_number" class="form-control" placeholder="Contact Number" required>

Contact Number is required.

                                Email Address
                                <input name="email" type="text" ng-model="serviceprovider.email" id="email" class="form-control" placeholder="Email Address" required>

Email Address is required.

                                Area of Expertise
                                <input name="area_of_expertise" type="text" ng-model="serviceprovider.area_of_expertise" id="area_of_expertise" class="form-control" placeholder="Area of Expertise" required>

Area of Expertise is required.

                                <input type="submit" value="Update" class="btn btn-default">

                        </fieldset>
                    </form>


text:
Email beperkt doorgeven

<tt>relay_domains</tt>

Deze parameter beperkt hoeveel email er word doorgegeven door het email systeem
van de cliënt hostnaam domein (en subdomeinen), en beperkt naar hoeveel bestemming
domeinen (en subdomeinen) het word verstuurd.

<include relay_rules>

Specificeer een lijst met hosts of domeinen, <tt>/file/name</tt> patronen of
<tt>type:name</tt> opzoek tabellen, gescheiden met komma's en/of een spatie. Een file
naam word vervangen door zijn inhoud; een <tt>type:name</tt> tabel is word vergeleken
wanneer een (hoofd) domein verschijnt als opzoek sleutel.

NOTE: Postfix zal niet automatisch email doorsturen voor domeinen die in de lijst staan
van het systeem als de primaire of backup MX host. Bekijk de <tt>permit_mx_backup</tt>
beperkingen, in de omschrijving van de
<tt>smtpd_recipient_restrictions</tt> parameter.


text:
<?php

$Testimonial = new \Franklin\Data\Testimonial($VirtualParent);

$Testimonial->Name = $Data['Testimonial_Name'];
$Testimonial->Content = $Data['Testimonial_Content'];
$Testimonial->Image = $Data['Testimonial_Image'];
$Testimonial->Language->Id = $Data['Testimonial_Language_Id'];
$Testimonial->Excerpt->Id = $Data['Testimonial_Excerpt'];
$Testimonial->Signature->Id = $Data['Testimonial_Signature'];

$Results[] = $Testimonial->Create();


text:
<StackLayout class="layout" sdkExampleTitle sdkToggleNavButton>
    <Label class="h4 m-15 text-center" text="Increase/Decrease number after 1 seconds" textWrap="true"></Label>
    <TextView class="h2 input m-15 text-center" [text]="counter" text="" editable="false"></TextView>
    <GridLayout class="m-x-auto" rows="auto" columns="150 150">
        <Button class="btn btn-primary btn-rounded-sm btn-active" row="0" col="0" text="+" (tap)="increase($event)"></Button>
        <Button class="btn btn-primary btn-rounded-sm btn-active" row="0" col="1" text="-" (tap)="decrease($event)"></Button>
    </GridLayout>
</StackLayout>


text:
package jk_5.nailed.server.team;

import com.google.common.collect.ImmutableSet;
import jk_5.nailed.api.chat.ChatColor;
import jk_5.nailed.api.map.Team;
import jk_5.nailed.api.mappack.metadata.MappackTeam;
import jk_5.nailed.api.player.Player;
import jk_5.nailed.api.scoreboard.ScoreboardTeam;
import jk_5.nailed.api.util.Location;
import jk_5.nailed.server.map.MapTeamManager;

import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import java.util.Collection;
import java.util.HashSet;
import java.util.Set;

public class NailedTeam implements Team {

    private final MappackTeam mappackTeam;
    private final Set<Player> memberSet = new HashSet<Player>();
    private final ScoreboardTeam scoreboardTeam;
    private Location spawnpoint = null;

    public NailedTeam(MappackTeam mappackTeam, MapTeamManager manager) {
        this.mappackTeam = mappackTeam;
        this.scoreboardTeam = manager.getMap().getScoreboardManager().getOrCreateTeam(mappackTeam.id());
        this.scoreboardTeam.setPrefix(mappackTeam.color().toString());
        this.scoreboardTeam.setDisplayName(mappackTeam.name());
    }

    public void onPlayerJoined(@Nonnull Player player){
        this.memberSet.add(player);
        scoreboardTeam.addPlayer(player);
    }

    public void onPlayerLeft(@Nonnull Player player){
        this.memberSet.remove(player);
        this.scoreboardTeam.removePlayer(player);
    }

    @Nonnull
    @Override
    public String id() {
        return mappackTeam.id();
    }

    @Nonnull
    @Override
    public String name() {
        return mappackTeam.name();
    }

    @Nonnull
    @Override
    public ChatColor color() {
        return mappackTeam.color();
    }

    @Nonnull
    @Override
    public Collection<Player> members() {
        return ImmutableSet.copyOf(memberSet);
    }

    @Nullable
    @Override
    public Location getSpawnPoint() {
        return spawnpoint;
    }

    @Override
    public void setSpawnPoint(@Nullable Location spawnpoint) {
        this.spawnpoint = spawnpoint;
    }

    @Override
    public String getName() {
        return mappackTeam.name();
    }
}


text:
/*
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package io.prestosql.pinot;

import com.google.common.collect.ImmutableMap;
import io.airlift.log.Logger;
import io.airlift.log.Logging;
import io.prestosql.Session;
import io.prestosql.metadata.SessionPropertyManager;
import io.prestosql.testing.DistributedQueryRunner;

import java.util.Map;

import static io.prestosql.testing.TestingSession.testSessionBuilder;

public class PinotQueryRunner
{
    private PinotQueryRunner()
    {
    }

    public static DistributedQueryRunner createPinotQueryRunner(Map<String, String> extraProperties, Map<String, String> extraPinotProperties)
            throws Exception
    {
        DistributedQueryRunner queryRunner = DistributedQueryRunner.builder(createSession("default"))
                .setNodeCount(2)
                .setExtraProperties(extraProperties)
                .build();
        queryRunner.installPlugin(new PinotPlugin());
        queryRunner.createCatalog("pinot", "pinot", extraPinotProperties);
        return queryRunner;
    }

    public static Session createSession(String schema)
    {
        SessionPropertyManager sessionPropertyManager = new SessionPropertyManager();
        return testSessionBuilder(sessionPropertyManager)
                .setCatalog("pinot")
                .setSchema(schema)
                .build();
    }

    public static void main(String[] args)
            throws Exception
    {
        Logging.initialize();
        Map<String, String> properties = ImmutableMap.of("http-server.http.port", "8080");
        Map<String, String> pinotProperties = ImmutableMap.<String, String>builder()
                .put("pinot.controller-urls", "localhost:9000")
                .put("pinot.segments-per-split", "10")
                .put("pinot.request-timeout", "3m")
                .build();
        DistributedQueryRunner queryRunner = createPinotQueryRunner(properties, pinotProperties);
        Thread.sleep(10);
        Logger log = Logger.get(PinotQueryRunner.class);
        log.info("======== SERVER STARTED ========");
        log.info("\n====\n%s\n====", queryRunner.getCoordinator().getBaseUrl());
    }
}


text:
package consulo.ui.dialog.impl;

import consulo.ui.Component;
import consulo.ui.dialog.Dialog;
import consulo.ui.dialog.DialogDescriptor;
import consulo.ui.dialog.DialogService;

import javax.annotation.Nonnull;
import javax.annotation.Nullable;

/**
 * @author VISTALL
 * @since 14/12/2021
 */
public class UnifiedDialogServiceImpl implements DialogService {
  @Nonnull
  @Override
  public <V> Dialog<V> build(@Nullable Component parent, @Nonnull DialogDescriptor<V> descriptor) {
    return null;
  }
}


text:
package com.spun.util.servlets;

public interface SynchronizedServlet
	extends Runnable
{
  /***********************************************************************/
	/**
	  * This should run the servlet. when it is completed, it should make a call
		* back to ServletSynchronizer.servletFinished(key, result)
		* @see com.spun.util.servlets.ServletSynchronizer.servletFinished(String,String)
		**/
  public void init(ServletSynchronizer sync, String key);

  /***********************************************************************/
  /***********************************************************************/
}


text:
const REQUEST = 'REQUEST';
const SUCCESS = 'SUCCESS';
const FAILURE = 'FAILURE';

function createRequestTypes(base) {
  const res = {};
  [REQUEST, SUCCESS, FAILURE].forEach((type) => { res[type] = `${base}_${type}`; })
  return res;
}

export const FETCH_VIDEOS = createRequestTypes('FETCH_VIDEOS');
export const FETCH_VIDEO = createRequestTypes('FETCH_VIDEO');


text:
package silverhillapps.com.flickrsample.utils;

import android.content.Context;
import android.graphics.Bitmap;
import android.widget.ImageView;

import com.nostra13.universalimageloader.cache.disc.impl.UnlimitedDiscCache;
import com.nostra13.universalimageloader.cache.disc.naming.HashCodeFileNameGenerator;
import com.nostra13.universalimageloader.cache.memory.impl.LruMemoryCache;
import com.nostra13.universalimageloader.cache.memory.impl.UsingFreqLimitedMemoryCache;
import com.nostra13.universalimageloader.core.DisplayImageOptions;
import com.nostra13.universalimageloader.core.ImageLoader;
import com.nostra13.universalimageloader.core.ImageLoaderConfiguration;
import com.nostra13.universalimageloader.core.assist.QueueProcessingType;
import com.nostra13.universalimageloader.core.decode.BaseImageDecoder;
import com.nostra13.universalimageloader.core.download.BaseImageDownloader;
import com.nostra13.universalimageloader.utils.StorageUtils;

import java.io.File;

import silverhillapps.com.flickrsample.SHAFSApplication;

/**
 * This class is a util for image loading/caching through UIL library.
 */
public class ImageUtils {

    private ImageLoader imageLoader; // The imagen loader object.

    public ImageUtils(Context context) {
        imageLoader = ImageLoader.getInstance();

        File cacheDir = StorageUtils.getCacheDirectory(context);
        ImageLoaderConfiguration config = new ImageLoaderConfiguration.Builder(context)
                .memoryCacheExtraOptions(480, 800) // default = device screen dimensions
                .diskCacheExtraOptions(480, 800, null)
                .threadPriority(Thread.NORM_PRIORITY - 1) // default
                .tasksProcessingOrder(QueueProcessingType.FIFO) // default
                .denyCacheImageMultipleSizesInMemory()
                .memoryCache(new LruMemoryCache(2 * 1024 * 1024))
                .memoryCacheSize(2 * 1024 * 1024)
                .memoryCacheSizePercentage(13) // default
                .diskCache(new UnlimitedDiscCache(cacheDir)) // default
                .diskCacheSize(50 * 1024 * 1024)
                .diskCacheFileCount(100)
                .diskCacheFileNameGenerator(new HashCodeFileNameGenerator()) // default
                .imageDownloader(new BaseImageDownloader(context)) // default
                .defaultDisplayImageOptions(DisplayImageOptions.createSimple()) // default
                .writeDebugLogs()
                .build();

        imageLoader.init(config);

    }

    /**
     * Main method for network image displaying
     * @param url
     * @param imageView
     */
    public void displayImage(String url, ImageView imageView) {
        imageLoader.displayImage(url,imageView);
    }
}


text:
.verification-status > span {
	display: none;
	margin: 0 5px;
}

.verification-status-positive > .verification-status-positive {
	display: inline-block;
}

.verification-status-negative > .verification-status-negative {
	display: inline-block;
}


text:
layout: api
title: getUTCSeconds
permalink: getUTCSeconds/index.html
filename: api/getUTCSeconds.md
---


text:
from setuptools import setup, find_packages

import sptrans

version = sptrans.release

setup(name='sptrans',
      version=version,
      description="Python library for the SPTrans API. Read the docs here: http://sptrans.readthedocs.org/",
      long_description="""\
""",
      classifiers=[
          'Development Status :: 3 - Alpha',
          'License :: OSI Approved :: BSD License',
          'Natural Language :: English',
          'Programming Language :: Python :: 2.7',
          'Programming Language :: Python :: 3.3',
          'Topic :: Internet :: WWW/HTTP',
          'Topic :: Scientific/Engineering :: GIS',
          'Topic :: Software Development :: Libraries :: Python Modules',
      ],  # Get strings from http://pypi.python.org/pypi?%3Aaction=list_classifiers
      keywords='sptrans api transporte sp',
      author='Diogo Baeder',
      author_email='diogobaeder@yahoo.com.br',
      url='http://sptrans.readthedocs.org/',
      license='BSD 2-clause',
      packages=find_packages(exclude=['ez_setup', 'examples', 'tests']),
      include_package_data=True,
      zip_safe=True,
      install_requires=[
          'requests',
      ],
      entry_points="""
      # -*- Entry points: -*-
      """,
      )


text:
/**
 * SingleNidFilter
 *
 * @author Joel Kniaz
 */
package gov.va.isaac.gui.enhancedsearchview.filters;

/**
 * SingleNidFilter
 *
 * @author Joel Kniaz
 *
 * This interface is used solely in the GUI to attempt to retain filter parameters
 * when replacing an existing filter with a new one
 *
 */
public interface SingleNidFilter {
	public abstract int getNid();
	public abstract void setNid(int nid);
}


text:
package com.evernote.client.android;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Locale;

import android.util.Log;

import com.evernote.edam.userstore.BootstrapInfo;
import com.evernote.edam.userstore.BootstrapProfile;
import com.evernote.thrift.TException;

/**
 * A class that provides access to check the current
 * {@link com.evernote.edam.userstore.Constants#EDAM_VERSION_MAJOR} and
 * the {@link com.evernote.edam.userstore.Constants#EDAM_VERSION_MINOR} against the Evernote Web serivice for API
 * Compatibility
 *
 * It provides access to the {@link List} of {@link BootstrapProfile} representing the possible server connections
 * for the user.  This list must be requested from the server on any type of authentication attempt
 *
 * @author @tylersmithnet
 */
public class BootstrapManager {

  private static final String LOGTAG = "EvernoteSession";

  /**
   * List of locales that match china
   */
  private static List<Locale> sChinaLocales = Arrays.asList(new Locale[]{
      Locale.TRADITIONAL_CHINESE,
      Locale.CHINESE,
      Locale.CHINA,
      Locale.SIMPLIFIED_CHINESE});

  /**
   * Server matched name for BootstrapProfile that matches china
   */
  public static final String CHINA_PROFILE = "Evernote-China";

  /**
   * Display names for Yinxiang and Evernote
   */
  public static final String DISPLAY_YXBIJI = "印象笔记";
  public static final String DISPLAY_EVERNOTE = "Evernote";
  public static final String DISPLAY_EVERNOTE_INTL = "Evernote International";

  private ArrayList<String> mBootstrapServerUrls = new ArrayList<String>();
  private AsyncUserStoreClient mUserStoreClient;
  private Locale mLocale;
  private ClientFactory mClientProducer;
  private String mBootstrapServerUsed;

  /**
   * private constructor
   */
  private BootstrapManager() {};

  /**
   * package-scope constructor
   */
  BootstrapManager(EvernoteSession.EvernoteService service, ClientFactory producer) {
    this(service, producer, Locale.getDefault());
  }

  /**
   * package-scope constructor
   *
   * @param service {@link com.evernote.client.android.EvernoteSession.EvernoteService#PRODUCTION} when using
   * production and {@link com.evernote.client.android.EvernoteSession.EvernoteService#SANDBOX} when using sandbox
   * @param producer Client producer used to create clients
   * @param locale Used to detect if the china servers need to be checked
   */
  BootstrapManager(EvernoteSession.EvernoteService service, ClientFactory producer, Locale locale) {
    mLocale = locale;
    mClientProducer = producer;

    mBootstrapServerUrls.clear();
    switch(service) {
      case PRODUCTION:
        if (sChinaLocales.contains(mLocale)) {
          mBootstrapServerUrls.add(EvernoteSession.HOST_CHINA);
        }
        mBootstrapServerUrls.add(EvernoteSession.HOST_PRODUCTION);
        break;

      case SANDBOX:
        mBootstrapServerUrls.add(EvernoteSession.HOST_SANDBOX);
        break;
    }
  }

  /**
   * Initialized the User Store to check for supported version of the API
   *
   * @throws ClientUnsupportedException on unsupported version
   * @throws Exception on generic errors
   */
  private void initializeUserStoreAndCheckVersion() throws Exception {

    int i = 0;
    String version = com.evernote.edam.userstore.Constants.EDAM_VERSION_MAJOR + "."
        + com.evernote.edam.userstore.Constants.EDAM_VERSION_MINOR;

    for (String url : mBootstrapServerUrls) {
      i++;
      try {
        mUserStoreClient =  mClientProducer.createUserStoreClient(url);

        if (!mUserStoreClient.getClient().checkVersion(mClientProducer.getUserAgent(),
            com.evernote.edam.userstore.Constants.EDAM_VERSION_MAJOR,
            com.evernote.edam.userstore.Constants.EDAM_VERSION_MINOR)) {
          mUserStoreClient = null;
          throw new ClientUnsupportedException(version);
        }

        mBootstrapServerUsed = url;
        return;
      } catch (ClientUnsupportedException cue) {

        Log.e(LOGTAG, "Invalid Version", cue);
        throw cue;
      } catch (Exception e) {
        mUserStoreClient = null;
        if (i < mBootstrapServerUrls.size()) {
          Log.e(LOGTAG, "Error contacting bootstrap server=" + url, e);
          continue;
        } else {
          throw e;
        }
      }
    }
  }

  /**
   * Makes a web request to get the latest bootstrap information
   * This is a requirement during the oauth process
   *
   * @return {@link BootstrapInfoWrapper}
   * @throws Exception
   */
  BootstrapInfoWrapper getBootstrapInfo() throws Exception {
    Log.d(LOGTAG, "getBootstrapInfo()");
    BootstrapInfo bsInfo = null;
    try {
      if (mUserStoreClient == null) {
        initializeUserStoreAndCheckVersion();
      }

      bsInfo = mUserStoreClient.getClient().getBootstrapInfo(mLocale.toString());
      printBootstrapInfo(bsInfo);

    } catch (ClientUnsupportedException cue) {
      throw cue;
    } catch (TException e) {
      Log.e(LOGTAG, "error getting bootstrap info", e);
    }

    BootstrapInfoWrapper wrapper = new BootstrapInfoWrapper(mBootstrapServerUsed, bsInfo);
    return wrapper;
  }

  /**
   * Log the {@link BootstrapProfile} list
   * @param bsInfo
   */
  void printBootstrapInfo(BootstrapInfo bsInfo) {
    if (bsInfo == null) return;

    Log.d(LOGTAG, "printBootstrapInfo");
    List<BootstrapProfile> profiles = bsInfo.getProfiles();
    if (profiles != null) {
      for (BootstrapProfile profile : profiles) {
        Log.d(LOGTAG, profile.toString());
      }
    } else {
      Log.d(LOGTAG, "Profiles are null");
    }
  }

  /**
   * Wrapper class to hold the Evernote API server URL and the {@link BootstrapProfile} object
   */
  static class BootstrapInfoWrapper {
    private String mServerUrl;
    private BootstrapInfo mBootstrapInfo;

    BootstrapInfoWrapper(String serverUrl, BootstrapInfo info) {
      mServerUrl = serverUrl;
      mBootstrapInfo = info;
    }

    String getServerUrl() {
      return mServerUrl;
    }

    BootstrapInfo getBootstrapInfo() {
      return mBootstrapInfo;
    }
  }

  public static class ClientUnsupportedException extends Exception {
    public ClientUnsupportedException(String version) {
      super("Client version " + version + " not supported.");
    }
  };
}


text:
## Directories

`src`: source code for dragonfly client

`docs`: documentation that is not auto-generated

`tools`: tools needed for building/distributing/testing

## Developing Dragonfly

When working on the code base you should use the `dragonkeeper`
tool. See [dragonkeeper's README](https://github.com/operasoftware/dragonkeeper/blob/master/README.md)
for more information.

## Building Dragonfly

**Note:** It is not necessary to build Dragonfly during development. See above.

Building is done using the `df2` tool. For more information, see
[https://github.com/operasoftware/dragonfly-build-tools](https://github.com/operasoftware/dragonfly-build-tools).

## Running test builds of dragonfly

Open [opera:config#DeveloperTools|DeveloperToolsURL](opera:config#DeveloperTools|DeveloperToolsURL) and set the URL to the
path to the Dragonfly build to use.

## Updating translations

**NOTE**: While translated strings are placed in the `src/ui-strings`
directory, that is not the authoritative location for translations.
Strings are kept in Opera's translation infrastructure, which uses .po
files. These are not publicly available.

As a consequence, we can not integrate string fixes from volunteers by
simply merging new versions of the JavaScript string files.

Translations currently offered:
  Беларуская (be), Български (bg), Česky (cs), Deutsch (de), U.S. English (en),
  British English (en-GB), Español (España) (es-ES), Español (Latinoamérica) (es-LA),
  Eesti keel (et), Français (fr), Français Canadien (fr-CA), Frysk (fy), Gàidhlig (gd),
  Magyar (hu), Bahasa Indonesia (id), Italiano (it), 日本語 (ja), ქართული (ka),
  македонски јазик (mk), Norsk bokmål (nb), Nederlands (nl), Norsk nynorsk (nn),
  Polski (pl), Português (pt), Português (Brasil) (pt-BR), Română (ro), Русский язык (ru),
  Slovenčina (sk), српски (sr), Svenska (sv), Türkçe (tr), Українська (uk), 简体中文 (zh-cn),
  繁體中文 (zh-tw)


text:
#ifndef QBLITTABLE_P_H
#define QBLITTABLE_P_H

//
//  W A R N I N G
//  -------------
//
// This file is not part of the Qt API.  It exists purely as an
// implementation detail.  This header file may change from version to
// version without notice, or even be removed.
//
// We mean it.
//

#include <QtCore/qsize.h>
#include <QtGui/private/qpixmap_blitter_p.h>

#ifndef QT_NO_BLITTABLE
QT_BEGIN_NAMESPACE

class QImage;
class QBlittablePrivate;

class Q_GUI_EXPORT QBlittable
{
    Q_DECLARE_PRIVATE(QBlittable);
public:
    enum Capability {

        SolidRectCapability             = 0x0001,
        SourcePixmapCapability          = 0x0002,
        SourceOverPixmapCapability      = 0x0004,
        SourceOverScaledPixmapCapability = 0x0008,
        AlphaFillRectCapability         = 0x0010,
        OpacityPixmapCapability         = 0x0020,
        DrawScaledCachedGlyphsCapability = 0x0040,
        SubPixelGlyphsCapability         = 0x0080,
        ComplexClipCapability            = 0x0100,

        // Internal ones
        OutlineCapability               = 0x0001000
    };
    Q_DECLARE_FLAGS (Capabilities, Capability)

    QBlittable(const QSize &size, Capabilities caps);
    virtual ~QBlittable();

    Capabilities capabilities() const;
    QSize size() const;

    virtual void fillRect(const QRectF &rect, const QColor &color) = 0;
    virtual void drawPixmap(const QRectF &rect, const QPixmap &pixmap, const QRectF &subrect) = 0;
    virtual void alphaFillRect(const QRectF &rect, const QColor &color, QPainter::CompositionMode cmode) {
        Q_UNUSED(rect);
        Q_UNUSED(color);
        Q_UNUSED(cmode);
        qWarning("Please implement alphaFillRect function in your platform or remove AlphaFillRectCapability from it");
    }
    virtual void drawPixmapOpacity(const QRectF &rect, const QPixmap &pixmap, const QRectF &subrect, QPainter::CompositionMode cmode, qreal opacity) {
        Q_UNUSED(rect);
        Q_UNUSED(pixmap);
        Q_UNUSED(subrect);
        Q_UNUSED(cmode);
        Q_UNUSED(opacity);
        qWarning("Please implement drawPixmapOpacity function in your platform or remove OpacityPixmapCapability from it");
    }
    virtual bool drawCachedGlyphs(const QPaintEngineState *state, QFontEngine::GlyphFormat glyphFormat, int numGlyphs, const glyph_t *glyphs, const QFixedPoint *positions, QFontEngine *fontEngine) {
        Q_UNUSED(state);
        Q_UNUSED(glyphFormat);
        Q_UNUSED(numGlyphs);
        Q_UNUSED(glyphs);
        Q_UNUSED(positions);
        Q_UNUSED(fontEngine);
        qWarning("Please implement drawCachedGlyphs function in your platform or remove DrawCachedGlyphsCapability from it");
        return true;
    }

    QImage *lock();
    void unlock();

    bool isLocked() const;

protected:
    virtual QImage *doLock() = 0;
    virtual void doUnlock() = 0;
    QBlittablePrivate *d_ptr;
};

QT_END_NAMESPACE
#endif //QT_NO_BLITTABLE
#endif //QBLITTABLE_P_H


text:
require 'spec_helper'
require 'lotus/app'
require 'support/fixtures/flowers_controller'

describe 'Basic Request' do
  before(:all) do
    Routes = Lotus::Routes.draw do
      get '/flowers',            controller: 'flowers'
      get '/flowers/set_body',   controller: 'flowers', action: 'set_body'
      get '/flowers/set_status', controller: 'flowers', action: 'set_status'
      get '/flowers/set_header', controller: 'flowers', action: 'set_header'
    end
  end

  let(:app) { Lotus::App.new(Routes) }

  it 'is successful' do
    get '/flowers'
    last_response.should be_ok
  end

  it 'sets response body' do
    get '/flowers/set_body'
    last_response.should be_ok
    last_response.body.should == 'Lotus'
  end

  it 'sets a status' do
    get '/flowers/set_status'
    last_response.status.should be(403)
  end

  it 'sets an header' do
    get '/flowers/set_header'
    last_response.headers['Content-Type'].should == 'application/json'
  end

  it 'is not found' do
    get '/unknown'
    last_response.status.should be(404)
  end
end


text:
module.exports = {
  type: 'keynote',
  prettyType: 'Keynote',
  tags: ['event', 'featured-event'],
};


text:
import unittest

import numpy as np
import six

import chainer
from chainer.backends import cuda
from chainer import functions
from chainer import gradient_check
from chainer import testing
from chainer.testing import attr
from chainer.utils import type_check

def _as_two_dim(x):
    if x.ndim == 2:
        return x
    return x.reshape((len(x), -1))

@testing.parameterize(*testing.product({
    'dtype': [np.float16, np.float32, np.float64],
    'shape': [(4, 3, 5), (4, 15)],
}))
class TestBatchL2NormSquared(unittest.TestCase):

    def setUp(self):
        self.x = np.random.uniform(-1, 1, self.shape).astype(self.dtype)
        self.gy = np.random.uniform(-1, 1, self.shape[0]).astype(self.dtype)
        self.ggx = np.random.uniform(-1, 1, self.shape).astype(self.dtype)

        if self.dtype == np.float16:
            self.check_forward_options = {'atol': 1e-3, 'rtol': 1e-3}
            self.check_backward_options = {'atol': 1e-2, 'rtol': 1e-2}
            self.check_double_backward_options = {'atol': 1e-2, 'rtol': 1e-2}
        else:
            self.check_forward_options = {}
            self.check_backward_options = {}
            self.check_double_backward_options = {}

    def check_forward(self, x_data):
        x = chainer.Variable(x_data)

        y = functions.batch_l2_norm_squared(x)
        self.assertEqual(y.data.dtype, self.dtype)
        y_data = cuda.to_cpu(y.data)

        x_two_dim = _as_two_dim(self.x)
        y_expect = np.empty(len(self.x), dtype=self.dtype)
        for n in six.moves.range(len(self.x)):
            y_expect[n] = sum(map(lambda x: x * x, x_two_dim[n]))

        testing.assert_allclose(y_expect, y_data, **self.check_forward_options)

    def test_forward_cpu(self):
        self.check_forward(self.x)

    @attr.gpu
    def test_forward_gpu(self):
        self.check_forward(cuda.to_gpu(self.x))

    def check_backward(self, x_data, y_grad):
        gradient_check.check_backward(
            functions.batch_l2_norm_squared, x_data, y_grad, eps=1,
            **self.check_backward_options)

    def test_backward_cpu(self):
        self.check_backward(self.x, self.gy)

    @attr.gpu
    def test_backward_gpu(self):
        self.check_backward(cuda.to_gpu(self.x), cuda.to_gpu(self.gy))

    def check_double_backward(self, x_data, y_grad, x_grad_grad):
        gradient_check.check_double_backward(
            functions.batch_l2_norm_squared,
            x_data, y_grad, x_grad_grad, dtype=np.float64,
            **self.check_double_backward_options)

    def test_double_backward_cpu(self):
        self.check_double_backward(self.x, self.gy, self.ggx)

    @attr.gpu
    def test_double_backward_gpu(self):
        self.check_double_backward(
            cuda.to_gpu(self.x),
            cuda.to_gpu(self.gy),
            cuda.to_gpu(self.ggx))

class TestBatchL2NormSquaredTypeError(unittest.TestCase):

    def test_invalid_shape(self):
        x = chainer.Variable(np.zeros((4,), dtype=np.float32))

        with self.assertRaises(type_check.InvalidType):
            chainer.functions.batch_l2_norm_squared(x)

testing.run_module(__name__, __file__)


text:
namespace content {

class WebUISetupImpl : public mojo::InterfaceImpl<WebUISetup> {
 public:
  static void Bind(mojo::ScopedMessagePipeHandle handle);

 private:
  WebUISetupImpl() {}

  virtual void OnConnectionError() OVERRIDE;

  // WebUISetup methods:
  virtual void SetWebUIHandle(
      int32_t view_routing_id,
      mojo::ScopedMessagePipeHandle web_ui_handle) OVERRIDE;

  DISALLOW_COPY_AND_ASSIGN(WebUISetupImpl);
};

}  // namespace content

#endif  // CONTENT_RENDERER_WEB_UI_SETUP_IMPL_H_


text: A basic indexing plugin, adds basic fields: url, host, title, content, etc.