text:
namespace PaymentService {

class WalletService;

class PaymentServiceJsonRpcServer : public CryptoNote::JsonRpcServer {
public:
  PaymentServiceJsonRpcServer(System::Dispatcher& sys, System::Event& stopEvent, WalletService& service, Logging::ILogger& loggerGroup);
  PaymentServiceJsonRpcServer(const PaymentServiceJsonRpcServer&) = delete;

protected:
  virtual void processJsonRpcRequest(const Common::JsonValue& req, Common::JsonValue& resp) override;

private:
  WalletService& service;
  Logging::LoggerRef logger;

  typedef std::function<void (const Common::JsonValue& jsonRpcParams, Common::JsonValue& jsonResponse)> HandlerFunction;

  template <typename RequestType, typename ResponseType, typename RequestHandler>
  HandlerFunction jsonHandler(RequestHandler handler) {
    return [handler] (const Common::JsonValue& jsonRpcParams, Common::JsonValue& jsonResponse) mutable {
      RequestType request;
      ResponseType response;

      try {
        CryptoNote::JsonInputValueSerializer inputSerializer(const_cast<Common::JsonValue&>(jsonRpcParams));
        serialize(request, inputSerializer);
      } catch (std::exception&) {
        makeGenericErrorReponse(jsonResponse, "Invalid Request", -32600);
        return;
      }

      std::error_code ec = handler(request, response);
      if (ec) {
        makeErrorResponse(ec, jsonResponse);
        return;
      }

      CryptoNote::JsonOutputStreamSerializer outputSerializer;
      serialize(response, outputSerializer);
      fillJsonResponse(outputSerializer.getValue(), jsonResponse);
    };
  }

  std::unordered_map<std::string, HandlerFunction> handlers;

  std::error_code handleReset(const Reset::Request& request, Reset::Response& response);
  std::error_code handleCreateAddress(const CreateAddress::Request& request, CreateAddress::Response& response);
  std::error_code handleDeleteAddress(const DeleteAddress::Request& request, DeleteAddress::Response& response);
  std::error_code handleGetSpendKeys(const GetSpendKeys::Request& request, GetSpendKeys::Response& response);
  std::error_code handleGetBalance(const GetBalance::Request& request, GetBalance::Response& response);
  std::error_code handleGetBlockHashes(const GetBlockHashes::Request& request, GetBlockHashes::Response& response);
  std::error_code handleGetTransactionHashes(const GetTransactionHashes::Request& request, GetTransactionHashes::Response& response);
  std::error_code handleGetTransactions(const GetTransactions::Request& request, GetTransactions::Response& response);
  std::error_code handleGetUnconfirmedTransactionHashes(const GetUnconfirmedTransactionHashes::Request& request, GetUnconfirmedTransactionHashes::Response& response);
  std::error_code handleGetTransaction(const GetTransaction::Request& request, GetTransaction::Response& response);
  std::error_code handleSendTransaction(const SendTransaction::Request& request, SendTransaction::Response& response);
  std::error_code handleCreateDelayedTransaction(const CreateDelayedTransaction::Request& request, CreateDelayedTransaction::Response& response);
  std::error_code handleGetDelayedTransactionHashes(const GetDelayedTransactionHashes::Request& request, GetDelayedTransactionHashes::Response& response);
  std::error_code handleDeleteDelayedTransaction(const DeleteDelayedTransaction::Request& request, DeleteDelayedTransaction::Response& response);
  std::error_code handleSendDelayedTransaction(const SendDelayedTransaction::Request& request, SendDelayedTransaction::Response& response);
  std::error_code handleGetViewKey(const GetViewKey::Request& request, GetViewKey::Response& response);
  std::error_code handleGetStatus(const GetStatus::Request& request, GetStatus::Response& response);
  std::error_code handleGetAddresses(const GetAddresses::Request& request, GetAddresses::Response& response);

};

}//namespace PaymentService


text:
<?php

use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateProfilePropertiesTable extends Migration
{

	/**
	 * Run the migrations.
	 *
	 * @return void
	 */
	public function up()
	{
		Schema::create('profile_property', function(Blueprint $table)
		{
			$table->increments('id');
			$table->integer('id', true);
			$table->integer('skos_id');
			$table->dateTime('created_at');
			$table->dateTime('updated_at');
			$table->dateTime('deleted_at');
			$table->integer('created_by');
			$table->integer('updated_by');
			$table->integer('deleted_by');
			$table->integer('profile_id');
			$table->integer('skos_parent_id');
			$table->string('name', 255);
			$table->string('label', 255);
			$table->text('definition');
			$table->text('comment');
			$table->string('type', 255);
			$table->string('uri', 255);
			$table->integer('status_id');
			$table->string('language', 255);
			$table->text('note');
			$table->integer('display_order');
			$table->integer('export_order');
			$table->integer('picklist_order');
			$table->string('examples', 255);
			$table->boolean('is_required');
			$table->boolean('is_reciprocal');
			$table->boolean('is_singleton');
			$table->boolean('is_in_picklist');
			$table->boolean('is_in_export');
			$table->integer('inverse_profile_property_id');
			$table->boolean('is_in_class_picklist');
			$table->boolean('is_in_property_picklist');
			$table->boolean('is_in_rdf');
			$table->boolean('is_in_xsd');
			$table->boolean('is_attribute');
			$table->boolean('has_language');
			$table->boolean('is_object_prop');
			$table->boolean('is_in_form');
			$table->timestamps();
			$table->softDeletes();
		});
	}

	/**
	 * Reverse the migrations.
	 *
	 * @return void
	 */
	public function down()
	{
		Schema::drop('profile_property');
	}

}

redpajama_set_name: RedPajamaGithub


text:
import sys

# Use a dictionary of dictionary to store tokens to check for duplicates
# Key of first dictionary: First word
# Key of second dictionary: Second word
# Value of second dictionary: Token
tokens = {}

# Remove duplicates from every file in arguments
for arg in sys.argv:
    if arg[-3:] == 'out':
        # Open files
        infile = open(arg)
        outfile = open(arg[:-3]+'psd', 'w')
        start = 0
        write = 0
        lines = infile.readlines()
        # Read all of the lines
        for i in range(len(lines)):
            line = lines[i]
            if '/~*' in line:  # Start of text of token
                token = []
                start = 1
                write = 0
            elif '*~/' in line:  # End of text of token
                # See if token has already been seen
                # If not write out the tree, and add to DoD
                # If it has, don't write out tree
                start = 0
                tokent = ''.join(token[:-1])  # Token as text
                tokenl = tokent.split(' ') + ['', '']  # Token as list
                try:
                    token1 = tokens[tokenl[0]]  # Stored first words
                    try:
                        if tokent not in token1[tokenl[1]]:
                            write = 1
                            tokens[token[0]][tokenl[1]].append(tokent)
                    except:
                        write = 1
                        tokens[tokenl[0]][tokenl[1]] = [tokent]
                except:
                    write = 1
                    tokens[tokenl[0]] = {}
                    tokens[tokenl[0]][tokenl[1]] = [tokent]
            elif write == 1:  # Line contains parts of unseen tree, write out
                outfile.write(line)
            elif start == 1:  # Part of token text, store for later
                token.append(line)
        outfile.close()


text:
var assert = require('assert');
var path = require('path');
var minimatch = require('minimatch');

var BUILTIN_OPTIONS = {
    plugins: true,
    preset: true,
    excludeFiles: true,
    additionalRules: true,
    fileExtensions: true,
    maxErrors: true,
    configPath: true,
    esnext: true,
    es3: true,
    esprima: true,
    errorFilter: true
};

/**
 * JSCS Configuration.
 * Browser/Rhino-compatible.
 *
 * @name Configuration
 */
function Configuration() {
    this._presets = {};
    this._rules = {};
    this._configuredRules = [];
    this._unsupportedRuleNames = [];
    this._fileExtensions = ['.js'];
    this._excludedFileMasks = [];
    this._excludedFileMatchers = [];
    this._ruleSettings = {};
    this._maxErrors = null;
    this._basePath = '.';
    this._overrides = {};
    this._presetName = null;
    this._esnextEnabled = false;
    this._es3Enabled = true;
    this._esprima = null;
    this._errorFilter = null;
}

/**
 * Load settings from a configuration.
 *
 * @param {Object} config
 */
Configuration.prototype.load = function(config) {
    this._throwNonCamelCaseErrorIfNeeded(config);

    var overrides = this._overrides;
    var currentConfig = {};

    copyConfiguration(config, currentConfig);
    copyConfiguration(overrides, currentConfig);

    var ruleSettings = this._processConfig(currentConfig);
    var processedSettings = {};

    Object.keys(ruleSettings).forEach(function(optionName) {
        var rule = this._rules[optionName];
        if (rule) {
            var optionValue = ruleSettings[optionName];
            if (optionValue !== null) {
                rule.configure(ruleSettings[optionName]);
                this._configuredRules.push(rule);
                processedSettings[optionName] = ruleSettings[optionName];
            }
        } else {
            this._unsupportedRuleNames.push(optionName);
        }
    }, this);

    this._ruleSettings = processedSettings;
};

/**
 * Returns resulting configuration after preset is applied and options are processed.
 *
 * @return {Object}
 */
Configuration.prototype.getProcessedConfig = function() {
    var result = {};
    Object.keys(this._ruleSettings).forEach(function(key) {
        result[key] = this._ruleSettings[key];
    }, this);
    result.excludeFiles = this._excludedFileMasks;
    result.fileExtensions = this._fileExtensions;
    result.maxErrors = this._maxErrors;
    result.preset = this._presetName;
    result.esnext = this._esnextEnabled;
    result.es3 = this._es3Enabled;
    result.esprima = this._esprima;
    result.errorFilter = this._errorFilter;
    return result;
};

/**
 * Returns list of configured rules.
 *
 * @returns {Rule[]}
 */
Configuration.prototype.getConfiguredRules = function() {
    return this._configuredRules;
};

/**
 * Returns the list of unsupported rule names.
 *
 * @return {String[]}
 */
Configuration.prototype.getUnsupportedRuleNames = function() {
    return this._unsupportedRuleNames;
};

/**
 * Returns excluded file mask list.
 *
 * @returns {String[]}
 */
Configuration.prototype.getExcludedFileMasks = function() {
    return this._excludedFileMasks;
};

/**
 * Returns `true` if specified file path is excluded.
 *
 * @param {String} filePath
 * @returns {Boolean}
 */
Configuration.prototype.isFileExcluded = function(filePath) {
    filePath = path.resolve(filePath);
    return this._excludedFileMatchers.some(function(matcher) {
        return matcher.match(filePath);
    });
};

/**
 * Returns file extension list.
 *
 * @returns {String[]}
 */
Configuration.prototype.getFileExtensions = function() {
    return this._fileExtensions;
};

/**
 * Returns maximal error count.
 *
 * @returns {Number|undefined}
 */
Configuration.prototype.getMaxErrors = function() {
    return this._maxErrors;
};

/**
 * Returns `true` if `esnext` option is enabled.
 *
 * @returns {Boolean}
 */
Configuration.prototype.isESNextEnabled = function() {
    return this._esnextEnabled;
};

/**
 * Returns `true` if `es3` option is enabled.
 *
 * @returns {Boolean}
 */
Configuration.prototype.isES3Enabled = function() {
    return this._es3Enabled;
};

/**
 * Returns `true` if `esprima` option is not null.
 *
 * @returns {Boolean}
 */
Configuration.prototype.hasCustomEsprima = function() {
    return !!this._esprima;
};

/**
 * Returns the custom esprima parser.
 *
 * @returns {Object|null}
 */
Configuration.prototype.getCustomEsprima = function() {
    return this._esprima;
};

/**
 * Returns the loaded error filter.
 *
 * @returns {Function|null}
 */
Configuration.prototype.getErrorFilter = function() {
    return this._errorFilter;
};

/**
 * Returns base path.
 *
 * @returns {String}
 */
Configuration.prototype.getBasePath = function() {
    return this._basePath;
};

/**
 * Overrides specified settings.
 *
 * @param {String} overrides
 */
Configuration.prototype.override = function(overrides) {
    Object.keys(overrides).forEach(function(key) {
        this._overrides[key] = overrides[key];
    }, this);
};

/**
 * Processes configuration and returns config options.
 *
 * @param {Object} config
 * @returns {Object}
 */
Configuration.prototype._processConfig = function(config) {
    var ruleSettings = {};

    // Base path
    if (config.configPath) {
        assert(
            typeof config.configPath === 'string',
            '`configPath` option requires string value'
        );
        this._basePath = path.dirname(config.configPath);
    }

    // Load plugins
    if (config.plugins) {
        assert(Array.isArray(config.plugins), '`plugins` option requires array value');
        config.plugins.forEach(this._loadPlugin, this);
    }

    // Apply presets
    var presetName = config.preset;
    if (presetName) {
        this._presetName = presetName;
        assert(typeof presetName === 'string', '`preset` option requires string value');
        var presetData = this._presets[presetName];
        assert(Boolean(presetData), 'Preset "' + presetName + '" does not exist');
        var presetResult = this._processConfig(presetData);
        Object.keys(presetResult).forEach(function(key) {
            ruleSettings[key] = presetResult[key];
        });
    }

    // File extensions
    if (config.fileExtensions) {
        assert(
            typeof config.fileExtensions === 'string' || Array.isArray(config.fileExtensions),
            '`fileExtensions` option requires string or array value'
        );
        this._fileExtensions = [].concat(config.fileExtensions).map(function(ext) {
            return ext.toLowerCase();
        });
    }

    // File excludes
    if (config.excludeFiles) {
        assert(Array.isArray(config.excludeFiles), '`excludeFiles` option requires array value');
        this._excludedFileMasks = config.excludeFiles;
        this._excludedFileMatchers = this._excludedFileMasks.map(function(fileMask) {
            return new minimatch.Minimatch(path.resolve(this._basePath, fileMask), {
                dot: true
            });
        }, this);
    }

    // Additional rules
    if (config.additionalRules) {
        assert(Array.isArray(config.additionalRules), '`additionalRules` option requires array value');
        config.additionalRules.forEach(this._loadAdditionalRule, this);
    }

    if (config.hasOwnProperty('maxErrors')) {
        var maxErrors = config.maxErrors === null ? null : Number(config.maxErrors);
        assert(
            maxErrors > 0 || isNaN(maxErrors) || maxErrors === null,
            '`maxErrors` option requires number or null value'
        );
        this._maxErrors = maxErrors;
    }

    if (config.hasOwnProperty('esnext')) {
        assert(
            typeof config.esnext === 'boolean' || config.esnext === null,
            '`esnext` option requires boolean or null value'
        );
        this._esnextEnabled = Boolean(config.esnext);
    }

    if (config.hasOwnProperty('es3')) {
        assert(
            typeof config.es3 === 'boolean' || config.es3 === null,
            '`es3` option requires boolean or null value'
        );
        this._es3Enabled = Boolean(config.es3);
    }

    if (config.hasOwnProperty('esprima')) {
        this._loadEsprima(config.esprima);
    }

    if (config.hasOwnProperty('errorFilter')) {
        this._loadErrorFilter(config.errorFilter);
    }

    // Apply config options
    Object.keys(config).forEach(function(key) {
        if (!BUILTIN_OPTIONS[key]) {
            ruleSettings[key] = config[key];
        }
    });

    return ruleSettings;
};

/**
 * Loads plugin data.
 *
 * @param {function(Configuration)} plugin
 * @protected
 */
Configuration.prototype._loadPlugin = function(plugin) {
    assert(typeof plugin === 'function', '`plugin` should be a function');
    plugin(this);
};

/**
 * Loads an error filter.
 *
 * @param {Function|null} errorFilter
 * @protected
 */
Configuration.prototype._loadErrorFilter = function(errorFilter) {
    assert(
        typeof errorFilter === 'function' ||
        errorFilter === null,
        '`errorFilter` option requires a function or null value'
    );
    this._errorFilter = errorFilter;
};

/**
 * Loads a custom esprima.
 *
 * @param {Object|null} esprima
 * @protected
 */
Configuration.prototype._loadEsprima = function(esprima) {
    assert(
        (esprima && typeof esprima.parse === 'function') ||
        esprima === null,
        '`esprima` option requires a null value or an object with a parse function'
    );
    this._esprima = esprima;
};

/**
 * Includes plugin in the configuration environment.
 *
 * @param {function(Configuration)|*} plugin
 */
Configuration.prototype.usePlugin = function(plugin) {
    this._loadPlugin(plugin);
};

/**
 * Loads additional rule.
 *
 * @param {Rule} additionalRule
 * @protected
 */
Configuration.prototype._loadAdditionalRule = function(additionalRule) {
    assert(typeof additionalRule === 'object', '`additionalRule` should be an object');
    this.registerRule(additionalRule);
};

/**
 * Throws error for non camel-case options.
 *
 * @param {Object} ruleSettings
 * @protected
 */
Configuration.prototype._throwNonCamelCaseErrorIfNeeded = function(ruleSettings) {
    function symbolToUpperCase(s, symbol) {
        return symbol.toUpperCase();
    }
    function fixSettings(originalSettings) {
        var result = {};
        Object.keys(originalSettings).forEach(function(key) {
            var camelCaseName = key.replace(/_([a-zA-Z])/g, symbolToUpperCase);
            var value = originalSettings[key];
            if (typeof value === 'object' && value !== null && !Array.isArray(value)) {
                value = fixSettings(value);
            }
            result[camelCaseName] = value;
        });
        return result;
    }

    Object.keys(ruleSettings).forEach(function(key) {
        if (key.indexOf('_') !== -1) {
            throw new Error(
                'JSCS now accepts configuration options in camel case. Sorry for inconvenience. ' +
                'On the bright side, we tried to convert your jscs config to camel case.\n' +
                '----------------------------------------\n' +
                JSON.stringify(fixSettings(ruleSettings), null, 4) +
                '\n----------------------------------------\n'
            );
        }
    });
};

/**
 * Adds rule to the collection.
 *
 * @param {Rule|function} rule Rule instance or rule class.
 */
Configuration.prototype.registerRule = function(rule) {
    if (typeof rule === 'function') {
        var RuleClass = rule;
        rule = new RuleClass();
    }

    var optionName = rule.getOptionName();
    assert(!this._rules.hasOwnProperty(optionName), 'Rule "' + optionName + '" is already registered');
    this._rules[optionName] = rule;
};

/**
 * Returns list of registered rules.
 *
 * @returns {Rule[]}
 */
Configuration.prototype.getRegisteredRules = function() {
    var rules = this._rules;
    return Object.keys(rules).map(function(ruleOptionName) {
        return rules[ruleOptionName];
    });
};

/**
 * Adds preset to the collection.
 *
 * @param {String} presetName
 * @param {Object} presetConfig
 */
Configuration.prototype.registerPreset = function(presetName, presetConfig) {
    this._presets[presetName] = presetConfig;
};

/**
 * Returns registered presets object (key - preset name, value - preset content).
 *
 * @returns {Object}
 */
Configuration.prototype.getRegisteredPresets = function() {
    return this._presets;
};

/**
 * Returns `true` if preset with specified name exists.
 *
 * @param {String} presetName
 * @return {Boolean}
 */
Configuration.prototype.hasPreset = function(presetName) {
    return this._presets.hasOwnProperty(presetName);
};

/**
 * Registers built-in Code Style cheking rules.
 */
Configuration.prototype.registerDefaultRules = function() {

    /*
        Important!
        These rules are linked explicitly to keep browser-version supported.
    */

    this.registerRule(require('../rules/require-curly-braces'));
    this.registerRule(require('../rules/require-multiple-var-decl'));
    this.registerRule(require('../rules/disallow-multiple-var-decl'));
    this.registerRule(require('../rules/disallow-empty-blocks'));
    this.registerRule(require('../rules/require-space-after-keywords'));
    this.registerRule(require('../rules/require-space-before-keywords'));
    this.registerRule(require('../rules/disallow-space-after-keywords'));
    this.registerRule(require('../rules/disallow-space-before-keywords'));
    this.registerRule(require('../rules/require-parentheses-around-iife'));

    /* deprecated rules */
    this.registerRule(require('../rules/require-left-sticked-operators'));
    this.registerRule(require('../rules/disallow-left-sticked-operators'));
    this.registerRule(require('../rules/require-right-sticked-operators'));
    this.registerRule(require('../rules/disallow-right-sticked-operators'));
    this.registerRule(require('../rules/validate-jsdoc'));
    /* deprecated rules (end) */

    this.registerRule(require('../rules/require-operator-before-line-break'));
    this.registerRule(require('../rules/disallow-operator-before-line-break'));
    this.registerRule(require('../rules/disallow-implicit-type-conversion'));
    this.registerRule(require('../rules/require-camelcase-or-uppercase-identifiers'));
    this.registerRule(require('../rules/disallow-keywords'));
    this.registerRule(require('../rules/disallow-multiple-line-breaks'));
    this.registerRule(require('../rules/disallow-multiple-line-strings'));
    this.registerRule(require('../rules/validate-line-breaks'));
    this.registerRule(require('../rules/validate-quote-marks'));
    this.registerRule(require('../rules/validate-indentation'));
    this.registerRule(require('../rules/disallow-trailing-whitespace'));
    this.registerRule(require('../rules/disallow-mixed-spaces-and-tabs'));
    this.registerRule(require('../rules/require-keywords-on-new-line'));
    this.registerRule(require('../rules/disallow-keywords-on-new-line'));
    this.registerRule(require('../rules/require-line-feed-at-file-end'));
    this.registerRule(require('../rules/maximum-line-length'));
    this.registerRule(require('../rules/require-yoda-conditions'));
    this.registerRule(require('../rules/disallow-yoda-conditions'));
    this.registerRule(require('../rules/require-spaces-inside-object-brackets'));
    this.registerRule(require('../rules/require-spaces-inside-array-brackets'));
    this.registerRule(require('../rules/require-spaces-inside-parentheses'));
    this.registerRule(require('../rules/disallow-spaces-inside-object-brackets'));
    this.registerRule(require('../rules/disallow-spaces-inside-array-brackets'));
    this.registerRule(require('../rules/disallow-spaces-inside-parentheses'));
    this.registerRule(require('../rules/require-blocks-on-newline'));
    this.registerRule(require('../rules/require-space-after-object-keys'));
    this.registerRule(require('../rules/require-space-before-object-values'));
    this.registerRule(require('../rules/disallow-space-after-object-keys'));
    this.registerRule(require('../rules/disallow-space-before-object-values'));
    this.registerRule(require('../rules/disallow-quoted-keys-in-objects'));
    this.registerRule(require('../rules/require-quoted-keys-in-objects'));
    this.registerRule(require('../rules/disallow-dangling-underscores'));
    this.registerRule(require('../rules/require-aligned-object-values'));

    this.registerRule(require('../rules/disallow-padding-newlines-in-blocks'));
    this.registerRule(require('../rules/require-padding-newlines-in-blocks'));
    this.registerRule(require('../rules/require-padding-newlines-in-objects'));
    this.registerRule(require('../rules/disallow-padding-newlines-in-objects'));
    this.registerRule(require('../rules/require-newline-before-block-statements'));
    this.registerRule(require('../rules/disallow-newline-before-block-statements'));

    this.registerRule(require('../rules/require-padding-newlines-before-keywords'));
    this.registerRule(require('../rules/disallow-padding-newlines-before-keywords'));

    this.registerRule(require('../rules/disallow-trailing-comma'));
    this.registerRule(require('../rules/require-trailing-comma'));

    this.registerRule(require('../rules/disallow-comma-before-line-break'));
    this.registerRule(require('../rules/require-comma-before-line-break'));

    this.registerRule(require('../rules/disallow-space-before-block-statements.js'));
    this.registerRule(require('../rules/require-space-before-block-statements.js'));

    this.registerRule(require('../rules/disallow-space-before-postfix-unary-operators.js'));
    this.registerRule(require('../rules/require-space-before-postfix-unary-operators.js'));

    this.registerRule(require('../rules/disallow-space-after-prefix-unary-operators.js'));
    this.registerRule(require('../rules/require-space-after-prefix-unary-operators.js'));

    this.registerRule(require('../rules/disallow-space-before-binary-operators'));
    this.registerRule(require('../rules/require-space-before-binary-operators'));

    this.registerRule(require('../rules/disallow-space-after-binary-operators'));
    this.registerRule(require('../rules/require-space-after-binary-operators'));

    this.registerRule(require('../rules/require-spaces-in-conditional-expression'));
    this.registerRule(require('../rules/disallow-spaces-in-conditional-expression'));

    this.registerRule(require('../rules/require-spaces-in-function'));
    this.registerRule(require('../rules/disallow-spaces-in-function'));
    this.registerRule(require('../rules/require-spaces-in-function-expression'));
    this.registerRule(require('../rules/disallow-spaces-in-function-expression'));
    this.registerRule(require('../rules/require-spaces-in-anonymous-function-expression'));
    this.registerRule(require('../rules/disallow-spaces-in-anonymous-function-expression'));
    this.registerRule(require('../rules/require-spaces-in-named-function-expression'));
    this.registerRule(require('../rules/disallow-spaces-in-named-function-expression'));
    this.registerRule(require('../rules/require-spaces-in-function-declaration'));
    this.registerRule(require('../rules/disallow-spaces-in-function-declaration'));

    this.registerRule(require('../rules/require-spaces-in-call-expression'));
    this.registerRule(require('../rules/disallow-spaces-in-call-expression'));

    this.registerRule(require('../rules/validate-parameter-separator'));
    this.registerRule(require('../rules/require-space-between-arguments'));
    this.registerRule(require('../rules/disallow-space-between-arguments'));

    this.registerRule(require('../rules/require-capitalized-constructors'));

    this.registerRule(require('../rules/safe-context-keyword'));

    this.registerRule(require('../rules/require-dot-notation'));

    this.registerRule(require('../rules/require-space-after-line-comment'));
    this.registerRule(require('../rules/disallow-space-after-line-comment'));

    this.registerRule(require('../rules/require-anonymous-functions'));
    this.registerRule(require('../rules/disallow-anonymous-functions'));

    this.registerRule(require('../rules/require-function-declarations'));
    this.registerRule(require('../rules/disallow-function-declarations'));

    this.registerRule(require('../rules/require-capitalized-comments'));
    this.registerRule(require('../rules/disallow-capitalized-comments'));

    this.registerRule(require('../rules/require-line-break-after-variable-assignment'));

    this.registerRule(require('../rules/disallow-semicolons'));

    this.registerRule(require('../rules/require-spaces-in-for-statement'));
    this.registerRule(require('../rules/disallow-spaces-in-for-statement'));
};

/**
 * Registers built-in Code Style cheking presets.
 */
Configuration.prototype.registerDefaultPresets = function() {
    // https://github.com/airbnb/javascript
    this.registerPreset('airbnb', require('../../presets/airbnb.json'));

    // http://javascript.crockford.com/code.html
    this.registerPreset('crockford', require('../../presets/crockford.json'));

    // https://google-styleguide.googlecode.com/svn/trunk/javascriptguide.xml
    this.registerPreset('google', require('../../presets/google.json'));

    // http://gruntjs.com/contributing#syntax
    this.registerPreset('grunt', require('../../presets/grunt.json'));

    // https://contribute.jquery.org/style-guide/js/
    this.registerPreset('jquery', require('../../presets/jquery.json'));

    // https://github.com/mrdoob/three.js/wiki/Mr.doob's-Code-Style%E2%84%A2
    this.registerPreset('mdcs', require('../../presets/mdcs.json'));

    // https://www.mediawiki.org/wiki/Manual:Coding_conventions/JavaScript
    this.registerPreset('wikimedia', require('../../presets/wikimedia.json'));

    // https://github.com/yandex/codestyle/blob/master/js.md
    this.registerPreset('yandex', require('../../presets/yandex.json'));
};

module.exports = Configuration;

function copyConfiguration(source, dest) {
    Object.keys(source).forEach(function(key) {
        dest[key] = source[key];
    });
    if (source.configPath) {
        dest.configPath = source.configPath;
    }
}


text:
package com.github.twitch4j.eventsub.util;

import com.github.twitch4j.common.util.CryptoUtils;
import lombok.extern.slf4j.Slf4j;
import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Tag;
import org.junit.jupiter.api.Test;

import java.nio.charset.StandardCharsets;
import java.time.Instant;
import java.time.temporal.ChronoUnit;
import java.util.UUID;

import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertTrue;

@Slf4j
@Tag("unittest")
public class EventSubVerifierTest {

    @Test
    @DisplayName("Ensure only new message id's are valid")
    public void validateId() {
        UUID event1 = UUID.randomUUID();
        assertTrue(EventSubVerifier.verifyMessageId(event1.toString()));
        assertFalse(EventSubVerifier.verifyMessageId(event1.toString()));

        UUID event2 = UUID.randomUUID();
        assertTrue(EventSubVerifier.verifyMessageId(event2.toString()));
        assertFalse(EventSubVerifier.verifyMessageId(event2.toString()));
    }

    @Test
    @DisplayName("Ensure only recent events are valid")
    public void validateTime() {
        assertTrue(EventSubVerifier.verifyTimestamp(Instant.now().toString()));
        assertTrue(EventSubVerifier.verifyTimestamp(Instant.now().minus(1, ChronoUnit.MINUTES).toString()));
        assertTrue(EventSubVerifier.verifyTimestamp(Instant.now().plus(1, ChronoUnit.MINUTES).toString()));
        assertFalse(EventSubVerifier.verifyTimestamp(Instant.now().minus(11, ChronoUnit.MINUTES).toString()));
    }

    @Test
    @DisplayName("Ensure signature validation is functioning")
    public void validateSignature() {
        final String secret = "Twitch4J",
            id = "7d4c39a4-10b3-4166-b1fb-56130d1f693b",
            time = "2020-12-13T14:15:16.1718Z",
            expect = "sha256=2ac8d26bf60837663d8969f3cb4f22f685c8fa0a4b99d533c8bf622ed4596cc6";
        final byte[] body = ("{\"hello\":\"world\"}").getBytes(StandardCharsets.UTF_8);

        assertTrue(EventSubVerifier.verifySignature(secret, id, time, body, expect));
        assertTrue(EventSubVerifier.verifySignature(secret, id, time, body, expect.toUpperCase()));
        assertFalse(EventSubVerifier.verifySignature("s3cRe7", id, time, body, expect));
        assertFalse(EventSubVerifier.verifySignature(secret, UUID.randomUUID().toString(), time, body, expect));
        assertFalse(EventSubVerifier.verifySignature(secret, id, Instant.now().toString(), body, expect));
        assertFalse(EventSubVerifier.verifySignature(secret, id, time, null, expect));
        assertFalse(EventSubVerifier.verifySignature(secret, id, time, "Hello World".getBytes(StandardCharsets.UTF_8), expect));
        assertFalse(EventSubVerifier.verifySignature(secret, id, time, body, "sha256=f56bf6ce06a1adf46fa27831d7d15d"));
        assertFalse(EventSubVerifier.verifySignature(secret, id, time, body, "sha256=" + CryptoUtils.generateNonce(64)));
        assertFalse(EventSubVerifier.verifySignature(secret, id, time, body, "sha256=" + CryptoUtils.generateNonce(60) + "zÉñü"));
    }

}


text:
This plugin provides a very bare-bones implementation of Google Analytics'
tracking code.  Yes, there are a number of other good plugins out there for
adding Google Analytics to your site.  This one is extremely minimal, with no
extra frills.

## Configuration ##

The plugin provides no UI for configuring it.  Instead, you must define a PHP
constant named `GOOGLE_ANALYTICS_ID`.  This is most easily done by adding a
snippet like the following to your wp-config.php file:

    define('GOOGLE_ANALYTICS_ID', 'UA-XXXXXX-X');

## Questions ##

**Does this plugin track logged-in users?**

Out of the box, it will not track logged in administrators.  All other
visitors, logged in are not, are tracked.  You can override this behavior using
the `analytics_track_user` filter.

**Can I include custom Google Analytics code**

Yes, an action named `analytics_tracking_js` is called after setting up the
`_gaq` var, but before including the `ga.js` script.


text:
TreeFeature::TreeFeature() : TerrainFeature("tree", Vector3(3, 6, 3), 5){}

TreeFeature* TreeFeature::clone(Vector3 _pos, BiomeGenInfo *_baseInfo){
    TreeFeature *_tree = new TreeFeature();
    _tree->posCorner = _pos;
    _tree->type = type;
    _tree->baseInfo = _baseInfo;

    _tree->size = size;
    _tree->size.y += (int)(2*sin(_baseInfo->humidity) + 1);

    if (_tree->baseInfo->primaryBiome == "jungle"){
        _tree->size *= (int)(.3*sin(_baseInfo->temperature)+1.4);
    }

    return _tree;
}

unsigned char TreeFeature::generateBlock(Vector3 _address, BiomeGenInfo *_info){
    if (_address.y < posCorner.y || _address.y > posCorner.y + size.y) return 251; // will happen a lot since feature map is 2D
    if (_address.x < posCorner.x || _address.x > posCorner.x + size.x || _address.z < posCorner.z || _address.z > posCorner.z + size.z){ // should not happen given feature map
        cerr << "--Terrain Feature Error: \""<<type<<"\" requested for point "<<_address<<" within "<<posCorner<<size<<"."<<endl;
        return 251;
    }

    unsigned char _logTexture = WOOD;
    unsigned char _leafTexture = LEAVES;
//    if (_info->primaryBiome == "jungle"){
//        _logTexture = "spruce_log";
//    }

    Vector3 _relative = _address - posCorner;
    if (_relative.x == (int)(size.x/2) && _relative.z == (int)(size.z/2) && _relative.y < size.y-1){
        return _logTexture;
    }
    if (_relative.y > size.y/2+1){
        if (_relative.y < size.y-1 || (_relative.x > 0 && _relative.x < size.x-1 && _relative.z > 0 && _relative.z < size.z-1)){
            return _leafTexture;
        }
    } else if (_relative.y > size.y/2 && fabs(_relative.x - (int)size.x/2) > 1 && fabs(_relative.z - (int)size.z/2) > 1){
        return _leafTexture;
    }

    return 251;
}


text:
Imager for Craft 3.x
=====

**Imager is dead - long live [Imager X](https://plugins.craftcms.com/imager-x)!**

Well, dead is a bit harsh, but... This version of the Craft plugin is no longer
actively maintained. After four years, 322 commits, 255 closed issues,
352 stars and ~14700 active installs, I've decided to make this plugin commercial
to be able to continue maintaining it. To do so, I had to create a new plugin
(since P&T doesn't allow developers to convert free plugins to commercial ones,
which makes sense) and the result is [Imager X](https://plugins.craftcms.com/imager-x).

Imager X is a drop-in replacement for Imager, all you need to do is uninstall
Imager, install Imager X, and rename the config file from `imager.php` to
`imager-x.php`. No template changes needed.

Imager X also comes with some new features, like:

- Support for named transforms, a new way to define your transforms in a central place, and easily reuse it in your templates.
- Support for auto generating transforms on asset upload or element save.
- Console commands and element actions for generating transforms.
- Support for GraphQL.
- Support for adding a fallbackImage that is used when a transform fails.
- Support for adding a mockImage that completely overrides any used image (great for development!).
- Much improved docs built on Vuepress.

**Give it a try!**

_And if you don't want to pay, feel free to use Imager 2.0 for as long as you wish! [You can still access the old documentation here](https://github.com/aelvan/Imager-Craft/blob/e06b24885dd194a6b0659a66f9333067975b027e/README.md)._


text:
//
//  ALiOSDemo8ViewController.m
//  PureLayout Example-iOS
//
//  Copyright (c) 2014 Tyler Fox
//  https://github.com/smileyborg/PureLayout
//

#import "ALiOSDemo8ViewController.h"
#import <PureLayout/PureLayout.h>

@interface ALiOSDemo8ViewController ()

@property (nonatomic, strong) UIView *containerView;
@property (nonatomic, strong) UIView *blueView;
@property (nonatomic, strong) UIView *redView;
@property (nonatomic, strong) UIView *yellowView;
@property (nonatomic, strong) UIView *greenView;

@property (nonatomic, assign) BOOL didSetupConstraints;

@end

@implementation ALiOSDemo8ViewController

- (void)loadView
{
    self.view = [UIView new];
    self.view.backgroundColor = [UIColor colorWithWhite:0.1 alpha:1.0];

    [self.view addSubview:self.containerView];
    [self.containerView addSubview:self.blueView];
    [self.containerView addSubview:self.redView];
    [self.containerView addSubview:self.yellowView];
    [self.containerView addSubview:self.greenView];

    [self.view setNeedsUpdateConstraints]; // bootstrap Auto Layout
}

- (void)updateViewConstraints
{
    if (!self.didSetupConstraints) {
        /**
         First, we'll set up some 'good' constraints that work correctly.
         Note that we identify all of the constraints with a short description of what their purpose is - this is a great feature
         to help you document and comment constraints both in the code, and at runtime. If a Required constraint is ever broken,
         it will raise an exception, and you will see these identifiers show up next to the constraint in the console.
         */

        [UIView autoSetIdentifier:@"Pin Container View Edges" forConstraints:^{
            [self.containerView autoPinToTopLayoutGuideOfViewController:self withInset:10.0];
            [self.containerView autoPinEdgesToSuperviewEdgesWithInsets:UIEdgeInsetsMake(0.0, 10.0, 10.0, 10.0) excludingEdge:ALEdgeTop];
        }];

        NSArray *views = @[self.redView, self.blueView, self.yellowView, self.greenView];

        [[views autoDistributeViewsAlongAxis:ALAxisVertical alignedTo:ALAttributeVertical withFixedSize:40.0] autoIdentifyConstraints:@"Distribute Views Vertically"];

        /**
         Note that the -autoIdentify and -autoIdentifyConstraints methods set the identifier, and then return the constraint(s).
         This lets you chain the identifier call right after creating the constraint(s), and still capture a reference to the constraint(s)!
         */

        NSArray *constraints = [[views autoSetViewsDimension:ALDimensionWidth toSize:60.0] autoIdentifyConstraints:@"Set Width of All Views"];
        constraints = nil; // you can do something with the constraints at this point

        NSLayoutConstraint *constraint = [[self.redView autoAlignAxisToSuperviewAxis:ALAxisVertical] autoIdentify:@"Align Red View to Superview Vertical Axis"];
        constraint = nil; // you can do something with the constraint at this point

        /**
         Now, let's add some 'bad' constraints that conflict with one or more of the 'good' constraints above.
         Start by uncommenting one of the below constraints, and running the demo. A constraint exception will be logged
         to the console, because one or more views was over-constrained, and therefore one or more constraints had to be broken.
         But because we have provided human-readable identifiers, notice how easy it is to figure out which constraints are
         conflicting, and which constraint shouldn't be there!
         */
        [UIView autoSetIdentifier:@"Bad Constraints That Break Things" forConstraints:^{
//            [self.redView autoAlignAxis:ALAxisVertical toSameAxisOfView:self.view withOffset:5.0]; // uncomment me and watch things blow up!

//            [self.redView autoPinEdgeToSuperviewEdge:ALEdgeLeft]; // uncomment me and watch things blow up!

//            [views autoSetViewsDimension:ALDimensionHeight toSize:50.0]; // uncomment me and watch things blow up!
        }];

        self.didSetupConstraints = YES;
    }

    [super updateViewConstraints];
}

- (UIView *)containerView
{
    if (!_containerView) {
        _containerView = [UIView newAutoLayoutView];
        _containerView.backgroundColor = [UIColor lightGrayColor];
    }
    return _containerView;
}

- (UIView *)blueView
{
    if (!_blueView) {
        _blueView = [UIView newAutoLayoutView];
        _blueView.backgroundColor = [UIColor blueColor];
    }
    return _blueView;
}

- (UIView *)redView
{
    if (!_redView) {
        _redView = [UIView newAutoLayoutView];
        _redView.backgroundColor = [UIColor redColor];
    }
    return _redView;
}

- (UIView *)yellowView
{
    if (!_yellowView) {
        _yellowView = [UIView newAutoLayoutView];
        _yellowView.backgroundColor = [UIColor yellowColor];
    }
    return _yellowView;
}

- (UIView *)greenView
{
    if (!_greenView) {
        _greenView = [UIView newAutoLayoutView];
        _greenView.backgroundColor = [UIColor greenColor];
    }
    return _greenView;
}

@end


text:
function polpetta_redirect(href, internally) {
  if (internally) {
    has(this, "url") ||
    defineKnownProperty(this, "url", url.parse(href, true));
  } else {
    redirect.Location = href;
    this.response.writeHead(
      301, redirect
    );
    this.response.end();
    return false;
  }
}


text:
using Titanium.Core.Exceptions;

namespace Titanium.Core.Expressions
{
	internal sealed class UndefinedExpression : Expression
	{
		internal override Expression Evaluate()
		{
			return this;
		}

		public override int CompareTo(object obj)
		{
			var other = obj as UndefinedExpression;
			if (other != null)
			{
				return 0;
			}

			throw new IncomparableTypeException(GetType(), obj.GetType());
		}

		public override bool Equals(Evaluatable other)
		{
			return other is UndefinedExpression;
		}

		public override string ToString()
		{
			return "undef";
		}
	}
}


text:
@implementation ReviewTableViewCell

- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        // Initialization code
    }
    return self;
}

- (void)awakeFromNib
{
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated
{
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

- (void) setReview:(PLYReview *)review{
    if([_review isEqual:review]){
        return;
    }

    _review = review;

    [self updateCell];
}

-(void) updateCell{
    _productImage.hidden = YES;

    [_subjectLabel setText:_review.subject];
    [_bodyLabel setText:_review.body];
    [_authorLabel setText:_review.createdBy.nickname];

    [self loadMainImage];
}

- (void) loadMainImage{
    NSString *gtin = _review.GTIN;

    if (!gtin)
	{
		return;
	}

	[[PLYServer sharedServer] getImagesForGTIN:gtin completion:^(id result, NSError *error) {

		DTBlockPerformSyncIfOnMainThreadElseAsync(^{
            NSArray *images = result;

            if(images != nil && images.count > 0){

                PLYImage *imageMeta = images[0];

                int imageSize = _productImage.frame.size.width*[[UIScreen mainScreen] scale];

					NSURL *imageURL = [[PLYServer sharedServer] URLForImage:imageMeta maxWidth:imageSize maxHeight:imageSize crop:YES];

                NSString *imageIdentifier = [imageURL lastPathComponent];

                // check if we have a cached version
                DTImageCache *imageCache = [DTImageCache sharedCache];

                // TODO: We should also have the width and height as parameter, otherwise we could receive an image which has not the correct size.
                UIImage *thumbnail = [imageCache imageForUniqueIdentifier:imageIdentifier variantIdentifier:@"thumbnail"];

                if (thumbnail)
                {
                    [_productImage setImage:thumbnail];

                    return;
                }

                // need to load it
                UIImage *image = [[DTDownloadCache sharedInstance] cachedImageForURL:imageURL option:DTDownloadCacheOptionLoadIfNotCached completion:^(NSURL *URL, UIImage *image, NSError *error) {

                    DTBlockPerformSyncIfOnMainThreadElseAsync(^{
                        if (error)
                        {
                            DTLogError(@"Error loading image %@", [error localizedDescription]);
                        }
                        else
                        {
                            [imageCache addImage:image forUniqueIdentifier:imageIdentifier variantIdentifier:nil];

                            [_productImage setImage:image];
                        }
                    });
                }];

                if (image)
                {
                    [_productImage setImage:image];
                }

            } else {
                [_productImage setImage:[UIImage imageNamed:@"no_image.png"]];
            }

            _productImage.hidden = NO;
		});
	}];
}

@end


text:
<?php

namespace Swisscat\SalesforceBundle\Test\Consumer;

use Doctrine\ORM\EntityManagerInterface;
use PhpAmqpLib\Message\AMQPMessage;
use Phpforce\SoapClient\BulkSaver;
use Phpforce\SoapClient\Result\SaveResult;
use Psr\Log\LoggerInterface;
use Swisscat\SalesforceBundle\Consumer\SalesforceBack;
use Swisscat\SalesforceBundle\Consumer\SalesforcePublisherConsumer;
use Swisscat\SalesforceBundle\Mapping\Driver\XmlDriver;
use Swisscat\SalesforceBundle\Mapping\Mapper;
use Swisscat\SalesforceBundle\Mapping\Salesforce\Event;

class TestCase extends \Swisscat\SalesforceBundle\Test\TestCase
{
    /**
     * @param $mappingDir
     * @return \PHPUnit_Framework_MockObject_MockObject[]
     */
    protected function createConsumer($mappingDir)
    {
        $driver = new XmlDriver([dirname(__DIR__).'/TestData/MappingConfigurations/'.$mappingDir]);
        $driver->setEntityManager($em = $this->createMock(EntityManagerInterface::class));

        $em->expects($this->any())
            ->method('getClassMetadata')
            ->willReturn(\Swisscat\SalesforceBundle\Test\Producer\TestCase::getCustomerMetadata());

        return [new SalesforcePublisherConsumer($mapper = new Mapper($driver, $em), $logger = $this->createMock(LoggerInterface::class), $saver = $this->createMock(BulkSaver::class)), $saver, $em];
    }

    /**
     * @param $mappingDir
     * @return \PHPUnit_Framework_MockObject_MockObject[]
     */
    protected function createBackConsumer($mappingDir)
    {
        $driver = new XmlDriver([dirname(__DIR__).'/TestData/MappingConfigurations/'.$mappingDir]);
        $driver->setEntityManager($em = $this->createMock(EntityManagerInterface::class));

        $em->expects($this->any())
            ->method('getClassMetadata')
            ->willReturn(\Swisscat\SalesforceBundle\Test\Producer\TestCase::getCustomerMetadata());

        return [new SalesforceBack([['name' => 'TestTopic', 'type' => 'topic', 'resource' => 'Swisscat\SalesforceBundle\Test\TestData\Customer']], $em, $driver, $this->createMock(LoggerInterface::class)), $em];
    }

    protected function generateSaveResult(array $params)
    {
        $saveResult = new SaveResult();
        $refl = new \ReflectionClass(SaveResult::class);

        foreach ($params as $property => $value) {
            $p = $refl->getProperty($property);
            $p->setAccessible(true);
            $p->setValue($saveResult,$value);
        }

        return $saveResult;
    }

    /**
     * @param array $params
     * @return AMQPMessage
     */
    protected function generateAmqpMessage(array $params)
    {
        return new AMQPMessage(json_encode(array_replace_recursive([
            'salesforce' => [
                'sObject'=> [
                    'fieldsToNull' => [],
                    'FirstName' => 'First',
                    'LastName' => 'Last',
                    'Email' => 'customer@test.com'
                ],
                'type' => 'Contact',
            ],
            'local' => [
                'id' => 10,
                'type' => 'Swisscat\\SalesforceBundle\\Test\\TestData\\Customer'
            ]
        ], $params)));
    }

    protected function generateAmqpBackMessage(array $params)
    {
        return new AMQPMessage(json_encode(array_replace_recursive([
            'channel' => '/topic/TestTopic',
            'data' => [
                'event' => [
                    'createdDate'=> (new \DateTime())->format(Event::DateFormat),
                    'type' => 'created',
                    'replayId' => 1,
                ],
                'sobject' => [
                    'Email' => 'customer@test.com',
                    'FirstName' => 'First',
                    'LastName' => 'Last',
                    'Id' => '0030Y00000fDbAQQA0'
                ],
            ],
        ], $params)));
    }
}


text:
'''
Fileserver backend which serves files pushed to the Master

The :mod:`cp.push <salt.modules.cp.push>` function allows Minions to push files
up to the Master. Using this backend, these pushed files are exposed to other
Minions via the Salt fileserver.

To enable minionfs, :conf_master:`file_recv` needs to be set to ``True`` in
the master config file (otherwise :mod:`cp.push <salt.modules.cp.push>` will
not be allowed to push files to the Master), and ``minion`` must be added to
the :conf_master:`fileserver_backends` list.

.. code-block:: yaml

    fileserver_backend:
      - minion

Other minionfs settings include: :conf_master:`minionfs_whitelist`,
:conf_master:`minionfs_blacklist`, :conf_master:`minionfs_mountpoint`, and
:conf_master:`minionfs_env`.

.. seealso:: :ref:`tutorial-minionfs`

'''
from __future__ import absolute_import

# Import python libs
import os
import logging

# Import salt libs
import salt.fileserver
import salt.utils
import salt.utils.url

log = logging.getLogger(__name__)

# Define the module's virtual name
__virtualname__ = 'minion'

def __virtual__():
    '''
    Only load if file_recv is enabled
    '''
    if __virtualname__ not in __opts__['fileserver_backend']:
        return False
    return __virtualname__ if __opts__['file_recv'] else False

def _is_exposed(minion):
    '''
    Check if the minion is exposed, based on the whitelist and blacklist
    '''
    return salt.utils.check_whitelist_blacklist(
        minion,
        whitelist=__opts__['minionfs_whitelist'],
        blacklist=__opts__['minionfs_blacklist']
    )

def find_file(path, tgt_env='base', **kwargs):  # pylint: disable=W0613
    '''
    Search the environment for the relative path
    '''
    fnd = {'path': '', 'rel': ''}
    if os.path.isabs(path):
        return fnd
    if tgt_env not in envs():
        return fnd
    if os.path.basename(path) == 'top.sls':
        log.debug('minionfs will NOT serve top.sls '
                  'for security reasons (path requested: {0})'.format(path))
        return fnd

    mountpoint = salt.utils.url.strip_proto(__opts__['minionfs_mountpoint'])
    # Remove the mountpoint to get the "true" path
    path = path[len(mountpoint):].lstrip(os.path.sep)
    try:
        minion, pushed_file = path.split(os.sep, 1)
    except ValueError:
        return fnd
    if not _is_exposed(minion):
        return fnd
    full = os.path.join(
        __opts__['cachedir'], 'minions', minion, 'files', pushed_file
    )
    if os.path.isfile(full) \
            and not salt.fileserver.is_file_ignored(__opts__, full):
        fnd['path'] = full
        fnd['rel'] = path
        fnd['stat'] = list(os.stat(full))
        return fnd
    return fnd

def envs():
    '''
    Returns the one environment specified for minionfs in the master
    configuration.
    '''
    return [__opts__['minionfs_env']]

def serve_file(load, fnd):
    '''
    Return a chunk from a file based on the data received

    CLI Example:

    .. code-block:: bash

        # Push the file to the master
        $ salt 'source-minion' cp.push /path/to/the/file
        $ salt 'destination-minion' cp.get_file salt://source-minion/path/to/the/file /destination/file
    '''
    ret = {'data': '', 'dest': ''}
    if not fnd['path']:
        return ret
    ret['dest'] = fnd['rel']
    gzip = load.get('gzip', None)

    # AP
    # May I sleep here to slow down serving of big files?
    # How many threads are serving files?
    with salt.utils.fopen(fnd['path'], 'rb') as fp_:
        fp_.seek(load['loc'])
        data = fp_.read(__opts__['file_buffer_size'])
        if gzip and data:
            data = salt.utils.gzip_util.compress(data, gzip)
            ret['gzip'] = gzip
        ret['data'] = data
    return ret

def update():
    '''
    When we are asked to update (regular interval) lets reap the cache
    '''
    try:
        salt.fileserver.reap_fileserver_cache_dir(
            os.path.join(__opts__['cachedir'], 'minionfs/hash'),
            find_file)
    except os.error:
        # Hash file won't exist if no files have yet been served up
        pass

def file_hash(load, fnd):
    '''
    Return a file hash, the hash type is set in the master config file
    '''
    path = fnd['path']
    ret = {}
    if 'env' in load:
        salt.utils.warn_until(
            'Carbon',
            'Passing a salt environment should be done using \'saltenv\' '
            'not \'env\'. This functionality will be removed in Salt Carbon.'
        )
        load['saltenv'] = load.pop('env')

    if load['saltenv'] not in envs():
        return {}

    # if the file doesn't exist, we can't get a hash
    if not path or not os.path.isfile(path):
        return ret

    # set the hash_type as it is determined by config-- so mechanism won't change that
    ret['hash_type'] = __opts__['hash_type']

    # check if the hash is cached
    # cache file's contents should be "hash:mtime"
    cache_path = os.path.join(
        __opts__['cachedir'],
        'minionfs/hash',
        load['saltenv'],
        '{0}.hash.{1}'.format(fnd['rel'], __opts__['hash_type'])
    )
    # if we have a cache, serve that if the mtime hasn't changed
    if os.path.exists(cache_path):
        try:
            with salt.utils.fopen(cache_path, 'rb') as fp_:
                try:
                    hsum, mtime = fp_.read().split(':')
                except ValueError:
                    log.debug(
                        'Fileserver attempted to read incomplete cache file. '
                        'Retrying.'
                    )
                    file_hash(load, fnd)
                    return ret
                if os.path.getmtime(path) == mtime:
                    # check if mtime changed
                    ret['hsum'] = hsum
                    return ret
        # Can't use Python select() because we need Windows support
        except os.error:
            log.debug(
                'Fileserver encountered lock when reading cache file. '
                'Retrying.'
            )
            file_hash(load, fnd)
            return ret

    # if we don't have a cache entry-- lets make one
    ret['hsum'] = salt.utils.get_hash(path, __opts__['hash_type'])
    cache_dir = os.path.dirname(cache_path)
    # make cache directory if it doesn't exist
    if not os.path.exists(cache_dir):
        os.makedirs(cache_dir)
    # save the cache object "hash:mtime"
    cache_object = '{0}:{1}'.format(ret['hsum'], os.path.getmtime(path))
    with salt.utils.flopen(cache_path, 'w') as fp_:
        fp_.write(cache_object)
    return ret

def file_list(load):
    '''
    Return a list of all files on the file server in a specified environment
    '''
    if 'env' in load:
        salt.utils.warn_until(
            'Carbon',
            'Passing a salt environment should be done using \'saltenv\' '
            'not \'env\'. This functionality will be removed in Salt Carbon.'
        )
        load['saltenv'] = load.pop('env')

    if load['saltenv'] not in envs():
        return []
    mountpoint = salt.utils.url.strip_proto(__opts__['minionfs_mountpoint'])
    prefix = load.get('prefix', '').strip('/')
    if mountpoint and prefix.startswith(mountpoint + os.path.sep):
        prefix = prefix[len(mountpoint + os.path.sep):]

    minions_cache_dir = os.path.join(__opts__['cachedir'], 'minions')
    minion_dirs = os.listdir(minions_cache_dir)

    # If the prefix is not an empty string, then get the minion id from it. The
    # minion ID will be the part before the first slash, so if there is no
    # slash, this is an invalid path.
    if prefix:
        tgt_minion, _, prefix = prefix.partition('/')
        if not prefix:
            # No minion ID in path
            return []
        # Reassign minion_dirs so we don't unnecessarily walk every minion's
        # pushed files
        if tgt_minion not in minion_dirs:
            log.warning(
                'No files found in minionfs cache for minion ID \'{0}\''
                .format(tgt_minion)
            )
            return []
        minion_dirs = [tgt_minion]

    ret = []
    for minion in minion_dirs:
        if not _is_exposed(minion):
            continue
        minion_files_dir = os.path.join(minions_cache_dir, minion, 'files')
        if not os.path.isdir(minion_files_dir):
            log.debug(
                'minionfs: could not find files directory under {0}!'
                .format(os.path.join(minions_cache_dir, minion))
            )
            continue
        walk_dir = os.path.join(minion_files_dir, prefix)
        # Do not follow links for security reasons
        for root, _, files in os.walk(walk_dir, followlinks=False):
            for fname in files:
                # Ignore links for security reasons
                if os.path.islink(os.path.join(root, fname)):
                    continue
                relpath = os.path.relpath(
                    os.path.join(root, fname), minion_files_dir
                )
                if relpath.startswith('../'):
                    continue
                rel_fn = os.path.join(mountpoint, minion, relpath)
                if not salt.fileserver.is_file_ignored(__opts__, rel_fn):
                    ret.append(rel_fn)
    return ret

# There should be no emptydirs
#def file_list_emptydirs(load):

def dir_list(load):
    '''
    Return a list of all directories on the master

    CLI Example:

    .. code-block:: bash

        $ salt 'source-minion' cp.push /absolute/path/file  # Push the file to the master
        $ salt 'destination-minion' cp.list_master_dirs
        destination-minion:
            - source-minion/absolute
            - source-minion/absolute/path
    '''
    if 'env' in load:
        salt.utils.warn_until(
            'Carbon',
            'Passing a salt environment should be done using \'saltenv\' '
            'not \'env\'. This functionality will be removed in Salt Carbon.'
        )
        load['saltenv'] = load.pop('env')

    if load['saltenv'] not in envs():
        return []
    mountpoint = salt.utils.url.strip_proto(__opts__['minionfs_mountpoint'])
    prefix = load.get('prefix', '').strip('/')
    if mountpoint and prefix.startswith(mountpoint + os.path.sep):
        prefix = prefix[len(mountpoint + os.path.sep):]

    minions_cache_dir = os.path.join(__opts__['cachedir'], 'minions')
    minion_dirs = os.listdir(minions_cache_dir)

    # If the prefix is not an empty string, then get the minion id from it. The
    # minion ID will be the part before the first slash, so if there is no
    # slash, this is an invalid path.
    if prefix:
        tgt_minion, _, prefix = prefix.partition('/')
        if not prefix:
            # No minion ID in path
            return []
        # Reassign minion_dirs so we don't unnecessarily walk every minion's
        # pushed files
        if tgt_minion not in minion_dirs:
            log.warning(
                'No files found in minionfs cache for minion ID \'{0}\''
                .format(tgt_minion)
            )
            return []
        minion_dirs = [tgt_minion]

    ret = []
    for minion in os.listdir(minions_cache_dir):
        if not _is_exposed(minion):
            continue
        minion_files_dir = os.path.join(minions_cache_dir, minion, 'files')
        if not os.path.isdir(minion_files_dir):
            log.warning(
                'minionfs: could not find files directory under {0}!'
                .format(os.path.join(minions_cache_dir, minion))
            )
            continue
        walk_dir = os.path.join(minion_files_dir, prefix)
        # Do not follow links for security reasons
        for root, _, _ in os.walk(walk_dir, followlinks=False):
            relpath = os.path.relpath(root, minion_files_dir)
            # Ensure that the current directory and directories outside of
            # the minion dir do not end up in return list
            if relpath in ('.', '..') or relpath.startswith('../'):
                continue
            ret.append(os.path.join(mountpoint, minion, relpath))
    return ret


text:
package com.google.android.exoplayer2.source;

import com.google.android.exoplayer2.C;
import com.google.android.exoplayer2.FormatHolder;
import com.google.android.exoplayer2.decoder.DecoderInputBuffer;
import java.io.IOException;

/**
 * A stream of media samples (and associated format information).
 */
public interface SampleStream {

  /**
   * Returns whether data is available to be read.
   * <p>
   * Note: If the stream has ended then a buffer with the end of stream flag can always be read from
   * {@link #readData(FormatHolder, DecoderInputBuffer)}. Hence an ended stream is always ready.
   *
   * @return Whether data is available to be read.
   */
  boolean isReady();

  /**
   * Throws an error that's preventing data from being read. Does nothing if no such error exists.
   *
   * @throws IOException The underlying error.
   */
  void maybeThrowError() throws IOException;

  /**
   * Attempts to read from the stream.
   *
   * @param formatHolder A {@link FormatHolder} to populate in the case of reading a format.
   * @param buffer A {@link DecoderInputBuffer} to populate in the case of reading a sample or the
   *     end of the stream. If the end of the stream has been reached, the
   *     {@link C#BUFFER_FLAG_END_OF_STREAM} flag will be set on the buffer.
   * @return The result, which can be {@link C#RESULT_NOTHING_READ}, {@link C#RESULT_FORMAT_READ} or
   *     {@link C#RESULT_BUFFER_READ}.
   */
  int readData(FormatHolder formatHolder, DecoderInputBuffer buffer);

  /**
   * Attempts to skip to the keyframe before the specified time.
   *
   * @param timeUs The specified time.
   */
  void skipToKeyframeBefore(long timeUs);

}


text:
<?php

namespace Test\Database\Cli;

use Neutrino\Constants\Services;
use Neutrino\Database\Schema\DialectInterface;
use Phalcon\Db\Adapter;

/**
 * Class FreshTaskTest
 *
 * @package Test\Database\Cli
 */
class FreshTaskTest extends DatabaseCliTestCase
{
    public function testMainAction()
    {
        $db = $this->mockService(Services::DB, Adapter::class, true);
        $db
            ->expects($this->exactly(2))
            ->method('execute');

        $db
            ->expects($this->once())
            ->method('getDialect')
            ->willReturn($this->createMock(DialectInterface::class));
        $db
            ->expects($this->once())
            ->method('listTables')
            ->willReturn([]);

        $this->output->expects($this->once())->method('info')->with('Dropped all tables successfully.');

        $this->migrator->expects($this->once())->method('storageExist')->willReturn(true);
        $this->migrator->expects($this->once())->method('paths')->willReturn([]);
        $this->migrator->expects($this->once())->method('getNotes')->willReturn([]);
        $this->migrator->expects($this->once())->method('run')->with(
            [BASE_PATH . '/migrations'],
            ['step' => 0, 'pretend' => false]
        );

        $this->dispatchCli('quark migrate:fresh');
    }
}


text:
"use strict";

window.devtoolsFormatters = [
  {
    header: function(x) {
      if (x.proxyTarget) {
//        return ["span", {"style": "background-color: #fcc"}, "Hello!"];
        return ["object", {"object": x.proxyTarget}];
      } else {
        return null;
      }
    },
    hasBody: function(x) {
      return x.constructor && x.constructor === Proxy;
    },
    body: function(x) {
      const targetRef = ["object", {"object": x.target}];
      return ["ol", {}, ["li", {}, "world!"], ["li", {}, targetRef]];
    }
  }
];


text:
.. module:: examples

.. _tutorials:

=====================
Tutorials & Topics
=====================

Tutorials
==============

Most of the material presented in the these tutorials is based on the
:mod:`examples` module in the `pulsar distribution <https://github.com/quantmind/pulsar>`_.

.. toctree::
   :maxdepth: 1

   hello
   clients
   wsgi
   deploy
   httpbin
   proxy
   calculator
   chat
   flask
   philosophers
   pulsards
   udp
   logging

Topics
==============

These sections cover **pulsar internals** for the curious reader.

.. toctree::
   :maxdepth: 1

   actors
   command
   messages
   events
   signal
   sync
   benchmarking
   cextensions


text:
			{{item.post.title}}

{{item.post.player.name}}

Loading data...


text:
/** \file
 * Serial implementation of scalar, vector and tensor fields for 3D data analysis.
 * -- header file
 */

#include "core/globalDefs.h"
#include "multiBlock/multiContainerBlock3D.h"
#include "multiBlock/defaultMultiBlockPolicy3D.h"
#include "core/blockIdentifiers.h"

namespace plb {

MultiContainerBlock3D::MultiContainerBlock3D (
        MultiBlockManagement3D const& multiBlockManagement_,
        CombinedStatistics* combinedStatistics_ )

    : MultiBlock3D(multiBlockManagement_,
                   defaultMultiBlockPolicy3D().getBlockCommunicator(),
                   combinedStatistics_)
{
    allocateBlocks();
}

MultiContainerBlock3D::~MultiContainerBlock3D() {
    deAllocateBlocks();
}

MultiContainerBlock3D::MultiContainerBlock3D(plint nx_, plint ny_, plint nz_)
    : MultiBlock3D (
            // Default envelope-width to 0
            defaultMultiBlockPolicy3D().getMultiBlockManagement(nx_,ny_,nz_, 0),
            defaultMultiBlockPolicy3D().getBlockCommunicator(),
            defaultMultiBlockPolicy3D().getCombinedStatistics() )
{
    allocateBlocks();
}

MultiContainerBlock3D::MultiContainerBlock3D(MultiBlock3D const& rhs)
    : MultiBlock3D(rhs)
{
    allocateBlocks();
}

MultiContainerBlock3D::MultiContainerBlock3D(MultiBlock3D const& rhs, Box3D subDomain, bool crop)
    : MultiBlock3D (
            intersect(rhs.getMultiBlockManagement(), subDomain, crop),
            rhs.getBlockCommunicator().clone(),
            rhs.getCombinedStatistics().clone() )
{
    allocateBlocks();
}

MultiContainerBlock3D::MultiContainerBlock3D(MultiContainerBlock3D const& rhs)
    : MultiBlock3D(rhs)
{
    allocateBlocks(rhs);
}

MultiContainerBlock3D& MultiContainerBlock3D::operator= (
        MultiContainerBlock3D const& rhs )
{
    MultiContainerBlock3D tmp(rhs);
    swap(tmp);
    return *this;
}

MultiContainerBlock3D* MultiContainerBlock3D::clone() const {
    return new MultiContainerBlock3D(*this);
}

MultiContainerBlock3D* MultiContainerBlock3D::clone (
        MultiBlockManagement3D const& multiBlockManagement ) const
{
    // By definition, the data of a multi container block cannot be redistributed over
    //   a different block arrangement. Consequently, this function only creates a
    //   multi container block with the desired multi block management, but then it
    //   is the responsibility of the caller to initialize its data appropriately.
    return new MultiContainerBlock3D(multiBlockManagement, defaultMultiBlockPolicy3D().getCombinedStatistics());
}

void MultiContainerBlock3D::swap(MultiContainerBlock3D& rhs) {
    blocks.swap(rhs.blocks);
    MultiBlock3D::swap(rhs);
}

void MultiContainerBlock3D::allocateBlocks()
{
    for (pluint iBlock=0; iBlock<this->getLocalInfo().getBlocks().size(); ++iBlock)
    {
        plint blockId = this->getLocalInfo().getBlocks()[iBlock];
        SmartBulk3D bulk(this->getMultiBlockManagement(), blockId);
        Box3D envelope = bulk.computeEnvelope();
        AtomicContainerBlock3D* newBlock =
            new AtomicContainerBlock3D (
                    envelope.getNx(), envelope.getNy(), envelope.getNz() );
        newBlock -> setLocation(Dot3D(envelope.x0, envelope.y0, envelope.z0));
        blocks[blockId] = newBlock;
    }
}

void MultiContainerBlock3D::allocateBlocks(MultiContainerBlock3D const& rhs)
{
    for (pluint iBlock=0; iBlock<this->getLocalInfo().getBlocks().size(); ++iBlock)
    {
        plint blockId = this->getLocalInfo().getBlocks()[iBlock];
        BlockMap::const_iterator it(rhs.blocks.find(blockId));
        PLB_ASSERT( it != rhs.blocks.end() );
        AtomicContainerBlock3D* newBlock = new AtomicContainerBlock3D( *it->second );
        blocks[blockId] = newBlock;
    }
}

void MultiContainerBlock3D::deAllocateBlocks()
{
    for (BlockMap::iterator it = blocks.begin(); it != blocks.end(); ++it)
    {
        delete it->second;
    }
}

AtomicContainerBlock3D& MultiContainerBlock3D::getComponent(plint blockId)
{
    BlockMap::iterator it = blocks.find(blockId);
    PLB_ASSERT (it != blocks.end());
    return *it->second;
}

AtomicContainerBlock3D const& MultiContainerBlock3D::
    getComponent(plint blockId) const
{
    BlockMap::const_iterator it = blocks.find(blockId);
    PLB_ASSERT (it != blocks.end());
    return *it->second;
}

plint MultiContainerBlock3D::sizeOfCell() const {
    return 0;
}

plint MultiContainerBlock3D::getCellDim() const {
    return 0;
}

int MultiContainerBlock3D::getStaticId() const {
    return 0;
}

void MultiContainerBlock3D::copyReceive (
                MultiBlock3D const& fromBlock, Box3D const& fromDomain,
                Box3D const& toDomain, modif::ModifT whichData )
{
    PLB_ASSERT( false );
}

std::string MultiContainerBlock3D::getBlockName() const {
    return std::string("ContainerBlock3D");
}

std::vector<std::string> MultiContainerBlock3D::getTypeInfo() const {
    return std::vector<std::string>();
}

MultiContainerBlock3D* createContainerBlock(MultiBlock3D& templ, ContainerBlockData* data)
{
    MultiContainerBlock3D* dataContainer = new MultiContainerBlock3D(templ);

    MultiBlockManagement3D const& management = templ.getMultiBlockManagement();
    ThreadAttribution const& threadAttribution = management.getThreadAttribution();
    SparseBlockStructure3D const& sparseBlock = management.getSparseBlockStructure();
    std::map<plint,Box3D> const& domains = sparseBlock.getBulks();

    std::map<plint,Box3D>::const_iterator it = domains.begin();
    plint pos = 0;
    for (; it != domains.end(); ++it, ++pos) {
        plint id = it->first;
        if (threadAttribution.isLocal(id)) {
            AtomicContainerBlock3D& atomicDataContainer = dataContainer->getComponent(id);
            ContainerBlockData* nextData = data->clone();
            nextData->setUniqueID(pos);
            atomicDataContainer.setData(nextData);
        }
    }

    delete data;
    return dataContainer;
}

}  // namespace plb


text:
package com.yahoo.athenz.zms;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.yahoo.rdl.*;

//
// Quota - The representation for a quota object
//
public class Quota {
    public String name;
    public int subdomain;
    public int role;
    public int roleMember;
    public int policy;
    public int assertion;
    public int entity;
    public int service;
    public int serviceHost;
    public int publicKey;
    @RdlOptional
    @JsonInclude(JsonInclude.Include.NON_EMPTY)
    public Timestamp modified;

    public Quota setName(String name) {
        this.name = name;
        return this;
    }
    public String getName() {
        return name;
    }
    public Quota setSubdomain(int subdomain) {
        this.subdomain = subdomain;
        return this;
    }
    public int getSubdomain() {
        return subdomain;
    }
    public Quota setRole(int role) {
        this.role = role;
        return this;
    }
    public int getRole() {
        return role;
    }
    public Quota setRoleMember(int roleMember) {
        this.roleMember = roleMember;
        return this;
    }
    public int getRoleMember() {
        return roleMember;
    }
    public Quota setPolicy(int policy) {
        this.policy = policy;
        return this;
    }
    public int getPolicy() {
        return policy;
    }
    public Quota setAssertion(int assertion) {
        this.assertion = assertion;
        return this;
    }
    public int getAssertion() {
        return assertion;
    }
    public Quota setEntity(int entity) {
        this.entity = entity;
        return this;
    }
    public int getEntity() {
        return entity;
    }
    public Quota setService(int service) {
        this.service = service;
        return this;
    }
    public int getService() {
        return service;
    }
    public Quota setServiceHost(int serviceHost) {
        this.serviceHost = serviceHost;
        return this;
    }
    public int getServiceHost() {
        return serviceHost;
    }
    public Quota setPublicKey(int publicKey) {
        this.publicKey = publicKey;
        return this;
    }
    public int getPublicKey() {
        return publicKey;
    }
    public Quota setModified(Timestamp modified) {
        this.modified = modified;
        return this;
    }
    public Timestamp getModified() {
        return modified;
    }

    @Override
    public boolean equals(Object another) {
        if (this != another) {
            if (another == null || another.getClass() != Quota.class) {
                return false;
            }
            Quota a = (Quota) another;
            if (name == null ? a.name != null : !name.equals(a.name)) {
                return false;
            }
            if (subdomain != a.subdomain) {
                return false;
            }
            if (role != a.role) {
                return false;
            }
            if (roleMember != a.roleMember) {
                return false;
            }
            if (policy != a.policy) {
                return false;
            }
            if (assertion != a.assertion) {
                return false;
            }
            if (entity != a.entity) {
                return false;
            }
            if (service != a.service) {
                return false;
            }
            if (serviceHost != a.serviceHost) {
                return false;
            }
            if (publicKey != a.publicKey) {
                return false;
            }
            if (modified == null ? a.modified != null : !modified.equals(a.modified)) {
                return false;
            }
        }
        return true;
    }
}


text:
function [imageXYZListLinearLinear toneMapProfileOut]=autoLinearLinear(params,imageXYZList)
% [imageXYZListLinearLinear toneMapProfile]=autoLinearLinear(params,imageXYZList)
%
% if function is called with no arguments, it returns a cell in which the first
% element specifies how many input vectors the function takes (for now, 1
% means that the function uses the sum of diffuse, ambient and specular
% light). the following elements of the cell specify the names of the parameters the
% function uses, which it expects to find in
% params.[function_name].[parameter_name] this is used by ward_gui in order
% to allow the user to specify the value of each parameter.
%
% if there are two output arguments, the second output is the profile of
% the settings used to execute the current tone mapping. this struct
% consists of toneMapProfile.autoLinearLinear.[cutOff,
% maxLightSpecularNew].
%
% if params.toneMapLock is true, this function expects to find a saved
% profile from its last execution in
% params.toneMapProfile.autoLinearLinear with the same fields as
% those mentioned above.
%
% if the number of light lists passed is more than one, pass them in the
% following order: diffuse, specular, ambient
%
% 12 August 2004 dpl wrote it.
%
% 12 august 2004 dpl wrote it.

if nargin==0
    imageXYZListLinearLinear{1}=1;
    imageXYZListLinearLinear{2}='lightConst';
    return;
end

% see if we're using saved params
useSaved=params.toneMapLock;

% find where imageXYZList isn't zero
i=find(imageXYZList(2,:));
imageXYZListNoZero=imageXYZList(2,i);

% get max value of image, and generate histogram bins

yMax=max(imageXYZListNoZero);
if useSaved
    cutOff=params.toneMapProfile.autoLinearLinear.cutOff;
else
    numBins=1000;
    binMax=log10(yMax);
    bins=logspace(0,binMax,numBins);
    histogram=hist(imageXYZListNoZero,bins);

    % chop off bottom of histogram and find max
    populated=find(histogram);
    [minPopulated minPopulatedIndex]=min(populated);
    chop=round(.05*numBins+minPopulated);
    histogram(1:chop)=0;
    [histMax index]=max(histogram);

    % set cut off point to be at center of next bin
    cutOff=1.1*bins(index);
    toneMapProfile.autoLinearLinear.cutOff=cutOff;
end

% find image minus bright spots
imageXYZListNoBright=zeros(size(imageXYZList));
j=find(imageXYZList(2,:)<cutOff);
imageXYZListNoBright(:,j)=imageXYZList(:,j);

% find image of bright spots
imageXYZListBright=zeros(size(imageXYZList));
k=find(imageXYZList(2,:)>=cutOff);
imageXYZListBright(:,k)=imageXYZList(:,k);

% now scale bright image given parameters
maxLightSpecular=max(imageXYZListBright(2,:));
if useSaved
    maxLightSpecularNew=params.toneMapProfile.autoLinearLinear.maxLightSpecularNew;
else
    maxLightDiffuse=max(imageXYZListNoBright(2,:));

    maxLightSpecularNew=maxLightDiffuse*(1/params.autoLinearLinear.lightConst-1);
    toneMapProfile.autoLinearLinear.maxLightSpecularNew=maxLightSpecularNew;
end
imageXYZListBrightNew=zeros(size(imageXYZListBright));
imageXYZListBrightNew=maxLightSpecularNew.*imageXYZListBright./maxLightSpecular;

imageXYZListBrightSquare=list2image(params,imageXYZListBright);
imageXYZListNoBrightSquare=list2image(params,imageXYZListNoBright);

% find ave color around the bright spot
[i j]=find(imageXYZListBrightSquare(:,:,2)==yMax);
numBrightPixelsPerSpot=length(k)/params.numLightSources;
measuringRadius=ceil(1.5*sqrt(numBrightPixelsPerSpot/pi));
imageXYZListNoBrightSmallSquare=imageXYZListNoBrightSquare((i-measuringRadius):(i+measuringRadius),(j-measuringRadius):(j+measuringRadius),:);
n=find(imageXYZListNoBrightSmallSquare(:,:,2));
for x=[1 2 3]
    temp=imageXYZListNoBrightSmallSquare(:,:,x);
    averageColor(x)=mean(mean(temp(n)));
end

% fill in center with this color
temp=repmat(averageColor',[1 length(k)]);
imageXYZListNoBright=imageXYZListNoBright;
imageXYZListNoBright(:,k)=temp;

% find places with large change, and replace those places with this color
imageXYZListNoBrightSquare=list2image(params,imageXYZListNoBright);
imageXYZListNoBrightSmallSquare=imageXYZListNoBrightSquare((i-measuringRadius):(i+measuringRadius),(j-measuringRadius):(j+measuringRadius),:);
noBrightChange=zeros(params.rows,params.cols);
change=gradient(imageXYZListNoBrightSmallSquare(:,:,2));
averageChange=mean(mean(abs(change)));
p=find(abs(change)>averageChange);
for x=1:3
    temp=imageXYZListNoBrightSmallSquare(:,:,x);
    temp(p)=averageColor(x);
    imageXYZListNoBrightSmallSquare(:,:,x)=temp;
end

% blur this area
blurFilter=1-fspecial('gaussian',8,3);
blurFilter=blurFilter/sum(sum(blurFilter));
imageXYZListNoBrightSmallSquare=imfilter(imageXYZListNoBrightSmallSquare,blurFilter,'replicate');

imageXYZListNoBrightSquare((i-measuringRadius):(i+measuringRadius),(j-measuringRadius):(j+measuringRadius),:)=imageXYZListNoBrightSmallSquare;
imageXYZListNoBright=image2list(params,imageXYZListNoBrightSquare);

% end function
imageXYZListLinearLinear=imageXYZListNoBright+imageXYZListBrightNew;
if (nargout==2)
    if useSaved
        toneMapProfileOut=params.toneMapProfile;
    else
        if isfield(params,'toneMapProfile')
            toneMapProfileOut=params.toneMapProfile;
        end
        toneMapProfileOut.autoLinearLinear=toneMapProfile.autoLinearLinear;
    end
end


text:
from dal.oracle.common import execute_select
from dal.oracle.era import db

__author__ = 'Ahmed G. Ali'

def retrieve_study_id_by_run_id(run_id):
    sql = """SELECT STUDY_ID FROM EXPERIMENT
 WHERE EXPERIMENT_ID = (SELECT EXPERIMENT_ID FROM RUN WHERE RUN_ID = '%s')""" % run_id
    return execute_select(sql, db)

def retrieve_runs_by_study_id(study_id):
    sql = """select * from RUN where EXPERIMENT_ID in
(SELECT EXPERIMENT_ID FROM EXPERIMENT WHERE STUDY_ID = '%s')""" % study_id
    return execute_select(sql, db)

def retrieve_samples_by_study_id(study_id):
    sql = """select es.experiment_id, s.* from SAMPLE s,EXPERIMENT_SAMPLE es  where es.EXPERIMENT_ID in
(SELECT EXPERIMENT_ID FROM EXPERIMENT  WHERE STUDY_ID = '%s') AND s.SAMPLE_ID = es.SAMPLE_ID""" % study_id
    return execute_select(sql, db)

def retrieve_files_by_study_id(study_id):
    sql = """select * from WEBIN_FILE  WHERE DATA_FILE_OWNER_ID in
(select RUN_ID from RUN where EXPERIMENT_ID in
(SELECT EXPERIMENT_ID FROM EXPERIMENT WHERE STUDY_ID = '%s') ) AND DATA_FILE_OWNER = 'RUN'""" % study_id
    return execute_select(sql, db)


text:
function results = vl_test(suite, test)
% VL_TEST  Run test suite
%  RESULTS = VL_TEST() runs all VLFeat test suites. The tests
%  verify that VLFeat is working correctly.
%
%  RESULTS is a structure listing the result of each test.
%  It has fileds:
%
%  TESTNAME:   name of the test
%  SUCCEDED:   a boolean flag indicating whether the test succeded
%  EXCEPTION:  the exception generated if the test failed
%
%  VL_TEST(SUITE) runs only the specified SUITE.
%
%  VL_TEST(SUITE, TEST) runs the specified SUITE/TEST without catching
%  the potential exception. Useful to DBSTOP to debug.

% Author: Andrea Vedaldi

% Copyright (C) 2013-14 Andrea Vedaldi.
% Copyright (C) 2007-12 Andrea Vedaldi and Brian Fulkerson.
% All rights reserved.
%
% This file is part of the VLFeat library and is made available under
% the terms of the BSD license (see the COPYING file).

clear functions ;

testRoot = fileparts(mfilename('fullpath')) ;

if nargin == 0
  files = dir(fullfile(testRoot, 'vl_test_*.m')) ;
elseif nargin == 1
  files.name = fullfile(['vl_test_' suite '.m']) ;
end

if nargin < 2
  results = {} ;
  for i = 1:length(files)
    testCommand = files(i).name(1:end-2) ;
    if strcmp(testCommand, 'vl_test_init'), continue ; end
    fprintf('vl_test: running %s\n', testCommand) ;
    results{i} = feval(str2func(testCommand)) ;
  end

  results = cat(2, results{:}) ;
  for i = 1:length(results)
    if results(i).succeded
      fprintf('vl_test: %-35s ... passed\n', results(i).testName) ;
    else
      fprintf('vl_test: %-35s ... failed\n', results(i).testName) ;
      fprintf('%s:%d: %s\n', ...
              results(i).exception.stack(1).name, ...
              results(i).exception.stack(1).line, ...
              results(i).exception.message) ;
    end
  end

  fprintf('vl_test: %d tested, %d succeded, %d failed\n', ...
          numel(results), sum([results.succeded]), sum(~[results.succeded])) ;
else
  feval(str2func(sprintf('vl_test_%s', suite)), test) ;
end


text:
<?xml version="1.0" encoding="utf-8"?>

<refentry xml:id="zmqsocket.connect" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
 <refnamediv>
  <refname>ZMQSocket::connect</refname>
  <refpurpose>Connect the socket</refpurpose>
 </refnamediv>

 <refsect1 role="description">
  &reftitle.description;
  <methodsynopsis>
   <modifier>public</modifier> <type>ZMQSocket</type><methodname>ZMQSocket::connect</methodname>
   <methodparam><type>string</type><parameter>dsn</parameter></methodparam>
   <methodparam choice="opt"><type>boolean</type><parameter>force</parameter><initializer>false</initializer></methodparam>
  </methodsynopsis>
  <para>
   Connect the socket to a remote endpoint. The endpoint is defined in format <literal>transport://address</literal> where
   transport is one of the following: inproc, ipc, tcp, pgm or epgm.
  </para>
 </refsect1>

 <refsect1 role="parameters">
  &reftitle.parameters;
  <para>
   <variablelist>
    <varlistentry>
     <term><parameter>dsn</parameter></term>
     <listitem>
      <para>
       The connect dsn, for example <literal>transport://address</literal>.
      </para>
     </listitem>
    </varlistentry>
    <varlistentry>
     <term><parameter>force</parameter></term>
     <listitem>
      <para>
       Tries to connect even if the socket has already been connected to given endpoint.
      </para>
     </listitem>
    </varlistentry>
   </variablelist>
  </para>
 </refsect1>

 <refsect1 role="examples">
 &reftitle.examples;
  <para>
   <example>
    <title>A <function>ZMQContext</function> example</title>
    <para>
     Construct a new context and allocate request socket from it
    </para>
    <programlisting role="php">
<![CDATA[
<?php
/* Server hostname */
$dsn = "tcp://127.0.0.1:5555";

/* Create a socket */
$socket = new ZMQSocket(new ZMQContext(), ZMQ::SOCKET_REQ, 'my socket');

/* Get list of connected endpoints */
$endpoints = $socket->getEndpoints();

/* Check if the socket is connected */
if (!in_array($dsn, $endpoints['connect'])) {
    echo "
Connecting to $dsn
";
    $socket->connect($dsn);
} else {
    echo "
Already connected to $dsn
";
}

/* Send and receive */
$socket->send("Hello!");
$message = $socket->recv();

echo "
Server said: {$message}
";
?>
]]>
    </programlisting>
   </example>
  </para>
 </refsect1>

 <refsect1 role="returnvalues">
  &reftitle.returnvalues;
  <para>
   Returns the current object. Throws ZMQSocketException on error.
  </para>
 </refsect1>

</refentry>


text:
/*
 * UltraCart Rest API V2
 *
 * UltraCart REST API Version 2
 *
 * OpenAPI spec version: 2.0.0
 * Contact: support@ultracart.com
 * Generated by: https://github.com/swagger-api/swagger-codegen.git
 */

using System;
using System.Linq;
using System.IO;
using System.Text;
using System.Text.RegularExpressions;
using System.Collections;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Runtime.Serialization;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
using System.ComponentModel.DataAnnotations;
using SwaggerDateConverter = com.ultracart.admin.v2.Client.SwaggerDateConverter;

namespace com.ultracart.admin.v2.Model
{
    /// <summary>
    /// ScreenRecordingFilterStringSearch
    /// </summary>
    [DataContract]
    public partial class ScreenRecordingFilterStringSearch :  IEquatable<ScreenRecordingFilterStringSearch>, IValidatableObject
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="ScreenRecordingFilterStringSearch" /> class.
        /// </summary>
        /// <param name="doesNotExist">doesNotExist.</param>
        /// <param name="exists">exists.</param>
        /// <param name="_is">_is.</param>
        /// <param name="isNot">isNot.</param>
        /// <param name="startsWith">startsWith.</param>
        public ScreenRecordingFilterStringSearch(bool? doesNotExist = default(bool?), bool? exists = default(bool?), string _is = default(string), string isNot = default(string), string startsWith = default(string))
        {
            this.DoesNotExist = doesNotExist;
            this.Exists = exists;
            this.Is = _is;
            this.IsNot = isNot;
            this.StartsWith = startsWith;
        }

        /// <summary>
        /// Gets or Sets DoesNotExist
        /// </summary>
        [DataMember(Name="does_not_exist", EmitDefaultValue=false)]
        public bool? DoesNotExist { get; set; }

        /// <summary>
        /// Gets or Sets Exists
        /// </summary>
        [DataMember(Name="exists", EmitDefaultValue=false)]
        public bool? Exists { get; set; }

        /// <summary>
        /// Gets or Sets Is
        /// </summary>
        [DataMember(Name="is", EmitDefaultValue=false)]
        public string Is { get; set; }

        /// <summary>
        /// Gets or Sets IsNot
        /// </summary>
        [DataMember(Name="is_not", EmitDefaultValue=false)]
        public string IsNot { get; set; }

        /// <summary>
        /// Gets or Sets StartsWith
        /// </summary>
        [DataMember(Name="starts_with", EmitDefaultValue=false)]
        public string StartsWith { get; set; }

        /// <summary>
        /// Returns the string presentation of the object
        /// </summary>
        /// <returns>String presentation of the object</returns>
        public override string ToString()
        {
            var sb = new StringBuilder();
            sb.Append("class ScreenRecordingFilterStringSearch {\n");
            sb.Append("  DoesNotExist: ").Append(DoesNotExist).Append("\n");
            sb.Append("  Exists: ").Append(Exists).Append("\n");
            sb.Append("  Is: ").Append(Is).Append("\n");
            sb.Append("  IsNot: ").Append(IsNot).Append("\n");
            sb.Append("  StartsWith: ").Append(StartsWith).Append("\n");
            sb.Append("}\n");
            return sb.ToString();
        }

        /// <summary>
        /// Returns the JSON string presentation of the object
        /// </summary>
        /// <returns>JSON string presentation of the object</returns>
        public virtual string ToJson()
        {
            return JsonConvert.SerializeObject(this, Formatting.Indented);
        }

        /// <summary>
        /// Returns true if objects are equal
        /// </summary>
        /// <param name="input">Object to be compared</param>
        /// <returns>Boolean</returns>
        public override bool Equals(object input)
        {
            return this.Equals(input as ScreenRecordingFilterStringSearch);
        }

        /// <summary>
        /// Returns true if ScreenRecordingFilterStringSearch instances are equal
        /// </summary>
        /// <param name="input">Instance of ScreenRecordingFilterStringSearch to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(ScreenRecordingFilterStringSearch input)
        {
            if (input == null)
                return false;

            return
                (
                    this.DoesNotExist == input.DoesNotExist ||
                    (this.DoesNotExist != null &&
                    this.DoesNotExist.Equals(input.DoesNotExist))
                ) &&
                (
                    this.Exists == input.Exists ||
                    (this.Exists != null &&
                    this.Exists.Equals(input.Exists))
                ) &&
                (
                    this.Is == input.Is ||
                    (this.Is != null &&
                    this.Is.Equals(input.Is))
                ) &&
                (
                    this.IsNot == input.IsNot ||
                    (this.IsNot != null &&
                    this.IsNot.Equals(input.IsNot))
                ) &&
                (
                    this.StartsWith == input.StartsWith ||
                    (this.StartsWith != null &&
                    this.StartsWith.Equals(input.StartsWith))
                );
        }

        /// <summary>
        /// Gets the hash code
        /// </summary>
        /// <returns>Hash code</returns>
        public override int GetHashCode()
        {
            unchecked // Overflow is fine, just wrap
            {
                int hashCode = 41;
                if (this.DoesNotExist != null)
                    hashCode = hashCode * 59 + this.DoesNotExist.GetHashCode();
                if (this.Exists != null)
                    hashCode = hashCode * 59 + this.Exists.GetHashCode();
                if (this.Is != null)
                    hashCode = hashCode * 59 + this.Is.GetHashCode();
                if (this.IsNot != null)
                    hashCode = hashCode * 59 + this.IsNot.GetHashCode();
                if (this.StartsWith != null)
                    hashCode = hashCode * 59 + this.StartsWith.GetHashCode();
                return hashCode;
            }
        }

        /// <summary>
        /// To validate all properties of the instance
        /// </summary>
        /// <param name="validationContext">Validation context</param>
        /// <returns>Validation Result</returns>
        IEnumerable<System.ComponentModel.DataAnnotations.ValidationResult> IValidatableObject.Validate(ValidationContext validationContext)
        {
            yield break;
        }
    }

}


text:
ACCEPTED

#### According to
The Catalogue of Life, 3rd January 2011

#### Published in
Sydowia 57(2): 272 (2005)

#### Original name
Fusoidispora Vijaykr., Jeewon & K.D. Hyde

### Remarks
null