text:
<?php
/**
 * SmsApiTest
 * PHP version 5
 *
 * @category Class
 * @package  NotifyLk
 * @author   http://github.com/swagger-api/swagger-codegen
 * @license  http://www.apache.org/licenses/LICENSE-2.0 Apache License v2
 * @link     https://github.com/swagger-api/swagger-codegen
 */

/**
 * Notify.lk API
 *
 * Send SMS with Notify.lk
 *
 * OpenAPI spec version: v1
 *
 * Generated by: https://github.com/swagger-api/swagger-codegen.git
 *
 * 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.
 */

/**
 * NOTE: This class is auto generated by the swagger code generator program.
 * https://github.com/swagger-api/swagger-codegen
 * Please update the test case below to test the endpoint.
 */

namespace NotifyLk;

use \NotifyLk\Configuration;
use \NotifyLk\ApiClient;
use \NotifyLk\ApiException;
use \NotifyLk\ObjectSerializer;

/**
 * SmsApiTest Class Doc Comment
 *
 * @category Class
 * @package  NotifyLk
 * @author   http://github.com/swagger-api/swagger-codegen
 * @license  http://www.apache.org/licenses/LICENSE-2.0 Apache License v2
 * @link     https://github.com/swagger-api/swagger-codegen
 */
class SmsApiTest extends \PHPUnit_Framework_TestCase
{

    /**
     * Setup before running any test cases
     */
    public static function setUpBeforeClass()
    {

    }

    /**
     * Setup before running each test case
     */
    public function setUp()
    {

    }

    /**
     * Clean up after running each test case
     */
    public function tearDown()
    {

    }

    /**
     * Clean up after running all test cases
     */
    public static function tearDownAfterClass()
    {

    }

    /**
     * Test case for sendSMS
     *
     * Sending SMS to a number from specified sender ID.
     *
     */
    public function testSendSMS()
    {

    }

}


text:
select test_kylin_fact.lstg_format_name,sum(test_kylin_fact.price) as GMV
 , count(*) as TRANS_CNT from test_kylin_fact
 where test_kylin_fact.lstg_format_name is null
 group by test_kylin_fact.lstg_format_name having sum(price)>5000 and count(*)>72

redpajama_set_name: RedPajamaGithub


text:
#import <Hoomi/HFAccessToken.h>

@class HFLoginButton;

/*!
 Delegate definition for handling events from HFLoginButton.
 */
@protocol HFLoginButtonDelegate <NSObject>

@optional

/*!
 Called by the HFLoginButton before initiating authorization. Use this to show a progress indicator.

 @param button the button that was the source of the event
 */
- (void)buttonWillPerformHoomiAuthorization:(HFLoginButton *)button;

/*!
 Called by the HFLoginButton after authorization completes with either the new token or the error that
 occurred during the login process. This may not be called if the application was closed in the background
 during authorization.

 @param button the button that was the source of the event
 @param token the token (if any) that resulted from the authorization
 @param error the error that occurred during authorization (if any)
 */
- (void)button:(HFLoginButton *)button didPerformHoomiAuthorizationWithResult:(HFAccessToken *)token error:(NSError *)error;

@end


text:
(function(window, load, id){
  if (!load) {
    var fn = '(' + arguments.callee.toString() + ')(this, true, "' + chrome.runtime.id + '");';
    var script = document.createElement('script');
    script.appendChild(document.createTextNode(fn));
    document.body.appendChild(script);
    return;
  }
  var native_open = window.native_open = window.open;
  var port = chrome.runtime.connect(id);
  window.open = function(url,name){
    if (url === void 0) return native_open(url,name);
    port.postMessage({ message: 'openInTab', url: url });
    return true;
  };
  document.addEventListener('click',function(evt){
    if (evt.target.href && evt.target.target === '_blank'){
      evt.preventDefault();
      window.open(evt.target.href, '_blank');
    }
  },false);
  var _onload = window.onload;
  window.onload = function(){
    _onload();
    var p = window.Control.pin;
    var v = window.Control.view_original;
    var force_next_item = function(){
      var i = window.get_active_item();
      window.Control.scroll_next_item();
      if(i == window.get_active_item()){
        window.Control.scroll_next_item();
      }
    };
    var pin = function(){
      var res = p.apply(this, arguments);
      force_next_item();
      return res;
    };
    var view_original = function(){
      var res = v.apply(this, arguments);
      force_next_item();
      return res;
    };
    window.Keybind.add("p", pin);
    window.Keybind.add("v", view_original);
  };
})();


text:
<?xml version="1.0" encoding="UTF-8"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
         xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <modelVersion>4.0.0</modelVersion>
    <groupId>org.wso2.appserver</groupId>
    <artifactId>jaxrs-client-api-test-webapp</artifactId>
    <version>1.0.0</version>
    <packaging>war</packaging>
    <name>jaxrs-client-api-test-webapp</name>
    <description>jaxrs-client-api-test webapp</description>
    <properties>
        <CApp.type>web/application</CApp.type>
    </properties>
    <dependencies>
        <dependency>
            <groupId>org.apache.cxf</groupId>
            <artifactId>cxf-rt-rs-client</artifactId>
            <version>3.1.1</version>
            <!--<scope>provided</scope>-->
        </dependency>
        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>javax.servlet-api</artifactId>
            <version>3.1.0</version>
            <scope>provided</scope>
        </dependency>
    </dependencies>
    <repositories>
        <repository>
            <releases>
                <enabled>true</enabled>
                <updatePolicy>daily</updatePolicy>
                <checksumPolicy>ignore</checksumPolicy>
            </releases>
            <id>wso2-nexus</id>
            <url>http://maven.wso2.org/nexus/content/groups/wso2-public/</url>
        </repository>
        <repository>
            <releases>
                <enabled>true</enabled>
                <updatePolicy>daily</updatePolicy>
                <checksumPolicy>ignore</checksumPolicy>
            </releases>
            <id>java.net2</id>
            <name>Repository hosting the jee6 artifacts</name>
            <url>http://download.java.net/maven/2</url>
        </repository>
    </repositories>
    <pluginRepositories>
        <pluginRepository>
            <releases>
                <enabled>true</enabled>
                <updatePolicy>daily</updatePolicy>
                <checksumPolicy>ignore</checksumPolicy>
            </releases>
            <id>wso2-nexus</id>
            <url>http://maven.wso2.org/nexus/content/groups/wso2-public/</url>
        </pluginRepository>
    </pluginRepositories>
    <build>
        <plugins>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>build-helper-maven-plugin</artifactId>
                <version>1.8</version>
                <configuration/>
            </plugin>
            <plugin>
                <artifactId>maven-war-plugin</artifactId>
                <version>2.4</version>
                <executions>
                    <execution>
                        <id>war</id>
                        <phase>package</phase>
                        <goals>
                            <goal>war</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <warSourceDirectory>WebContent</warSourceDirectory>
                </configuration>
            </plugin>
            <plugin>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.1</version>
                <configuration>
                    <source>1.5</source>
                    <target>1.5</target>
                </configuration>
            </plugin>
        </plugins>
    </build>
</project>


text:
<?php

// ATTENTION! DO NOT EDIT THIS FILE!
// This file is necessary to run the unit tests and profiling scripts.
// Please copy it to 'test-settings.php' and make the necessary edits.

// Note: The only external library you *need* is SimpleTest; everything else
//       is optional.

// We've got a lot of tests, so we recommend turning the limit off.
set_time_limit(0);

// Turning off output buffering will prevent mysterious errors from core dumps.
$data = @ob_get_clean();
if ($data !== false && $data !== '') {
    echo "Output buffer contains data [".urlencode($data)."]\n";
    exit;
}

// -----------------------------------------------------------------------------
// REQUIRED SETTINGS

// Note on running SimpleTest:
//      Because HTML Purifier is PHP5-only and E_STRICT compliant, SimpleTest
//      1.0.1 will not work; you need to run SimpleTest off its trunk using:
//
//        $ svn co https://simpletest.svn.sourceforge.net/svnroot/simpletest/simpletest/trunk simpletest
//
//      If SimpleTest is borked with HTML Purifier, please contact me or
//      the SimpleTest devs; I am a developer for SimpleTest so I should be
//      able to quickly assess a fix. SimpleTest's problem is my problem!

// Where is SimpleTest located? Remember to include a trailing slash!
$simpletest_location = '/path/to/simpletest/';

// -----------------------------------------------------------------------------
// OPTIONAL SETTINGS

// Note on running PHPT:
//      Vanilla PHPT from https://github.com/tswicegood/PHPT_Core should
//      work fine on Linux w/o multitest.
//
//      To do multitest or Windows testing, you'll need some more
//      patches at https://github.com/ezyang/PHPT_Core
//
//      I haven't tested the Windows setup in a while so I don't know if
//      it still works.

// Should PHPT tests be enabled?
$GLOBALS['HTMLPurifierTest']['PHPT'] = false;

// If PHPT isn't in your Path via PEAR, set that here:
// set_include_path('/path/to/phpt/Core/src' . PATH_SEPARATOR . get_include_path());

// Where is CSSTidy located? (Include trailing slash. Leave false to disable.)
$csstidy_location    = false;

// For tests/multitest.php, which versions to test?
$versions_to_test    = array();

// Stable PHP binary to use when invoking maintenance scripts.
$php = 'php';

// For tests/multitest.php, what is the multi-version executable? It must
// accept an extra parameter (version number) before all other arguments
$phpv = false;

// Should PEAR tests be run? If you've got a valid PEAR installation, set this
// to true (or, if it's not in the include path, to its install directory).
$GLOBALS['HTMLPurifierTest']['PEAR'] = false;

// If PEAR is enabled, what PEAR tests should be run? (Note: you will
// need to ensure these libraries are installed)
$GLOBALS['HTMLPurifierTest']['Net_IDNA2'] = true;

// vim: et sw=4 sts=4


text:
"""
Copyright (c) 2017 Red Hat, Inc
All rights reserved.

This software may be modified and distributed under the terms
of the BSD license. See the LICENSE file for details.

These tests are moved to a separate file due to https://github.com/bkabrda/flexmock/issues/13
"""
import logging
import sys

from flexmock import flexmock
import pytest

import requests
import six
from requests.packages.urllib3.util import Retry
from osbs.http import HttpSession, HttpStream
from osbs.exceptions import OsbsNetworkException, OsbsResponseException
from osbs.constants import HTTP_RETRIES_STATUS_FORCELIST, HTTP_RETRIES_METHODS_WHITELIST
from osbs.core import Openshift
from osbs.http import http_client
logger = logging.getLogger(__file__)

@pytest.fixture
def s():
    return HttpSession(verbose=True)

def has_connection():
    # In case we run tests in an environment without internet connection.

    if sys.version_info < (2, 7):
        # py 2.6 doesn't have SNI support, required for httpbin, as it has SSLv3 certificates
        return False

    try:
        HttpStream("https://httpbin.org/get", "get")
        return True
    except OsbsNetworkException:
        return False

# Replace real retry with fake version to speed up testing
fake_retry = Retry(total=1,
                   backoff_factor=1,
                   status_forcelist=HTTP_RETRIES_STATUS_FORCELIST)

@pytest.mark.skipif(not has_connection(),
                    reason="requires internet connection")
class TestHttpRetries(object):
    @pytest.mark.parametrize('status_code', HTTP_RETRIES_STATUS_FORCELIST)
    @pytest.mark.parametrize('method', HTTP_RETRIES_METHODS_WHITELIST)
    def test_fail_after_retries(self, s, status_code, method):
        flexmock(Retry).new_instances(fake_retry)
        # latest python-requests throws OsbsResponseException, 2.6.x - OsbsNetworkException
        with pytest.raises((OsbsNetworkException, OsbsResponseException)) as exc_info:
            s.request(method=method, url='http://httpbin.org/status/%s' % status_code).json()
        if isinstance(exc_info, OsbsResponseException):
            assert exc_info.value.status_code == status_code

    def test_stream_logs_not_decoded(self, caplog):
        flexmock(Retry).new_instances(fake_retry)
        server = Openshift('http://oapi/v1/', 'v1', 'http://oauth/authorize',
                           k8s_api_url='http://api/v1/')

        logs = (
            u'Lógs'.encode('utf-8'),
            u'Lðgs'.encode('utf-8'),
        )

        fake_response = flexmock(status_code=http_client.OK, headers={})

        (fake_response
            .should_receive('iter_lines')
            .and_yield(*logs)
            .with_args(decode_unicode=False))

        (flexmock(requests)
            .should_receive('request')
            .and_return(fake_response))

        with caplog.atLevel(logging.ERROR):
            for result in server.stream_logs('anything'):
                assert isinstance(result, six.binary_type)


text:
{{user.name}}

Subscriptions

			{{subscription.name}}
			<button type="button" ng-click="unsubscribe(subscription)" class="btn btn-xs btn-warning pull-right">Unubscribe</button>

		<form name="postForm" ng-class="form-horizontal" novalidate rc-submit="post()" >

				<input type="text" name="postText" placeholder="What's going on?" ng-model="postText" required class="form-control" tabindex="1"></input>

					Tell us how you feel
					{{postForm.postText.$error.$serverError}}

				<button type="submit" class="btn btn-primary" spinner="postForm.$submitting" tabindex="2">Post</button>

		</form>

{{post.postedDate | amCalendar}}

{{post.text}}

					{{post.author.name}}

		<button type="button" class="btn btn-lg btn-block btn-link" ng-click="loadNextPage()">Load more</button>

Suggested users

			{{suggestedUser.name}}
			<button type="button" ng-click="subscribe(suggestedUser)" class="btn btn-xs btn-info pull-right">Subscribe</button>


text:
(function(){
	var ns = dragonBones.use("objects");
    var utils = dragonBones.use("utils");
    var geom = dragonBones.use("geom");

    var SkeletonData = ns.SkeletonData;
    var ArmatureData = ns.ArmatureData;
    var BoneData = ns.BoneData;
    var SkinData = ns.SkinData;
    var SlotData = ns.SlotData;
    var DisplayData = ns.DisplayData;
    var AnimationData = ns.AnimationData;
    var TransformTimeline = ns.TransformTimeline;
    var TransformFrame = ns.TransformFrame;
    var Frame = ns.Frame;

	function DataParser() {
    }
    DataParser.parseTextureAtlasData = function (rawData, scale) {
        if (typeof scale === "undefined") { scale = 1; }
        if (!rawData) {
            throw new Error();
        }

        var textureAtlasData = {};
        textureAtlasData.__name = rawData[utils.ConstValues.A_NAME];
        var subTextureList = rawData[utils.ConstValues.SUB_TEXTURE];
        for(var index = 0, l = subTextureList.length;index < l;index ++){
            var subTextureObject = subTextureList[index];
            var subTextureName = subTextureObject[utils.ConstValues.A_NAME];
            var subTextureData = new geom.Rectangle(Number(subTextureObject[utils.ConstValues.A_X]) / scale, Number(subTextureObject[utils.ConstValues.A_Y]) / scale, Number(subTextureObject[utils.ConstValues.A_WIDTH]) / scale, Number(subTextureObject[utils.ConstValues.A_HEIGHT]) / scale);
            textureAtlasData[subTextureName] = subTextureData;
        }

        return textureAtlasData;
    };

    DataParser.parseSkeletonData = function (rawData) {
        if (!rawData) {
            throw new Error();
        }

        var frameRate = Number(rawData[utils.ConstValues.A_FRAME_RATE]);
        var data = new SkeletonData();
        data.name = rawData[utils.ConstValues.A_NAME];

        var armatureObjectList = rawData[utils.ConstValues.ARMATURE];
        for(var index = 0, l = armatureObjectList.length;index < l;index ++){
            var armatureObject = armatureObjectList[index];
            data.addArmatureData(DataParser.parseArmatureData(armatureObject, data, frameRate));
        }

        return data;
    };

    DataParser.parseArmatureData = function (armatureObject, data, frameRate) {
        var armatureData = new ArmatureData();
        armatureData.name = armatureObject[utils.ConstValues.A_NAME];

        var boneObjectList = armatureObject[utils.ConstValues.BONE];
        for(var index = 0, l = boneObjectList.length;index < l;index ++){
            var boneObject = boneObjectList[index];
            armatureData.addBoneData(DataParser.parseBoneData(boneObject));
        }

        var skinObjectList = armatureObject[utils.ConstValues.SKIN];
        for(var index = 0, l = skinObjectList.length;index < l;index ++){
            var skinObject = skinObjectList[index];
            armatureData.addSkinData(DataParser.parseSkinData(skinObject, data));
        }

        utils.DBDataUtil.transformArmatureData(armatureData);
        armatureData.sortBoneDataList();

        var animationObjectList = armatureObject[utils.ConstValues.ANIMATION];
        for(var index = 0, l = animationObjectList.length;index < l;index ++){
            var animationObject = animationObjectList[index];
            armatureData.addAnimationData(DataParser.parseAnimationData(animationObject, armatureData, frameRate));
        }

        return armatureData;
    };

    DataParser.parseBoneData = function (boneObject) {
        var boneData = new BoneData();
        boneData.name = boneObject[utils.ConstValues.A_NAME];
        boneData.parent = boneObject[utils.ConstValues.A_PARENT];
        boneData.length = Number(boneObject[utils.ConstValues.A_LENGTH]) || 0;

        DataParser.parseTransform(boneObject[utils.ConstValues.TRANSFORM], boneData.global);
        boneData.transform.copy(boneData.global);

        return boneData;
    };

    DataParser.parseSkinData = function (skinObject, data) {
        var skinData = new SkinData();
        skinData.name = skinObject[utils.ConstValues.A_NAME];
        var slotObjectList = skinObject[utils.ConstValues.SLOT];
        for(var index = 0, l = slotObjectList.length;index < l;index ++){
            var slotObject = slotObjectList[index];
            skinData.addSlotData(DataParser.parseSlotData(slotObject, data));
        }

        return skinData;
    };

    DataParser.parseSlotData = function (slotObject, data) {
        var slotData = new SlotData();
        slotData.name = slotObject[utils.ConstValues.A_NAME];
        slotData.parent = slotObject[utils.ConstValues.A_PARENT];
        slotData.zOrder = Number(slotObject[utils.ConstValues.A_Z_ORDER]);

        var displayObjectList = slotObject[utils.ConstValues.DISPLAY];
        for(var index = 0, l = displayObjectList.length;index < l;index ++){
            var displayObject = displayObjectList[index];
            slotData.addDisplayData(DataParser.parseDisplayData(displayObject, data));
        }

        return slotData;
    };

    DataParser.parseDisplayData = function (displayObject, data) {
        var displayData = new DisplayData();
        displayData.name = displayObject[utils.ConstValues.A_NAME];
        displayData.type = displayObject[utils.ConstValues.A_TYPE];

        displayData.pivot = data.addSubTexturePivot(0, 0, displayData.name);

        DataParser.parseTransform(displayObject[utils.ConstValues.TRANSFORM], displayData.transform, displayData.pivot);

        return displayData;
    };

    DataParser.parseAnimationData = function (animationObject, armatureData, frameRate) {
        var animationData = new AnimationData();
        animationData.name = animationObject[utils.ConstValues.A_NAME];
        animationData.frameRate = frameRate;
        animationData.loop = Number(animationObject[utils.ConstValues.A_LOOP]) || 0;
        animationData.fadeInTime = Number(animationObject[utils.ConstValues.A_FADE_IN_TIME]);
        animationData.duration = Number(animationObject[utils.ConstValues.A_DURATION]) / frameRate;
        animationData.scale = Number(animationObject[utils.ConstValues.A_SCALE]);

        if (animationObject.hasOwnProperty(utils.ConstValues.A_TWEEN_EASING)) {
            var tweenEase = animationObject[utils.ConstValues.A_TWEEN_EASING];
            if (tweenEase == undefined || tweenEase == null) {
                animationData.tweenEasing = NaN;
            } else {
                animationData.tweenEasing = Number(tweenEase);
            }
        } else {
            animationData.tweenEasing = NaN;
        }

        DataParser.parseTimeline(animationObject, animationData, DataParser.parseMainFrame, frameRate);

        var timeline;
        var timelineName;
        var timelineObjectList = animationObject[utils.ConstValues.TIMELINE];
        for(var index = 0, l = timelineObjectList.length;index < l;index ++){
            var timelineObject = timelineObjectList[index];
            timeline = DataParser.parseTransformTimeline(timelineObject, animationData.duration, frameRate);
            timelineName = timelineObject[utils.ConstValues.A_NAME];
            animationData.addTimeline(timeline, timelineName);
        }

        utils.DBDataUtil.addHideTimeline(animationData, armatureData);
        utils.DBDataUtil.transformAnimationData(animationData, armatureData);

        return animationData;
    };

    DataParser.parseTimeline = function (timelineObject, timeline, frameParser, frameRate) {
        var position = 0;
        var frame;
        var frameObjectList = timelineObject[utils.ConstValues.FRAME]||[];

        for(var index = 0, l = frameObjectList.length;index < l;index ++){
            var frameObject = frameObjectList[index];
            frame = frameParser(frameObject, frameRate);
            frame.position = position;
            timeline.addFrame(frame);
            position += frame.duration;
        }
        if (frame) {
            frame.duration = timeline.duration - frame.position;
        }
    };

    DataParser.parseTransformTimeline = function (timelineObject, duration, frameRate) {
        var timeline = new TransformTimeline();
        timeline.duration = duration;

        DataParser.parseTimeline(timelineObject, timeline, DataParser.parseTransformFrame, frameRate);

        timeline.scale = Number(timelineObject[utils.ConstValues.A_SCALE]);
        timeline.offset = Number(timelineObject[utils.ConstValues.A_OFFSET]);

        return timeline;
    };

    DataParser.parseFrame = function (frameObject, frame, frameRate) {
        frame.duration = Number(frameObject[utils.ConstValues.A_DURATION]) / frameRate;
        frame.action = frameObject[utils.ConstValues.A_ACTION];
        frame.event = frameObject[utils.ConstValues.A_EVENT];
        frame.sound = frameObject[utils.ConstValues.A_SOUND];
    };

    DataParser.parseMainFrame = function (frameObject, frameRate) {
        var frame = new Frame();
        DataParser.parseFrame(frameObject, frame, frameRate);
        return frame;
    };

    DataParser.parseTransformFrame = function (frameObject, frameRate) {
        var frame = new TransformFrame();
        DataParser.parseFrame(frameObject, frame, frameRate);

        frame.visible = Number(frameObject[utils.ConstValues.A_HIDE]) != 1;

        if (frameObject.hasOwnProperty(utils.ConstValues.A_TWEEN_EASING)) {
            var tweenEase = frameObject[utils.ConstValues.A_TWEEN_EASING];
            if (tweenEase == undefined || tweenEase == null) {
                frame.tweenEasing = NaN;
            } else {
                frame.tweenEasing = Number(tweenEase);
            }
        } else {
            frame.tweenEasing = 0;
        }

        frame.tweenRotate = Number(frameObject[utils.ConstValues.A_TWEEN_ROTATE]) || 0;
        frame.displayIndex = Number(frameObject[utils.ConstValues.A_DISPLAY_INDEX]) || 0;

        frame.zOrder = Number(frameObject[utils.ConstValues.A_Z_ORDER]) || 0;

        DataParser.parseTransform(frameObject[utils.ConstValues.TRANSFORM], frame.global, frame.pivot);
        frame.transform.copy(frame.global);

        var colorTransformObject = frameObject[utils.ConstValues.COLOR_TRANSFORM];
        if (colorTransformObject) {
            frame.color = new geom.ColorTransform();
            frame.color.alphaOffset = Number(colorTransformObject[utils.ConstValues.A_ALPHA_OFFSET]);
            frame.color.redOffset = Number(colorTransformObject[utils.ConstValues.A_RED_OFFSET]);
            frame.color.greenOffset = Number(colorTransformObject[utils.ConstValues.A_GREEN_OFFSET]);
            frame.color.blueOffset = Number(colorTransformObject[utils.ConstValues.A_BLUE_OFFSET]);

            frame.color.alphaMultiplier = Number(colorTransformObject[utils.ConstValues.A_ALPHA_MULTIPLIER]) * 0.01;
            frame.color.redMultiplier = Number(colorTransformObject[utils.ConstValues.A_RED_MULTIPLIER]) * 0.01;
            frame.color.greenMultiplier = Number(colorTransformObject[utils.ConstValues.A_GREEN_MULTIPLIER]) * 0.01;
            frame.color.blueMultiplier = Number(colorTransformObject[utils.ConstValues.A_BLUE_MULTIPLIER]) * 0.01;
        }

        return frame;
    };

    DataParser.parseTransform = function (transformObject, transform, pivot) {
        if (typeof pivot === "undefined") { pivot = null; }
        if (transformObject) {
            if (transform) {
                transform.x = Number(transformObject[utils.ConstValues.A_X]);
                transform.y = Number(transformObject[utils.ConstValues.A_Y]);
                transform.skewX = Number(transformObject[utils.ConstValues.A_SKEW_X]) * utils.ConstValues.ANGLE_TO_RADIAN;
                transform.skewY = Number(transformObject[utils.ConstValues.A_SKEW_Y]) * utils.ConstValues.ANGLE_TO_RADIAN;
                transform.scaleX = Number(transformObject[utils.ConstValues.A_SCALE_X]);
                transform.scaleY = Number(transformObject[utils.ConstValues.A_SCALE_Y]);
            }
            if (pivot) {
                pivot.x = Number(transformObject[utils.ConstValues.A_PIVOT_X]);
                pivot.y = Number(transformObject[utils.ConstValues.A_PIVOT_Y]);
            }
        }
    };
	ns.DataParser = DataParser;
})();


text:
package com.example.ftoustau.startmeapp.Controller;

import android.content.Context;
import android.widget.Toast;

import com.example.ftoustau.startmeapp.Model.DAO.DAOChartContainer.DAOInternetChartXGenre;
import com.example.ftoustau.startmeapp.Model.DAO.DAOChartContainer.DaoChartXGenreDatabase;
import com.example.ftoustau.startmeapp.Model.DAO.DAOGenre.DAOGenreDatabase;
import com.example.ftoustau.startmeapp.Model.DAO.DAOGenre.DAOGenreInternet;
import com.example.ftoustau.startmeapp.Model.POJO.AlbumPackage.Album;
import com.example.ftoustau.startmeapp.Model.POJO.GenrePackage.Genre;
import com.example.ftoustau.startmeapp.Util.HTTPConnectionManager;
import com.example.ftoustau.startmeapp.Util.ResultListener;

import java.util.ArrayList;

/**
 * Created by ftoustau on 26/06/17.
 */

public class ControllerAlbumXGenre {
    public void getAlbums (final Context context, final ResultListener<ArrayList<Album>> viewLsitener, Integer id){
        if(HTTPConnectionManager.isNetworkinOnline(context)){
            //pedir a internet
            DAOInternetChartXGenre daoInternetChartXGenre = new DAOInternetChartXGenre();
            daoInternetChartXGenre.getAlbumByGenre(new ResultListener<ArrayList<Album>>() {
                @Override
                public void finish(ArrayList<Album> resultado) {
                    DaoChartXGenreDatabase daoChartXGenreDatabase =new DaoChartXGenreDatabase(context);
                    daoChartXGenreDatabase.addListAlbum(resultado);
                    viewLsitener.finish(resultado);

                }
            },id);

        }else {
            //Pedir a base de datos
            DaoChartXGenreDatabase daoChartXGenreDatabase = new DaoChartXGenreDatabase(context);
            ArrayList<Album> albums = daoChartXGenreDatabase.getListAlbumInDataBase();
            Toast.makeText(context, albums.toString(), Toast.LENGTH_SHORT);
            viewLsitener.finish(albums);
        }
    }

}


text:
.class public Lcom/htc/wrap/android/webkit/HtcWrapCacheManager;
.super Ljava/lang/Object;
.source "HtcWrapCacheManager.java"

# direct methods
.method public constructor <init>()V
    .locals 0

    .prologue
    .line 5
    invoke-direct/range {p0 .. p0}, Ljava/lang/Object;-><init>()V

    return-void
.end method

.method public static getCacheSize()J
    .locals 2

    .prologue
    .line 19
    invoke-static {}, Landroid/webkit/CacheManager;->getCacheSize()J

    move-result-wide v0

    return-wide v0
.end method

.method public static setCacheSize(J)V
    .locals 0
    .parameter "lCacheSize_Byte"

    .prologue
    .line 11
    invoke-static {p0, p1}, Landroid/webkit/CacheManager;->setCacheSize(J)V

    .line 12
    return-void
.end method


text:
namespace tui {

  CheckBox::CheckBox(Application *app, std::string text, bool checked)
      : Widget(app), text(text), checked(checked) {
        locator = [this] (Rectangle parent) -> Rectangle {
        return {this->position, this->size};
      };
    }
  void CheckBox::draw() {
    Window *wnd = this->get_window();
    WINDOW *cwin = wnd->get_curses_window();
    std::string str = fit_string_in_gap(std::string() + (this->focused?"<":"[")+(this->checked?"X":" ")+(this->focused?">":"]")+" "+text, size.w, TextAlign::left);
    ::wmove(cwin, position.y, position.x);
    ::wprintw(cwin, "%s", str.c_str());
  }

    void CheckBox::parent_resize(Rectangle parent) {
      std::tie(position, size) = locator(parent);
    }
}


text:
class CreateMines < ActiveRecord::Migration
  def change
    create_table :mines do |t|
      t.string :name
      t.text :description
      t.float :latitude
      t.float :longitude
      t.decimal :expected_capacity
      t.decimal :real_capacity

      t.timestamps
    end
    add_index :mines, :name, unique: true
  end
end


text:
package com.google.gson.stream;

import java.io.IOException;
import java.io.StringReader;
import junit.framework.TestCase;

public class JsonReaderPathTest extends TestCase {
  public void testPath() throws IOException {
    JsonReader reader = new JsonReader(
        new StringReader("{\"a\":[2,true,false,null,\"b\",{\"c\":\"d\"},[3]]}"));
    assertEquals("$", reader.getPath());
    reader.beginObject();
    assertEquals("$.", reader.getPath());
    reader.nextName();
    assertEquals("$.a", reader.getPath());
    reader.beginArray();
    assertEquals("$.a[0]", reader.getPath());
    reader.nextInt();
    assertEquals("$.a[1]", reader.getPath());
    reader.nextBoolean();
    assertEquals("$.a[2]", reader.getPath());
    reader.nextBoolean();
    assertEquals("$.a[3]", reader.getPath());
    reader.nextNull();
    assertEquals("$.a[4]", reader.getPath());
    reader.nextString();
    assertEquals("$.a[5]", reader.getPath());
    reader.beginObject();
    assertEquals("$.a[5].", reader.getPath());
    reader.nextName();
    assertEquals("$.a[5].c", reader.getPath());
    reader.nextString();
    assertEquals("$.a[5].c", reader.getPath());
    reader.endObject();
    assertEquals("$.a[5]", reader.getPath());
    reader.beginArray();
    assertEquals("$.a[5][0]", reader.getPath());
    reader.nextInt();
    assertEquals("$.a[5][1]", reader.getPath());
    reader.endArray();
    assertEquals("$.a[5]", reader.getPath());
    reader.endArray();
    assertEquals("$.a", reader.getPath());
    reader.endObject();
    assertEquals("$", reader.getPath());
  }

  public void testObjectPath() throws IOException {
    JsonReader reader = new JsonReader(new StringReader("{\"a\":1,\"b\":2}"));
    assertEquals("$", reader.getPath());

    reader.peek();
    assertEquals("$", reader.getPath());
    reader.beginObject();
    assertEquals("$.", reader.getPath());

    reader.peek();
    assertEquals("$.", reader.getPath());
    reader.nextName();
    assertEquals("$.a", reader.getPath());

    reader.peek();
    assertEquals("$.a", reader.getPath());
    reader.nextInt();
    assertEquals("$.a", reader.getPath());

    reader.peek();
    assertEquals("$.a", reader.getPath());
    reader.nextName();
    assertEquals("$.b", reader.getPath());

    reader.peek();
    assertEquals("$.b", reader.getPath());
    reader.nextInt();
    assertEquals("$.b", reader.getPath());

    reader.peek();
    assertEquals("$.b", reader.getPath());
    reader.endObject();
    assertEquals("$", reader.getPath());

    reader.peek();
    assertEquals("$", reader.getPath());
    reader.close();
    assertEquals("$", reader.getPath());
  }

  public void testArrayPath() throws IOException {
    JsonReader reader = new JsonReader(new StringReader("[1,2]"));
    assertEquals("$", reader.getPath());

    reader.peek();
    assertEquals("$", reader.getPath());
    reader.beginArray();
    assertEquals("$[0]", reader.getPath());

    reader.peek();
    assertEquals("$[0]", reader.getPath());
    reader.nextInt();
    assertEquals("$[1]", reader.getPath());

    reader.peek();
    assertEquals("$[1]", reader.getPath());
    reader.nextInt();
    assertEquals("$[2]", reader.getPath());

    reader.peek();
    assertEquals("$[2]", reader.getPath());
    reader.endArray();
    assertEquals("$", reader.getPath());

    reader.peek();
    assertEquals("$", reader.getPath());
    reader.close();
    assertEquals("$", reader.getPath());
  }

  public void testMultipleTopLevelValuesInOneDocument() throws IOException {
    JsonReader reader = new JsonReader(new StringReader("[][]"));
    reader.setLenient(true);
    reader.beginArray();
    reader.endArray();
    assertEquals("$", reader.getPath());
    reader.beginArray();
    reader.endArray();
    assertEquals("$", reader.getPath());
  }

  public void testSkipArrayElements() throws IOException {
    JsonReader reader = new JsonReader(new StringReader("[1,2,3]"));
    reader.beginArray();
    reader.skipValue();
    reader.skipValue();
    assertEquals("$[2]", reader.getPath());
  }

  public void testSkipObjectNames() throws IOException {
    JsonReader reader = new JsonReader(new StringReader("{\"a\":1}"));
    reader.beginObject();
    reader.skipValue();
    assertEquals("$.null", reader.getPath());
  }

  public void testSkipObjectValues() throws IOException {
    JsonReader reader = new JsonReader(new StringReader("{\"a\":1,\"b\":2}"));
    reader.beginObject();
    reader.nextName();
    reader.skipValue();
    assertEquals("$.null", reader.getPath());
    reader.nextName();
    assertEquals("$.b", reader.getPath());
  }

  public void testSkipNestedStructures() throws IOException {
    JsonReader reader = new JsonReader(new StringReader("[[1,2,3],4]"));
    reader.beginArray();
    reader.skipValue();
    assertEquals("$[1]", reader.getPath());
  }
}


text:
'use strict'

const hashPassword = require('../hashPassword')

/**
 * @module Passport for waterline ORM
 * @description Passport model for waterline ORM
 */
module.exports = {
  config: app => {
    return {
      /**
       * Callback to be run before creating a Passport.
       *
       * @param {Object}   passport The soon-to-be-created Passport
       * @param {Function} next
       */
      beforeCreate: (passport, next) => {
        hashPassword(app.config.passport.bcrypt, passport, next)
      },

      /**
       * Callback to be run before updating a Passport.
       *
       * @param {Object}   passport Values to be updated
       * @param {Function} next
       */
      beforeUpdate: (passport, next) => {
        hashPassword(app.config.passport.bcrypt, passport, next)
      }
    }
  },
  schema: app => {
    return {
      // Required field: Protocol
      //
      // Defines the protocol to use for the passport. When employing the local
      // strategy, the protocol will be set to 'local'. When using a third-party
      // strategy, the protocol will be set to the standard used by the third-
      // party service (e.g. 'oauth', 'oauth2', 'openid').
      protocol: {
        type: 'alphanumeric',
        required: true
      },

      // Local fields: Password, Access Token
      //
      // When the local strategy is employed, a password will be used as the
      // means of authentication along with either a username or an email.
      //
      password: {
        type: 'string',
        minLength: 8
      },

      // Provider fields: Provider, identifer and tokens
      //
      // "provider" is the name of the third-party auth service in all lowercase
      // (e.g. 'github', 'facebook') whereas "identifier" is a provider-specific
      // key, typically an ID. These two fields are used as the main means of
      // identifying a passport and tying it to a local user.
      //
      // The "tokens" field is a JSON object used in the case of the OAuth stan-
      // dards. When using OAuth 1.0, a `token` as well as a `tokenSecret` will
      // be issued by the provider. In the case of OAuth 2.0, an `accessToken`
      // and a `refreshToken` will be issued.
      provider: {type: 'alphanumericdashed'},
      identifier: {type: 'string'},
      tokens: {type: 'string'},

      // Associations
      //
      // Associate every passport with one, and only one, user. This requires an
      // adapter compatible with associations.
      //
      // For more information on associations in Waterline, check out:
      // https://github.com/balderdashy/waterline
      user: {
        model: 'User',
        required: true
      }
    }
  }
}


text:
/**
 * @file
 * @brief
 *  This file defines the OpenThread Instance API.
 */

#ifndef OPENTHREAD_INSTANCE_H_
#define OPENTHREAD_INSTANCE_H_

#include <stdlib.h>

#include <openthread/error.h>
#include <openthread/platform/logging.h>
#include <openthread/platform/toolchain.h>

#ifdef __cplusplus
extern "C" {
#endif

/**
 * The OpenThread API monotonic version number.
 *
 * This number MUST increase by one each time the contents of public OpenThread API include headers change.
 *
 * @note This number versions both OpenThread platform and user APIs.
 *
 */
#define OPENTHREAD_API_VERSION (18)

/**
 * @addtogroup api-instance
 *
 * @brief
 *   This module includes functions that control the OpenThread Instance.
 *
 * @{
 *
 */

/**
 * This structure represents the OpenThread instance structure.
 */
typedef struct otInstance otInstance;

/**
 * This function initializes the OpenThread library.
 *
 * This function initializes OpenThread and prepares it for subsequent OpenThread API calls. This function must be
 * called before any other calls to OpenThread.
 *
 * This function is available and can only be used when support for multiple OpenThread instances is enabled.
 *
 * @param[in]    aInstanceBuffer      The buffer for OpenThread to use for allocating the otInstance structure.
 * @param[inout] aInstanceBufferSize  On input, the size of aInstanceBuffer. On output, if not enough space for
 *                                    otInstance, the number of bytes required for otInstance.
 *
 * @returns  A pointer to the new OpenThread instance.
 *
 * @sa otInstanceFinalize
 *
 */
otInstance *otInstanceInit(void *aInstanceBuffer, size_t *aInstanceBufferSize);

/**
 * This function initializes the static single instance of the OpenThread library.
 *
 * This function initializes OpenThread and prepares it for subsequent OpenThread API calls. This function must be
 * called before any other calls to OpenThread.
 *
 * This function is available and can only be used when support for multiple OpenThread instances is disabled.
 *
 * @returns A pointer to the single OpenThread instance.
 *
 */
otInstance *otInstanceInitSingle(void);

/**
 * This function indicates whether or not the instance is valid/initialized.
 *
 * The instance is considered valid if it is acquired and initialized using either `otInstanceInitSingle()` (in single
 * instance case) or `otInstanceInit()` (in multi instance case). A subsequent call to `otInstanceFinalize()` causes
 * the instance to be considered as uninitialized.
 *
 * @param[in] aInstance A pointer to an OpenThread instance.
 *
 * @returns TRUE if the given instance is valid/initialized, FALSE otherwise.
 *
 */
bool otInstanceIsInitialized(otInstance *aInstance);

/**
 * This function disables the OpenThread library.
 *
 * Call this function when OpenThread is no longer in use.
 *
 * @param[in] aInstance A pointer to an OpenThread instance.
 *
 */
void otInstanceFinalize(otInstance *aInstance);

/**
 * This enumeration defines flags that are passed as part of `otStateChangedCallback`.
 *
 */
enum
{
    OT_CHANGED_IP6_ADDRESS_ADDED            = 1 << 0,  ///< IPv6 address was added
    OT_CHANGED_IP6_ADDRESS_REMOVED          = 1 << 1,  ///< IPv6 address was removed
    OT_CHANGED_THREAD_ROLE                  = 1 << 2,  ///< Role (disabled, detached, child, router, leader) changed
    OT_CHANGED_THREAD_LL_ADDR               = 1 << 3,  ///< The link-local address changed
    OT_CHANGED_THREAD_ML_ADDR               = 1 << 4,  ///< The mesh-local address changed
    OT_CHANGED_THREAD_RLOC_ADDED            = 1 << 5,  ///< RLOC was added
    OT_CHANGED_THREAD_RLOC_REMOVED          = 1 << 6,  ///< RLOC was removed
    OT_CHANGED_THREAD_PARTITION_ID          = 1 << 7,  ///< Partition ID changed
    OT_CHANGED_THREAD_KEY_SEQUENCE_COUNTER  = 1 << 8,  ///< Thread Key Sequence changed
    OT_CHANGED_THREAD_NETDATA               = 1 << 9,  ///< Thread Network Data changed
    OT_CHANGED_THREAD_CHILD_ADDED           = 1 << 10, ///< Child was added
    OT_CHANGED_THREAD_CHILD_REMOVED         = 1 << 11, ///< Child was removed
    OT_CHANGED_IP6_MULTICAST_SUBSCRIBED     = 1 << 12, ///< Subscribed to a IPv6 multicast address
    OT_CHANGED_IP6_MULTICAST_UNSUBSCRIBED   = 1 << 13, ///< Unsubscribed from a IPv6 multicast address
    OT_CHANGED_THREAD_CHANNEL               = 1 << 14, ///< Thread network channel changed
    OT_CHANGED_THREAD_PANID                 = 1 << 15, ///< Thread network PAN Id changed
    OT_CHANGED_THREAD_NETWORK_NAME          = 1 << 16, ///< Thread network name changed
    OT_CHANGED_THREAD_EXT_PANID             = 1 << 17, ///< Thread network extended PAN ID changed
    OT_CHANGED_MASTER_KEY                   = 1 << 18, ///< Master key changed
    OT_CHANGED_PSKC                         = 1 << 19, ///< PSKc changed
    OT_CHANGED_SECURITY_POLICY              = 1 << 20, ///< Security Policy changed
    OT_CHANGED_CHANNEL_MANAGER_NEW_CHANNEL  = 1 << 21, ///< Channel Manager new pending Thread channel changed
    OT_CHANGED_SUPPORTED_CHANNEL_MASK       = 1 << 22, ///< Supported channel mask changed
    OT_CHANGED_COMMISSIONER_STATE           = 1 << 23, ///< Commissioner state changed
    OT_CHANGED_THREAD_NETIF_STATE           = 1 << 24, ///< Thread network interface state changed
    OT_CHANGED_THREAD_BACKBONE_ROUTER_STATE = 1 << 25, ///< Backbone Router state changed
    OT_CHANGED_THREAD_BACKBONE_ROUTER_LOCAL = 1 << 26, ///< Local Backbone Router configuration changed
    OT_CHANGED_JOINER_STATE                 = 1 << 27, ///< Joiner state changed
};

/**
 * This type represents a bit-field indicating specific state/configuration that has changed. See `OT_CHANGED_*`
 * definitions.
 *
 */
typedef uint32_t otChangedFlags;

/**
 * This function pointer is called to notify certain configuration or state changes within OpenThread.
 *
 * @param[in]  aFlags    A bit-field indicating specific state that has changed.  See `OT_CHANGED_*` definitions.
 * @param[in]  aContext  A pointer to application-specific context.
 *
 */
typedef void (*otStateChangedCallback)(otChangedFlags aFlags, void *aContext);

/**
 * This function registers a callback to indicate when certain configuration or state changes within OpenThread.
 *
 * @param[in]  aInstance  A pointer to an OpenThread instance.
 * @param[in]  aCallback  A pointer to a function that is called with certain configuration or state changes.
 * @param[in]  aContext   A pointer to application-specific context.
 *
 * @retval OT_ERROR_NONE     Added the callback to the list of callbacks.
 * @retval OT_ERROR_ALREADY  The callback was already registered.
 * @retval OT_ERROR_NO_BUFS  Could not add the callback due to resource constraints.
 *
 */
otError otSetStateChangedCallback(otInstance *aInstance, otStateChangedCallback aCallback, void *aContext);

/**
 * This function removes a callback to indicate when certain configuration or state changes within OpenThread.
 *
 * @param[in]  aInstance   A pointer to an OpenThread instance.
 * @param[in]  aCallback   A pointer to a function that is called with certain configuration or state changes.
 * @param[in]  aContext    A pointer to application-specific context.
 *
 */
void otRemoveStateChangeCallback(otInstance *aInstance, otStateChangedCallback aCallback, void *aContext);

/**
 * This method triggers a platform reset.
 *
 * The reset process ensures that all the OpenThread state/info (stored in volatile memory) is erased. Note that the
 * `otPlatformReset` does not erase any persistent state/info saved in non-volatile memory.
 *
 * @param[in]  aInstance A pointer to an OpenThread instance.
 */
void otInstanceReset(otInstance *aInstance);

/**
 * This method deletes all the settings stored on non-volatile memory, and then triggers platform reset.
 *
 * @param[in]  aInstance A pointer to an OpenThread instance.
 */
void otInstanceFactoryReset(otInstance *aInstance);

/**
 * This function erases all the OpenThread persistent info (network settings) stored on non-volatile memory.
 * Erase is successful only if the device is in `disabled` state/role.
 *
 * @param[in]  aInstance A pointer to an OpenThread instance.
 *
 * @retval OT_ERROR_NONE           All persistent info/state was erased successfully.
 * @retval OT_ERROR_INVALID_STATE  Device is not in `disabled` state/role.
 *
 */
otError otInstanceErasePersistentInfo(otInstance *aInstance);

/**
 * This function gets the OpenThread version string.
 *
 * @returns A pointer to the OpenThread version.
 *
 */
const char *otGetVersionString(void);

/**
 * This function gets the OpenThread radio version string.
 *
 * @param[in]  aInstance A pointer to an OpenThread instance.
 *
 * @returns A pointer to the OpenThread radio version.
 *
 */
const char *otGetRadioVersionString(otInstance *aInstance);

/**
 * @}
 *
 */

#ifdef __cplusplus
} // extern "C"
#endif

#endif // OPENTHREAD_INSTANCE_H_


text:
import dbus
import pprint
import os
import sys
from dbus.mainloop.glib import DBusGMainLoop

# our own packages
sys.path.insert(1, os.path.join(os.path.dirname(__file__), '../'))
from vedbus import VeDbusItemExport, VeDbusItemImport

DBusGMainLoop(set_as_default=True)

# Connect to the sessionbus. Note that on ccgx we use systembus instead.
dbusConn = dbus.SessionBus() if 'DBUS_SESSION_BUS_ADDRESS' in os.environ else dbus.SystemBus()

# dictionary containing the different items
dbusObjects = {}

# check if the vbus.ttyO1 exists (it normally does on a ccgx, and for linux a pc, there is
# some emulator.
hasVEBus = 'com.victronenergy.vebus.ttyO1' in dbusConn.list_names()

dbusObjects['PyString'] = VeDbusItemImport(dbusConn, 'com.victronenergy.example', '/String')
if hasVEBus: dbusObjects['C_string'] = VeDbusItemImport(dbusConn, 'com.victronenergy.vebus.ttyO1', '/Mgmt/ProcessName')

dbusObjects['PyFloat'] = VeDbusItemImport(dbusConn, 'com.victronenergy.example', '/Float')
if hasVEBus: dbusObjects['C_float'] = VeDbusItemImport(dbusConn, 'com.victronenergy.vebus.ttyO1', '/Dc/V')

dbusObjects['PyInt'] = VeDbusItemImport(dbusConn, 'com.victronenergy.example', '/Int')
if hasVEBus: dbusObjects['C_int'] = VeDbusItemImport(dbusConn, 'com.victronenergy.vebus.ttyO1', '/State')

dbusObjects['PyNegativeInt'] = VeDbusItemImport(dbusConn, 'com.victronenergy.example', '/NegativeInt')
if hasVEBus: dbusObjects['C_negativeInt'] = VeDbusItemImport(dbusConn, 'com.victronenergy.vebus.ttyO1', '/Dc/I')

# print the results
print('----')
for key, o in dbusObjects.items():
	print(key + ' at ' + o.serviceName + o.path)
	pprint.pprint(dbusObjects[key])
	print('pprint veBusItem.get_value(): ')
	pprint.pprint(dbusObjects[key].get_value())
	print('pprint veBusItem.get_text(): ')
	pprint.pprint(dbusObjects[key].get_text())
	print('----')


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
null

#### Original name
Cladonia uncialis var. pseudo-oxyceras Delise

### Remarks
null


text:
package org.pentaho.big.data.kettle.plugins.hdfs.trans;

import org.junit.Test;

import static org.junit.Assert.assertEquals;

/**
 * Created by bryan on 11/23/15.
 */
public class HadoopFileOutputDialogTest {
  @Test
  public void testGetUrlPathHdfsPrefix() {
    String prefixToBeRemoved = "hdfs://myhost:8020";
    String expected = "/path/to/file";
    assertEquals( expected, HadoopFileOutputDialog.getUrlPath( prefixToBeRemoved + expected ) );
  }

  @Test
  public void testGetUrlPathMapRPRefix() {
    String prefixToBeRemoved = "maprfs://";
    String expected = "/path/to/file";
    assertEquals( expected, HadoopFileOutputDialog.getUrlPath( prefixToBeRemoved + expected ) );
  }

  @Test
  public void testGetUrlPathSpecialPrefix() {
    String prefixToBeRemoved = "mySpecialPrefix://host";
    String expected = "/path/to/file";
    assertEquals( expected, HadoopFileOutputDialog.getUrlPath( prefixToBeRemoved + expected ) );
  }

  @Test
  public void testGetUrlPathNoPrefix() {
    String expected = "/path/to/file";
    assertEquals( expected, HadoopFileOutputDialog.getUrlPath( expected ) );
  }

  @Test
  public void testGetUrlPathVariablePrefix() {
    String expected = "${myTestVar}";
    assertEquals( expected, HadoopFileOutputDialog.getUrlPath( expected ) );
  }
}


text:
From column: _extractions / cve / result / value_
``` python
return "vulnerability/"+ getValue("value").upper()
```

#### _id_clean_
From column: _json_rep / id_
``` python
return getValue("id").upper()
```

#### _update_uri_
From column: _json_rep / id_clean_
``` python
x = getValue("id_clean")
if len(x) > 0:
   return "securityUpdate/" + x
```

#### _published_iso_
From column: _json_rep / published_
``` python
return DM.iso8601date(getValue("published"))
```

#### _timestamp_iso_
From column: _timestamp_
``` python
return DM.iso8601date(getValue("timestamp"))
```

## Selections

## Semantic Types
| Column | Property | Class |
|  ----- | -------- | ----- |
| __id_ | `schema:source`
 - _specified provenance_ | `memex:SecurityUpdate1`|
| _cve_uri_ | `uri` | `memex:Vulnerability1`|
| _id_clean_ | `schema:name` | `memex:SecurityUpdate1`|
| _published_iso_ | `schema:datePublished` | `memex:SecurityUpdate1`|
| _source_name_ | `schema:publisher`
 - _specified provenance_ | `memex:SecurityUpdate1`|
| _text_ | `schema:text` | `memex:SecurityUpdate1`|
| _timestamp_iso_ | `memex:dateRecorded`
 - _specified provenance_ | `memex:SecurityUpdate1`|
| _title_ | `schema:title` | `memex:SecurityUpdate1`|
| _update_uri_ | `uri` | `memex:SecurityUpdate1`|

## Links
| From | Property | To |
|  --- | -------- | ---|
| `memex:SecurityUpdate1` | `memex:fixesVulnerability` | `memex:Vulnerability1`|
| `memex:Vulnerability1` | `memex:isFixedBy` | `memex:SecurityUpdate1`|


text:
namespace weblayer {

FaviconFetcherImpl::FaviconFetcherImpl(content::WebContents* web_contents,
                                       FaviconFetcherDelegate* delegate)
    : web_contents_(web_contents),
      observer_subscription_(FaviconTabHelper::FromWebContents(web_contents)
                                 ->RegisterFaviconFetcherDelegate(delegate)) {}

FaviconFetcherImpl::~FaviconFetcherImpl() = default;

gfx::Image FaviconFetcherImpl::GetFavicon() {
  return FaviconTabHelper::FromWebContents(web_contents_)->favicon();
}

}  // namespace weblayer


text:
cask 'screenflick' do
  version :latest
  sha256 :no_check

  url 'http://www.araelium.com/screenflick/downloads/Screenflick.zip'
  appcast 'https://arweb-assets.s3.amazonaws.com/downloads/screenflick/screenflick2.xml',
          :sha256 => '2da4c7c5a2f954a6e205840f160e488729fe4a9f795c0b9543a2e92f17229a81'
  name 'Screenflick'
  homepage 'http://www.araelium.com/screenflick/'
  license :commercial

  app 'Screenflick.app'
end


text:
.class public interface abstract annotation Ljavax/annotation/RegEx;
.super Ljava/lang/Object;
.source "RegEx.java"

# interfaces
.implements Ljava/lang/annotation/Annotation;

# annotations
.annotation system Ldalvik/annotation/AnnotationDefault;
    value = .subannotation Ljavax/annotation/RegEx;
        when = .enum Ljavax/annotation/meta/When;->ALWAYS:Ljavax/annotation/meta/When;
    .end subannotation
.end annotation

.annotation system Ldalvik/annotation/MemberClasses;
    value = {
        Ljavax/annotation/RegEx$Checker;
    }
.end annotation

.annotation runtime Ljava/lang/annotation/Documented;
.end annotation

.annotation runtime Ljava/lang/annotation/Retention;
    value = .enum Ljava/lang/annotation/RetentionPolicy;->RUNTIME:Ljava/lang/annotation/RetentionPolicy;
.end annotation

.annotation runtime Ljavax/annotation/Syntax;
    value = "RegEx"
.end annotation

.annotation build Ljavax/annotation/meta/TypeQualifierNickname;
.end annotation

# virtual methods
.method public abstract when()Ljavax/annotation/meta/When;
.end method


text:
int main( int argc, char *argv[] )
 {
  std::cout << "Hello world" << std::endl;

  return EXIT_SUCCESS;
 }


text:
<!DOCTYPE HTML>
<html>
<head>
  <script src="/oasis.js"></script>
  <script src="/fixtures/rejected_request_from_environment.js"></script>
</head>
<body>
</body>
</html>


text:
class AddNoteToApplications < ActiveRecord::Migration
  def change
    add_column :applications, :note, :text
  end
end


text:
#region License

#endregion

using System;
using System.Linq;
using System.Abstract;
using System.Collections.ObjectModel;
using System.Collections.Generic;

namespace Contoso.Abstract
{
    ///
    /// Interface IAppServiceBus
    ///
    /// <seealso cref="System.Abstract.IServiceBus" />
    /// <remark>
    /// An application service bus specific service bus interface
    /// </remark>
    public interface IAppServiceBus : IServiceBus
    {
        ///
        /// Adds this instance.
        ///
        /// <typeparam name="TMessageHandler">The type of the message handler.</typeparam>
        /// <returns>IAppServiceBus.</returns>
        IAppServiceBus Add<TMessageHandler>()
            where TMessageHandler : class;
        ///
        /// Adds the specified message handler type.
        ///
        /// <param name="messageHandlerType">Type of the message handler.</param>
        /// <returns>IAppServiceBus.</returns>
        IAppServiceBus Add(Type messageHandlerType);
    }

    ///
    /// Class AppServiceBus.
    ///
    /// <seealso cref="Contoso.Abstract.IAppServiceBus" />
    /// <remark>
    /// An application service bus implementation
    /// </remark>
    /// <example>
    ///
    ///ServiceBusManager.SetProvider(() => new AppServiceBus()
    ///.Add(Handler1)
    ///.Add(Handler2))
    ///.RegisterWithServiceLocator();
    ///ServiceBusManager.Send<Message1>(x => x.Body = "Message");
    ///
    /// </example>
    public class AppServiceBus : Collection<AppServiceBusRegistration>, IAppServiceBus, ServiceBusManager.IRegisterWithLocator
    {
        readonly Func<Type, IServiceMessageHandler<object>> _messageHandlerFactory;
        readonly Func<IServiceLocator> _locator;

        ///
        /// Initializes a new instance of the <see cref="AppServiceBus" /> class.
        ///
        public AppServiceBus()
            : this(t => (IServiceMessageHandler<object>)Activator.CreateInstance(t), () => ServiceLocatorManager.Current) { }
        ///
        /// Initializes a new instance of the <see cref="AppServiceBus" /> class.
        ///
        /// <param name="messageHandlerFactory">The message handler factory.</param>
        public AppServiceBus(Func<Type, IServiceMessageHandler<object>> messageHandlerFactory)
            : this(messageHandlerFactory, () => ServiceLocatorManager.Current) { }
        ///
        /// Initializes a new instance of the <see cref="AppServiceBus" /> class.
        ///
        /// <param name="messageHandlerFactory">The message handler factory.</param>
        /// <param name="locator">The locator.</param>
        /// <exception cref="ArgumentNullException">messageHandlerFactory
        /// or
        /// locator</exception>
        public AppServiceBus(Func<Type, IServiceMessageHandler<object>> messageHandlerFactory, Func<IServiceLocator> locator)
        {
            _messageHandlerFactory = messageHandlerFactory ?? throw new ArgumentNullException(nameof(messageHandlerFactory));
            _locator = locator ?? throw new ArgumentNullException(nameof(locator));
        }

        Action<IServiceLocator, string> ServiceBusManager.IRegisterWithLocator.RegisterWithLocator =>
            (locator, name) => ServiceBusManager.RegisterInstance<IAppServiceBus>(this, name, locator);

        ///
        /// Gets the service object of the specified type.
        ///
        /// <param name="serviceType">An object that specifies the type of service object to get.</param>
        /// <returns>Throws NotImplementedException.</returns>
        /// <exception cref="NotImplementedException"></exception>
        public object GetService(Type serviceType) =>
            throw new NotImplementedException();

        ///
        /// Creates a new message.
        ///
        /// <typeparam name="TMessage">The type of the message.</typeparam>
        /// <param name="messageBuilder">The message builder.</param>
        /// <returns>The newly created message.</returns>
        public TMessage CreateMessage<TMessage>(Action<TMessage> messageBuilder)
            where TMessage : class
        {
            var message = _locator().Resolve<TMessage>();
            messageBuilder?.Invoke(message);
            return message;
        }

        ///
        /// Adds a message handler.
        ///
        /// <typeparam name="TMessageHandler">The type of the message handler.</typeparam>
        /// <returns>Fluent</returns>
        public IAppServiceBus Add<TMessageHandler>()
            where TMessageHandler : class =>
            Add(typeof(TMessageHandler));
        ///
        /// Adds a message handler
        ///
        /// <param name="messageHandlerType">Type of the message handler.</param>
        /// <returns>Fluent</returns>
        /// <exception cref="InvalidOperationException">Unable find a message handler</exception>
        public IAppServiceBus Add(Type messageHandlerType)
        {
            var messageType = GetMessageTypeFromHandler(messageHandlerType);
            if (messageType == null)
                throw new InvalidOperationException("Unable find a message handler");
            Add(new AppServiceBusRegistration
            {
                MessageHandlerType = messageHandlerType,
                MessageType = messageType,
            });
            return this;
        }

        ///
        /// Sends a message on the bus
        ///
        /// <param name="destination">The destination.</param>
        /// <param name="messages">The messages.</param>
        /// <returns>Null</returns>
        /// <exception cref="ArgumentNullException">messages</exception>
        public IServiceBusCallback Send(IServiceBusEndpoint destination, params object[] messages)
        {
            if (messages == null)
                throw new ArgumentNullException(nameof(messages));
            foreach (var message in messages)
                foreach (var type in GetTypesOfMessageHandlers(message.GetType()))
                    HandleTheMessage(type, message);
            return null;
        }

        void HandleTheMessage(Type type, object message) =>
            _messageHandlerFactory(type)
                .Handle(message);

        IEnumerable<Type> GetTypesOfMessageHandlers(Type messageType) =>
            Items.Where(x => x.MessageType == messageType)
                .Select(x => x.MessageHandlerType);

        ///
        /// Gets the message type from handler.
        ///
        /// <param name="messageHandlerType">Type of the message handler.</param>
        /// <returns>Type.</returns>
        static Type GetMessageTypeFromHandler(Type messageHandlerType) =>
            null;
        //var serviceMessageType = typeof(IServiceMessage);
        //var applicationServiceMessageType = typeof(IApplicationServiceMessage);
        //return messageHandlerType.GetInterfaces()
        //    .Where(h => h.IsGenericType && (h.FullName.StartsWith("System.Abstract.IServiceMessageHandler`1") || h.FullName.StartsWith("Contoso.Abstract.IApplicationServiceMessageHandler`1")))
        //    .Select(h => h.GetGenericArguments()[0])
        //    .Where(m => m.GetInterfaces().Any(x => x == serviceMessageType || x == applicationServiceMessageType))
        //    .SingleOrDefault();

        ///
        /// Replies messages back up the bus.
        ///
        /// <param name="messages">The messages.</param>
        /// <exception cref="NotImplementedException"></exception>
        public void Reply(params object[] messages) =>
            throw new NotImplementedException();

        ///
        /// Returns a value back up the bus.
        ///
        /// <typeparam name="T"></typeparam>
        /// <param name="value">The value.</param>
        /// <exception cref="NotImplementedException"></exception>
        public void Return<T>(T value) =>
            throw new NotImplementedException();
    }
}


text:
var S = require('sanctuary');

var R = require('..');
var eq = require('./shared/eq');

describe('either', function() {
  it('combines two boolean-returning functions into one', function() {
    var even = function(x) {return x % 2 === 0;};
    var gt10 = function(x) {return x > 10;};
    var f = R.either(even, gt10);
    eq(f(8), true);
    eq(f(13), true);
    eq(f(7), false);
  });

  it('accepts functions that take multiple parameters', function() {
    var between = function(a, b, c) {return a < b && b < c;};
    var total20 = function(a, b, c) {return a + b + c === 20;};
    var f = R.either(between, total20);
    eq(f(4, 5, 8), true);
    eq(f(12, 2, 6), true);
    eq(f(7, 5, 1), false);
  });

  it('does not evaluate the second expression if the first one is true', function() {
    var T = function() { return true; };
    var Z = function() { effect = 'Z got evaluated'; };
    var effect = 'not evaluated';
    R.either(T, Z)();
    eq(effect, 'not evaluated');
  });

  it('accepts fantasy-land applicative functors', function() {
    var Just = S.Just;
    var Nothing = S.Nothing;
    eq(R.either(Just(true), Just(true)), Just(true));
    eq(R.either(Just(true), Just(false)), Just(true));
    eq(R.either(Just(false), Just(false)), Just(false));
    eq(R.either(Just(true), Nothing()), Nothing());
    eq(R.either(Nothing(), Just(false)), Nothing());
    eq(R.either(Nothing(), Nothing()), Nothing());
  });

});


text:
ICE Lotto [![GPL-2.0 license](https://img.shields.io/badge/license-MIT-blue.svg)](https://opensource.org/licenses/MIT)
=========

This is a lotto web application for GuildWars 2
Built on the Meteor platform

Environment
------------
This project should work on Windows, OSX, and Linux

Dependencies
------------
* Meteor 1.3 or higher

Installation
------------
1. Clone the Repository
2. `meteor npm install --save`

Run
------------
1. `meteor run`
2. Visit [http://localhost:3000](http://localhost:3000)

**Notes**

You may need to run meteor with some additional parameters. Below are some commonly used examples. For a full listing, check Meteor's documentation [here](http://docs.meteor.com/commandline.html).

| Argument     | CMD Parameter              |
|--------------|----------------------------|
| API          | `--settings settings.json` |
| Port         | `--port 1234`              |

In order to use the GW2 API to auto-populate the Guild Bank contents as well as the user log entries, you will need a `settings.json` file passed into meteor.

Example `settings.json` file (replace the values with your own information):

```json
{
	"apiKey": "00000000-0000-0000-0000-00000000000000000000-0000-0000-0000-000000000000",
	"guildId": "00000000-0000-0000-0000-000000000000",
	"inventory": "Bank Section Name"
}
```


text:
package com.jy.repository.task.log;

import com.jy.entity.task.log.TaskLog;
import com.jy.repository.base.BaseDao;
import com.jy.repository.base.JYBatis;
/**
 * 动态任务数据层
 */
@JYBatis
public interface TaskLogDao extends BaseDao<TaskLog>{

}


text:
using System;

namespace SharpCompress.Common
{
    [Flags]
    public enum ExtractOptions
    {
        None = 0,

        /// <summary>
        /// overwrite target if it exists
        /// </summary>
        Overwrite = 1 << 0,

        /// <summary>
        /// extract with internal directory structure
        /// </summary>
        ExtractFullPath = 1 << 1,

        /// <summary>
        /// preserve file time
        /// </summary>
        PreserveFileTime = 1 << 2,

        /// <summary>
        /// preserve windows file attributes
        /// </summary>
        PreserveAttributes = 1 << 3,
    }
}


text:
var connect = require('connect');
var serveStatic = require('serve-static');

connect()
.use(serveStatic(__dirname))
.listen(8080, function(){
    console.log('Server running on 8080...');
});


text:
using namespace std;
using namespace seqan;

// Helper function that compares two amino acid matrices for equality.
// TODO(holtgrew): If used somewhere else, put into some place to share.
template <typename TScore1, typename TScore2>
void assertAminoAcidMatricesAreEqual(TScore1 const & mat1, TScore2 const & mat2) {
    for (AminoAcid a = 'A'; a <= '*'; ++a) {
        for (AminoAcid b = 'A'; b <= '*'; ++b) {
            SEQAN_ASSERT_EQ_MSG(
                    score(mat1, a, b), score(mat2, a, b),
                    "a = %c, b = %c", static_cast<char>(a),
                    static_cast<char>(b));
        }
    }
}

// Performs SEQAN_ASSERT_EQ(0, x) for all cells x in matrix.
template<typename TScore>
void assertAminoAcidMatrixIsDefaultInitialized(const TScore &matrix) {
    for (AminoAcid a = 'A'; a <= '*'; ++a) {
        for (AminoAcid b = 'A'; b <= '*'; ++b) {
            SEQAN_ASSERT_EQ(0, score(matrix, a, b));
        }
    }
}

// Test the default implementation for scoreGap* from score_base.h.
SEQAN_DEFINE_TEST(test_score_gap_open) {
    // TODO(holtgrew): The following *crashes* with edit distance score!  References to temporaries returned.
    // We simply test this with an simple score, test default implementation.
    SimpleScore simpleScore;
    const CharString kSeq1 = "A";
    const CharString kSeq2 = "A";
    typedef Position<CharString>::Type TPos;
    const TPos kPos1 = 0;
    const TPos kPos2 = 0;

    SEQAN_ASSERT_EQ(scoreGapOpen(simpleScore),
                    scoreGapOpenHorizontal(simpleScore, sequenceEntryForScore(simpleScore, kSeq1, kPos1),
                                           sequenceEntryForScore(simpleScore, kSeq2, kPos2)));
    SEQAN_ASSERT_EQ(scoreGapOpen(simpleScore),
                    scoreGapOpenVertical(simpleScore, sequenceEntryForScore(simpleScore, kSeq1, kPos1),
                                         sequenceEntryForScore(simpleScore, kSeq2, kPos2)));
    SEQAN_ASSERT_EQ(scoreGapExtend(simpleScore),
                    scoreGapExtendHorizontal(simpleScore, sequenceEntryForScore(simpleScore, kSeq1, kPos1),
                                             sequenceEntryForScore(simpleScore, kSeq2, kPos2)));
    SEQAN_ASSERT_EQ(scoreGapExtend(simpleScore),
                    scoreGapExtendVertical(simpleScore, sequenceEntryForScore(simpleScore, kSeq1, kPos1),
                                           sequenceEntryForScore(simpleScore, kSeq2, kPos2)));
    SEQAN_ASSERT_EQ(scoreGap(simpleScore),
                    scoreGapHorizontal(simpleScore, sequenceEntryForScore(simpleScore, kSeq1, kPos1),
                                       sequenceEntryForScore(simpleScore, kSeq2, kPos2)));
    SEQAN_ASSERT_EQ(scoreGap(simpleScore),
                    scoreGapVertical(simpleScore, sequenceEntryForScore(simpleScore, kSeq1, kPos1),
                                     sequenceEntryForScore(simpleScore, kSeq2, kPos2)));
    SEQAN_ASSERT_EQ(score(simpleScore, kSeq1[kPos1], kSeq2[kPos2]),
                    score(simpleScore, sequenceEntryForScore(simpleScore, kSeq1, kPos1),
                          sequenceEntryForScore(simpleScore, kSeq2, kPos2)));
}

// Compare the built-in Blosum matrices against matrices from
// reference files.
SEQAN_DEFINE_TEST(test_score_matrix) {
    // We test the scoring matrix with amino acids as the underlying
    // sequence.  This should be the most common case.
    typedef int TValue;
    typedef Score<TValue, ScoreMatrix<AminoAcid, Default> > TScore;

    // Define path to BLOSUM62 matrix that we want to load.
    // TODO(holtgrew): It should be easier to construct these paths.
    String<char> pathToTestSrc = SEQAN_PATH_TO_ROOT();
    append(pathToTestSrc, "/core/tests/score/");
    String<char> pathToBlosum62(pathToTestSrc);
    append(pathToBlosum62, "BLOSUM62");

    // Test with default constructor.
    {
        // Call appropriate constructor.
        TScore matrixScore;
        // Assert score state.
        SEQAN_ASSERT_EQ(-1, scoreGap(matrixScore));
        SEQAN_ASSERT_EQ(-1, scoreGapExtend(matrixScore));
        SEQAN_ASSERT_EQ(-1, scoreGapOpen(matrixScore));
        // Test function score().  The default score is TValue() == 0
        // for all matches.
        assertAminoAcidMatrixIsDefaultInitialized(matrixScore);
    }

    // Test the const accessor functions.
    {
        // Call appropriate constructor.
        const TScore matrixScore;
        // Assert score state.
        SEQAN_ASSERT_EQ(-1, scoreGap(matrixScore));
        SEQAN_ASSERT_EQ(-1, scoreGapExtend(matrixScore));
        SEQAN_ASSERT_EQ(-1, scoreGapOpen(matrixScore));
        // Test function score().  The default score is TValue() == 0
        // for all matches.
        assertAminoAcidMatrixIsDefaultInitialized(matrixScore);
    }

    // Test the setter functions.
    {
        // The test score value for the test.
        const TValue kScoreValue = 42;
        // Create a new score matrix.
        TScore matrixScore;
        // Test function score().  The default score is TValue() == 0
        // for all matches.
        assertAminoAcidMatrixIsDefaultInitialized(matrixScore);
        // Set the score for a substitution and check the result.
        setScore(matrixScore, AminoAcid('A'), AminoAcid('X'), kScoreValue);
        SEQAN_ASSERT_EQ(kScoreValue,
                        score(matrixScore, AminoAcid('A'), AminoAcid('X')));
    }

    // Test with gap extension constructor.
    {
        // Define constant test data and call appropriate constructor.
        const TValue kGapScore = 1;
        TScore matrixScore(kGapScore);
        // Assert score state.
        SEQAN_ASSERT_EQ(kGapScore, scoreGap(matrixScore));
        SEQAN_ASSERT_EQ(kGapScore, scoreGapExtend(matrixScore));
        SEQAN_ASSERT_EQ(kGapScore, scoreGapOpen(matrixScore));
        // Test function score().  The default score is TValue() == 0
        // for all matches.
        assertAminoAcidMatrixIsDefaultInitialized(matrixScore);
    }

    // Test with gap extension and gap open constructor.
    {
        // Define constant test data and call appropriate constructor.
        const TValue kGapExtensionScore = 1;
        const TValue kGapOpenScore = 2;
        TScore matrixScore(kGapExtensionScore, kGapOpenScore);
        // Assert score state.
        SEQAN_ASSERT_EQ(kGapExtensionScore, scoreGap(matrixScore));
        SEQAN_ASSERT_EQ(kGapExtensionScore, scoreGapExtend(matrixScore));
        SEQAN_ASSERT_EQ(kGapOpenScore, scoreGapOpen(matrixScore));
        // Test function score().  The default score is TValue() == 0
        // for all matches.
        assertAminoAcidMatrixIsDefaultInitialized(matrixScore);
    }

    // Test with path to file constructor.
    {
        // Call appropriate constructor.
        const TScore matrixScore(pathToBlosum62);
        // Assert score state.
        SEQAN_ASSERT_EQ(-1, scoreGap(matrixScore));
        SEQAN_ASSERT_EQ(-1, scoreGapExtend(matrixScore));
        SEQAN_ASSERT_EQ(-1, scoreGapOpen(matrixScore));
        // The resulting matrix from the file should be equal to the
        // built-in BLOSUM62 matrix.
        Blosum62 blosum62;
        assertAminoAcidMatricesAreEqual(blosum62, matrixScore);
    }

    // Test with path to file, gap extension constructor.
    {
        // Call appropriate constructor.
        const TValue kGapScore = 1;
        TScore matrixScore(pathToBlosum62, kGapScore);
        // Assert score state.
        SEQAN_ASSERT_EQ(kGapScore, scoreGap(matrixScore));
        SEQAN_ASSERT_EQ(kGapScore, scoreGapExtend(matrixScore));
        SEQAN_ASSERT_EQ(kGapScore, scoreGapOpen(matrixScore));
        // The resulting matrix from the file should be equal to the
        // built-in BLOSUM62 matrix.
        Blosum62 blosum62;
        assertAminoAcidMatricesAreEqual(blosum62, matrixScore);
    }

    // Test with path to file, gap extension and gap open constructor.
    {
        // Define constant test data and call appropriate constructor.
        const TValue kGapExtensionScore = 1;
        const TValue kGapOpenScore = 2;
        TScore matrixScore(pathToBlosum62, kGapExtensionScore, kGapOpenScore);
        // Assert score state.
        SEQAN_ASSERT_EQ(kGapExtensionScore, scoreGap(matrixScore));
        SEQAN_ASSERT_EQ(kGapExtensionScore, scoreGapExtend(matrixScore));
        SEQAN_ASSERT_EQ(kGapOpenScore, scoreGapOpen(matrixScore));
        // The resulting matrix from the file should be equal to the
        // built-in BLOSUM62 matrix.
        Blosum62 blosum62;
        assertAminoAcidMatricesAreEqual(blosum62, matrixScore);
    }
}

// Test the File I/O code for score matrices.
SEQAN_DEFINE_TEST(test_score_matrix_file) {
    // TODO(holtgrew): It should be easier to construct these paths.
    // The path to the directory with the test's sources and fixtures.
    String<char> pathToTestSrc = SEQAN_PATH_TO_ROOT();
    append(pathToTestSrc, "/core/tests/score/");

    // Load fixture BLOSUM62 matrix.
    // TODO(holtgrew): Should be done in a function.
    Score<int, ScoreMatrix<> > sc;
    String<char> meta;
    String<char> pathToBlosum62(pathToTestSrc);
    append(pathToTestSrc, "BLOSUM62");
    // TODO(holtgrew): If the file does not exist, a bus error occurs, code should catch this case and print an error.
    loadScoreMatrix(sc, pathToTestSrc, meta);

    // Compare fixture BLOSUM62 matrix to built-in one.
    {
        Blosum62 blosum62;
        assertAminoAcidMatricesAreEqual(blosum62, sc);
    }

    // Perform assertions on scores of the built-in Blosum62 matrix.
    {
        Blosum62 blosum62;
        SEQAN_ASSERT_EQ(scoreGapExtend(blosum62), -1);
        SEQAN_ASSERT_EQ(scoreGapOpen(blosum62), scoreGapExtend(blosum62));
        SEQAN_ASSERT_EQ(scoreGap(blosum62), scoreGapExtend(blosum62));
    }

    // Store and load the fixture BLOSUM62 matrix again.
    {
        const char *temp_filename = SEQAN_TEMP_FILENAME();
        FILE *fl = fopen(temp_filename, "wb");
        write(fl, sc, meta);
        fclose(fl);

        Score<int, ScoreMatrix<> > sc2;
        String<char> meta2;
        loadScoreMatrix(sc2, temp_filename, meta2);
        assertAminoAcidMatricesAreEqual(sc, sc2);
        SEQAN_ASSERT_EQ(meta, meta2);
    }

    // Store and load the built-in matrix again.
    {
        const char *temp_filename = SEQAN_TEMP_FILENAME();
        FILE *fl = fopen(temp_filename, "wb");
        write(fl, Blosum62());
        fclose(fl);

        Score<int, ScoreMatrix<> > sc2;
        loadScoreMatrix(sc2, temp_filename);
        assertAminoAcidMatricesAreEqual(sc2, Blosum62());
    }

    // Test setScore()
    {
        setScore(sc, 'A', '*', 100);
        SEQAN_ASSERT_EQ(score(sc, 'A', '*'), 100);
    }
}

// Testing the edit distance score is simple, the functions simply
// return the edit distance values.
SEQAN_DEFINE_TEST(test_score_edit) {
    // TODO(holtgrew): Break out each block into a test of its own.
    // We will only test with int scores, the most common case.
    typedef int TValue;
    typedef Score<TValue, EditDistance> TScore;

    // Test the default constructor.
    {
        TScore editDistanceScore;
        SEQAN_ASSERT_EQ(0, scoreMatch(editDistanceScore));
        SEQAN_ASSERT_EQ(-1, scoreMismatch(editDistanceScore));
        // TODO(holtgrew): FIXME! Does not compile because of reference to temporary.
        // SEQAN_ASSERT_EQ(-1, scoreGap(editDistanceScore));
        SEQAN_ASSERT_EQ(-1, scoreGapExtend(editDistanceScore));
        SEQAN_ASSERT_EQ(-1, scoreGapOpen(editDistanceScore));
        // Test function score().
        SEQAN_ASSERT_EQ(0, score(editDistanceScore, 'A', 'A'));
        SEQAN_ASSERT_EQ(-1, score(editDistanceScore, 'A', 'C'));
    }

    // Test the const accessor functions.
    {
        const TScore editDistanceScore;
        SEQAN_ASSERT_EQ(0, scoreMatch(editDistanceScore));
        SEQAN_ASSERT_EQ(-1, scoreMismatch(editDistanceScore));
        // TODO(holtgrew): FIXME! Does not compile because of reference to temporary.
        // SEQAN_ASSERT_EQ(-1, scoreGap(editDistanceScore));
        SEQAN_ASSERT_EQ(-1, scoreGapExtend(editDistanceScore));
        SEQAN_ASSERT_EQ(-1, scoreGapOpen(editDistanceScore));
        // Test function score().
        SEQAN_ASSERT_EQ(0, score(editDistanceScore, 'A', 'A'));
        SEQAN_ASSERT_EQ(-1, score(editDistanceScore, 'A', 'C'));
    }

    // Test the shortcut.  Since the assignment operator is not
    // overloaded, the following should not compile if the shortcut is
    // not defined appropriately.
    {
        // TODO(holtgrew): Use a metaprogramming for type equality instead?, something like SEQAN_ASSERT(type-equals(x, y));?
        Score<int, EditDistance> scoreEditDistance;
        EditDistanceScore editDistanceScore;
        scoreEditDistance = editDistanceScore;
    }
}

// Score<TValue, Simple> is, you have guessed it, very simple.  Thus,
// we will simply use different constructors to construct Simple Score
// objects and call the scoring functions on them.
SEQAN_DEFINE_TEST(test_score_simple) {
    // TODO(holtgrew): Break out each block into a test of its own.
    // We will only test with int scores, the most common case.
    typedef int TValue;
    typedef Score<TValue, Simple> TScore;

    // Test the default constructor.
    {
        TScore simpleScore;
        SEQAN_ASSERT_EQ(0, scoreMatch(simpleScore));
        SEQAN_ASSERT_EQ(-1, scoreMismatch(simpleScore));
        SEQAN_ASSERT_EQ(-1, scoreGap(simpleScore));
        SEQAN_ASSERT_EQ(-1, scoreGapExtend(simpleScore));
        SEQAN_ASSERT_EQ(-1, scoreGapOpen(simpleScore));
        // Test function score().
        SEQAN_ASSERT_EQ(0, score(simpleScore, 'A', 'A'));
        SEQAN_ASSERT_EQ(-1, score(simpleScore, 'A', 'C'));
    }

    // Test the const member retrieval functions.
    // TODO(holtgrew): Should these functions not be called getFUNCNAME?
    {
        const TScore simpleScore;
        SEQAN_ASSERT_EQ(0, scoreMatch(simpleScore));
        SEQAN_ASSERT_EQ(-1, scoreMismatch(simpleScore));
        SEQAN_ASSERT_EQ(-1, scoreGap(simpleScore));
        SEQAN_ASSERT_EQ(-1, scoreGapExtend(simpleScore));
        SEQAN_ASSERT_EQ(-1, scoreGapOpen(simpleScore));
        // Test function score().
        SEQAN_ASSERT_EQ(0, score(simpleScore, 'A', 'A'));
        SEQAN_ASSERT_EQ(-1, score(simpleScore, 'A', 'C'));
    }

    // Test the non-const member retrieval functions with assignments.
    {
        const int kMatch = 1;
        const int kMismatch = 2;
        const int kGapExtension = 3;
        const int kGapOpen = 4;
        // Perform assignments.
        TScore simpleScore;
        setScoreMatch(simpleScore, kMatch);
        setScoreMismatch(simpleScore, kMismatch);
        setScoreGap(simpleScore, kGapExtension);
        setScoreGapExtend(simpleScore, kGapExtension);
        setScoreGapOpen(simpleScore, kGapOpen);
        // Check results.
        SEQAN_ASSERT_EQ(kMatch, scoreMatch(simpleScore));
        SEQAN_ASSERT_EQ(kMismatch, scoreMismatch(simpleScore));
        SEQAN_ASSERT_EQ(kGapExtension, scoreGap(simpleScore));
        SEQAN_ASSERT_EQ(kGapExtension, scoreGapExtend(simpleScore));
        SEQAN_ASSERT_EQ(kGapOpen, scoreGapOpen(simpleScore));
    }

    // Test the constructor with match, mismatch, gap arguments.
    {
        // Define constant test data.
        const int kMatch = 1;
        const int kMismatch = 2;
        const int kGap = 3;
        // Construct the score and make assertions about its state.
        TScore simpleScore(kMatch, kMismatch, kGap);
        SEQAN_ASSERT_EQ(kMatch, scoreMatch(simpleScore));
        SEQAN_ASSERT_EQ(kMismatch, scoreMismatch(simpleScore));
        SEQAN_ASSERT_EQ(kGap, scoreGap(simpleScore));
        SEQAN_ASSERT_EQ(kGap, scoreGapExtend(simpleScore));
        SEQAN_ASSERT_EQ(kGap, scoreGapOpen(simpleScore));
        // Test function score().
        SEQAN_ASSERT_EQ(kMatch, score(simpleScore, 'A', 'A'));
        SEQAN_ASSERT_EQ(kMismatch, score(simpleScore, 'A', 'C'));
    }

    // Test the constructor with match, mismatch, gap extension, gap
    // open arguments.
    {
        // Define constant test data.
        const int kMatch = 1;
        const int kMismatch = 2;
        const int kGapExtension = 3;
        const int kGapOpen = 4;
        // Construct the score and make assertions about its state.
        TScore simpleScore(kMatch, kMismatch, kGapExtension, kGapOpen);
        SEQAN_ASSERT_EQ(kMatch, scoreMatch(simpleScore));
        SEQAN_ASSERT_EQ(kMismatch, scoreMismatch(simpleScore));
        SEQAN_ASSERT_EQ(kGapExtension, scoreGap(simpleScore));
        SEQAN_ASSERT_EQ(kGapExtension, scoreGapExtend(simpleScore));
        SEQAN_ASSERT_EQ(kGapOpen, scoreGapOpen(simpleScore));
        // Test function score().
        SEQAN_ASSERT_EQ(kMatch, score(simpleScore, 'A', 'A'));
        SEQAN_ASSERT_EQ(kMismatch, score(simpleScore, 'A', 'C'));
    }

    // Test the shortcut.  Since the assignment operator is not
    // overloaded, the following should not compile if the shortcut is
    // not defined appropriately.
    {
        // TODO(holtgrew): Use a metaprogramming for type equality instead?, something like SEQAN_ASSERT(type-equals(x, y));?
        Score<int, Simple> scoreSimple;
        SimpleScore simpleScore;
        simpleScore = scoreSimple;
    }
}

// Test the _sprintfValue() functions from score_matrix.h.
SEQAN_DEFINE_TEST(test_score_matrix_sprintf_value) {
    // Size of the buffers to sprintfValue() to below.
    const int kBufferSize = 100;

    // Test with type unsigned.
    {
        char buffer[kBufferSize];
        _sprintfValue(buffer, static_cast<unsigned>(1.5));
        SEQAN_ASSERT_EQ(0, strcmp(buffer, "1"));
    }

    // Test with type int.
    {
        char buffer[kBufferSize];
        _sprintfValue(buffer, static_cast<int>(1.5));
        SEQAN_ASSERT_EQ(0, strcmp(buffer, "1"));
    }

    // Test with type float.
    {
        char buffer[kBufferSize];
        _sprintfValue(buffer, static_cast<float>(1.5));
        SEQAN_ASSERT_EQ(0, strcmp(buffer, "1.5"));
    }

    // Test with type double.
    {
        char buffer[kBufferSize];
        _sprintfValue(buffer, static_cast<double>(1.5));
        SEQAN_ASSERT_EQ(0, strcmp(buffer, "1.5"));
    }
}

// Test the built-in data matrices by comparing them to the matrices
// from test data files.
SEQAN_DEFINE_TEST(test_score_matrix_data) {
    // We test the scoring matrix with amino acids as the underlying
    // sequence.  This should be the most common case.
    typedef int TValue;
    typedef Score<TValue, ScoreMatrix<AminoAcid, ScoreMatrixFile> > TScore;

    // TODO(holtgrew): It should be easier to construct these paths.
    String<char> pathToTestSrc = SEQAN_PATH_TO_ROOT();
    append(pathToTestSrc, "/core/tests/score/");

    // Test with BLOSUM30.
    {
        // The built-in BLOSUM30 matrix.
        Blosum30 blosum30;
        // Use a quick-and-dirty test that the matrix indeed is BLOSUM30.
        SEQAN_ASSERT_EQ(0, score(blosum30, AminoAcid('A'), AminoAcid('N')));
        SEQAN_ASSERT_EQ(1, score(blosum30, AminoAcid('V'), AminoAcid('A')));

        // Build path to BLOSUM30 matrix.
        String<char> pathToBlosum30(pathToTestSrc);
        append(pathToBlosum30, "BLOSUM30");
        // Load matrix.
        TScore loadedBlosum30(pathToBlosum30);
        // Compare loaded with built-in matrix.
        assertAminoAcidMatricesAreEqual(loadedBlosum30, blosum30);
    }

    // Test with BLOSUM45.
    {
        // The built-in BLOSUM45 matrix.
        Blosum45 blosum45;
        // Use a quick-and-dirty test that the matrix indeed is BLOSUM45.
        SEQAN_ASSERT_EQ(-1, score(blosum45, AminoAcid('A'), AminoAcid('N')));
        SEQAN_ASSERT_EQ(0, score(blosum45, AminoAcid('V'), AminoAcid('A')));

        // Build path to BLOSUM45 matrix.
        String<char> pathToBlosum45(pathToTestSrc);
        append(pathToBlosum45, "BLOSUM45");
        // Load matrix.
        TScore loadedBlosum45(pathToBlosum45);
        // Compare loaded with built-in matrix.
        assertAminoAcidMatricesAreEqual(loadedBlosum45, blosum45);
    }

    // Test with BLOSUM62.
    {
        // The built-in BLOSUM62 matrix.
        Blosum62 blosum62;
        // Use a quick-and-dirty test that the matrix indeed is BLOSUM62.
        SEQAN_ASSERT_EQ(-2, score(blosum62, AminoAcid('A'), AminoAcid('N')));
        SEQAN_ASSERT_EQ(0, score(blosum62, AminoAcid('V'), AminoAcid('A')));

        // Build path to BLOSUM62 matrix.
        String<char> pathToBlosum62(pathToTestSrc);
        append(pathToBlosum62, "BLOSUM62");
        // Load matrix.
        TScore loadedBlosum62(pathToBlosum62);
        // Compare loaded with built-in matrix.
        assertAminoAcidMatricesAreEqual(loadedBlosum62, blosum62);
    }

    // Test with BLOSUM80.
    {
        // The built-in BLOSUM80 matrix.
        Blosum80 blosum80;
        // Use a quick-and-dirty test that the matrix indeed is BLOSUM80.
        SEQAN_ASSERT_EQ(-3, score(blosum80, AminoAcid('A'), AminoAcid('N')));
        SEQAN_ASSERT_EQ(-1, score(blosum80, AminoAcid('V'), AminoAcid('A')));

        // Build path to BLOSUM80 matrix.
        String<char> pathToBlosum80(pathToTestSrc);
        append(pathToBlosum80, "BLOSUM80");
        // Load matrix.
        TScore loadedBlosum80(pathToBlosum80);
        // Compare loaded with built-in matrix.
        assertAminoAcidMatricesAreEqual(loadedBlosum80, blosum80);
    }

    // Test with PAM40.
    {
        // The built-in PAM40 matrix.
        Pam40 pam40;
        // Use a quick-and-dirty test that the matrix indeed is PAM40.
        SEQAN_ASSERT_EQ(-3, score(pam40, AminoAcid('A'), AminoAcid('N')));
        SEQAN_ASSERT_EQ(-2, score(pam40, AminoAcid('V'), AminoAcid('A')));

        // Build path to PAM40 matrix.
        String<char> pathToPam40(pathToTestSrc);
        append(pathToPam40, "PAM40");
        // Load matrix.
        TScore loadedPam40(pathToPam40);
        // Compare loaded with built-in matrix.
        assertAminoAcidMatricesAreEqual(loadedPam40, pam40);
    }

    // Test with PAM120.
    {
        // The built-in PAM120 matrix.
        Pam120 pam120;
        // Use a quick-and-dirty test that the matrix indeed is PAM120.
        SEQAN_ASSERT_EQ(-1, score(pam120, AminoAcid('A'), AminoAcid('N')));
        SEQAN_ASSERT_EQ(0, score(pam120, AminoAcid('V'), AminoAcid('A')));

        // Build path to PAM120 matrix.
        String<char> pathToPam120(pathToTestSrc);
        append(pathToPam120, "PAM120");
        // Load matrix.
        TScore loadedPam120(pathToPam120);
        // Compare loaded with built-in matrix.
        assertAminoAcidMatricesAreEqual(loadedPam120, pam120);
    }

    // Test with PAM200.
    {
        // The built-in PAM200 matrix.
        Pam200 pam200;
        // Use a quick-and-dirty test that the matrix indeed is PAM200.
        SEQAN_ASSERT_EQ(0, score(pam200, AminoAcid('A'), AminoAcid('N')));
        SEQAN_ASSERT_EQ(0, score(pam200, AminoAcid('V'), AminoAcid('A')));

        // Build path to PAM200 matrix.
        String<char> pathToPam200(pathToTestSrc);
        append(pathToPam200, "PAM200");
        // Load matrix.
        TScore loadedPam200(pathToPam200);
        // Compare loaded with built-in matrix.
        assertAminoAcidMatricesAreEqual(loadedPam200, pam200);
    }

    // Test with PAM250.
    {
        // The built-in PAM250 matrix.
        Pam250 pam250;
        // Use a quick-and-dirty test that the matrix indeed is PAM250.
        SEQAN_ASSERT_EQ(0, score(pam250, AminoAcid('A'), AminoAcid('N')));
        SEQAN_ASSERT_EQ(0, score(pam250, AminoAcid('V'), AminoAcid('A')));

        // Build path to PAM250 matrix.
        String<char> pathToPam250(pathToTestSrc);
        append(pathToPam250, "PAM250");
        // Load matrix.
        TScore loadedPam250(pathToPam250);
        // Compare loaded with built-in matrix.
        assertAminoAcidMatricesAreEqual(loadedPam250, pam250);
    }

    // Test with VTML200.
    {
        // The built-in VTML200 matrix.
        Vtml200 vtml200;
        // Use a quick-and-dirty test that the matrix indeed is VTML200.
        SEQAN_ASSERT_EQ(-1, score(vtml200, AminoAcid('A'), AminoAcid('N')));
        SEQAN_ASSERT_EQ(0, score(vtml200, AminoAcid('V'), AminoAcid('A')));

        // Build path to VTML200 matrix.
        String<char> pathToVTML200(pathToTestSrc);
        append(pathToVTML200, "VTML200I");
        // Load matrix.
        TScore loadedVTML200(pathToVTML200);
        // Compare loaded with built-in matrix.
        assertAminoAcidMatricesAreEqual(loadedVTML200, vtml200);
    }
}

template <typename TScoreSpec>
void testScoreSequenceEntryForScore()
{
    typedef Score<int, TScoreSpec> TScoringScheme;
    typedef typename SequenceEntryForScore<TScoringScheme, DnaString>::Type TEntry1;

    DnaString seq1 = "ACGTACG";
    Dna5String seq2 = "ACGTNACNA";

    TScoringScheme scoringScheme;

    TEntry1 val1 = sequenceEntryForScore(scoringScheme, seq1, 0);
    TEntry1 val2 = sequenceEntryForScore(scoringScheme, seq2, 0);

    SEQAN_ASSERT_EQ(val1, 'A');
    SEQAN_ASSERT_EQ(val2, 'A');

    val1 = sequenceEntryForScore(scoringScheme, seq1, 4);
    val2 = sequenceEntryForScore(scoringScheme, seq2, 4);

    SEQAN_ASSERT_EQ(val1, 'A');
    SEQAN_ASSERT_EQ(val2, 'N');
}

SEQAN_DEFINE_TEST(test_score_sequence_entry_for_score)
{
    testScoreSequenceEntryForScore<Simple>();
    testScoreSequenceEntryForScore<ScoreMatrix<AminoAcid, Blosum62_> >();
}

SEQAN_BEGIN_TESTSUITE(test_score) {
    // Call the tests for this module.
    SEQAN_CALL_TEST(test_score_gap_open);
    SEQAN_CALL_TEST(test_score_simple);
    SEQAN_CALL_TEST(test_score_edit);
    SEQAN_CALL_TEST(test_score_matrix);
    SEQAN_CALL_TEST(test_score_matrix_file);
    SEQAN_CALL_TEST(test_score_matrix_sprintf_value);
    SEQAN_CALL_TEST(test_score_matrix_data);
    SEQAN_CALL_TEST(test_score_sequence_entry_for_score);
}
SEQAN_END_TESTSUITE


text:
package org.apache.catalina.deploy;

import java.io.Serializable;

/**
 * Representation of a local EJB resource reference for a web application, as
 * represented in a <ejb-local-ref> element in the
 * deployment descriptor.
 *
 * @author Craig R. McClanahan
 * @version $Revision: 1.2 $ $Date: 2003/01/27 23:45:19 $
 */

public final class ContextLocalEjb implements Serializable {

    // ------------------------------------------------------------- Properties

    /**
     * The description of this EJB.
     */
    private String description = null;

    public String getDescription() {
        return (this.description);
    }

    public void setDescription(String description) {
        this.description = description;
    }

    /**
     * The name of the EJB home implementation class.
     */
    private String home = null;

    public String getHome() {
        return (this.home);
    }

    public void setHome(String home) {
        this.home = home;
    }

    /**
     * The link to a J2EE EJB definition.
     */
    private String link = null;

    public String getLink() {
        return (this.link);
    }

    public void setLink(String link) {
        this.link = link;
    }

    /**
     * The name of the EJB local implementation class.
     */
    private String local = null;

    public String getLocal() {
        return (this.local);
    }

    public void setLocal(String local) {
        this.local = local;
    }

    /**
     * The name of this EJB.
     */
    private String name = null;

    public String getName() {
        return (this.name);
    }

    public void setName(String name) {
        this.name = name;
    }

    /**
     * The name of the EJB bean implementation class.
     */
    private String type = null;

    public String getType() {
        return (this.type);
    }

    public void setType(String type) {
        this.type = type;
    }

    // --------------------------------------------------------- Public Methods

    /**
     * Return a String representation of this object.
     */
    public String toString() {

        StringBuffer sb = new StringBuffer("ContextLocalEjb[");
        sb.append("name=");
        sb.append(name);
        if (description != null) {
            sb.append(", description=");
            sb.append(description);
        }
        if (type != null) {
            sb.append(", type=");
            sb.append(type);
        }
        if (home != null) {
            sb.append(", home=");
            sb.append(home);
        }
        if (link != null) {
            sb.append(", link=");
            sb.append(link);
        }
        if (local != null) {
            sb.append(", local=");
            sb.append(local);
        }
        sb.append("]");
        return (sb.toString());

    }

    // -------------------------------------------------------- Package Methods

    /**
     * The NamingResources with which we are associated (if any).
     */
    protected NamingResources resources = null;

    public NamingResources getNamingResources() {
        return (this.resources);
    }

    void setNamingResources(NamingResources resources) {
        this.resources = resources;
    }

}


text:
import ffm
import numpy as np
from .base import FactorizationMachine
from sklearn.utils.testing import assert_array_equal
from .validation import check_array, assert_all_finite

class FMRecommender(FactorizationMachine):

    """ Factorization Machine Recommender with pairwise (BPR) loss solver.

    Parameters
    ----------
    n_iter : int, optional
        The number of interations of individual samples .

    init_stdev: float, optional
        Sets the stdev for the initialization of the parameter

    random_state: int, optional
        The seed of the pseudo random number generator that
        initializes the parameters and mcmc chain.

    rank: int
        The rank of the factorization used for the second order interactions.

    l2_reg_w : float
        L2 penalty weight for pairwise coefficients.

    l2_reg_V : float
        L2 penalty weight for linear coefficients.

    l2_reg : float
        L2 penalty weight for all coefficients (default=0).

    step_size : float
        Stepsize for the SGD solver, the solver uses a fixed step size and
        might require a tunning of the number of iterations `n_iter`.

    Attributes
    ---------

    w0_ : float
        bias term

    w_ : float | array, shape = (n_features)
        Coefficients for linear combination.

    V_ : float | array, shape = (rank_pair, n_features)
        Coefficients of second order factor matrix.
    """

    def __init__(self, n_iter=100, init_stdev=0.1, rank=8, random_state=123,
                 l2_reg_w=0.1, l2_reg_V=0.1, l2_reg=0, step_size=0.1):
        super(FMRecommender, self).\
            __init__(n_iter=n_iter, init_stdev=init_stdev, rank=rank,
                     random_state=random_state)
        if (l2_reg != 0):
            self.l2_reg_V = l2_reg
            self.l2_reg_w = l2_reg
        else:
            self.l2_reg_w = l2_reg_w
            self.l2_reg_V = l2_reg_V
        self.step_size = step_size
        self.task = "ranking"

    def fit(self, X, pairs):
        """ Fit model with specified loss.

        Parameters
        ----------
        X : scipy.sparse.csc_matrix, (n_samples, n_features)

        y : float | ndarray, shape = (n_compares, 2)
                Each row `i` defines a pair of samples such that
                the first returns a high value then the second
                FM(X[i,0]) > FM(X[i, 1]).
        """
        X = X.T
        X = check_array(X, accept_sparse="csc", dtype=np.float64)
        assert_all_finite(pairs)

        pairs = pairs.astype(np.float64)
        # check that pairs contain no real values
        assert_array_equal(pairs, pairs.astype(np.int32))
        assert pairs.max() <= X.shape[1]
        assert pairs.min() >= 0
        self.w0_, self.w_, self.V_ = ffm.ffm_fit_sgd_bpr(self, X, pairs)
        return self


text:
module PathMapper
  module Node
    module Dir
      module File
        def _create!
          { d: { result: self }, code: :ok }
        end

        def _override!(content)
          { d: { result: self }, code: :ok }
        end

        def _rename!(new_path)
          mapper = PathMapper.new(new_path)
          mapper.parent.create!(logger: false)
          mapper.delete!(logger: false) unless mapper.empty?
          super
        end

        def _delete!(full: false)
          self.with_dry_run do |dry_run|
            if dry_run
              self.delete_storage_branch(@path)
            else
              @path.rmtree
            end
          end

          parent = self.parent
          parent.delete!(full: full) if parent.empty? and full

          { d: { result: self._create_node(@path) }, code: :deleted }
        end

        def md5
          nil
        end
      end
    end
  end
end