text:
<?xml version="1.0"?>
<!--
   Licensed to the Apache Software Foundation (ASF) under one or more
   contributor license agreements.  See the NOTICE file distributed with
   this work for additional information regarding copyright ownership.
   The ASF licenses this file to You 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.
-->
<metainfo>
  <schemaVersion>2.0</schemaVersion>
  <services>
    <service>
      <name>AMBARI_INFRA</name>
      <displayName>Ambari Infra</displayName>
      <comment>Core shared service used by Ambari managed components.</comment>
      <version>0.1.0</version>
      <components>
        <component>
          <name>INFRA_SOLR</name>
          <timelineAppid>infra-solr</timelineAppid>
          <displayName>Infra Solr Instance</displayName>
          <category>MASTER</category>
          <cardinality>1+</cardinality>
          <versionAdvertised>false</versionAdvertised>
          <commandScript>
            <script>scripts/infra_solr.py</script>
            <scriptType>PYTHON</scriptType>
            <timeout>1800</timeout>
          </commandScript>
          <logs>
            <log>
              <logId>infra_solr</logId>
              <primary>true</primary>
            </log>
          </logs>
          <dependencies>
            <dependency>
              <name>AMBARI_INFRA/INFRA_SOLR_CLIENT</name>
              <scope>host</scope>
              <auto-deploy>
                <enabled>true</enabled>
              </auto-deploy>
            </dependency>

            <dependency>
              <name>ZOOKEEPER/ZOOKEEPER_SERVER</name>
              <scope>cluster</scope>
              <auto-deploy>
                <enabled>true</enabled>
              </auto-deploy>
            </dependency>

          </dependencies>
          <configuration-dependencies>
            <config-type>infra-solr-env</config-type>
            <config-type>infra-solr-xml</config-type>
            <config-type>infra-solr-log4j</config-type>
            <config-type>infra-solr-security-json</config-type>
          </configuration-dependencies>
        </component>

        <component>
          <name>INFRA_SOLR_CLIENT</name>
          <displayName>Infra Solr Client</displayName>
          <category>CLIENT</category>
          <cardinality>0+</cardinality>
          <versionAdvertised>false</versionAdvertised>
          <commandScript>
            <script>scripts/infra_solr_client.py</script>
            <scriptType>PYTHON</scriptType>
          </commandScript>
          <configFiles>
            <configFile>
              <type>env</type>
              <fileName>log4j.properties</fileName>
              <dictionaryName>infra-solr-client-log4j</dictionaryName>
            </configFile>
          </configFiles>
          <configuration-dependencies>
            <config-type>infra-solr-client-log4j</config-type>
          </configuration-dependencies>
        </component>

      </components>

      <osSpecifics>
        <osSpecific>
          <osFamily>redhat7,amazon2015,redhat6,suse11,suse12</osFamily>
          <packages>
            <package>
              <name>ambari-infra-solr-client</name>
              <skipUpgrade>true</skipUpgrade>
            </package>
            <package>
              <name>ambari-infra-solr</name>
              <condition>should_install_infra_solr</condition>
              <skipUpgrade>true</skipUpgrade>
            </package>
          </packages>
        </osSpecific>
        <osSpecific>
          <osFamily>debian7,ubuntu12,ubuntu14,ubuntu16</osFamily>
          <packages>
            <package>
              <name>ambari-infra-solr-client</name>
              <skipUpgrade>true</skipUpgrade>
            </package>
            <package>
              <name>ambari-infra-solr</name>
              <condition>should_install_infra_solr</condition>
              <skipUpgrade>true</skipUpgrade>
            </package>
          </packages>
        </osSpecific>
      </osSpecifics>

      <commandScript>
        <script>scripts/service_check.py</script>
        <scriptType>PYTHON</scriptType>
        <timeout>300</timeout>
      </commandScript>

      <requiredServices>
        <service>ZOOKEEPER</service>
      </requiredServices>

      <themes>
        <theme>
          <fileName>theme.json</fileName>
          <default>true</default>
        </theme>
      </themes>

      <quickLinksConfigurations>
        <quickLinksConfiguration>
          <fileName>quicklinks.json</fileName>
          <default>true</default>
        </quickLinksConfiguration>
      </quickLinksConfigurations>

    </service>
  </services>
</metainfo>


text:
function epidemic_word_file = epidemic_words( directory, w, h, r, align )
% Create an epidemic_word_file, given a directory dir, window length w, a shift length h, and a resolution r.
% Input arguments:
%     directory - Directory of csv data files
%     w - Window length
%     h - Shift length
%     r - Quantization resolution/bands
% Output arguments:
%     epidemic_word_file - Struct array of idx-win pairs

% Get all csv files in directory
files = dir(fullfile(directory,'*.csv'));

% Initialize files container
numfiles = numel(files);
filesarray(numfiles).mat = [];
filesarray(numfiles).states = [];
filesarray(numfiles).numstates = 0;
filesarray(numfiles).idxtimes = [];
filesarray(numfiles).numtimes = 0;
filesarray(numfiles).numelems = 0;

% Populate files container
totalnumelems = 0;
for fi = 1:numfiles
    [ mat, states ] = parsedatafile( fullfile(directory, files(fi).name) );
    filesarray(fi).mat = mat;
    filesarray(fi).states = states;
    numstates = numel(states);
    filesarray(fi).numstates = numstates;
    idxtimes = 1:h:size(mat, 1)-(w-1);
    filesarray(fi).idxtimes = idxtimes;
    numtimes = numel(idxtimes);
    filesarray(fi).numtimes = numtimes;
    numelems = numstates*numtimes;
    filesarray(fi).numelems = numelems;
    totalnumelems = totalnumelems + numelems;
end

% Initalize struct array for mat output
epidemic_word_file(totalnumelems).f = '';
epidemic_word_file(totalnumelems).s = '';
epidemic_word_file(totalnumelems).t = 0;
epidemic_word_file(totalnumelems).win = zeros(1, w);

% Initialize mongo
javaaddpath('mongo-java-driver-2.12.3.jar');
import('com.mongodb.*');
mongoClient = MongoClient();
db = mongoClient.getDB( 'epidemic' );
coll = db.getCollection('word_file');
coll.drop();
builder = coll.initializeUnorderedBulkOperation();

% Processing each file
ei = 1;
for fi = 1:numfiles
    % Compute normalized mat
    normedmat = normmat( filesarray(fi).mat );
    % Compute quantized mat
    quantizedmat = quantmat( normedmat, r, align );
    % For each state and time iteration
    for si = 1:filesarray(fi).numstates
        for ti = filesarray(fi).idxtimes
            [~, f, ~] = fileparts(files(fi).name);
            s = char(filesarray(fi).states(si));
            % Compute current window
            win = transpose(quantizedmat(ti:ti+(w-1), si));
            % Compute strength
            strength = norm(win);

            % write to mat
            epidemic_word_file(ei).f = f;
            epidemic_word_file(ei).s = s;
            epidemic_word_file(ei).t = ti;
            epidemic_word_file(ei).win = win;

            % write to mongo
            doc = BasicDBObject();
            doc.put('f', f);
            doc.put('s', s);
            doc.put('t', ti);
            % win values stored as strings, use str2num to reverse this
            doc.put('win', num2str(win));
            doc.put('str', strength);
            builder.insert(doc);

            ei = ei + 1;
        end
    end
end

% save to mongo
builder.execute();

% create mongo indexes on fst, strength and win
idxfst = BasicDBObject();
idxfst.put('f', true);
idxfst.put('s', true);
idxfst.put('t', true);
% coll.createIndex(idxfst, BasicDBObject('unique', true));
% coll.createIndex(BasicDBObject('str', true));
idxwinf = BasicDBObject();
idxwinf.put('win', true);
idxwinf.put('f', true);
% coll.createIndex(idxwinf);

close(mongoClient);

end

redpajama_set_name: RedPajamaGithub


text:
#include "octypes.h"
#include "easysetup.h"
#include "logging/things_logger.h"
#include "resource_handler.h"
#include "oic_string.h"
#include "cloud/cloud_manager.h"
#include "things_api.h"

#ifdef CONFIG_ST_THINGS_FOTA
#include "fota/fmwup_api.h"
#endif

#define ES_ENROLLEE_TAG "[easysetup]"

static bool g_is_secured = false;

static es_provisioning_callbacks_s g_es_provisioning_cb;
static es_device_property g_es_device_property;
static things_get_easysetup_state_func_type g_notify_easysetup_state = NULL;

void es_register_notify_easysetup_state(void *func)
{
	g_notify_easysetup_state = (things_get_easysetup_state_func_type) func;
}

void ESWiFiRsrcCallback(es_result_e es_result, es_wifi_prov_data_s *event_data)
{
	THINGS_LOG_D(ES_ENROLLEE_TAG, "ESWiFiRsrcCallback IN");

	if (es_result != ES_OK) {
		THINGS_LOG_E(ES_ENROLLEE_TAG, "ESWiFiRsrcCallback ES_ERROR Occured");
		return;
	}
	// deliver data to es_provisioning_callbacks_s
	if (g_es_provisioning_cb.wifi_prov_cb != NULL) {
		g_es_provisioning_cb.wifi_prov_cb(event_data);
	} else {
		THINGS_LOG_E(ES_ENROLLEE_TAG, "wifi_prov_cb is NULL");
		return;
	}
}

void ESCloudRsrcCallback(es_result_e es_resoult, es_cloud_prov_data_s *event_data)
{
	THINGS_LOG_D(ES_ENROLLEE_TAG, "ESCloudRsrcCallback IN");

	if (es_resoult != ES_OK) {
		THINGS_LOG_E(ES_ENROLLEE_TAG, "ESCloudRsrcCallback ES_ERROR Occured");
		return;
	}

	if (g_es_provisioning_cb.cloud_data_prov_cb != NULL) {
		g_es_provisioning_cb.cloud_data_prov_cb(event_data);
	} else {
		THINGS_LOG_E(ES_ENROLLEE_TAG, "cloud_data_prov_cb is NULL");
		return;
	}
}

void ESDevconfRsrcallback(es_result_e es_resoult, es_dev_conf_prov_data_s *event_data)
{
	THINGS_LOG_D(ES_ENROLLEE_TAG, "ESDevconfRsrcallback IN");

	if (es_resoult != ES_OK) {
		THINGS_LOG_E(ES_ENROLLEE_TAG, "ESDevconfRsrcallback ES_ERROR Occured");
		return;
	}

	if (g_es_provisioning_cb.dev_conf_prov_cb != NULL) {
		g_es_provisioning_cb.dev_conf_prov_cb(event_data);
	} else {
		THINGS_LOG_E(ES_ENROLLEE_TAG, "dev_conf_prov_cb is NULL");
		return;
	}

	THINGS_LOG_D(ES_ENROLLEE_TAG, "ESDevconfRsrcallback OUT");
}

es_result_e es_init_enrollee(bool is_secured, es_resource_mask_e resource_mask, es_provisioning_callbacks_s callbacks)
{
	THINGS_LOG_D(ES_ENROLLEE_TAG, "es_init_enrollee IN");

	g_is_secured = is_secured;
	g_es_provisioning_cb.wifi_prov_cb = NULL;
	g_es_provisioning_cb.dev_conf_prov_cb = NULL;
	g_es_provisioning_cb.cloud_data_prov_cb = NULL;

	if ((resource_mask & ES_WIFI_RESOURCE) == ES_WIFI_RESOURCE) {
		if (callbacks.wifi_prov_cb != NULL) {
			g_es_provisioning_cb.wifi_prov_cb = callbacks.wifi_prov_cb;
			register_wifi_rsrc_event_callback(ESWiFiRsrcCallback);
		} else {
			THINGS_LOG_E(ES_ENROLLEE_TAG, "wifi_prov_cb NULL");
			return ES_ERROR;
		}
	}
	if ((resource_mask & ES_DEVCONF_RESOURCE) == ES_DEVCONF_RESOURCE) {
		if (callbacks.dev_conf_prov_cb != NULL) {
			g_es_provisioning_cb.dev_conf_prov_cb = callbacks.dev_conf_prov_cb;
			register_dev_conf_rsrc_event_callback(ESDevconfRsrcallback);
		} else {
			THINGS_LOG_E(ES_ENROLLEE_TAG, "dev_conf_prov_cb NULL");
			return ES_ERROR;
		}
	}
	if ((resource_mask & ES_CLOUD_RESOURCE) == ES_CLOUD_RESOURCE) {
		if (callbacks.cloud_data_prov_cb != NULL) {
			g_es_provisioning_cb.cloud_data_prov_cb = callbacks.cloud_data_prov_cb;
			register_cloud_rsrc_event_callback(ESCloudRsrcCallback);
		} else {
			THINGS_LOG_E(ES_ENROLLEE_TAG, "cloud_data_prov_cb NULL");
			return ES_ERROR;
		}
	}

	if (create_easysetup_resources(g_is_secured, resource_mask) != OC_STACK_OK) {
		unregister_resource_event_callback();

		if (delete_easysetup_resources() != OC_STACK_OK) {
			THINGS_LOG_E(ES_ENROLLEE_TAG, "Deleting prov resource ES_ERROR!!");
		}

		return ES_ERROR;
	}

	THINGS_LOG_D(ES_ENROLLEE_TAG, "es_init_enrollee OUT");
	return ES_OK;
}

things_es_enrollee_state_e es_get_state(void)
{
	return get_enrollee_state();
}

bool es_get_cloud_login_state(void)
{
	bool res;
	switch (get_enrollee_state()) {
	case ES_STATE_REGISTERED_TO_CLOUD:
	case ES_STATE_PUBLISHING_RESOURCES_TO_CLOUD:
	case ES_STATE_PUBLISHED_RESOURCES_TO_CLOUD:
	case ES_STATE_FAILED_TO_PUBLISH_RESOURCES_TO_CLOUD:
		res = true;
		break;
	default:
		res = false;
		break;
	}

	return res;
}

es_result_e es_set_device_property(es_device_property *device_property)
{
	THINGS_LOG_D(ES_ENROLLEE_TAG, "es_set_device_property IN");

	if (set_device_property(device_property) != OC_STACK_OK) {
		THINGS_LOG_E(ES_ENROLLEE_TAG, "es_set_device_property ES_ERROR");
		return ES_ERROR;
	}

	int mode_idx = 0;
	while ((device_property->WiFi).mode[mode_idx] != WiFi_EOF) {
		(g_es_device_property.WiFi).mode[mode_idx] = (device_property->WiFi).mode[mode_idx];
		THINGS_LOG_D(ES_ENROLLEE_TAG, "WiFi Mode : %d", (g_es_device_property.WiFi).mode[mode_idx]);
		mode_idx++;
	}
	(g_es_device_property.WiFi).freq = (device_property->WiFi).freq;
	THINGS_LOG_D(ES_ENROLLEE_TAG, "WiFi Freq : %d", (g_es_device_property.WiFi).freq);

	things_strncpy((g_es_device_property.dev_conf_s).device_name, (device_property->dev_conf_s).device_name, MAX_DEVICELEN);
	THINGS_LOG_D(ES_ENROLLEE_TAG, "Device Name : %s", (g_es_device_property.dev_conf_s).device_name);

	things_strncpy((g_es_device_property.dev_conf_s).device_type, (device_property->dev_conf_s).device_type, MAX_DEVICELEN);
	THINGS_LOG_D(ES_ENROLLEE_TAG, "Device Type : %s", (g_es_device_property.dev_conf_s).device_type);

	THINGS_LOG_D(ES_ENROLLEE_TAG, "es_set_device_property OUT");
	return ES_OK;
}

es_result_e es_set_state(things_es_enrollee_state_e es_state)
{
	//THINGS_LOG_D(ES_ENROLLEE_TAG, "es_set_state IN");
	OCStackResult res = OC_STACK_ERROR;

	if (es_state >= ES_STATE_EOF) {
		THINGS_LOG_E(ES_ENROLLEE_TAG, "Invalid things_es_enrollee_state_e : %d", es_state);
		return ES_ERROR;
	}

	if (es_cloud_session_stop_trigger(es_state) == true) {
		THINGS_LOG_E(ES_ENROLLEE_TAG, "Cloud Connection Log-Out ing...");
		return ES_ERROR;
	}

	if ((res = set_enrollee_state(es_state)) == OC_STACK_ERROR) {
		THINGS_LOG_E(ES_ENROLLEE_TAG, "es_set_state setting is failed.");
		return ES_ERROR;
	}

	if (g_notify_easysetup_state != NULL && res == OC_STACK_OK) {
		THINGS_LOG_D(ES_ENROLLEE_TAG, "Notify Easy-Setup State to THINGS_APP. %d", es_state);
#ifdef CONFIG_ST_THINGS_FOTA
		if (es_state == ES_STATE_PUBLISHED_RESOURCES_TO_CLOUD) {
			int ret = fmwup_check_firmware_upgraded();
			if (ret != 0) {
				THINGS_LOG_D("fmwup_check_firmware_upgraded : [%d]", ret);
			}
		}
#endif
		g_notify_easysetup_state(es_state);
	}

	THINGS_LOG_D(ES_ENROLLEE_TAG, "Set ESState succesfully : %d", es_state);
	//THINGS_LOG_D(ES_ENROLLEE_TAG, "es_set_state OUT");
	return ES_OK;
}

static es_error_code_e ci_errcode_to_es_errcode(ci_error_code_e cm_err_code)
{
	es_error_code_e es_err_code = ES_ERRCODE_NO_ERROR;

	switch (cm_err_code) {
	case ERRCI_NO_ERROR:
	case ERRCI_SUCCESS:
		es_err_code = ES_ERRCODE_NO_ERROR;
		break;
	case ERRCI_SAMSUNG_ACCOUNT_AUTHORIZATION_FAILED:
	case ERRCI_SAMSUNG_ACCOUNT_UNAUTHORIZED_TOKEN:
		es_err_code = ES_ERRCODE_INVALID_AUTHCODE;
		break;
	case ERRCI_TOKEN_VALIDATION_FAILED:
		es_err_code = ES_ERRCODE_INVALID_ACCESSTOKEN;
		break;
	case ERRCI_DEVICE_NOT_FOUND:
		es_err_code = ES_ERRCODE_FAILED_TO_FIND_REGISTERED_DEVICE_IN_CLOUD;
		break;
	case ERRCI_USER_NOT_FOUND:
		es_err_code = ES_ERRCODE_FAILED_TO_FIND_REGISTERED_USER_IN_CLOUD;
		break;
	default:
		es_err_code = ES_ERRCODE_UNKNOWN;
		break;
	}

	return es_err_code;
}

es_result_e es_set_error_code(es_error_code_e es_err_code)
{
	THINGS_LOG_D(ES_ENROLLEE_TAG, "es_set_error_code IN");

	if (es_err_code > ES_ERRCODE_UNKNOWN) {
		THINGS_LOG_E(ES_ENROLLEE_TAG, "Invalid es_set_error_code : %d", es_err_code);
		return ES_ERROR;
	}

	if (set_enrollee_err_code(es_err_code) != OC_STACK_OK) {
		THINGS_LOG_E(ES_ENROLLEE_TAG, "es_set_error_code ES_ERROR");
		return ES_ERROR;
	}

	THINGS_LOG_D(ES_ENROLLEE_TAG, "Set es_error_code_e successfully : %d", es_err_code);
	return ES_OK;
}

es_result_e es_set_cloud_error_code(ci_error_code_e es_err_code)
{
	THINGS_LOG_D(ES_ENROLLEE_TAG, "es_set_cloud_error_code IN");

	es_error_code_e esError = ES_ERRCODE_NO_ERROR;

	if (es_err_code > ERRCI_UNKNOWN) {
		THINGS_LOG_E(ES_ENROLLEE_TAG, "Invalid es_set_cloud_error_code : %d", es_err_code);
		return ES_ERROR;
	}

	esError = ci_errcode_to_es_errcode(es_err_code);

	if (set_cloud_err_code(es_err_code) != OC_STACK_OK) {
		THINGS_LOG_E(ES_ENROLLEE_TAG, "es_set_cloud_error_code ES_ERROR");
		return ES_ERROR;
	}

	THINGS_LOG_D(ES_ENROLLEE_TAG, "Set es_error_code_e successfully : %d", es_err_code);

	es_set_error_code(esError);

	THINGS_LOG_D(ES_ENROLLEE_TAG, "es_set_cloud_error_code OUT");
	return ES_OK;
}

es_result_e es_terminate_enrollee(void)
{
	THINGS_LOG_D(ES_ENROLLEE_TAG, "es_terminate_enrollee IN");

	unregister_resource_event_callback();

	//Delete Prov resource
	if (delete_easysetup_resources() != OC_STACK_OK) {
		THINGS_LOG_E(ES_ENROLLEE_TAG, "Deleting prov resource ES_ERROR!!");
		return ES_ERROR;
	}

	THINGS_LOG_D(ES_ENROLLEE_TAG, "es_terminate_enrollee success");
	return ES_OK;
}


text:
package com.javarush.task.task24.task2413;

public class Canvas {
    private int width;
    private int height;
    private char[][] matrix;

    public Canvas(int width, int height) {
        this.width = width;
        this.height = height;
        this.matrix = new char[height + 2][width + 2];
    }

    public void setPoint(int width, int height, char c) {

    }

    public int getWidth() {
        return width;
    }

    public void setWidth(int width) {
        this.width = width;
    }

    public int getHeight() {
        return height;
    }

    public void setHeight(int height) {
        this.height = height;
    }

    public char[][] getMatrix() {
        return matrix;
    }

    public void setMatrix(char[][] matrix) {
        this.matrix = matrix;
    }
}


text:
An Ember addon for [bootstrap-multiselect](https://github.com/davidstutz/bootstrap-multiselect].

## Installation

* npm install namlook/emberek-multiselect


text:
import { FETCH_INSULT, STORE_INSULT } from '../constants/insultConstants.js';
import { dispatch } from '../dispatcher.js';
import $ from 'jquery'

export function fetchInsult() {

  return function() {

    $.ajax({
      method:"GET",
      url:'insults'
    }).then((insult) => {
      dispatch(storeInsult(insult));
    })
  }
}

export function storeInsult(insult) {
  return {
    type: STORE_INSULT,
    insult
  }
}

// export function sendInsult(insult) {
//
//   return function() {
//
//     $.ajax({
//       method:"POST",
//       url:'insults',
//       data: JSON.stringify({insult}),
//       contentType: "application/json"
//     }).then((insult) => {
//       dispatch(storeInsult(insult));
//     })
//   }
// }


text:
@class NSString, NSURL, NSDictionary, NSURLConnection, NSDate;
@protocol BRMusicStoreImageDecryptionAgent;

__attribute__((visibility("hidden")))
@interface BRImageLoadJob : NSObject {
@private
	NSString *_imageName;	// 4 = 0x4
	NSURL *_url;	// 8 = 0x8
	NSDictionary *_headerFields;	// 12 = 0xc
	NSURLConnection *_connection;	// 16 = 0x10
	NSDate *_requestDate;	// 20 = 0x14
	BOOL _writeImage;	// 24 = 0x18
	id<BRMusicStoreImageDecryptionAgent> _decryptionAgent;	// 28 = 0x1c
}
@property(retain) NSURLConnection *connection;	// G=0x31640cc5; S=0x31640e9d; converted property
@property(readonly, retain) NSDictionary *headerFields;	// G=0x31640cb5; converted property
@property(readonly, retain) NSDate *requestDate;	// G=0x31640cd5; converted property
@property(readonly, retain) NSURL *url;	// G=0x3159f755; converted property
@property(readonly, assign) BOOL writeImage;	// G=0x31640ce5; converted property
- (id)initWithName:(id)name url:(id)url headerFields:(id)fields decryptionAgent:(id)agent writeImage:(BOOL)image;	// 0x31640ed5
// converted property getter: - (id)connection;	// 0x31640cc5
- (void)dealloc;	// 0x3159fe19
- (id)decryptionAgent;	// 0x31640ca5
// converted property getter: - (id)headerFields;	// 0x31640cb5
- (id)name;	// 0x3159f215
// converted property getter: - (id)requestDate;	// 0x31640cd5
// converted property setter: - (void)setConnection:(id)connection;	// 0x31640e9d
// converted property getter: - (id)url;	// 0x3159f755
// converted property getter: - (BOOL)writeImage;	// 0x31640ce5
@end


text:
namespace stellar_dotnet_sdk.responses.effects
{
    /// <summary>
    ///     Represents trustline_updated effect response.
    ///     See: https://www.stellar.org/developers/horizon/reference/resources/effect.html
    ///     <seealso cref="requests.EffectsRequestBuilder" />
    ///     <seealso cref="Server" />
    /// </summary>
    public class TrustlineUpdatedEffectResponse : TrustlineCUDResponse
    {
        public override int TypeId => 22;

        public TrustlineUpdatedEffectResponse()
        {

        }

        /// <inheritdoc />
        public TrustlineUpdatedEffectResponse(string limit, string assetType, string assetCode, string assetIssuer)
            : base(limit, assetType, assetCode, assetIssuer)
        {
        }
    }
}


text:
**PathFinding Original code:**
<http://github.com/juhgiyo/eppathfinding.cs>

**More details:**
Please read our [Manifest](https://github.com/k-aGv/manifest)

***DotNet documentation***
http://www.dotnetframework.org


text:
"""
    `Earth Resources Observation and Science (EROS) Center`_ application services (Raster)

    .. _Earth Resources Observation and Science (EROS) Center: http://nimbus.cr.usgs.gov/app_services.php
"""
from .core import get_available_datasets, get_themes, get_attribute_list, get_available_formats, get_raster, get_raster_availability


text:
class CreateUserStats < ActiveRecord::Migration
  def change
    create_table :user_stats do |t|
      t.belongs_to :user
      t.string :feeling
      t.integer :sleep
      t.integer :calories
      t.integer :exercise

      t.timestamps null: true
    end
  end
end


text:
package com.planet_ink.coffee_mud.Races;
import com.planet_ink.coffee_mud.core.interfaces.*;
import com.planet_ink.coffee_mud.core.*;
import com.planet_ink.coffee_mud.Abilities.interfaces.*;
import com.planet_ink.coffee_mud.Areas.interfaces.*;
import com.planet_ink.coffee_mud.Behaviors.interfaces.*;
import com.planet_ink.coffee_mud.CharClasses.interfaces.*;
import com.planet_ink.coffee_mud.Commands.interfaces.*;
import com.planet_ink.coffee_mud.Common.interfaces.*;
import com.planet_ink.coffee_mud.Exits.interfaces.*;
import com.planet_ink.coffee_mud.Items.interfaces.*;
import com.planet_ink.coffee_mud.Locales.interfaces.*;
import com.planet_ink.coffee_mud.MOBS.interfaces.*;
import com.planet_ink.coffee_mud.Races.interfaces.*;

import java.util.*;

@SuppressWarnings("unchecked")
public class Wolf extends StdRace
{
	public String ID(){	return "Wolf"; }
	public String name(){ return "Wolf"; }
	public int shortestMale(){return 15;}
	public int shortestFemale(){return 15;}
	public int heightVariance(){return 12;}
	public int lightestWeight(){return 10;}
	public int weightVariance(){return 60;}
	public long forbiddenWornBits(){return Integer.MAX_VALUE-Item.WORN_HEAD-Item.WORN_FEET-Item.WORN_NECK-Item.WORN_EARS-Item.WORN_EYES;}
	public String racialCategory(){return "Canine";}

	//                                an ey ea he ne ar ha to le fo no gi mo wa ta wi
	private static final int[] parts={0 ,2 ,2 ,1 ,1 ,0 ,0 ,1 ,4 ,4 ,1 ,0 ,1 ,1 ,1 ,0 };
	public int[] bodyMask(){return parts;}

	private int[] agingChart={0,1,2,4,7,15,20,21,22};
	public int[] getAgingChart(){return agingChart;}

	protected static Vector resources=new Vector();
	public int availabilityCode(){return Area.THEME_FANTASY|Area.THEME_SKILLONLYMASK;}

	public void affectEnvStats(Environmental affected, EnvStats affectableStats)
	{
		super.affectEnvStats(affected,affectableStats);
		affectableStats.setSensesMask(affectableStats.sensesMask()|EnvStats.CAN_SEE_INFRARED);
	}
	public void affectCharStats(MOB affectedMOB, CharStats affectableStats)
	{
		super.affectCharStats(affectedMOB, affectableStats);
		affectableStats.setRacialStat(CharStats.STAT_STRENGTH,10);
		affectableStats.setRacialStat(CharStats.STAT_DEXTERITY,10);
		affectableStats.setRacialStat(CharStats.STAT_INTELLIGENCE,1);
	}
	public void affectCharState(MOB affectedMob, CharState affectableMaxState)
	{
		affectableMaxState.setMovement(affectableMaxState.getMovement()+150);
	}

	public void executeMsg(Environmental myHost, CMMsg msg)
	{
		MOB mob=(MOB)myHost;
		if(msg.amISource(mob)
		&&(!msg.amITarget(mob))
		&&(msg.targetMinor()==CMMsg.TYP_DAMAGE)
		&&(msg.target()!=null)
		&&(msg.target() instanceof MOB)
		&&(mob.fetchWieldedItem()==null)
		&&(msg.tool()!=null)
		&&(msg.tool() instanceof Weapon)
		&&(((Weapon)msg.tool()).weaponClassification()==Weapon.CLASS_NATURAL)
		&&(!((MOB)msg.target()).isMonster())
		&&(CMLib.dice().rollPercentage()==1)
		&&(((msg.value())>(((MOB)msg.target()).maxState().getHitPoints()/20)))
		&&(!CMSecurity.isDisabled("AUTODISEASE")))
		{
			Ability A=CMClass.getAbility("Disease_Lycanthropy");
			if((A!=null)&&(msg.target().fetchEffect(A.ID())==null))
				A.invoke(mob,msg.target(),true,0);
		}
		super.executeMsg(myHost,msg);
	}

	public Weapon myNaturalWeapon()
	{
		if(naturalWeapon==null)
		{
			naturalWeapon=CMClass.getWeapon("StdWeapon");
			naturalWeapon.setName("sharp teeth");
			naturalWeapon.setWeaponType(Weapon.TYPE_PIERCING);
		}
		return naturalWeapon;
	}
	public String healthText(MOB viewer, MOB mob)
	{
		double pct=(CMath.div(mob.curState().getHitPoints(),mob.maxState().getHitPoints()));

		if(pct<.10)
			return "^r" + mob.displayName(viewer) + "^r is hovering on deaths door!^N";
		else
		if(pct<.20)
			return "^r" + mob.displayName(viewer) + "^r is covered in blood and matted hair.^N";
		else
		if(pct<.30)
			return "^r" + mob.displayName(viewer) + "^r is bleeding badly from lots of wounds.^N";
		else
		if(pct<.40)
			return "^y" + mob.displayName(viewer) + "^y has large patches of bloody matted fur.^N";
		else
		if(pct<.50)
			return "^y" + mob.displayName(viewer) + "^y has some bloody matted fur.^N";
		else
		if(pct<.60)
			return "^p" + mob.displayName(viewer) + "^p has a lot of cuts and gashes.^N";
		else
		if(pct<.70)
			return "^p" + mob.displayName(viewer) + "^p has a few cut patches.^N";
		else
		if(pct<.80)
			return "^g" + mob.displayName(viewer) + "^g has a cut patch of fur.^N";
		else
		if(pct<.90)
			return "^g" + mob.displayName(viewer) + "^g has some disheveled fur.^N";
		else
		if(pct<.99)
			return "^g" + mob.displayName(viewer) + "^g has some misplaced hairs.^N";
		else
			return "^c" + mob.displayName(viewer) + "^c is in perfect health.^N";
	}
	public Vector myResources()
	{
		synchronized(resources)
		{
			if(resources.size()==0)
			{
				resources.addElement(makeResource
				("some "+name().toLowerCase()+" claws",RawMaterial.RESOURCE_BONE));
				resources.addElement(makeResource
				("some "+name().toLowerCase()+" hair",RawMaterial.RESOURCE_FUR));
				resources.addElement(makeResource
				("a pound of "+name().toLowerCase()+" meat",RawMaterial.RESOURCE_MEAT));
				resources.addElement(makeResource
				("some "+name().toLowerCase()+" blood",RawMaterial.RESOURCE_BLOOD));
				resources.addElement(makeResource
				("a pile of "+name().toLowerCase()+" bones",RawMaterial.RESOURCE_BONE));
			}
		}
		return resources;
	}
}


text: ${cat.name}


text:
package ru.spbau.svidchenko.asteroids_project.standalone_game_client;

import javafx.animation.AnimationTimer;
import javafx.application.Platform;
import javafx.event.EventHandler;
import javafx.scene.Scene;
import javafx.scene.input.KeyEvent;
import javafx.scene.input.MouseEvent;
import javafx.stage.Stage;
import ru.spbau.svidchenko.asteroids_project.commons.Constants;
import ru.spbau.svidchenko.asteroids_project.game_logic.WorldDescriptor;
import ru.spbau.svidchenko.asteroids_project.game_logic.player.GunnerPlayer;
import ru.spbau.svidchenko.asteroids_project.game_logic.player.PilotPlayer;
import ru.spbau.svidchenko.asteroids_project.game_logic.player.ShipCrew;
import ru.spbau.svidchenko.asteroids_project.graphics_common.GraphicStyleContainer;
import ru.spbau.svidchenko.asteroids_project.standalone_game_client.standalone_app.StandaloneAppGameExecutor;
import ru.spbau.svidchenko.asteroids_project.standalone_game_client.standalone_app.StandaloneClientInterface;

public abstract class CommonGame {
    protected abstract EventHandler<KeyEvent> getOnKeyPressHandler();
    protected abstract EventHandler<KeyEvent> getOnKeyReleaseHandler();
    protected abstract EventHandler<MouseEvent> getOnMouseMovedHandler();
    protected abstract EventHandler<MouseEvent> getOnMouseClickHandler();
    protected abstract Scene initScene();
    protected abstract AnimationTimer buildAnimationTimer();
    protected abstract boolean interrupted();

    protected final PilotPlayer.Action pilotAction = new PilotPlayer.Action();
    protected final GunnerPlayer.Action gunnerAction = new GunnerPlayer.Action();
    protected final Scene scene;
    protected final Stage stage;
    protected ShipCrew currentShipCrew;
    protected GraphicStyleContainer style;

    private ClientMenu menu;
    private AnimationTimer animationTimer;

    protected CommonGame(Stage stage) {
        this.stage = stage;
        scene = initScene();
        initEventHandler();
    }

    public void start(WorldDescriptor descriptor, ClientMenu menu, int pilotId, int gunnerId, GraphicStyleContainer style) {
        this.menu = menu;
        this.style = style;
        animationTimer = buildAnimationTimer();
        currentShipCrew = new ShipCrew(new Pilot(pilotId), new Gunner(gunnerId));
        descriptor.players.add(currentShipCrew);
        new Thread(new StandaloneAppGameExecutor(descriptor, Constants.TURNS_IN_GAME, new Client())).start();
        stage.setScene(scene);
    }

    private void initEventHandler() {
        scene.setOnKeyPressed(getOnKeyPressHandler());
        scene.setOnKeyReleased(getOnKeyReleaseHandler());
        scene.setOnMouseMoved(getOnMouseMovedHandler());
        scene.setOnMouseClicked(getOnMouseClickHandler());
    }

    private class Client implements StandaloneClientInterface {
        @Override
        public void onGameStart() {
            animationTimer.start();
        }

        @Override
        public void onGameEnd() {
            animationTimer.stop();
            Platform.runLater(() -> menu.start());
        }

        @Override
        public boolean isGameInterrupted() {
            return interrupted();
        }
    }

    private class Gunner extends GunnerPlayer {
        public Gunner(long id) {
            super(id);
        }

        @Override
        protected Action chooseAction() {
            return gunnerAction;
        }
    }

    private class Pilot extends PilotPlayer {
        public Pilot(int id) {
            super(id);
        }

        @Override
        protected Action chooseAction() {
            return pilotAction;
        }
    }
}


text:
import Versions from '@/components/versions'
import Viewer from '@/components/viewer'
import Tooltip from '@/components/tooltip'
import Illustration from '@/components/illustration'
import copyToClipboard from 'copy-to-clipboard'

export default
{
    name: 'file',

    components:
    {
        Versions,
        Viewer,
        Tooltip,
        Illustration
    },

    computed:
    {
        serverConfig()
        {
            return this.$store.state.serverConfig
        },

        downloadUrl()
        {
            return `${this.$store.state.serverConfig.domain}/${this.$store.state.projects.current.slug}/files/${this.content.path.full}`
        },

        downloadDataUri()
        {
            if(this.$store.state.files.currentVersion)
            {
                return `data:text/plain;charset=utf-8,${encodeURIComponent(this.$store.state.files.currentVersion.content)}`
            }

            return ''
        },

        isImage()
        {
            return ['jpg', 'jpeg', 'png', 'tiff', 'gif', 'webp'].indexOf(this.content.extension) !== -1
        },

        isCode()
        {
            return this.content.versions.length > 0
        },

        version()
        {
            return this.$store.state.files.currentVersion
        }
    },

    data()
    {
        return {
            differencesActive: true,
            versionsActive: true,
            copied: false
        }
    },

    props:
    {
        content: { type: Object }
    },

    methods:
    {
        onDifferencesClick()
        {
            this.differencesActive = !this.differencesActive
        },

        onVersionsClick()
        {
            this.versionsActive = !this.versionsActive
        },

        onCopyClick()
        {
            copyToClipboard(this.version.content)
            this.copied = true
        },

        onCopyMouseleave()
        {
            this.copied = false
        }
    }
}


text:
namespace LongestSubSequenceOfEqualNumbers
{
    using System;
    using System.Collections.Generic;
    using Common;

    public class Startup
    {
        public static void Main()
        {
            var numbers = ConsoleInput.TakeInput(new List<int>());
            LongestSubSequence((List<int>)numbers);

        }

        private static List<int> LongestSubSequence(List<int> numbers)
        {
            int longestSubSequenceCount = 0;
            int longestSubSequenceNumber = 0;
            var uniqueNumbers = new Dictionary<int, int>();

            for (int i = 0; i < numbers.Count; i++)
            {
                int currentNumber = numbers[i];
                if (uniqueNumbers.ContainsKey(currentNumber))
                {
                    int count = uniqueNumbers[currentNumber] += 1;
                    if (count > longestSubSequenceCount)
                    {
                        longestSubSequenceCount = count;
                        longestSubSequenceNumber = currentNumber;
                    }
                }
            }

            var longestSubSequence = new List<int>();

            for (int i = 0; i < longestSubSequenceCount; i++)
            {
                longestSubSequence.Add(longestSubSequenceNumber);
            }

            return longestSubSequence;
        }
    }
}


text:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>

  <groupId>org.tinyj.lava</groupId>
  <artifactId>lava-api</artifactId>
  <version>0-SNAPSHOT</version>

  <name>TinyJ Lava-API</name>
  <description>Functional interfaces with checked exceptions.</description>
  <url>https://github.com/tinyj/tinyj-lava-api</url>
  <scm>
    <url>https://github.com/tinyj/tinyj-lava-api</url>
  </scm>
  <licenses>
    <license>
      <name>Apache License, Version 2.0</name>
      <url>https://www.apache.org/licenses/LICENSE-2.0.txt</url>
      <distribution>repo</distribution>
    </license>
  </licenses>
  <developers>
    <developer>
      <name>Eric Karge</name>
      <email>e.karge@struction.de</email>
    </developer>
  </developers>

  <properties>
    <maven.compiler.release>9</maven.compiler.release>
    <maven.compiler.source>${maven.compiler.release}</maven.compiler.source>
    <maven.compiler.target>${maven.compiler.release}</maven.compiler.target>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
  </properties>

  <build>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>3.7.0</version>
        <executions>
          <execution>
            <id>base-compile</id>
            <goals>
              <goal>compile</goal>
            </goals>
            <configuration>
              <excludes>
                <exclude>src/main/java/module-info.java</exclude>
                <release>8</release>
              </excludes>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-source-plugin</artifactId>
        <version>3.0.1</version>
        <executions>
          <execution>
            <id>attach-sources</id>
            <goals>
              <goal>jar-no-fork</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-javadoc-plugin</artifactId>
        <version>3.0.0-M1</version>
        <executions>
          <execution>
            <phase>package</phase>
            <goals>
              <goal>jar</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <javadocExecutable>${java.home}/bin/javadoc</javadocExecutable>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-jar-plugin</artifactId>
        <version>3.0.2</version>
        <executions>
          <execution>
            <phase>package</phase>
            <goals>
              <goal>jar</goal>
            </goals>
            <configuration>
              <classifier>doc</classifier>
              <classesDirectory>${project.basedir}</classesDirectory>
              <includes>
                <include>LICENSE.md</include>
                <include>README.md</include>
                <include>APIdoc.md</include>
              </includes>
            </configuration>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>

  <dependencies>
    <dependency>
      <groupId>org.mockito</groupId>
      <artifactId>mockito-core</artifactId>
      <version>2.12.0</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.testng</groupId>
      <artifactId>testng</artifactId>
      <version>6.11</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.assertj</groupId>
      <artifactId>assertj-core</artifactId>
      <version>3.8.0</version>
      <scope>test</scope>
    </dependency>
  </dependencies>

  <profiles>
    <profile>
      <id>sonatype</id>
      <build>
        <plugins>
          <plugin>
            <groupId>org.sonatype.plugins</groupId>
            <artifactId>nexus-staging-maven-plugin</artifactId>
            <version>1.6.8</version>
            <extensions>true</extensions>
            <configuration>
              <serverId>ossrh</serverId>
              <nexusUrl>https://oss.sonatype.org/</nexusUrl>
              <autoReleaseAfterClose>true</autoReleaseAfterClose>
            </configuration>
          </plugin>
        </plugins>
      </build>
      <distributionManagement>
        <snapshotRepository>
          <id>ossrh</id>
          <url>https://oss.sonatype.org/content/repositories/snapshots</url>
        </snapshotRepository>
      </distributionManagement>
    </profile>
    <profile>
      <id>sign</id>
      <activation>
        <property>
          <name>profile.sign</name>
          <value>true</value>
        </property>
      </activation>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-gpg-plugin</artifactId>
            <version>1.6</version>
            <executions>
              <execution>
                <id>sign-artifacts</id>
                <phase>verify</phase>
                <goals>
                  <goal>sign</goal>
                </goals>
              </execution>
            </executions>
            <configuration>
              <gpgArguments>
                <argument>--pinentry-mode</argument>
                <argument>loopback</argument>
              </gpgArguments>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>
</project>


text:
package uk.ac.susx.tag.classificationframework.featureextraction.documentprocessing;

import com.google.common.base.Joiner;
import com.google.common.collect.Lists;
import edu.stanford.nlp.ling.CoreAnnotations;
import edu.stanford.nlp.ling.CoreLabel;
import edu.stanford.nlp.pipeline.Annotation;
import edu.stanford.nlp.pipeline.StanfordCoreNLP;
import edu.stanford.nlp.util.CoreMap;
import uk.ac.susx.tag.classificationframework.datastructures.AnnotatedToken;
import uk.ac.susx.tag.classificationframework.datastructures.Document;

import java.io.ObjectInputStream;
import java.util.List;
import java.util.Properties;

/**
 * Created with IntelliJ IDEA.
 * User: Andrew D. Robertson
 * Date: 10/02/2015
 * Time: 16:32
 */
public class StanfordNERPipeline extends DocProcessor {

    private transient StanfordCoreNLP pipeline;

    public StanfordNERPipeline(){
        loadPipeline();
    }

    @Override
    public Document process(Document document) {
        String originalText = document.source.text;
        if (!originalText.trim().isEmpty()) {
            document.clear(); // Overwrite any current tokenisation
            Annotation toBeAnnotated = new Annotation(originalText);
            pipeline.annotate(toBeAnnotated);

            List<CoreMap> sentences = toBeAnnotated.get(CoreAnnotations.SentencesAnnotation.class);
            for(CoreMap sentence: sentences) {
                for (CoreLabel token: sentence.get(CoreAnnotations.TokensAnnotation.class)) {
                    String word = token.get(CoreAnnotations.TextAnnotation.class);
                    String pos = token.get(CoreAnnotations.PartOfSpeechAnnotation.class);
                    String ne = token.get(CoreAnnotations.NamedEntityTagAnnotation.class);
                    int start = token.get(CoreAnnotations.BeginIndexAnnotation.class);
                    int end = token.get(CoreAnnotations.EndIndexAnnotation.class);

                    AnnotatedToken t = new AnnotatedToken(word);
                    t.start(start);
                    t.end(end);
                    t.put("pos", pos);
                    t.put("NERTag", ne);
                    document.add(t);
                }
            }
        }
        return document;
    }

    @Override
    public String configuration() {
        return "";
    }

    public void loadPipeline(){
        Properties props = new Properties();
        props.setProperty("annotators", "tokenize, ssplit, pos, lemma, ner");
        pipeline = new StanfordCoreNLP(props);
    }

    private void readObject(ObjectInputStream in) throws Exception {
        in.defaultReadObject();
        loadPipeline();
    }

    @Override
    public boolean isThreadSafe() {
        return true;
    }
}


text:
"""
Decorators and context managers for NVIDIA Tools Extension to profile MONAI components
"""

from collections import defaultdict
from functools import wraps
from typing import Any, Optional, Tuple, Union

from torch.autograd import Function
from torch.nn import Module
from torch.optim import Optimizer
from torch.utils.data import Dataset

from monai.utils import ensure_tuple, optional_import

_nvtx, _ = optional_import("torch._C._nvtx", descriptor="NVTX is not installed. Are you sure you have a CUDA build?")

__all__ = ["Range"]

class Range:
    """
    A decorator and context manager for NVIDIA Tools Extension (NVTX) Range for profiling.
    When used as a decorator it encloses a specific method of the object with an NVTX Range.
    When used as a context manager, it encloses the runtime context (created by with statement) with an NVTX Range.

    Args:
        name: the name to be associated to the range
        methods: (only when used as decorator) the name of a method (or a list of the name of the methods)
            to be wrapped by NVTX range.
            If None (default), the method(s) will be inferred based on the object's type for various MONAI components,
            such as Networks, Losses, Functions, Transforms, and Datasets.
            Otherwise, it look up predefined methods: "forward", "__call__", "__next__", "__getitem__"
        append_method_name: if append the name of the methods to be decorated to the range's name
            If None (default), it appends the method's name only if we are annotating more than one method.
        recursive: if set to True, it will recursively annotate every individual module in a list
            or in a chain of modules (chained using Compose). Default to False.

    """

    name_counter: dict = defaultdict(int)

    def __init__(
        self,
        name: Optional[str] = None,
        methods: Optional[Union[str, Tuple[str, ...]]] = None,
        append_method_name: Optional[bool] = None,
        recursive: bool = False,
    ) -> None:
        self.name = name
        self.methods = methods
        self.append_method_name = append_method_name
        self.recursive = recursive

    def __call__(self, obj: Any):
        if self.recursive is True:
            if isinstance(obj, (list, tuple)):
                return type(obj)(Range(recursive=True)(t) for t in obj)

            from monai.transforms.compose import Compose

            if isinstance(obj, Compose):
                obj.transforms = Range(recursive=True)(obj.transforms)

            self.recursive = False

        # Define the name to be associated to the range if not provided
        if self.name is None:
            name = type(obj).__name__
            # If CuCIM or TorchVision transform wrappers are being used,
            # append the underlying transform to the name for more clarity
            if "CuCIM" in name or "TorchVision" in name:
                name = f"{name}_{obj.name}"
            self.name_counter[name] += 1
            if self.name_counter[name] > 1:
                self.name = f"{name}_{self.name_counter[name]}"
            else:
                self.name = name

        # Define the methods to be wrapped if not provided
        if self.methods is None:
            self.methods = self._get_method(obj)
        else:
            self.methods = ensure_tuple(self.methods)

        # Check if to append method's name to the range's name
        if self.append_method_name is None:
            if len(self.methods) > 1:
                self.append_method_name = True
            else:
                self.append_method_name = False

        # Decorate the methods
        for method in self.methods:
            self._decorate_method(obj, method, self.append_method_name)

        return obj

    def _decorate_method(self, obj, method, append_method_name):
        # Append the method's name to the range's name
        if append_method_name:
            name = f"{self.name}.{method}"
        else:
            name = self.name

        # Get the class for special functions
        if method.startswith("__"):
            owner = type(obj)
        else:
            owner = obj

        # Get the method to be wrapped
        _temp_func = getattr(owner, method)

        # Wrap the method with NVTX range (range push/pop)
        @wraps(_temp_func)
        def range_wrapper(*args, **kwargs):
            _nvtx.rangePushA(name)
            output = _temp_func(*args, **kwargs)
            _nvtx.rangePop()
            return output

        # Replace the method with the wrapped version
        if method.startswith("__"):
            # If it is a special method, it requires special attention
            class NVTXRangeDecoratedClass(owner):
                ...

            setattr(NVTXRangeDecoratedClass, method, range_wrapper)
            obj.__class__ = NVTXRangeDecoratedClass

        else:
            setattr(owner, method, range_wrapper)

    def _get_method(self, obj: Any) -> tuple:
        if isinstance(obj, Module):
            method_list = ["forward"]
        elif isinstance(obj, Optimizer):
            method_list = ["step"]
        elif isinstance(obj, Function):
            method_list = ["forward", "backward"]
        elif isinstance(obj, Dataset):
            method_list = ["__getitem__"]
        else:
            default_methods = ["forward", "__call__", "__next__", "__getitem__"]
            method_list = []
            for method in default_methods:
                if hasattr(obj, method):
                    method_list.append(method)
            if len(method_list) < 1:
                raise ValueError(
                    f"The method to be wrapped for this object [{type(obj)}] is not recognized."
                    "The name of the method should be provided or the object should have one of these methods:"
                    f"{default_methods}"
                )
        return ensure_tuple(method_list)

    def __enter__(self):
        if self.name is None:
            # Number the range with class variable counter to avoid duplicate names.
            self.name_counter["context"] += 1
            self.name = f"context_{self.name_counter['context']}"

        _nvtx.rangePushA(self.name)

    def __exit__(self, type, value, traceback):
        _nvtx.rangePop()


text:
import "../polymer/polymer-legacy.js";
import './iron-doc-viewer-styles.js';
import { Polymer } from "../polymer/lib/legacy/polymer-fn.js";
import { html } from "../polymer/lib/utils/html-tag.js";
Polymer({
  _template: html`

[[title]]

`,
  is: 'iron-doc-demo',
  properties: {
    demo: Object,
    srcPrefix: {
      type: String,
      value: ''
    },
    title: {
      computed: '_computeTitle(demo)',
      notify: true
    }
  },
  _computeTitle: function (demo) {
    return 'Demo ' + (demo.description || demo.url);
  }
});


text:
#region License
//
// The Open Toolkit Library License
//
// Copyright (c) 2006 - 2009 the Open Toolkit library.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights to
// use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
// the Software, and to permit persons to whom the Software is furnished to do
// so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all
// copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
// OTHER DEALINGS IN THE SOFTWARE.
//
#endregion

using System;
using System.Collections.Generic;
using System.Text;

namespace OpenTK.Input
{
    /// <summary>
    /// Defines the event data for <see cref="KeyboardDevice"/> events.
    /// </summary>
    /// <remarks>
    /// <para>
    /// Do not cache instances of this type outside their event handler.
    /// If necessary, you can clone a KeyboardEventArgs instance using the
    /// <see cref="KeyboardKeyEventArgs(KeyboardKeyEventArgs)"/> constructor.
    /// </para>
    /// </remarks>
    public class KeyboardKeyEventArgs : EventArgs
    {
        #region Fields

        Key key;

        #endregion

        #region Constructors

        /// <summary>
        /// Constructs a new KeyboardEventArgs instance.
        /// </summary>
        public KeyboardKeyEventArgs() { }

        /// <summary>
        /// Constructs a new KeyboardEventArgs instance.
        /// </summary>
        /// <param name="args">An existing KeyboardEventArgs instance to clone.</param>
        public KeyboardKeyEventArgs(KeyboardKeyEventArgs args)
        {
            Key = args.Key;
        }

        #endregion

        #region Public Members

        /// <summary>
        /// Gets the <see cref="Key"/> that generated this event.
        /// </summary>
        public Key Key
        {
            get { return key; }
            internal set { key = value; }
        }

        #endregion
    }
}


text:
Loads a JSON from a string input, and returns a JSON object result.

## Script Data

---

| **Name** | **Description** |
| --- | --- |
| Script Type | python3 |
| Tags | Utility |

## Inputs
---

| **Argument Name** | **Description** |
| --- | --- |
| input | The input string to transform to a JSON object. |

## Outputs
---

| **Path** | **Description** | **Type** |
| --- | --- | --- |
| JsonObject | The JSON object loaded from the input. | Unknown |


text:
package com.qiuqp.mybill.ui;

import java.util.ArrayList;
import java.util.List;

import com.qiuqp.mybill.AppContext;
import com.qiuqp.mybill.R;
import com.qiuqp.mybill.adapter.ViewPagerAdapter;

import android.app.Activity;
import android.os.Bundle;
import android.support.v4.view.ViewPager;
import android.support.v4.view.ViewPager.OnPageChangeListener;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.ImageView;
import android.widget.LinearLayout;

public class GuideActivity extends Activity implements OnPageChangeListener  {
	    private AppContext appContext;
	    private ViewPager vp;
	    private ViewPagerAdapter vpAdapter;
	    private List<View> views;

	    // 底部小点图片
	    private ImageView[] dots;

	    // 记录当前选中位置
	    private int currentIndex;

	    @Override
	    protected void onCreate(Bundle savedInstanceState) {
	        super.onCreate(savedInstanceState);
	        setContentView(R.layout.guide);
	        appContext = (AppContext) getApplication();
	        // 初始化页面
	        initViews();

	        // 初始化底部小点
	        initDots();
	    }

	    private void initViews() {
	        LayoutInflater inflater = LayoutInflater.from(this);

	        views = new ArrayList<View>();
	        // 初始化引导图片列表
	        views.add(inflater.inflate(R.layout.what_new_one, null));
	        views.add(inflater.inflate(R.layout.what_new_two, null));
	        views.add(inflater.inflate(R.layout.what_new_three, null));
	        //views.add(inflater.inflate(R.layout.what_new_four, null));

	        // 初始化Adapter
	        vpAdapter = new ViewPagerAdapter(views,this,appContext);

	        vp = (ViewPager) findViewById(R.id.viewpager);
	        vp.setAdapter(vpAdapter);
	        // 绑定回调
	        vp.setOnPageChangeListener(this);
	    }

	    private void initDots() {
	        LinearLayout ll = (LinearLayout) findViewById(R.id.linearguid);

	        dots = new ImageView[views.size()];

	        // 循环取得小点图片
	        for (int i = 0; i < views.size(); i++) {
	            dots[i] = (ImageView) ll.getChildAt(i);
	            dots[i].setEnabled(true);// 都设为灰色
	        }

	        currentIndex = 0;
	        dots[currentIndex].setEnabled(false);// 设置为白色,即选中状态
	    }

	    private void setCurrentDot(int position) {
	        if (position < 0 || position > views.size() - 1
	                || currentIndex == position) {
	            return;
	        }

	        dots[position].setEnabled(false);
	        dots[currentIndex].setEnabled(true);

	        currentIndex = position;
	    }

	    // 当滑动状态改变时调用
	    @Override
	    public void onPageScrollStateChanged(int arg0) {
	    }

	    // 当当前页面被滑动时调用
	    @Override
	    public void onPageScrolled(int arg0, float arg1, int arg2) {
	    }

	    // 当新的页面被选中时调用
	    @Override
	    public void onPageSelected(int arg0) {
	        // 设置底部小点选中状态
	        setCurrentDot(arg0);
	    }
}


text:
module Fog
  module Compute
    class Google
      class Mock
        def get_firewall(_firewall_name)
          # :no-coverage:
          Fog::Mock.not_implemented
          # :no-coverage:
        end
      end

      class Real
        def get_firewall(firewall_name)
          @compute.get_firewall(@project, firewall_name)
        end
      end
    end
  end
end


text:
<?php
use UfoCms\FrontController\Controller\AppDev;
umask(0000);
define("__WEB_DIR__", __DIR__ . '/');
define("__ROOT_DIR__", __DIR__ . '/../');
/**
 * @var Composer\Autoload\ClassLoader $loader
 */
$loader = require __DIR__.'/../app/autoload.php';
$frontController = AppDev::init(); // init dev front controller
$frontController->getConfig()
    ->addAllowedIP('127.0.0.1') // ip for access to dev environment from localhost
    ->addAllowedIP('172.22.0.1') // ip for access to dev environment from docker
    ->setAccessToken('tapgerine.tz') // debug key for save in cookie
;
$frontController->handleRequest();


text:
ruby_block 'PhyML Directories' do
	block do
		::Dir.mkdir 'C:\Program Files (x86)\ATGC' unless ::Dir.exists? 'C:\Program Files (x86)\ATGC'
		::Dir.mkdir 'C:\Program Files (x86)\ATGC\PhyML' unless ::Dir.exists? 'C:\Program Files (x86)\ATGC\PhyML'
		::Dir.mkdir 'C:\ProgramData\Microsoft\Windows\Start Menu\Programs\ATGC' unless ::Dir.exists? 'C:\ProgramData\Microsoft\Windows\Start Menu\Programs\ATGC'
		::Dir.mkdir 'C:\ProgramData\Microsoft\Windows\Start Menu\Programs\ATGC\PhyML' unless ::Dir.exists? 'C:\ProgramData\Microsoft\Windows\Start Menu\Programs\ATGC\PhyML'
	end
end

remote_file "ATGC PhyML" do
  source 'http://ims-chef.wesleyan.edu/windows/atgc_phyml/PhyML-3.1_win32.exe'
  path 'C:\Program Files (x86)\ATGC\PhyML\PhyML-3.1_win32.exe'
  checksum '941c1f84288ff894337d44c30a971024d2a6765267409167fa0efe9250ae5431'
  backup false
end

remote_file "ATGC PhyML (Start Script)" do
  source 'http://ims-chef.wesleyan.edu/windows/atgc_phyml/phyml.bat'
  path 'C:\Program Files (x86)\ATGC\PhyML\phyml.bat'
  checksum '06340d26bb571dc03a7f015716c7530228b819dcf41708ac79267784443d4528'
  backup false
end

windows_shortcut "Add PhyML to Start Menu" do
	name 'C:\ProgramData\Microsoft\Windows\Start Menu\Programs\ATGC\PhyML\PhyML.lnk'
	description "Launches PhyML"
	cwd 'C:\Program Files (x86)\ATGC\PhyML\\'
	target 'C:\Program Files (x86)\ATGC\PhyML\phyml.bat'
end


text:
import http_lazy_headers as hlh

from . import utils

class TETest(utils.FieldTestCase):

    field = hlh.TE

    def test_raw_values(self):
        self.assertFieldRawEqual(
            ['gzip, deflate;q=0.5', 'compress'],
            ((hlh.Encodings.gzip, hlh.ParamsCI()),
             (hlh.Encodings.compress, hlh.ParamsCI()),
             (hlh.Encodings.deflate, hlh.ParamsCI([
                 (hlh.Attributes.q, 0.5)]))))

        self.assertFieldRawEqual(
            ['GziP'],
            ((hlh.Encodings.gzip, hlh.ParamsCI()),))

        self.assertFieldRawEqual(
            ['foo'],
            (('foo', hlh.ParamsCI()),))

        self.assertFieldRawEqual(
            ['trailers'],
            (('trailers', hlh.ParamsCI()),))

        # Transfer-extension (not "trailers")
        self.assertFieldRawEqual(
            ['trailers;q=1'],
            (('trailers', hlh.ParamsCI([
                (hlh.Attributes.q, 1)])),))

    def test_str(self):
        self.assertFieldStrEqual(
            ((hlh.Encodings.gzip, hlh.ParamsCI()),
             (hlh.Encodings.compress, hlh.ParamsCI([
                 (hlh.Attributes.q, 1)])),
             (hlh.Encodings.deflate, hlh.ParamsCI([
                 (hlh.Attributes.q, 0.5)]))),
            'te: gzip, compress; q=1, deflate; q=0.5')

        self.assertFieldStrEqual(
            (('trailers', hlh.ParamsCI()),),
            'te: trailers')

        # Transfer-extension (not "trailers")
        self.assertFieldStrEqual(
            (('trailers', hlh.ParamsCI([
                (hlh.Attributes.q, 1)])),),
            'te: trailers; q=1')

    def test_raw_empty(self):
        """
        Should allow empty raw value
        """
        self.assertFieldRawEqual(
            [''],
            ())

    def test_empty(self):
        """
        Should allow empty value
        """
        self.assertFieldStrEqual(
            (),
            'te: ')

    def test_raw_bad_values(self):
        """
        Should not allow bad raw values
        """
        self.assertRawOK(['gzip'])
        self.assertRaisesHeaderError(['=^'])
        self.assertRaisesHeaderError(['gzip;'])
        self.assertRaisesHeaderError(['gzip;q='])

    def test_bad_values(self):
        """
        Should not allow bad values
        """
        good_te = ('gzip', hlh.ParamsCI())
        self.assertOK([good_te])
        self.assertRaisesInternalError([1])
        self.assertRaisesInternalError([None])
        self.assertRaisesInternalError(['foo'])
        self.assertRaisesInternalError([(1, hlh.ParamsCI())])
        self.assertRaisesInternalError([(None, hlh.ParamsCI())])
        self.assertRaisesInternalError([('', hlh.ParamsCI())])
        self.assertRaisesInternalError([('gzip', None)])


text:
import {
    ChangeDetectionStrategy,
    ChangeDetectorRef,
    Component,
    Input,
    ViewChild,
    ViewEncapsulation
} from "@angular/core";
import {
    CommandFactory,
    ICommand,
    Library,
    Oas20PathItem,
    Oas30PathItem,
    OasDocument,
    OasParameter,
    OasPathItem,
    OasPaths,
    SimplifiedParameterType
} from "apicurio-data-models";
import {SourceFormComponent} from "./source-form.base";
import {ClonePathDialogComponent} from "../dialogs/clone-path.component";
import {AddPathDialogComponent} from "../dialogs/add-path.component";
import {RenamePathDialogComponent} from "../dialogs/rename-path.component";
import {SelectionService} from "../../_services/selection.service";
import {CommandService} from "../../_services/command.service";
import {DocumentService} from "../../_services/document.service";
import {EditorsService} from "../../_services/editors.service";
// import {SectionComponent} from "./shared/section.component";
import {AbstractBaseComponent} from "../common/base-component";

@Component({
    selector: "path-form",
    templateUrl: "path-form.component.html",
    styleUrls: [ "path-form.component.css" ],
    encapsulation: ViewEncapsulation.None,
    changeDetection: ChangeDetectionStrategy.OnPush
})
export class PathFormComponent extends SourceFormComponent<OasPathItem> {

    protected _path: OasPathItem;
    @Input()
    set path(path: OasPathItem) {
        this._path = path;
        this.sourceNode = path;
        this.revertSource();
    }
    get path(): OasPathItem {
        return this._path;
    }

    @ViewChild("clonePathDialog", { static: true }) clonePathDialog: ClonePathDialogComponent;
    @ViewChild("addPathDialog", { static: true }) addPathDialog: AddPathDialogComponent;
    @ViewChild("renamePathDialog", { static: true }) renamePathDialog: RenamePathDialogComponent;

    public constructor(protected changeDetectorRef: ChangeDetectorRef,
                       protected selectionService: SelectionService,
                       protected commandService: CommandService,
                       protected documentService: DocumentService,
                       private editors: EditorsService) {
        super(changeDetectorRef, selectionService, commandService, documentService);
    }

    protected createEmptyNodeForSource(): OasPathItem {
        return (<OasPaths>this.path.parent()).createPathItem(this.path.getPath());
    }

    protected createReplaceNodeCommand(node: OasPathItem): ICommand {
        return CommandFactory.createReplacePathItemCommand(this.path, node);
    }

    public document(): OasDocument {
        return <OasDocument>this.path.ownerDocument();
    }

    public is3xDocument(): boolean {
        return (<OasDocument>this.path.ownerDocument()).is3xDocument();
    }

    public delete(): void {
        let command: ICommand = CommandFactory.createDeletePathCommand(this.path.getPath());
        this.commandService.emit(command);
    }

    public newPath(): void {
        this.addPathDialog.open(<OasDocument>this.path.ownerDocument(), this.path.getPath());
    }

    public addPath(path: string): void {
        let command: ICommand = CommandFactory.createNewPathCommand(path);
        this.commandService.emit(command);
        let nodePath = Library.createNodePath(this.path.ownerDocument());
        nodePath.appendSegment("paths", false);
        nodePath.appendSegment(path, true);
        this.selectionService.select(nodePath.toString());
    }

    public clone(modalData?: any): void {
        if (undefined === modalData || modalData === null) {
            this.clonePathDialog.open(<OasDocument>this.path.ownerDocument(), this.path);
        } else {
            let pathItem: OasPathItem = modalData.object;
            console.info("[PathFormComponent] Clone path item: %s", modalData.path);
            let cloneSrcObj: any = Library.writeNode(pathItem);
            let command: ICommand = CommandFactory.createAddPathItemCommand(modalData.path, cloneSrcObj);
            this.commandService.emit(command);
            let nodePath = Library.createNodePath(this.path.ownerDocument());
            nodePath.appendSegment("paths", false);
            nodePath.appendSegment(modalData.path, true);
            this.selectionService.select(nodePath.toString());
        }
    }

    public rename(modalData?: any): void {
        if (undefined === modalData || modalData === null) {
            this.renamePathDialog.open(<OasDocument>this.path.ownerDocument(), this.path as Oas20PathItem | Oas30PathItem);
        } else {
            let path: OasPathItem = modalData.path;
            console.info("[PathFormComponent] Rename path item: %s", modalData.path);
            let oldName: string = path.getPath();
            console.info("[PathFormComponent] Rename definition to: %s", modalData.name);
            let command: ICommand = CommandFactory.createRenamePathItemCommand(oldName, modalData.name, modalData.renameSubpaths);
            this.commandService.emit(command);
        }
    }

    public hasParameters(type: string): boolean {
        if (!this.path.parameters) {
            return false;
        }
        return this.path.parameters.filter((value) => {
                return value.in === type;
            }).length > 0;
    }

    public parameters(paramType: string): OasParameter[] {
        if (!this.path.parameters) {
            return [];
        }
        let params: OasParameter[] = this.path.parameters;
        return params.filter( value => {
            return value.in === paramType;
        }).sort((param1, param2) => {
            return param1.name.localeCompare(param2.name);
        });
    }

    public changeParamDescription(param: OasParameter, newParamDescription: string): void {
        let command: ICommand = CommandFactory.createChangePropertyCommand<string>(param, "description", newParamDescription);
        this.commandService.emit(command);
    }

    public changeParamType(param: OasParameter, newType: SimplifiedParameterType): void {
        let command: ICommand = CommandFactory.createChangeParameterTypeCommand(this.path.ownerDocument().getDocumentType(),
            param as any, newType);
        this.commandService.emit(command);
    }

    public deleteParam(parameter: OasParameter): void {
        let command: ICommand = CommandFactory.createDeleteParameterCommand(parameter);
        this.commandService.emit(command);
    }

    public enableSourceMode(): void {
        this.sourceNode = this.path;
        super.enableSourceMode();
    }

}


text:
package org.apache.geode.cache.query.internal.aggregate;

import org.apache.geode.cache.query.QueryService;

/**
 * Computes the sum for replicated & PR based queries.
 *
 *
 */
public class Sum extends AbstractAggregator {

  private double result = 0;

  @Override
  public void accumulate(Object value) {
    if (value != null && value != QueryService.UNDEFINED) {
      Number number = (Number) value;
      result += number.doubleValue();
    }
  }

  @Override
  public void init() {

  }

  @Override
  public Object terminate() {
    return downCast(result);
  }
}


text:
namespace WebMConverter
{
    partial class ConverterForm
    {
        /// <summary>
        /// Required designer variable.
        /// </summary>
        private System.ComponentModel.IContainer components = null;

        /// <summary>
        /// Clean up any resources being used.
        /// </summary>
        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
        protected override void Dispose(bool disposing)
        {
            if (disposing && (components != null))
            {
                components.Dispose();
            }
            base.Dispose(disposing);
        }

        #region Windows Form Designer generated code

        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
            this.textBoxOutput = new System.Windows.Forms.RichTextBox();
            this.buttonCancel = new System.Windows.Forms.Button();
            this.pictureBox = new System.Windows.Forms.PictureBox();
            this.buttonPlay = new System.Windows.Forms.Button();
            this.tableLayoutPanel1.SuspendLayout();
            ((System.ComponentModel.ISupportInitialize)(this.pictureBox)).BeginInit();
            this.SuspendLayout();
            //
            // tableLayoutPanel1
            //
            this.tableLayoutPanel1.ColumnCount = 3;
            this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 31F));
            this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50F));
            this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50F));
            this.tableLayoutPanel1.Controls.Add(this.buttonPlay, 1, 1);
            this.tableLayoutPanel1.Controls.Add(this.textBoxOutput, 0, 0);
            this.tableLayoutPanel1.Controls.Add(this.buttonCancel, 2, 1);
            this.tableLayoutPanel1.Controls.Add(this.pictureBox, 0, 1);
            this.tableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
            this.tableLayoutPanel1.Location = new System.Drawing.Point(3, 3);
            this.tableLayoutPanel1.Name = "tableLayoutPanel1";
            this.tableLayoutPanel1.RowCount = 2;
            this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
            this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 31F));
            this.tableLayoutPanel1.Size = new System.Drawing.Size(678, 435);
            this.tableLayoutPanel1.TabIndex = 0;
            //
            // textBoxOutput
            //
            this.textBoxOutput.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
            this.tableLayoutPanel1.SetColumnSpan(this.textBoxOutput, 3);
            this.textBoxOutput.Dock = System.Windows.Forms.DockStyle.Fill;
            this.textBoxOutput.Font = new System.Drawing.Font("Consolas", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.textBoxOutput.Location = new System.Drawing.Point(3, 3);
            this.textBoxOutput.Name = "textBoxOutput";
            this.textBoxOutput.ReadOnly = true;
            this.textBoxOutput.Size = new System.Drawing.Size(672, 398);
            this.textBoxOutput.TabIndex = 2;
            this.textBoxOutput.Text = "";
            //
            // buttonCancel
            //
            this.buttonCancel.Dock = System.Windows.Forms.DockStyle.Fill;
            this.buttonCancel.Location = new System.Drawing.Point(357, 407);
            this.buttonCancel.Name = "buttonCancel";
            this.buttonCancel.Size = new System.Drawing.Size(318, 25);
            this.buttonCancel.TabIndex = 3;
            this.buttonCancel.Text = "Cancel";
            this.buttonCancel.UseVisualStyleBackColor = true;
            this.buttonCancel.Click += new System.EventHandler(this.buttonCancel_Click);
            //
            // pictureBox
            //
            this.pictureBox.BackColor = System.Drawing.SystemColors.Control;
            this.pictureBox.BackgroundImage = global::WebMConverter.Properties.Resources.clock;
            this.pictureBox.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Center;
            this.pictureBox.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
            this.pictureBox.Dock = System.Windows.Forms.DockStyle.Fill;
            this.pictureBox.Location = new System.Drawing.Point(3, 407);
            this.pictureBox.Name = "pictureBox";
            this.pictureBox.Size = new System.Drawing.Size(25, 25);
            this.pictureBox.TabIndex = 4;
            this.pictureBox.TabStop = false;
            //
            // buttonPlay
            //
            this.buttonPlay.Dock = System.Windows.Forms.DockStyle.Fill;
            this.buttonPlay.Enabled = false;
            this.buttonPlay.Location = new System.Drawing.Point(34, 407);
            this.buttonPlay.Name = "buttonPlay";
            this.buttonPlay.Size = new System.Drawing.Size(317, 25);
            this.buttonPlay.TabIndex = 5;
            this.buttonPlay.Text = "Play result";
            this.buttonPlay.UseVisualStyleBackColor = true;
            this.buttonPlay.Click += new System.EventHandler(this.buttonPlay_Click);
            //
            // ConverterForm
            //
            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.ClientSize = new System.Drawing.Size(684, 441);
            this.ControlBox = false;
            this.Controls.Add(this.tableLayoutPanel1);
            this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.SizableToolWindow;
            this.Name = "ConverterForm";
            this.Padding = new System.Windows.Forms.Padding(3);
            this.Text = "Conversion Progress";
            this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.ConverterForm_FormClosing);
            this.FormClosed += new System.Windows.Forms.FormClosedEventHandler(this.ConverterForm_FormClosed);
            this.Load += new System.EventHandler(this.ConverterForm_Load);
            this.tableLayoutPanel1.ResumeLayout(false);
            ((System.ComponentModel.ISupportInitialize)(this.pictureBox)).EndInit();
            this.ResumeLayout(false);

        }

        #endregion

        private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1;
        private System.Windows.Forms.RichTextBox textBoxOutput;
        private System.Windows.Forms.Button buttonCancel;
        private System.Windows.Forms.PictureBox pictureBox;
        private System.Windows.Forms.Button buttonPlay;

    }
}


text:
@echo off
call qt-path.bat
call qtvars.bat
echo PATH
mkdir build
cd build
qmake -spec win32-g++ ../cppn-x.pro
call make release
cd ..


text:
C++ Networking Library using Boost ASIO.

### Notes
This is my first public repository. I would love for other people to get involved to help me improve my code. Additionally, any tips related to licensing, donations, or properly crediting resources that I have used would be helpful!

### Donations
* [@JohnFedorchak](https://github.com/JohnFedorchak):

### Licensing
KryNet is released under the [Apache License](http://www.apache.org/licenses/LICENSE-2.0).


text:
[![Build Status](https://travis-ci.org/puppetlabs/puppetlabs-hocon.png?branch=master)](https://travis-ci.org/puppetlabs/puppetlabs-hocon)

#HOCON file

####Table of Contents

1. [Overview](#overview)
2. [Module Description - What the module does and why it is useful](#module-description)
3. [Setup - The basics of getting started with the hocon module](#setup)
    * [Setup requirements](#setup-requirements)
    * [Beginning with hocon](#beginning-with-hocon)
4. [Usage - Configuration options and additional functionality](#usage)
5. [Reference - An under-the-hood peek at what the module is doing and how](#reference)
6. [Development - Guide for contributing to the module](#development)

##Overview

This module adds resource types to manage settings in HOCON-style configuration files.

##Module Description

The hocon module adds a resource type so that you can use Puppet to manage settings in HOCON configuration files.

##Setup

##Beginning with hocon

To manage a HOCON file, add the resource type `hocon_setting` to a class.

##Usage

Manage individual settings in HOCON files by adding the `hocon_setting` resource type to a class. For example:

```
hocon_setting { "sample setting":
  ensure  => present,
  path    => '/tmp/foo.conf',
  setting => 'foosetting',
  value   => 'FOO!',
}
```

To control a setting nested within a map contained at another setting, provide the path to that setting
under the "setting" parameter, with each level separated by a ".". So to manage `barsetting` in the following map

```
foo : {
    bar : {
        barsetting : "FOO!"
    }
}
```

You would put the following in your manifest:

```
hocon_setting {'sample nested setting':
  ensure  => present,
  path => '/tmp/foo.conf',
  setting => 'foo.bar.barsetting',
  value   => 'BAR!',
}
```

You can also set maps like so:

```
hocon_setting { 'sample map setting':
  ensure => present,
  path => '/tmp/foo.conf',
  setting => 'hash_setting',
  value => { 'a' => 'b' },
}
```

##Reference

###Type: hocon_setting

#### Parameters

* `ensure`: Ensures that the resource is present. Valid values are 'present', 'absent'.

* `name`: An arbitrary name used as the identity of the resource.

* `path`: The HOCON file in which Puppet will ensure the specified setting.

* `provider`: The specific backend to use for this `hocon_setting` resource. You will seldom need to specify this --- Puppet will usually discover the appropriate provider for your platform. The only available provider for `hocon_setting` is ruby.

* `setting`: The name of the HOCON file setting to be defined. This can be a top-level setting or a setting nested
  within another setting. To define a nested setting, give the full path to that setting with each level separated
  by a `.` So, to define a setting `foosetting` nested within a setting called `foo` contained on the top level,
  the `setting` parameter would be set to `foo.foosetting`.

* `value`: The value of the HOCON file setting to be defined.

* `type`: The type of the value passed into the `value` parameter. This value should be a string, with valid values being
    `'number'`, `'boolean'`, `'string'`, `'hash'`, `'array'`, `'array_element'`, and `'text'`.

    This parameter will not be need to be set most of the time, as the module
    is generally smart enough to figure this out on its own. There are only three cases in which this parameter is required.

    The first is the case in which the `value` type is a single-element array. In that case, the `type` parameter will need to be set to
    `'array'`. So, for example, to add a single-element array, you would add the following to your manifest

    ```
    hocon_setting { 'single array setting':
      ensure => present,
      path => '/tmp/foo.conf',
      setting => 'foo',
      value => [1],
      type => 'array',
    }
    ```

    If you are trying to manage single entries in an array (for example, adding to an array from a define) you will need to set the `'type'` parameter to
    `'array_element'`. For example, to add to an existing array in the 'foo' setting, you can add the following to your manifest

    ```
    hocon_setting { 'add to array':
      ensure  => present,
      path    => '/tmp/foo.conf',
      setting => 'foo',
      value   => 2,
      type    => 'array_element',
    }
    ```

    Note: When adding an item via 'array_element', the array must already exist in the HOCON file.

    Since this type represents a setting in a configuration file, you can pass a string containing the exact text of the value as you want it to appear
    in the file (this is useful, for example, if you want to set a parameter to a map or an array but want comments or specific indentation on elements in the map/array).
    In this case, `value` must be a string with no leading or trailing whitespace, newlines, or comments that contains a valid HOCON value, and the
    `type` parameter must be set to `'text'`. This is an advanced use case, and will not be necessary for most users. So, for example, say you want to
    add a map with particular indentation/comments into your configuration file at path `foo.bar`. You could create a variable like so

    ```
    $map =
    "{
        # This is setting a
        a : b
        # This is setting c
            c : d
     }"
    ```

    And your configuration file looks like so

    ```
    baz : qux
    foo : {
      a : b
    }
    ```

    You could then write the following in your manifest

    ```
    hocon_setting { 'exact text setting':
      ensure => present,
      path => '/tmp/foo.conf',
      setting => 'foo.bar',
      value => $map,
      type => 'text',
    }
    ```

    And the resulting configuration file would look like so

    ```
    baz : qux
    foo : {
      a : b
      bar : {
          # This is setting a
          a : b
          # This is setting c
              c : d
      }
    }
    ```

    Aside from these three cases, the `type` parameter does not need to be set.

##Development

Puppet Labs modules on the Puppet Forge are open projects, and community contributions are essential for keeping them great. We can't access the huge number of platforms and myriad of hardware, software, and deployment configurations that Puppet is intended to serve.

We want to keep it as easy as possible to contribute changes so that our modules work in your environment. There are a few guidelines that we need contributors to follow so that we can have a chance of keeping on top of things.

You can read the complete module contribution guide on the [Puppet Labs wiki](http://projects.puppetlabs.com/projects/module-site/wiki/Module_contributing).

##Contributors

The list of contributors can be found at: [https://github.com/puppetlabs/puppetlabs-hocon/graphs/contributors/contributors](https://github.com/puppetlabs/puppetlabs-hocon/graphs/contributors/contributors).


text:
from logging import getLogger

from django import forms
from django.core.exceptions import ValidationError
from django.forms import widgets
from django.utils import formats
from django.utils.formats import get_format
from django.utils.safestring import mark_safe
from django.utils.timezone import now
from django.utils.translation import ugettext_lazy, ugettext

from .models import Subscription, Optional

log = getLogger(__name__)

class ModelPricedOptInField(forms.ModelMultipleChoiceField):
    widget = forms.CheckboxSelectMultiple

    def __init__(self, **kwargs):
        forms.ModelMultipleChoiceField.__init__(self, None, **kwargs)

    def label_from_instance(self, obj):
        assert isinstance(obj, Optional)
        if obj.price:
            return '%s (R$ %s)' % (obj.name, obj.price)
        else:
            return '%s (grátis)' % obj.name

class SubscriptionForm(forms.ModelForm):
    full_name = forms.CharField(
        label=ugettext_lazy('Full name'),
        help_text=ugettext_lazy('As in legal documentation.'))
    document = forms.CharField(
        label=ugettext_lazy('ID'),
        help_text=ugettext_lazy('Type of document and its number.'))
    badge = forms.CharField(
        label=ugettext_lazy('Badge'),
        help_text=ugettext_lazy('Name to be printed on con badge.'))
    email = forms.EmailField(
        label=ugettext_lazy('E-mail'),
        help_text=ugettext_lazy('For contact before event date.'))
    phone = forms.CharField(
        label=ugettext_lazy('Cell phone'),
        help_text=ugettext_lazy('For contact at event date.'))
    born = forms.DateField(
        label=ugettext_lazy('Birth date'))
    shirt_size = forms.ChoiceField(
        label=ugettext_lazy('Shirt size'),
        choices=tuple(map(lambda a: (a, a), 'P M G GG GGG'.split())))
    blood = forms.CharField(
        label=ugettext_lazy('Blood type'),
        required=False,
        max_length=3,
        help_text=ugettext_lazy("Only if you're sure, blood type and Rh factor, such as O+, AB−, etc."))
    health_insured = forms.BooleanField(
        label=ugettext_lazy('Do you have private health plan coverage in the region?'),
        required=False)
    contact = forms.CharField(
        label=ugettext_lazy('Emergency contact'),
        widget=widgets.Textarea,
        help_text=ugettext_lazy('Nome, relationship, and phone number with area code.'))
    medication = forms.CharField(
        label=ugettext_lazy('Routine and emergency medical information'),
        required=False,
        widget=widgets.Textarea,
        help_text=ugettext_lazy(
            "Routine medication, crisis medication, blood pressure, diabetes, breathing conditions, heart "
            "conditions, food or medication allergies, any sort of condition that requires special care."))
    optionals = ModelPricedOptInField(label=ugettext_lazy('Optional'), required=False)
    agreed = forms.BooleanField(label=ugettext_lazy('Read and agreed to [terms and conditions].'))

    class Meta:
        model = Subscription
        exclude = 'event user state wait_until position paid paid_at'.split()

    def __init__(self, *args, **kwargs):
        forms.ModelForm.__init__(self, *args, **kwargs)
        subscription = self.instance
        event = subscription.event
        self.fields['optionals'].queryset = event.optional_set.all()
        self._add_agreement_link(event)
        self._add_age_warning(event)
        self.max_born = event.max_born

    def clean_born(self):
        born = self.cleaned_data['born']
        if born > self.max_born:
            raise ValidationError(
                ugettext('Must be born until %(date)s.'),
                code='too_young',
                params={'date': self.max_born},
            )
        return born

    def _add_agreement_link(self, event):
        label = str(self.fields['agreed'].label)
        url = event.agreement_url
        if url:
            label = mark_safe(label.replace('[', '' % event.agreement_url).replace(']', ''))
        else:
            label = label.replace('[', '').replace(']', '')
        self.fields['agreed'].label = label

    def _add_age_warning(self, event):
        msg = []
        if event.min_age:
            when = formats.date_format(event.starts_at, 'DATE_FORMAT').lower()
            msg.append(ugettext('You must be %(age)d or older at %(when)s.') % {'age': event.min_age, 'when': when})
        msg.append(ugettext('Write in format:'))
        msg.append(get_format('DATE_INPUT_FORMATS')[0].replace('%', ''))
        self.fields['born'].help_text += ' '.join(msg)

class PartialPayForm(forms.Form):
    amount = forms.DecimalField(
        label=ugettext_lazy('Amount to be paid'),
        help_text=ugettext_lazy('You can pay partially to combine different payment methods.'))

    def __init__(self, amount):
        super().__init__({'amount': amount})

class ManualTransactionForm(forms.Form):
    amount = forms.DecimalField()
    when = forms.DateTimeField(initial=now)
    attachment = forms.FileField(required=False)
    notes = forms.CharField(required=False)

    def __init__(self, subscription):
        if isinstance(subscription, Subscription):
            super().__init__()
            self.fields['amount'].initial = subscription.get_owing
        else:
            super().__init__(subscription)


text:
<!DOCTYPE html>

        <title>Curvytron</title>
        <meta name="description" content="Curvytron">
        <meta charset="utf-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0" />
        <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
        <meta name="apple-mobile-web-app-title" content="Curvytron">
        <meta name="apple-mobile-web-app-capable" content="yes">
        <meta name="mobile-web-app-capable" content="yes">
        <link rel="stylesheet" href="css/style.css">

            <form name="player" class="player-form" action="#play">
                <button type="button" name="color" class="color-button"></button>
                <input type="text" name="name" required placeholder="Enter your username" class="username" />
                <button name="join" class="submit" type="submit">PLAY</button>
            </form>

        <canvas id="render" class="game-render"></canvas>
        <button class="controller left" type="button"></button>
        <button class="controller right" type="button"></button>

742


text:
@interface BMSpriteInfo ()

- (void)_setupView;

@end

@implementation BMSpriteInfo

- (void)_setupView
{
    NSAssert(self.view, @"view is not set!");
    // note: setting position to bottom left corner in preparation for reading the texture later in BMGround
    self.view.position = ccp(0.5 * self.view.contentSize.width, 0.5 * self.view.contentSize.height);
}

- (id)initWithView:(CCSprite *)view finalPosition:(CGPoint)finalPosition
{
    if (self = [super initWithView:view]) {
        _finalPosition = finalPosition;
        [self _setupView];
    }
    return self;
}

@end


text:
package org.apache.camel.dataformat.bindy.fixed.number;

import java.math.BigDecimal;

import org.apache.camel.EndpointInject;
import org.apache.camel.Exchange;
import org.apache.camel.Produce;
import org.apache.camel.ProducerTemplate;
import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.component.mock.MockEndpoint;
import org.apache.camel.dataformat.bindy.annotation.DataField;
import org.apache.camel.dataformat.bindy.annotation.FixedLengthRecord;
import org.apache.camel.model.dataformat.BindyDataFormat;
import org.apache.camel.model.dataformat.BindyType;
import org.junit.Assert;
import org.junit.Test;
import org.springframework.test.annotation.DirtiesContext;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.AbstractJUnit4SpringContextTests;

@ContextConfiguration
public class BindyNumberTest extends AbstractJUnit4SpringContextTests {

    public static final String URI_DIRECT_MARSHALL         = "direct:marshall";
    public static final String URI_DIRECT_UNMARSHALL       = "direct:unmarshall";
    public static final String URI_MOCK_MARSHALL_RESULT    = "mock:marshall-result";
    public static final String URI_MOCK_UNMARSHALL_RESULT  = "mock:unmarshall-result";

    // *************************************************************************
    //
    // *************************************************************************

    @Produce(URI_DIRECT_MARSHALL)
    private ProducerTemplate mtemplate;

    @EndpointInject(URI_MOCK_MARSHALL_RESULT)
    private MockEndpoint mresult;

    @Produce(URI_DIRECT_UNMARSHALL)
    private ProducerTemplate utemplate;

    @EndpointInject(URI_MOCK_UNMARSHALL_RESULT)
    private MockEndpoint uresult;

    // *************************************************************************
    // TEST
    // *************************************************************************

    @Test
    @DirtiesContext
    public void testMarshall() throws Exception {
        DataModel rec = new DataModel();
        rec.field1 = new BigDecimal(123.45);
        rec.field2 = new BigDecimal(10.00);
        rec.field3 = new BigDecimal(10.00);
        rec.field4 = new Double(10.00);
        rec.field5 = new Double(10.00);

        mresult.expectedBodiesReceived("1234510.00   1010.00   10\r\n");

        mtemplate.sendBody(rec);
        mresult.assertIsSatisfied();
    }

    @Test
    @DirtiesContext
    public void testUnMarshall() throws Exception {

        utemplate.sendBody("1234510.00   1010.00   10");

        uresult.expectedMessageCount(1);
        uresult.assertIsSatisfied();

        // check the model
        Exchange  exc  = uresult.getReceivedExchanges().get(0);
        DataModel data = exc.getIn().getBody(DataModel.class);

        Assert.assertEquals(123.45D, data.field1.doubleValue(), 0D);
        Assert.assertEquals(10.00D, data.field2.doubleValue(), 0D);
        Assert.assertEquals(10.00D, data.field3.doubleValue(), 0D);
        Assert.assertEquals(10.00D, data.field4.doubleValue(), 0D);
        Assert.assertEquals(10.00D, data.field5.doubleValue(), 0D);
    }

    // *************************************************************************
    // ROUTES
    // *************************************************************************

    public static class ContextConfig extends RouteBuilder {
        @Override
        public void configure() {
            BindyDataFormat bindy = new BindyDataFormat();
            bindy.setClassType(DataModel.class);
            bindy.setLocale("en");
            bindy.type(BindyType.Fixed);

            from(URI_DIRECT_MARSHALL)
                .marshal(bindy)
                .to(URI_MOCK_MARSHALL_RESULT);
            from(URI_DIRECT_UNMARSHALL)
                .unmarshal().bindy(BindyType.Fixed, DataModel.class)
                .to(URI_MOCK_UNMARSHALL_RESULT);
        }
    }

    // *************************************************************************
    // DATA MODEL
    // *************************************************************************

    @FixedLengthRecord(length = 25, paddingChar = ' ')
    public static class DataModel {
        @DataField(pos =  1, length = 5, precision = 2, impliedDecimalSeparator = true)
        public BigDecimal field1;
        @DataField(pos =  6, length = 5, precision = 2)
        public BigDecimal field2;
        @DataField(pos = 11, length = 5)
        public BigDecimal field3;
        @DataField(pos = 16, length = 5, precision = 2)
        public Double field4;
        @DataField(pos = 21, length = 5)
        public Double field5;
    }
}