text:
define(['exports', 'core-js', 'aurelia-logging', 'aurelia-metadata', 'aurelia-dependency-injection', 'aurelia-loader', 'aurelia-path', 'aurelia-templating', 'aurelia-binding', 'aurelia-task-queue'], function (exports, _coreJs, _aureliaLogging, _aureliaMetadata, _aureliaDependencyInjection, _aureliaLoader, _aureliaPath, _aureliaTemplating, _aureliaBinding, _aureliaTaskQueue) {
  'use strict';

  exports.__esModule = true;

  function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj['default'] = obj; return newObj; } }

  function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; }

  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }

  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }

  var _core = _interopRequireDefault(_coreJs);

  var logger = _aureliaLogging.getLogger('aurelia');

  function loadPlugin(aurelia, loader, info) {
    logger.debug('Loading plugin ' + info.moduleId + '.');
    aurelia.resourcesRelativeTo = info.resourcesRelativeTo;

    return loader.loadModule(info.moduleId).then(function (m) {
      if ('configure' in m) {
        return Promise.resolve(m.configure(aurelia, info.config || {})).then(function () {
          aurelia.resourcesRelativeTo = null;
          logger.debug('Configured plugin ' + info.moduleId + '.');
        });
      } else {
        aurelia.resourcesRelativeTo = null;
        logger.debug('Loaded plugin ' + info.moduleId + '.');
      }
    });
  }

  var Plugins = (function () {
    function Plugins(aurelia) {
      var _this = this;

      _classCallCheck(this, Plugins);

      this.aurelia = aurelia;
      this.info = [];
      this.processed = false;

      aurelia.addPreStartTask(function () {
        return System.normalize('aurelia-bootstrapper').then(function (bootstrapperName) {
          return _this.bootstrapperName = bootstrapperName;
        });
      });
    }

    Plugins.prototype.feature = function feature(plugin, config) {
      plugin = plugin.endsWith('.js') || plugin.endsWith('.ts') ? plugin.substring(0, plugin.length - 3) : plugin;
      return this.plugin({ moduleId: plugin + '/index', resourcesRelativeTo: plugin, config: config || {} });
    };

    Plugins.prototype.plugin = function plugin(_plugin, config) {
      if (typeof _plugin === 'string') {
        _plugin = _plugin.endsWith('.js') || _plugin.endsWith('.ts') ? _plugin.substring(0, _plugin.length - 3) : _plugin;
        return this.plugin({ moduleId: _plugin, resourcesRelativeTo: _plugin, config: config || {} });
      }

      if (this.processed) {
        loadPlugin(this.aurelia, this.aurelia.loader, _plugin);
      } else {
        this.info.push(_plugin);
      }

      return this;
    };

    Plugins.prototype.defaultBindingLanguage = function defaultBindingLanguage() {
      var _this2 = this;

      this.aurelia.addPreStartTask(function () {
        return System.normalize('aurelia-templating-binding', _this2.bootstrapperName).then(function (name) {
          _this2.aurelia.use.plugin(name);
        });
      });

      return this;
    };

    Plugins.prototype.router = function router() {
      var _this3 = this;

      this.aurelia.addPreStartTask(function () {
        return System.normalize('aurelia-templating-router', _this3.bootstrapperName).then(function (name) {
          _this3.aurelia.use.plugin(name);
        });
      });

      return this;
    };

    Plugins.prototype.history = function history() {
      var _this4 = this;

      this.aurelia.addPreStartTask(function () {
        return System.normalize('aurelia-history-browser', _this4.bootstrapperName).then(function (name) {
          _this4.aurelia.use.plugin(name);
        });
      });

      return this;
    };

    Plugins.prototype.defaultResources = function defaultResources() {
      var _this5 = this;

      this.aurelia.addPreStartTask(function () {
        return System.normalize('aurelia-templating-resources', _this5.bootstrapperName).then(function (name) {
          System.map['aurelia-templating-resources'] = name;
          _this5.aurelia.use.plugin(name);
        });
      });

      return this;
    };

    Plugins.prototype.eventAggregator = function eventAggregator() {
      var _this6 = this;

      this.aurelia.addPreStartTask(function () {
        return System.normalize('aurelia-event-aggregator', _this6.bootstrapperName).then(function (name) {
          System.map['aurelia-event-aggregator'] = name;
          _this6.aurelia.use.plugin(name);
        });
      });

      return this;
    };

    Plugins.prototype.standardConfiguration = function standardConfiguration() {
      return this.aurelia.use.defaultBindingLanguage().defaultResources().history().router().eventAggregator();
    };

    Plugins.prototype.developmentLogging = function developmentLogging() {
      var _this7 = this;

      this.aurelia.addPreStartTask(function () {
        return System.normalize('aurelia-logging-console', _this7.bootstrapperName).then(function (name) {
          return _this7.aurelia.loader.loadModule(name).then(function (m) {
            _aureliaLogging.addAppender(new m.ConsoleAppender());
            _aureliaLogging.setLevel(_aureliaLogging.logLevel.debug);
          });
        });
      });

      return this;
    };

    Plugins.prototype._process = function _process() {
      var _this8 = this;

      var aurelia = this.aurelia,
          loader = aurelia.loader,
          info = this.info,
          current;

      if (this.processed) {
        return;
      }

      var next = function next() {
        if (current = info.shift()) {
          return loadPlugin(aurelia, loader, current).then(next);
        }

        _this8.processed = true;
        return Promise.resolve();
      };

      return next();
    };

    return Plugins;
  })();

  exports.Plugins = Plugins;

  var logger = _aureliaLogging.getLogger('aurelia'),
      slice = Array.prototype.slice;

  if (!window.CustomEvent || typeof window.CustomEvent !== 'function') {
    var CustomEvent = function CustomEvent(event, params) {
      var params = params || {
        bubbles: false,
        cancelable: false,
        detail: undefined
      };

      var evt = document.createEvent('CustomEvent');
      evt.initCustomEvent(event, params.bubbles, params.cancelable, params.detail);
      return evt;
    };

    CustomEvent.prototype = window.Event.prototype;
    window.CustomEvent = CustomEvent;
  }

  function preventActionlessFormSubmit() {
    document.body.addEventListener('submit', function (evt) {
      var target = evt.target;
      var action = target.action;

      if (target.tagName.toLowerCase() === 'form' && !action) {
        evt.preventDefault();
      }
    });
  }

  function loadResources(container, resourcesToLoad, appResources) {
    var viewEngine = container.get(_aureliaTemplating.ViewEngine),
        importIds = Object.keys(resourcesToLoad),
        names = new Array(importIds.length),
        i,
        ii;

    for (i = 0, ii = importIds.length; i < ii; ++i) {
      names[i] = resourcesToLoad[importIds[i]];
    }

    return viewEngine.importViewResources(importIds, names, appResources);
  }

  function runTasks(aurelia, tasks) {
    var current = undefined,
        next = function next() {
      if (current = tasks.shift()) {
        return Promise.resolve(current(aurelia)).then(next);
      }

      return Promise.resolve();
    };

    return next();
  }

  var Aurelia = (function () {
    function Aurelia(loader, container, resources) {
      _classCallCheck(this, Aurelia);

      this.resourcesToLoad = {};
      this.preStartTasks = [];
      this.postStartTasks = [];
      this.loader = loader || new window.AureliaLoader();
      this.container = container || new _aureliaDependencyInjection.Container();
      this.resources = resources || new _aureliaTemplating.ResourceRegistry();
      this.use = new Plugins(this);

      this.withInstance(Aurelia, this);
      this.withInstance(_aureliaLoader.Loader, this.loader);
      this.withInstance(_aureliaTemplating.ResourceRegistry, this.resources);

      this.container.makeGlobal();
    }

    Aurelia.prototype.withInstance = function withInstance(type, instance) {
      this.container.registerInstance(type, instance);
      return this;
    };

    Aurelia.prototype.withSingleton = function withSingleton(type, implementation) {
      this.container.registerSingleton(type, implementation);
      return this;
    };

    Aurelia.prototype.withTransient = function withTransient(type, implementation) {
      this.container.registerTransient(type, implementation);
      return this;
    };

    Aurelia.prototype.globalizeResources = function globalizeResources(resources) {
      var toAdd = Array.isArray(resources) ? resources : arguments,
          i,
          ii,
          resource,
          path,
          resourcesRelativeTo = this.resourcesRelativeTo || '';

      for (i = 0, ii = toAdd.length; i < ii; ++i) {
        resource = toAdd[i];
        if (typeof resource != 'string') {
          throw new Error('Invalid resource path [' + resource + ']. Resources must be specified as relative module IDs.');
        }

        path = _aureliaPath.join(resourcesRelativeTo, resource);
        this.resourcesToLoad[path] = this.resourcesToLoad[path];
      }

      return this;
    };

    Aurelia.prototype.renameGlobalResource = function renameGlobalResource(resourcePath, newName) {
      this.resourcesToLoad[resourcePath] = newName;
      return this;
    };

    Aurelia.prototype.addPreStartTask = function addPreStartTask(task) {
      this.preStartTasks.push(task);
      return this;
    };

    Aurelia.prototype.addPostStartTask = function addPostStartTask(task) {
      this.postStartTasks.push(task);
      return this;
    };

    Aurelia.prototype.start = function start() {
      var _this9 = this;

      if (this.started) {
        return Promise.resolve(this);
      }

      this.started = true;
      logger.info('Aurelia Starting');

      preventActionlessFormSubmit();

      return runTasks(this, this.preStartTasks).then(function () {
        return _this9.use._process().then(function () {
          if (!_this9.container.hasHandler(_aureliaTemplating.BindingLanguage)) {
            var message = 'You must configure Aurelia with a BindingLanguage implementation.';
            logger.error(message);
            throw new Error(message);
          }

          if (!_this9.container.hasHandler(_aureliaTemplating.Animator)) {
            _aureliaTemplating.Animator.configureDefault(_this9.container);
          }

          return loadResources(_this9.container, _this9.resourcesToLoad, _this9.resources);
        }).then(function () {
          return runTasks(_this9, _this9.postStartTasks).then(function () {
            logger.info('Aurelia Started');
            var evt = new window.CustomEvent('aurelia-started', { bubbles: true, cancelable: true });
            document.dispatchEvent(evt);
            return _this9;
          });
        });
      });
    };

    Aurelia.prototype.enhance = function enhance() {
      var _this10 = this;

      var bindingContext = arguments[0] === undefined ? {} : arguments[0];
      var applicationHost = arguments[1] === undefined ? null : arguments[1];

      this._configureHost(applicationHost);

      return new Promise(function (resolve) {
        var viewEngine = _this10.container.get(_aureliaTemplating.ViewEngine);
        _this10.root = viewEngine.enhance(_this10.container, _this10.host, _this10.resources, bindingContext);
        _this10.root.attached();
        _this10._onAureliaComposed();
        return _this10;
      });
    };

    Aurelia.prototype.setRoot = function setRoot() {
      var _this11 = this;

      var root = arguments[0] === undefined ? 'app' : arguments[0];
      var applicationHost = arguments[1] === undefined ? null : arguments[1];

      var compositionEngine,
          instruction = {};

      this._configureHost(applicationHost);

      compositionEngine = this.container.get(_aureliaTemplating.CompositionEngine);
      instruction.viewModel = root;
      instruction.container = instruction.childContainer = this.container;
      instruction.viewSlot = new _aureliaTemplating.ViewSlot(this.host, true);
      instruction.viewSlot.transformChildNodesIntoView();
      instruction.host = this.host;

      return compositionEngine.compose(instruction).then(function (root) {
        _this11.root = root;
        instruction.viewSlot.attached();
        _this11._onAureliaComposed();
        return _this11;
      });
    };

    Aurelia.prototype._configureHost = function _configureHost(applicationHost) {
      applicationHost = applicationHost || this.host;

      if (!applicationHost || typeof applicationHost == 'string') {
        this.host = document.getElementById(applicationHost || 'applicationHost') || document.body;
      } else {
        this.host = applicationHost;
      }

      this.host.aurelia = this;
      this.container.registerInstance(_aureliaTemplating.DOMBoundary, this.host);
    };

    Aurelia.prototype._onAureliaComposed = function _onAureliaComposed() {
      var evt = new window.CustomEvent('aurelia-composed', { bubbles: true, cancelable: true });
      setTimeout(function () {
        return document.dispatchEvent(evt);
      }, 1);
    };

    return Aurelia;
  })();

  exports.Aurelia = Aurelia;

  _defaults(exports, _interopRequireWildcard(_aureliaDependencyInjection));

  _defaults(exports, _interopRequireWildcard(_aureliaBinding));

  _defaults(exports, _interopRequireWildcard(_aureliaMetadata));

  _defaults(exports, _interopRequireWildcard(_aureliaTemplating));

  _defaults(exports, _interopRequireWildcard(_aureliaLoader));

  _defaults(exports, _interopRequireWildcard(_aureliaTaskQueue));

  _defaults(exports, _interopRequireWildcard(_aureliaPath));

  var LogManager = _aureliaLogging;
  exports.LogManager = LogManager;
});


text:
using Jal.Aop.Aspects;
using Microsoft.Extensions.DependencyInjection;
using System;
using System.Collections.Generic;

namespace Jal.Aop.Microsoft.Extensions.DependencyInjection.Apects.Installer
{
    public class AopAspectsBuilder : IAopAspectsBuilder
    {
        private readonly IServiceCollection _container;

        public List<Type> Types { get; }

        public AopAspectsBuilder(IServiceCollection container, List<Type> types)
        {
            _container = container;

            Types = types;
        }

        public IAopAspectsBuilder AddAdvice<TImplementation>() where TImplementation : class, IAdvice
        {
            _container.AddSingleton<IAdvice, TImplementation>();

            return this;
        }

        public IAopAspectsBuilder AddLogger<TImplementation>() where TImplementation : class, ILogger
        {
            _container.AddSingleton<ILogger, TImplementation>();

            return this;
        }

        public IAopAspectsBuilder AddAspect<TImplementation>() where TImplementation : class, IAspect
        {
            var type = typeof(TImplementation);

            Types.Add(type);

            _container.AddTransient(typeof(IAspect), type);

            return this;
        }
    }
}

redpajama_set_name: RedPajamaGithub


text:
<?php

namespace CsvMigrations\Test\TestCase\Utility;

use Cake\TestSuite\TestCase;
use CsvMigrations\Utility\Panel;

class PanelTest extends TestCase
{
    protected $config;

    public function setUp(): void
    {
        parent::setUp();

        $this->config = [
            'panels' => [
                'Foobar' => "(%%type%% == 'foobar' && %%name%% == 'antonis')",
            ],
        ];
    }

    public function tearDown(): void
    {
        unset($this->config);

        parent::tearDown();
    }

    public function testgetName(): void
    {
        $panel = new Panel('Foobar', $this->config);
        $this->assertEquals('Foobar', $panel->getName());
    }

    /**
     * @expectedException RuntimeException
     */
    public function testSetNameException(): void
    {
        $panel = new Panel('Foobar', $this->config);
        $panel->setName();
    }

    /**
     * @expectedException \Symfony\Component\ExpressionLanguage\SyntaxError
     */
    public function testInvalidExpression(): void
    {
        $panel = new Panel('Foobar', ['panels' => ['Foobar' => '(this is not a valid expression)']]);

        $panel->evalExpression([]);
    }

    /**
     * @dataProvider evalExpressionScenariosProvider
     * @param mixed[] $data
     */
    public function testEvalExpression(string $scenario, string $expression, array $data, bool $expected): void
    {
        $panelName = 'Foobar';
        $config['panels']['Foobar'] = $expression;
        $panel = new Panel($panelName, $config);
        $this->assertEquals($expected, $panel->evalExpression($data), sprintf('%s - Expression evaluation failed', $scenario));
        unset($panel);
    }

    /**
     * @return mixed[]
     */
    public function evalExpressionScenariosProvider(): array
    {
        return [
            [
                'Scenario 1 - string comparison',
                "%%status%% == 'first attempt'",
                ['status' => 'first attempt'],
                true,
            ],
            [
                'Scenario 2 - string with special character',
                "%%status%% == 'attempt #1'",
                ['status' => 'attempt #1'],
                true,
            ],
            [
                'Scenario 3 - logical operator AND',
                "%%status%% == 'active' && %%active%% == false",
                ['status' => 'active', 'active' => false],
                true,
            ],
            [
                'Scenario 4 - logical operator NOT',
                "!(%%status%% == 'active')",
                ['status' => 'deactive'],
                true,
            ],
            [
                'Scenario 5 - logical operator OR',
                "%%status%% == 'active' || %%active%% == false",
                ['status' => 'active', 'active' => true],
                true,
            ],
        ];
    }

    public function testGetPanels(): void
    {
        $config['panels']['Company'] = "(%%type%% == 'individual')";
        $config['panels']['Personal'] = "(%%type%% == 'company')";
        $actual = Panel::getPanelNames($config);
        $expected = ['Company', 'Personal'];

        $this->assertEquals($expected, $actual, 'Does not return the actual panel names from config.');

        $config = [];
        $actual = Panel::getPanelNames($config);
        $expected = [];

        $this->assertEquals($expected, $actual, 'On an empty config, the function should return an empty array.');
    }

    /**
     * Test expression evaluation with extra objects.
     *
     * @dataProvider evalExpressionScenariosWithExtrasProvider
     * @param string $scenario Scenario name
     * @param string $expression Expression to evaluate
     * @param mixed[] $data Fields data
     * @param mixed[] $extras Extra objects to be passed to expression evaluator
     * @param bool $expected Expected result
     * @return void
     */
    public function testEvalExpressionWithExtras(string $scenario, string $expression, array $data, array $extras, bool $expected): void
    {
        $panelName = 'Foobar';
        $config['panels']['Foobar'] = $expression;
        $panel = new Panel($panelName, $config);
        $this->assertEquals($expected, $panel->evalExpression($data, $extras), sprintf('%s - Expression evaluation failed', $scenario));
        unset($panel);
    }

    /**
     * Helper method for checking value in {@link self::testEvalExpressionWithExtras()}
     *
     * @param mixed $foo Value of foo
     * @return bool True if bar
     */
    public function isReallyBar($foo): bool
    {
        return $foo === 'bar';
    }

    /**
     * @return mixed[]
     */
    public function evalExpressionScenariosWithExtrasProvider(): array
    {
        return [
            [
                'Scenario 1 - Call function on custom object',
                "%%hello%% == 'world' && object.isReallyBar(%%foo%%)",
                ['foo' => 'bar', 'hello' => 'world'],
                ['object' => $this],
                true,
            ],
        ];
    }
}


text:
<?php

namespace EFParser;

use EFParserInterface\IExcel;

/**
 * Class excelParser.
 * Класс содержит общие свойства и методы, которые используются в классах Sheet, Сell
 */
class Excel implements IExcel
{
    /**
     * Документ
     *
     * @var string
     */
    public $sourceFile;

    /**
     * Путь к документу
     *
     * @var string
     */
    public $sourceFilePath;

    /**
     * Объект ридера
     *
     * @var string
     */
    public $sourceReader;

    /**
     * excelParser constructor.
     *
     * @param string $file (Документ)
     *
     * @param string $path (Путь)
     */
    public function __construct($file, $path)
    {
        $this->sourceFile       = $file;
        $this->sourceFilePath   = $path;
        $this->sourceReader     = $this->getReader();
    }

    /**
     * Метод возвращает ридер для документа
     *
     * @return PHPExcel_Reader_IReader  (Ридер документа)
     *
     * @throws PHPExcel_Reader_Exception (Не удалось определить тип документа)
     */
    public function getReader()
    {
        $readerType = \PHPExcel_IOFactory::identify($this->sourceFilePath . $this->sourceFile);

        return \PHPExcel_IOFactory::createReader($readerType);
    }

    /**
     * Метод возвращает массив с распарсенными данными, отсеивая null значения
     *
     * @param array $objPHPExcel (Масив данных полученных с помощью toArray())
     *
     * @return array
     */
    public function getData(array $objPHPExcel)
    {
        $data = array();

        foreach ($objPHPExcel as $key => $item)
        {
            foreach ($item as $value)
            {
                if (!is_null($value))
                {
                    $data[$key][] = $value;
                }
            }
        }

        return $data;
    }
}


text:
<?php
namespace ARIPD\BlogBundle\DataFixtures\ORM;
use ARIPD\UserBundle\DataFixtures\ORM\UserFixtures;
use ARIPD\BlogBundle\Entity\Tag;
use Doctrine\Common\Persistence\ObjectManager;
use Doctrine\Common\DataFixtures\AbstractFixture;
use Doctrine\Common\DataFixtures\DependentFixtureInterface;
use ARIPD\BlogBundle\Entity\Post;
use ARIPD\BlogBundle\Entity\Topic;
use ARIPD\AdminBundle\Util\ARIPDString;

class PostFixtures extends AbstractFixture implements DependentFixtureInterface {

	public static $NOFRecords = 100;

	public function load(ObjectManager $manager) {
		foreach (range(1, self::$NOFRecords) as $value) {

			$entity = new Post();
			$entity->setApproved(rand(0, 1));
			$entity->setName('Blog Post' . $value);
			$entity->setContent(ARIPDString::generateLoremIpsum(rand(1, 8)));
			$entity->setUser($manager->merge($this->getReference('aripduser_user-' . rand(1, count(UserFixtures::$initials)))));
			foreach (range(1, 8) as $v_tag) {
				$tag = new Tag();
				$tag->setName('tag-' . $v_tag);

				$entity->addTag($tag);
			}

			$manager->persist($entity);
			$this->addReference('aripdblog_post-' . $value, $entity);

		}

		$manager->flush();

	}

	public function getDependencies() {
		return array(
				'ARIPD\UserBundle\DataFixtures\ORM\UserFixtures',
		);
	}

}


text:
package test.parameters;

import org.testng.annotations.*;

import test.BaseTest;

/**
 * This class
 *
 * @author Cedric Beust, Jul 22, 2004
 *
 */
public class ParameterTest extends BaseTest {

//  @Configuration(beforeTestMethod = true)
//  public void methodSetUp() {
//    m_testRunner.setClasses(new Class[] { test.ParameterTest.class });
//  }

  public static void ppp(String s) {
    System.out.println("[ParameterTest] " + s);
  }

  @Test
  public void stringSingle() {
    addClass("test.parameters.ParameterSample");
    setParameter("first-name", "Cedric");
    addIncludedGroup("singleString");
    run();
    String[] passed = {
      "testSingleString",
      "testSingleStringDeprecated",
    };
    String[] failed = {
    };
    verifyTests("Passed", passed, getPassedTests());
    verifyTests("Failed", failed, getFailedTests());
  }

}


text:
from enum import Enum
from azure.core import CaseInsensitiveEnumMeta

class CreateMode(str, Enum, metaclass=CaseInsensitiveEnumMeta):
    """The mode to create a new server."""

    DEFAULT = "Default"
    POINT_IN_TIME_RESTORE = "PointInTimeRestore"
    GEO_RESTORE = "GeoRestore"
    REPLICA = "Replica"

class GeoRedundantBackup(str, Enum, metaclass=CaseInsensitiveEnumMeta):
    """Enable Geo-redundant or not for server backup."""

    ENABLED = "Enabled"
    DISABLED = "Disabled"

class IdentityType(str, Enum, metaclass=CaseInsensitiveEnumMeta):
    """The identity type. Set this to 'SystemAssigned' in order to automatically create and assign an
    Azure Active Directory principal for the resource.
    """

    SYSTEM_ASSIGNED = "SystemAssigned"

class InfrastructureEncryption(str, Enum, metaclass=CaseInsensitiveEnumMeta):
    """Add a second layer of encryption for your data using new encryption algorithm which gives
    additional data protection. Value is optional but if passed in, must be 'Disabled' or
    'Enabled'.
    """

    #: Default value for single layer of encryption for data at rest.
    ENABLED = "Enabled"
    #: Additional (2nd) layer of encryption for data at rest
    DISABLED = "Disabled"

class MinimalTlsVersionEnum(str, Enum, metaclass=CaseInsensitiveEnumMeta):
    """Enforce a minimal Tls version for the server."""

    TLS1_0 = "TLS1_0"
    TLS1_1 = "TLS1_1"
    TLS1_2 = "TLS1_2"
    TLS_ENFORCEMENT_DISABLED = "TLSEnforcementDisabled"

class OperationOrigin(str, Enum, metaclass=CaseInsensitiveEnumMeta):
    """The intended executor of the operation."""

    NOT_SPECIFIED = "NotSpecified"
    USER = "user"
    SYSTEM = "system"

class PrivateEndpointProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta):
    """State of the private endpoint connection."""

    APPROVING = "Approving"
    READY = "Ready"
    DROPPING = "Dropping"
    FAILED = "Failed"
    REJECTING = "Rejecting"

class PrivateLinkServiceConnectionStateActionsRequire(str, Enum, metaclass=CaseInsensitiveEnumMeta):
    """The actions required for private link service connection."""

    NONE = "None"

class PrivateLinkServiceConnectionStateStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta):
    """The private link service connection status."""

    APPROVED = "Approved"
    PENDING = "Pending"
    REJECTED = "Rejected"
    DISCONNECTED = "Disconnected"

class PublicNetworkAccessEnum(str, Enum, metaclass=CaseInsensitiveEnumMeta):
    """Whether or not public network access is allowed for this server. Value is optional but if
    passed in, must be 'Enabled' or 'Disabled'.
    """

    ENABLED = "Enabled"
    DISABLED = "Disabled"

class QueryPerformanceInsightResetDataResultState(str, Enum, metaclass=CaseInsensitiveEnumMeta):
    """Indicates result of the operation."""

    SUCCEEDED = "Succeeded"
    FAILED = "Failed"

class SecurityAlertPolicyName(str, Enum, metaclass=CaseInsensitiveEnumMeta):
    """SecurityAlertPolicyName."""

    DEFAULT = "Default"

class ServerKeyType(str, Enum, metaclass=CaseInsensitiveEnumMeta):
    """The key type like 'AzureKeyVault'."""

    AZURE_KEY_VAULT = "AzureKeyVault"

class ServerSecurityAlertPolicyState(str, Enum, metaclass=CaseInsensitiveEnumMeta):
    """Specifies the state of the policy, whether it is enabled or disabled."""

    ENABLED = "Enabled"
    DISABLED = "Disabled"

class ServerState(str, Enum, metaclass=CaseInsensitiveEnumMeta):
    """A state of a server that is visible to user."""

    READY = "Ready"
    DROPPING = "Dropping"
    DISABLED = "Disabled"
    INACCESSIBLE = "Inaccessible"

class ServerVersion(str, Enum, metaclass=CaseInsensitiveEnumMeta):
    """The version of a server."""

    FIVE6 = "5.6"
    FIVE7 = "5.7"
    EIGHT0 = "8.0"

class SkuTier(str, Enum, metaclass=CaseInsensitiveEnumMeta):
    """The tier of the particular SKU, e.g. Basic."""

    BASIC = "Basic"
    GENERAL_PURPOSE = "GeneralPurpose"
    MEMORY_OPTIMIZED = "MemoryOptimized"

class SslEnforcementEnum(str, Enum, metaclass=CaseInsensitiveEnumMeta):
    """Enable ssl enforcement or not when connect to server."""

    ENABLED = "Enabled"
    DISABLED = "Disabled"

class StorageAutogrow(str, Enum, metaclass=CaseInsensitiveEnumMeta):
    """Enable Storage Auto Grow."""

    ENABLED = "Enabled"
    DISABLED = "Disabled"

class VirtualNetworkRuleState(str, Enum, metaclass=CaseInsensitiveEnumMeta):
    """Virtual Network Rule State."""

    INITIALIZING = "Initializing"
    IN_PROGRESS = "InProgress"
    READY = "Ready"
    DELETING = "Deleting"
    UNKNOWN = "Unknown"


text:
<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <title>Angular2 seed</title>
</head>

<body>

<sample-app>Loading...</sample-app>

<script src="/libs/system-csp-production.js"></script>
<script>
	System.config({
		defaultJSExtensions: true
	});
</script>
<script src="/libs/angular2.dev.js"></script>
<script>
    System.import('app').then(function (app) {
        app.main();
    }).catch(console.error.bind(console));
</script>

</body>
</html>


text:
<?php

namespace Composer\Test\Installer;

use Composer\Installer\InstallerEvent;
use Composer\Test\TestCase;

class InstallerEventTest extends TestCase
{
    public function testGetter()
    {
        $composer = $this->getMockBuilder('Composer\Composer')->getMock();
        $io = $this->getMockBuilder('Composer\IO\IOInterface')->getMock();
        $transaction = $this->getMockBuilder('Composer\DependencyResolver\LockTransaction')->disableOriginalConstructor()->getMock();
        $event = new InstallerEvent('EVENT_NAME', $composer, $io, true, true, $transaction);

        $this->assertSame('EVENT_NAME', $event->getName());
        $this->assertInstanceOf('Composer\Composer', $event->getComposer());
        $this->assertInstanceOf('Composer\IO\IOInterface', $event->getIO());
        $this->assertTrue($event->isDevMode());
        $this->assertTrue($event->isExecutingOperations());
        $this->assertInstanceOf('Composer\DependencyResolver\Transaction', $event->getTransaction());
    }
}


text:
/*
 * null
 *
 * [FhirComposite("ConceptMapConceptMapComponent")]
 * [Serializable]
 */

#import "FHIRElement.h"

#import "FHIRConceptMap.h"

@class FHIRUri;
@class FHIRCode;
@class FHIRString;
@class FHIROtherConceptComponent;

@interface FHIRConceptMapConceptMapComponent : FHIRElement

/*
 * System of the target
 */
@property (nonatomic, strong) FHIRUri *systemElement;

@property (nonatomic, strong) NSString *system;

/*
 * Code that identifies the target concept
 */
@property (nonatomic, strong) FHIRCode *codeElement;

@property (nonatomic, strong) NSString *code;

/*
 * equal | equivalent | wider | subsumes | narrower | specialises | inexact | unmatched | disjoint
 */
@property (nonatomic, strong) FHIRCode/*<code>*/ *equivalenceElement;

@property (nonatomic) kConceptMapEquivalence equivalence;

/*
 * Description of status/issues in mapping
 */
@property (nonatomic, strong) FHIRString *commentsElement;

@property (nonatomic, strong) NSString *comments;

/*
 * Other concepts that this mapping also produces
 */
@property (nonatomic, strong) NSArray/*<OtherConceptComponent>*/ *product;

- (FHIRErrorList *)validate;

@end


text:
{% extends 'layout/styleguide.html' %}

{% set page_title = 'Templates' %}

{% block content %}

{{page_title}}

Templates are made when the layout component is combined with other components. These templates can be found here.

Create links to your templates here.

{% endblock %}


text:
from django.contrib import messages
from django.http import HttpResponseRedirect
from django.template.loader import render_to_string
from django.views.generic import TemplateView

from django_cradmin import javascriptregistry
from django_cradmin.apps.cradmin_generic_token_with_metadata.models import GenericTokenWithMetadata, \
    GenericTokenExpiredError

class ActivateAccountView(TemplateView, javascriptregistry.viewmixin.StandaloneBaseViewMixin):
    template_name = 'cradmin_activate_account/activate.django.html'
    appname = 'cradmin_activate_account'

    #: The template used to render the success message.
    #: Default value for :obj:`~.ActivateAccountView.get_success_message_template`
    success_message_template = 'cradmin_activate_account/messages/success.django.html'

    def get(self, *args, **kwargs):
        self.token_does_not_exist = False
        self.token_expired = False
        try:
            token = GenericTokenWithMetadata.objects.get_and_validate(
                token=self.kwargs['token'], app=self.appname)
        except GenericTokenWithMetadata.DoesNotExist:
            self.token_does_not_exist = True
        except GenericTokenExpiredError:
            self.token_expired = True
        else:
            return self.token_is_valid(token)
        return super(ActivateAccountView, self).get(*args, **kwargs)

    def get_context_data(self, **kwargs):
        context = super(ActivateAccountView, self).get_context_data(**kwargs)
        self.add_javascriptregistry_component_ids_to_context(context=context)
        context['token_does_not_exist'] = self.token_does_not_exist
        context['token_expired'] = self.token_expired
        return context

    def get_success_message_template(self):
        """
        Get the template used to render the success message.
        Defaults to :obj:`~.ActivateAccountView.success_message_template`.
        """
        return self.success_message_template

    def get_success_message(self, user):
        """
        Get the success message added by :meth:`.add_success_message`.

        Defaults to rendering the :meth:`.get_success_message_template`
        template.
        """
        return render_to_string(self.get_success_message_template(), {
            'user': user
        }).strip()

    def add_success_message(self, user):
        """
        Add success message.

        Defaults to adding the value of :meth:`~.ActivateAccountView.get_success_message`
        as a django messages framework success message.
        """
        messages.success(self.request, self.get_success_message(user))

    def activate_user(self, user):
        """
        Activate the user.

        You can override this to provide custom user activation code,
        but you will most likely want to override the ``activate_user()``
        method of your User model if you have a custom user model.
        """
        if hasattr(user, 'activate_user'):
            user.activate_user()
        else:
            user.is_active = True
        user.save()

    def token_is_valid(self, token):
        user = token.content_object
        next_url = token.metadata['next_url']
        self.activate_user(user)
        self.add_success_message(user)
        return HttpResponseRedirect(next_url)


text:
var cordova = require('../src/cordova/cordova'),
    platforms = require('../src/platforms/platforms'),
    HooksRunner = require('../src/hooks/HooksRunner'),
    Q = require('q'),
    util = require('../src/cordova/util');

var supported_platforms = Object.keys(platforms).filter(function(p) { return p != 'www'; });

describe('run command', function() {
    var is_cordova, cd_project_root, list_platforms, fire, platformApi, getPlatformApi;
    var project_dir = '/some/path';
    var prepare_spy;

    beforeEach(function() {
        is_cordova = spyOn(util, 'isCordova').andReturn(project_dir);
        cd_project_root = spyOn(util, 'cdProjectRoot').andReturn(project_dir);
        list_platforms = spyOn(util, 'listPlatforms').andReturn(supported_platforms);
        fire = spyOn(HooksRunner.prototype, 'fire').andReturn(Q());
        prepare_spy = spyOn(cordova.raw, 'prepare').andReturn(Q());
        platformApi = {
            run: jasmine.createSpy('run').andReturn(Q()),
            build: jasmine.createSpy('build').andReturn(Q())
        };
        getPlatformApi = spyOn(platforms, 'getPlatformApi').andReturn(platformApi);
    });
    describe('failure', function() {
        it('should not run inside a Cordova-based project with no added platforms by calling util.listPlatforms', function(done) {
            list_platforms.andReturn([]);
            Q().then(cordova.raw.run).then(function() {
                expect('this call').toBe('fail');
            }, function(err) {
                expect(err.message).toEqual('No platforms added to this project. Please use `cordova platform add <platform>`.');
            }).fin(done);
        });
        it('should not run outside of a Cordova-based project', function(done) {
            var msg = 'Dummy message about not being in a cordova dir.';
            cd_project_root.andThrow(new Error(msg));
            is_cordova.andReturn(false);
            Q().then(cordova.raw.run).then(function() {
                expect('this call').toBe('fail');
            }, function(err) {
                expect(err.message).toEqual(msg);
            }).fin(done);
        });
    });

    describe('success', function() {
        it('should call prepare before actually run platform ', function(done) {
            cordova.raw.run(['android','ios']).then(function() {
                expect(prepare_spy).toHaveBeenCalledWith({ platforms: [ 'android', 'ios' ], verbose: false, options: [] });
            }, function(err) {
                expect(err).toBeUndefined();
            }).fin(done);
        });
        it('should get PlatformApi instance for each platform and call its\' run method', function(done) {
            cordova.raw.run(['android','ios']).then(function() {
                expect(getPlatformApi).toHaveBeenCalledWith('android');
                expect(getPlatformApi).toHaveBeenCalledWith('ios');
                expect(platformApi.build).toHaveBeenCalled();
                expect(platformApi.run).toHaveBeenCalled();
            }, function(err) {
                expect(err).toBeUndefined();
            }).fin(done);
        });
        it('should pass down parameters', function(done) {
            cordova.raw.run({platforms: ['blackberry10'], options:{password: '1q1q'}}).then(function() {
                expect(prepare_spy).toHaveBeenCalledWith({ platforms: [ 'blackberry10' ], options: { password: '1q1q' }, verbose: false });
                expect(platformApi.build).toHaveBeenCalledWith({password: '1q1q'});
                expect(platformApi.run).toHaveBeenCalledWith({password: '1q1q', nobuild: true});
            }, function(err) {
                expect(err).toBeUndefined();
            }).fin(done);
        });
        it('should convert parameters from old format and warn user about this', function (done) {
            function warnSpy(message) {
                expect(message).toMatch('The format of cordova.raw.* methods "options" argument was changed');
            }

            cordova.on('warn', warnSpy);
            cordova.raw.run({platforms: ['blackberry10'], options:['--password=1q1q']}).then(function() {
                expect(prepare_spy).toHaveBeenCalledWith({ platforms: [ 'blackberry10' ],
                    options: jasmine.objectContaining({argv:['--password=1q1q']}), verbose: false });
                expect(platformApi.run).toHaveBeenCalledWith(jasmine.objectContaining({argv:['--password=1q1q']}));
            }, function(err) {
                expect(err).toBeUndefined();
            })
            .fin(function () {
                cordova.off('warn', warnSpy);
                done();
            });
        });

        it('should call platform\'s build method', function (done) {
            cordova.raw.run({platforms: ['blackberry10']})
            .then(function() {
                expect(prepare_spy).toHaveBeenCalled();
                expect(platformApi.build).toHaveBeenCalledWith({});
                expect(platformApi.run).toHaveBeenCalledWith(jasmine.objectContaining({nobuild: true}));
            }, function(err) {
                expect(err).toBeUndefined();
            })
            .fin(done);
        });

        it('should not call build if --nobuild option is passed', function (done) {
            cordova.raw.run({platforms: ['blackberry10'], options: { nobuild: true }})
            .then(function() {
                expect(prepare_spy).toHaveBeenCalled();
                expect(platformApi.build).not.toHaveBeenCalled();
                expect(platformApi.run).toHaveBeenCalledWith(jasmine.objectContaining({nobuild: true}));
            }, function(err) {
                expect(err).toBeUndefined();
            })
            .fin(done);
        });

        describe('run parameters should not be altered by intermediate build command', function() {
            var originalBuildSpy;
            beforeEach(function() {
                originalBuildSpy = platformApi.build;
                platformApi.build = jasmine.createSpy('build').andCallFake(function(opts) {
                    opts.couldBeModified = 'insideBuild';
                    return Q();
                });
            });
            afterEach(function() {
                platformApi.build = originalBuildSpy;
            });
            it('should leave parameters unchanged', function(done) {
                cordova.raw.run({platforms: ['blackberry10'], options:{password: '1q1q'}}).then(function() {
                    expect(prepare_spy).toHaveBeenCalledWith({ platforms: [ 'blackberry10' ], options: { password: '1q1q', 'couldBeModified': 'insideBuild' }, verbose: false });
                    expect(platformApi.build).toHaveBeenCalledWith({password: '1q1q', 'couldBeModified': 'insideBuild'});
                    expect(platformApi.run).toHaveBeenCalledWith({password: '1q1q', nobuild: true});
                }, function(err) {
                    expect(err).toBeUndefined();
                }).fin(done);
            });
        });
    });

    describe('hooks', function() {
        describe('when platforms are added', function() {
            it('should fire before hooks through the hooker module', function(done) {
                cordova.raw.run(['android', 'ios']).then(function() {
                    expect(fire).toHaveBeenCalledWith('before_run', {verbose: false, platforms:['android', 'ios'], options: []});
                }, function(err) {
                    expect(err).toBeUndefined();
                }).fin(done);
            });
            it('should fire after hooks through the hooker module', function(done) {
                cordova.raw.run('android').then(function() {
                     expect(fire).toHaveBeenCalledWith('after_run', {verbose: false, platforms:['android'], options: []});
                }, function(err) {
                    expect(err).toBeUndefined();
                }).fin(done);
            });
        });

        describe('with no platforms added', function() {
            it('should not fire the hooker', function(done) {
                list_platforms.andReturn([]);
                Q().then(cordova.raw.run).then(function() {
                    expect('this call').toBe('fail');
                }, function(err) {
                    expect(fire).not.toHaveBeenCalled();
                    expect(err.message).toEqual('No platforms added to this project. Please use `cordova platform add <platform>`.');
                }).fin(done);
            });
        });
    });
});


text:
package PerlSvc;

use Win32::PerfLib;
use CGI::Carp qw(carpout);
use IO::Socket qw(:DEFAULT :crlf);
use POSIX qw(uname);
use Fcntl qw(:flock);

# Get Operating System
my $os = (uname)[0];
$os =~ s/ //g;

# Slurp in path to Perfhome
$perfhome=&PATH;
$perfhome =~ s/\\bin//;
$perfOutFile="$perfhome/tmp/perf.out";

$perf="$perfhome/bin/perf.exe";

# Remove perf out file if it exists
if (-f "$perfOutFile") {
    unlink "$perfOutFile"
        or die "ERROR: Couldn't delete $perfOutFile: $!\n";
}

# Slurp in Configuration
my %conf       = ();
&GetConfiguration(\%conf);

# Set Environment Variables from %conf
foreach $key (keys %conf) {
        $ENV{$key}="$conf{$key}";
}

# Convert Intervals from minutes to seconds
$ENV{'RUN_INTERVAL'}=$ENV{'RUN_INTERVAL'} * 60;

# Log all alerts and warnings to the below logfile
my $logfile = "$perfhome/var/perfctl.log";
open(LOGFILE, ">> $logfile")
	or die "Unable to append to $logfile: $!\n";
carpout(*LOGFILE);

# Remove counter files if exist
&CounterRemove;

# Organize rates of data collection
&DataCollection;

# Organize Normal services into hash for sorting
foreach my $serviceBasic (@serviceBasicNormal) {
	$intervalBasic_h{$serviceBasic}=$ENV{'RUN_INTERVAL'};
}

# Organize unique services into hash for sorting
foreach my $serviceBasic (@serviceBasicUnique) {
	$serviceBasic =~ m/(\S+):(\d+)/;
       	$serviceBasic=$1; my $interval=$2;
       	$interval=$interval * 60;
	$intervalBasic_h{$serviceBasic}=$interval;
}

# Organize Normal extention services into hash for sorting
foreach my $serviceExt (@serviceExtNormal) {
  $serviceExt="$perfhome/ext/$serviceExt";
	$intervalExt_h{$serviceExt}=$ENV{'RUN_INTERVAL'};
}

# Organize unique extention services into hash for sorting
foreach my $serviceExt (@serviceExtUnique) {
	$serviceExt =~ m/(\S+):(\d+)/;
       	$serviceExt=$1; my $interval=$2;
        $serviceExt="$perfhome/ext/$serviceExt";
       	$interval=$interval * 60;
	$intervalExt_h{$serviceExt}=$interval;
}

# Main Body of Program
# Run metrics and sleep for X interval
sub Startup {

  # Open connection to perfmon data counters
  $perflib = new Win32::PerfLib($server);

  while (ContinueRun(10)) {

    my $currTime=time;

    # Determine if this is the first time through
    if (! defined $first)  {
		  $first="1";

      # Build has relating basic service to it's runtime interval
		  foreach my $serviceBasic (keys %intervalBasic_h) {

			 $newtime=$currTime + $intervalBasic_h{$serviceBasic};
			 $timeBasic_h{$serviceBasic}=$newtime;
      }

      # Build has relating extention service to it's runtime interval
		  foreach my $serviceExt (keys %intervalExt_h) {

			 $newtime=$currTime + $intervalExt_h{$serviceExt};
			 $timeExt_h{$serviceExt}=$newtime;
      }

    } else {
		  # Run service and reset it's time counter if it is = or < the current time
		  foreach my $serviceBasic (keys %timeBasic_h) {

        my $updateTime=();
        if ($currTime >= $timeBasic_h{$serviceBasic}) {
				  my $updateTime=$currTime + $intervalBasic_h{$serviceBasic};
				  $timeBasic_h{$serviceBasic}=$updateTime;
          &RunProgram($serviceBasic);
			   }
      }

      # Run extention service and reset it's time counter if it is = or < the current time
		  foreach my $serviceExt (keys %timeExt_h) {

        my $updateTime=();
        if ($currTime >= $timeExt_h{$serviceExt}) {
          $extFlag="1";
				  my $updateTime=$currTime + $intervalExt_h{$serviceExt};
				  $timeExt_h{$serviceExt}=$updateTime;
				  &RunProgram($serviceExt,$extFlag);
			   }
      }

      # Send data if it has been collected
      if (-f "$perfOutFile") {
          &SendData;
      }
    }
 }
 # Close connection to perfmon data counters
 $perflib->Close();
}

# Determine data collection
sub DataCollection {
	foreach my $serviceBasic (@servicesBasic) {
		# Separate unique/normal intervals for basic services
		if ($serviceBasic =~ m/\S+:\d+/) {
			push(@serviceBasicUnique,$serviceBasic);
		} elsif ($serviceBasic =~ m/\S+/) {
			push(@serviceBasicNormal,$serviceBasic);
		}
	}

  foreach my $serviceExt (@servicesExt) {
    # Separate unique/normal intervals for extention services
    if ($serviceExt =~ m/\S+:\d+/) {
      push(@serviceExtUnique,$serviceExt);
    } elsif ($serviceExt =~ m/\S+/) {
      push(@serviceExtNormal,$serviceExt);
    }
	}
}

# Run data gathering/services programs
sub RunProgram {

	my $service=shift;
  my $extFlag=shift;

	# Run data colloection program, service, or status
	warn "DEBUG: Running $service Service\n" if ($ENV{'DEBUG'});

    # Run Service program
    if (! defined $extFlag) {
      &$service;

    } else {
      system($service);
    }
}

### Metrics Gathering Section ###

# CPU Sub
sub cpu {

  my $service="cpu";

  # Index numbers for PerfLib
  my $processor = 238;
  my $queue = 1300;
  my $sys = 6;
  my $usr = 142;
  my $priv = 144;
  my $queue_length = 1302;

  # Initialize some variables
  my $proc_ref0 = {};
  my $proc_ref1 = {};
  my $queue_ref0 = {};
  my $proc_time=();
  my $user_time=();
  my $priv_time=();
  my $load=();
  my $Numerator0=();
  my $Numerator1=();
  my $Denominator0=();
  my $Denominator1=();

  # Navigate PerfLib data structure
  $perflib->GetObjectList($processor, $proc_ref0);
  sleep 1;
  $perflib->GetObjectList($processor, $proc_ref1);
  $perflib->GetObjectList($queue, $queue_ref0);

  my $instance_ref0 = $proc_ref0->{Objects}->{$processor}->{Instances};
  my $instance_ref1 = $proc_ref1->{Objects}->{$processor}->{Instances};

  foreach $p (keys %{$instance_ref0}) {

    my $counter_ref0 = $instance_ref0->{$p}->{Counters};
    my $counter_ref1 = $instance_ref1->{$p}->{Counters};

    foreach $i (keys %{$counter_ref0}){

        # Get the total of all processors only
        if ($instance_ref0->{$p}->{Name} eq "_Total") {

            if($counter_ref0->{$i}->{CounterNameTitleIndex} == $usr) {

                my $Numerator0 = $counter_ref0->{$i}->{Counter};
                my $Denominator0 = $proc_ref0->{PerfTime100nSec};
                my $Numerator1 = $counter_ref1->{$i}->{Counter};
                my $Denominator1 = $proc_ref1->{PerfTime100nSec};
                $user_time = (($Numerator1 - $Numerator0) /
                    ($Denominator1 - $Denominator0 )) * 100;
            }

            if($counter_ref0->{$i}->{CounterNameTitleIndex} == $priv) {

                my $Numerator0 = $counter_ref0->{$i}->{Counter};
                my $Denominator0 = $proc_ref0->{PerfTime100nSec};
                my $Numerator1 = $counter_ref1->{$i}->{Counter};
                my $Denominator1 = $proc_ref1->{PerfTime100nSec};
                $priv_time = (($Numerator1 - $Numerator0) /
                    ($Denominator1 - $Denominator0 )) * 100;
            }

        }
      }
  }

  # Calculate processor Idle time
  my $idl_time=100 - ($user_time + $priv_time);

  # Gather Load Average
  my $instance_ref0 = $queue_ref0->{Objects}->{$queue}->{Instances};

  foreach $p (keys %{$instance_ref0}) {

      my $counter_ref0 = $instance_ref0->{$p}->{Counters};

      foreach $i (keys %{$counter_ref0}){

          # Get the total of all processors only
          if ($instance_ref0->{$p}->{Name} eq "Blocking Queue") {

              if($counter_ref0->{$i}->{CounterNameTitleIndex} == $queue_length) {
                  my $Numerator0 = $counter_ref0->{$i}->{Counter};
                  $load="$Numerator0";
              }
          }
      }
  }

  # Send Data to Perf Server
  my $perfOut="$os data $service $user_time $priv_time $idl_time $load";
  &PerfOut($perfOut);

}

# Memory Sub
sub memory {

  my $service="mem";

  # Index numbers for PerfLib
  my $memory = 4;
  my $swap = 700;
  my $avail_mem_index = 1382;
  my $committed_index = 26;
  my $pages_in_index = 822;
  my $pages_out_index = 48;
  my $page_faults_index = 28;
  my $swap_usage_index = 702;

  # Initialize some variables
  my $mem_ref0 = {};
  my $mem_ref1 = {};
  my $swap_ref0 = {};
  my $mem_avail_mb=();
  my $mem_comm_mb=();
  $pages_in=();
  $pages_out=();
  my $page_faults=();
  my $swap_used_pct=();
  my $Numerator0=();
  my $Denominator0=();

  # Navigate PerfLib data structure
  $perflib->GetObjectList($memory, $mem_ref0);
  $perflib->GetObjectList($memory, $mem_ref1);
  $perflib->GetObjectList($swap, $swap_ref0);

  my $instance_ref0 = $mem_ref0->{Objects}->{$memory}->{Counters};
  my $instance_ref1 = $mem_ref1->{Objects}->{$memory}->{Counters};

  # Gather memory info
  foreach $p (keys %{$instance_ref0}) {

    my $counter_ref0 = $instance_ref0->{$p};
    my $counter_ref1 = $instance_ref1->{$p};

    foreach $i (keys %{$counter_ref0}){

        if($counter_ref0->{CounterNameTitleIndex} == $avail_mem_index) {

            $mem_avail_mb=$counter_ref0->{Counter};
        }

        if($counter_ref0->{CounterNameTitleIndex} == $committed_index) {

            $mem_comm_mb=$counter_ref0->{Counter};
            $mem_comm_mb=$mem_comm_mb / 1024 /1024;

        }

        if($counter_ref0->{CounterNameTitleIndex} == $pages_in_index) {
            $pages_in = $counter_ref1->{Counter};
        }

        if($counter_ref0->{CounterNameTitleIndex} == $pages_out_index) {
            $pages_out = $counter_ref1->{Counter};
        }
    }
  }

  # Gather swap info
  my $instance_ref0 = $swap_ref0->{Objects}->{$swap}->{Instances};

  foreach $p (keys %{$instance_ref0}) {

    my $counter_ref0 = $instance_ref0->{$p}->{Counters};

    foreach $i (keys %{$counter_ref0}){

        # Get the total of all paging files
        if ($instance_ref0->{$p}->{Name} eq "_Total") {

            if($counter_ref0->{$i}->{CounterNameTitleIndex} == $swap_usage_index) {

                if ($counter_ref0->{$i}->{CounterType} == 0x20020400) {
                    $Numerator0 = $counter_ref0->{$i}->{Counter};
                }
                if ($counter_ref0->{$i}->{CounterType} == 0x40030403) {
                    $Denominator0 = $counter_ref0->{$i}->{Counter};
                }
                $swap_used_pct=($Numerator0 / $Denominator0) * 100;

            }
         }
    }
  }

  # Handle Counter Data
  $counterData="pages_in pages_out";
  &COUNTERS($service,$counterData);

  # Figure out memory utlization
  my $mem_total_mb=$mem_avail_mb + $mem_comm_mb;
  my $mem_used_pct=($mem_comm_mb / $mem_total_mb) * 100;

  # Send Data to Perf Server
  my $perfOut="$os data $service $mem_used_pct $swap_used_pct $pages_in $pages_out";
  &PerfOut($perfOut);

}

# File System Sub
sub fs {

  my $service="fs";

  # Index numbers for PerfLib
  my $disk = 236;
  my $disk_free_mb_index = 410;
  my $disk_free_pct_index = 408;

  # Initialize some variables
  my $disk_ref0 = {};
  my $disk_ref1 = {};
  my $disk_free_mb=();
  my $disk_free_pct=();
  my $Numerator0=();

  # Navigate PerfLib data structure
  $perflib->GetObjectList($disk, $disk_ref0);

  $perflib->GetObjectList($disk, $disk_ref1);
  $perflib->Close();

  my $instance_ref0 = $disk_ref0->{Objects}->{$disk}->{Instances};
  my $instance_ref1 = $disk_ref1->{Objects}->{$disk}->{Instances};

  foreach my $p (keys %{$instance_ref0}) {

      my $counter_ref0 = $instance_ref0->{$p}->{Counters};
      my $counter_ref1 = $instance_ref1->{$p}->{Counters};

      foreach my $i (keys %{$counter_ref0}){

          my $disk_name="$instance_ref0->{$p}->{Name}";
          $disk_name =~ s/://g;

          if ($disk_name eq "_Total") {
              $disk_name =~ s/_//g;
          }

          if ($counter_ref0->{$i}->{CounterNameTitleIndex} == $disk_free_pct_index) {
              my $Countertype = $counter_ref0->{$i}->{CounterType};

              if ($Countertype eq 1073939459) {
                  $Base0 = $counter_ref0->{$i}->{Counter};
              }

              if ($Countertype eq 537003008) {
                  $Numerator0 = $counter_ref0->{$i}->{Counter};
              }

              if (defined $Base0 && $Numerator0) {
                  $disk_free_pct = ($Numerator0 / $Base0) * 100;
                  # Reset Values for next calculation
                  $Base0=();
                  $Numerator0=();
                  $disk_used_pct = 100 - $disk_free_pct;
                  push (@{$diskfs_h{$disk_name}}, $disk_used_pct);
              }
          }
      }
  }

  # Send Data to Perf Server
  foreach $key (sort keys %diskfs_h) {
    $perfOut="$os data $service $key @{$diskfs_h{$key}}";

    &PerfOut($perfOut);
  }
  undef %diskfs_h;
}

# IO Sub
sub io {

  my $service="io";

  # Index numbers for PerfLib
  my $disk = 236;
  my $disk_read_index = 220;
  my $disk_write_index = 222;
  my $disk_busy_index = 200;

  # Initialize some variables
  my $disk_ref0 = {};
  my $disk_ref1 = {};
  my $disk_read_kb=();
  my $disk_write_kb=();
  my $disk_busy_pct=();
  my $Numerator0=();

  # Navigate PerfLib data structure
  $perflib->GetObjectList($disk, $disk_ref0);

  $perflib->GetObjectList($disk, $disk_ref1);
  $perflib->Close();

  my $instance_ref0 = $disk_ref0->{Objects}->{$disk}->{Instances};
  my $instance_ref1 = $disk_ref1->{Objects}->{$disk}->{Instances};

  foreach my $p (keys %{$instance_ref0}) {

      my $counter_ref0 = $instance_ref0->{$p}->{Counters};
      my $counter_ref1 = $instance_ref1->{$p}->{Counters};

      foreach my $i (keys %{$counter_ref0}){

          my $disk_name="$instance_ref0->{$p}->{Name}";
          $disk_name =~ s/://g;

          if ($disk_name eq "_Total") {
              $disk_name =~ s/_//g;
          }

          if ($counter_ref0->{$i}->{CounterNameTitleIndex} == $disk_read_index) {

              $avg_disk_read_bytes = $counter_ref1->{$i}->{Counter};
              #$avg_disk_read_kb=$avg_disk_read_bytes / 1024;
              $avg_disk_read_kb=(($avg_disk_read_kb * .0001) / 1024);

              # Handle Counter Data
              $counterData="avg_disk_read_kb";
              &COUNTERS($service,$counterData,$disk_name);

              push (@{$diskio_h{$disk_name}}, $avg_disk_read_kb);

          }

          if ($counter_ref0->{$i}->{CounterNameTitleIndex} == $disk_write_index) {

              $avg_disk_write_bytes = $counter_ref1->{$i}->{Counter};
              #$avg_disk_write_kb=$avg_disk_write_bytes / 1024;
              $avg_disk_write_kb=(($avg_disk_write_kb * .0001) / 1024);

              # Handle Counter Data
              $counterData="avg_disk_write_kb";
              &COUNTERS($service,$counterData,$disk_name);

              push (@{$diskio_h{$disk_name}}, $avg_disk_write_kb);

          }
      }
  }

  # Send Data to Perf Server
  foreach $key (sort keys %diskio_h) {
    $perfOut="$os data $service $key @{$diskio_h{$key}}";

    &PerfOut($perfOut);
  }
  undef %diskio_h;
}

# TCP Sub
sub tcp {

  my $service="tcp";

  # Index numbers for PerfLib
  my $tcp = 510;
  my $bytes_in_index = 264;
  my $bytes_out_index = 506;

  # Initialize some variables
  my $tcp_ref0 = {};
  my $tcp_ref1 = {};
  $bytes_in=();
  $bytes_out=();
  my $int_count=1;

  # Navigate PerfLib data structure
  $perflib->GetObjectList($tcp, $tcp_ref0);
  $perflib->GetObjectList($tcp, $tcp_ref1);

  my $instance_ref0 = $tcp_ref0->{Objects}->{$tcp}->{Instances};
  my $instance_ref1 = $tcp_ref1->{Objects}->{$tcp}->{Instances};

  foreach $p (keys %{$instance_ref0}) {

    my $counter_ref0 = $instance_ref0->{$p}->{Counters};
    my $counter_ref1 = $instance_ref1->{$p}->{Counters};

    foreach $i (keys %{$counter_ref0}){

        next if ($instance_ref0->{$p}->{Name} =~ m/MS TCP Loopback interface/);
          my $int_name = $instance_ref0->{$p}->{Name};
          $int_name =~ m/(\S*)\s*(\S*)\s*(\S*)/;
          $int_name = "$1 $2 $3";
          $int_name =~ s/ //g;

          if($counter_ref0->{$i}->{CounterNameTitleIndex} == $bytes_in_index) {

            $bytes_in = $counter_ref1->{$i}->{Counter};
            $bytest_in = $bytes_in * .0001;

            # Handle adapters with the same name
            if (defined @{$traffic_h{$int_name}}[1]) {
                $int_name="$int_name#$int_count";
                $int_count++;
            }

            # Handle Counter Data
            $counterData="bytes_in";
            &COUNTERS($service,$counterData,$int_name);

            push (@{$traffic_h{$int_name}}, $bytes_in);

          }

          if($counter_ref0->{$i}->{CounterNameTitleIndex} == $bytes_out_index) {

            $bytes_out = $counter_ref1->{$i}->{Counter};
            $bytest_out = $bytes_out * .0001;

            # Handle adapters with the same name
            if (defined @{$traffic_h{$int_name}}[0]) {
                $int_name="$int_name#$int_count";
            }

            # Handle Counter Data
            $counterData="bytes_out";
            &COUNTERS($service,$counterData,$int_name);

            push (@{$traffic_h{$int_name}}, $bytes_out);

          }
      }
  }

  # Send Data to Perf Server
  foreach $key (sort keys %traffic_h) {
    $perfOut="$os data $service $key @{$traffic_h{$key}}";
    &PerfOut($perfOut);

  }
  undef %traffic_h;
}

# Socket Sub
sub socket {

  my $service="socket";

  # Index numbers for PerfLib
  my $socket = 638;
  my $sock_est_index = 642;
  my $sock_active_index = 644;
  my $sock_passive_index = 646;

  # Initialize some variables
  my $socket_ref0 = {};
  my $socket_ref1 = {};
  my $sock_est=();
  $sock_active=();
  $sock_passive=();
  my $Numerator0=();

  # Navigate PerfLib data structure
  $perflib->GetObjectList($socket, $socket_ref0);
  $perflib->GetObjectList($socket, $socket_ref1);

  my $instance_ref0 = $socket_ref0->{Objects}->{$socket}->{Counters};
  my $instance_ref1 = $socket_ref1->{Objects}->{$processor}->{Counters};

  foreach $p (keys %{$instance_ref0}) {

    my $counter_ref0 = $instance_ref0->{$p};
    my $counter_ref1 = $instance_ref1->{$p};

    foreach $i (keys %{$counter_ref0}){

        if($counter_ref0->{CounterNameTitleIndex} == $sock_est_index) {
          my $Numerator0 = $counter_ref0->{Counter};
          $sock_est = $Numerator0;
        }

        if($counter_ref0->{CounterNameTitleIndex} == $sock_active_index) {
          my $Numerator0 = $counter_ref0->{Counter};
          $sock_active = $Numerator0;
        }

        if($counter_ref0->{CounterNameTitleIndex} == $sock_passive_index) {
          my $Numerator0 = $counter_ref0->{Counter};
          $sock_passive = $Numerator0;
        }
    }
  }

  # Handle Counter Data
  $counterData="sock_active sock_passive";
  &COUNTERS($service,$counterData);

  # Send Data to Perf Server
  $perfOut="$os data $service $sock_active $sock_passive $sock_est";
  &PerfOut($perfOut);

}

# Process Sub
sub procs {

  my $service="procs";
  # Index numbers for PerfLib
  my $system = 2;
  my $proc_index = 248;

  # Initialize some variables
  my $proc_ref0 = {};
  my $procs=();

  # Navigate PerfLib data structure
  $perflib->GetObjectList($system, $proc_ref0);

  my $instance_ref0 = $proc_ref0->{Objects}->{$system}->{Counters};

  foreach $p (keys %{$instance_ref0}) {

    my $counter_ref0 = $instance_ref0->{$p};

    foreach $i (keys %{$counter_ref0}){

        # Get the system uptime

        if($counter_ref0->{CounterNameTitleIndex} == $proc_index) {

          $procs = $counter_ref0->{Counter};
        }
     }
  }

  # Send Data to Perf Server
  my $perfOut="$os data $service $procs";
  &PerfOut($perfOut);

}

# Uptime Sub
sub uptime {

  my $service="uptime";

  # Index numbers for PerfLib
  my $system = 2;
  my $uptime_index = 674;

  # Initialize some variables
  my $sys_ref0 = {};
  my $uptime=();
  my $Denominator0=();
  my $Timebase=();

  # Navigate PerfLib data structure
  $perflib->GetObjectList($system, $sys_ref0);

  my $instance_ref0 = $sys_ref0->{Objects}->{$system}->{Counters};

  foreach $p (keys %{$instance_ref0}) {

    my $counter_ref0 = $instance_ref0->{$p};

    foreach $i (keys %{$counter_ref0}){

        # Get the system uptime

        if($counter_ref0->{CounterNameTitleIndex} == $uptime_index) {

          my $Denominator0 = $sys_ref0->{PerfTime};
          my $Timebase = $sys_ref0->{PerfFreq};
          #print "Den: $Denominator0 Num: $Numerator0 Time: $Timebase\n";
          $uptimeSec = int($Denominator0 / $Timebase);
        }
     }
  }

  # Calculate uptime data
  $uptimeMin=$uptimeSec / 60;
  $uptimeHour=$uptimeMin / 60;
  $uptimeHour=sprintf("%.2f",$uptimeHour);

  # Write data to perf outfile
  my $perfOut="$os data $service $uptimeHour";
  &PerfOut($perfOut);

}

# Get actual value from counter
sub COUNTERS {

  # Get counters and split into array
  my $service=shift;
  my $counters=shift;
  my $device=shift;

  my @counters=split " ",$counters;

  foreach my $counter (@counters) {
      if (defined $device) {
          $counterName="$device.$counter";
      } else {
          $counterName="$counter";
      }

      if (! -f "$perfhome/tmp/counters/$service.$counterName") {
          open(COUNTER, ">$perfhome/tmp/counters/$service.$counterName")
              or die "WARNING: Couldn't open counter for $service.$counterName: $!\n";
          print COUNTER "${$counter}";

          close (COUNTER);

          # Set to 0 since we don't know the last value
          ${$counter}="0";
      } else {

          # Open for read
          open(COUNTER, "< $perfhome/tmp/counters/$service.$counterName")
              or die "WARNING: Couldn't open counter for $service.$counterName: $!\n";

          $data=<COUNTER>;
          close (COUNTER);

          # Open for write
          open(COUNTER, "> $perfhome/tmp/counters/$service.$counterName")
              or die "WARNING: Couldn't open counter for $service.$counterName: $!\n";

          print COUNTER "${$counter}";

          close (COUNTER);

          ${$counter}=${$counter} - $data;
      }
  }
}

# Delete metrics counters
sub CounterRemove {

  my $counterDir="$perfhome/tmp/counters";

  opendir(COUNTERDIR, $counterDir)
      or die "Couldn't open $counterDir directory: $!\n";

  while (defined ($file = readdir(COUNTERDIR))) {
      # Skip "." and ".."
      next if $file =~ m/^\.\.?$/;

      # Remove counter file
      if (-f "$counterDir/$file") {
          unlink "$counterDir/$file"
              or die "ERROR: Couldn't delete $counterDir/$file: $!\n";
      }
  }
}

# Write data to perf output file
sub PerfOut {

  my $perfOut=shift;

  open(PERFOUT, ">> $perfOutFile")
      or die "WARNING: Couldn't open file handle for $perfOutFile: $!\n";

  flock(PERFOUT, LOCK_EX)
      or die "WARNING: Couldn't obtain exclusive lock on $perfOutFile: $!\n";

  print PERFOUT "$perfOut\n";

  flock(PERFOUT, LOCK_UN)
      or die "WARNING: Couldn't release lock on $perfOutFile: $!\n";

}

# Send data to PerfStat server
sub SendData {

  my @data=();

  # Open perf out file and obtain lock
  open(PERFOUT, "< $perfOutFile")
      or die "ERROR: Couldn't open file handle to $perfOutFile: $!\n";

  flock(PERFOUT, LOCK_EX)
      or die "ERROR: Couldn't obtain shared lock for $perfOutFile: $!\n";

  # Slurp in contents of perf out
  while (<PERFOUT>) {
      push(@data, $_);
  }

  close (PERFOUT);

  # Remove perf out file
  unlink "$perfOutFile"
      or die "ERROR: Couldn't delete $perfOutFile: $!\n";

  # Prepare and send data to PerfStat server
  my $perfOut=join(":", @data);
  $perfOut =~ s/\n//g;

  my $socket = IO::Socket::INET->new( Proto    => "tcp",
                                      PeerAddr => "$ENV{'PERFSERVER'}",
				                              PeerPort => $ENV{'CLIENTPORT'},
		                                  Timeout  => 5)
          or undef $socket;

  # Send data to server or send alert
  if (defined $socket) {

      warn "DEBUG: Sending \"$perfOut\" to $server $ENV{'CLIENTPORT'}\n" if $ENV{'DEBUG'};

      print $socket "$perfOut";

      close $socket;
  } else {
      warn "Error: Couldn't Connect to $ENV{'PERFSERVER'}\n";
  }
}

# Get configuration dynamically from perf-conf
sub GetConfiguration {

  my $configfile="$perfhome/etc/perf-conf";
  my $hashref = shift;

  open(FILE, $configfile)
      or die "Couldn't open FileHandle for $configfile: $!\n";

  my @data=<FILE>;
  foreach $line (@data) {

    # Skip line if commented out
    next if ($line =~ m/^#/);
    $line =~ m/(\w+)=(.+)/;

    my $key=$1;
    my $value=$2;

		if ($key =~ m/^BASIC_SERVICES/) {
			@servicesBasic=split(/\s+/, $value);
    } elsif ($key =~ m/^EXT_SERVICES/) {
      @servicesExt=split(/\s+/, $value);
		} else {
 	    $hashref->{$key}=$value;
		}
  }
  close(FILE);
}

# Get path to perfctl executable
sub PATH {
  my $path = PerlSvc::exe();
 	$path =~ s/[\w\d]+\.exe//;
 	return $path;
}

# Install PerfMon as Service
sub Install {

    $Config{ServiceName} = 'Perfctl';
    $Config{DisplayName} = 'PerfStat Client';
    $Config{Description} = 'Sends performance data to PerfStat Server.';

    print "\nPerfmon Client Service Installed\n";
}

# Remove PerfMon as Service
sub Remove {

    $Config{ServiceName} = 'Perfctl';

    print "\nPerfmon Client Removed\n";
}

package main;


text:
ACCEPTED

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

#### Published in
Schr. naturf. Ges. Leipzig 1: 62 (1822)

#### Original name
Physarum polycephalum Schwein., 1822

### Remarks
null


text:
Convert JavaScript comments in logs, warnings or errors

## Getting Started
Install the module with: `npm install log-comments`

## Documentation
This tool should help in some rare situations, where you want your app to log for debugging purpose, but only
in testing or in production environment, so you don't want be distracted by a bloat of logs when you are developing.
Just put one of these three

- <-{l}
- <-{w}
- <-{e}

strings at the end of your comment and the comment will be wrapped
respectively with console.log(), console.warn(), console.error();

## Options
 --in-place, -i:   overwrite existing file with the new one
 --directory, -d:  specify a directory, all .js files inside directory will be parsed and elaborated
 --help, -h:       print help

## Examples
###code
// This will be a log <-{l}
// This will be a warn <-{w}
// This will be an error <-{e}

### cli
log-comments [OPTIONS] [FILE]

## Contributing
In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using [grunt](https://github.com/gruntjs/grunt).

## Release History
_(Nothing yet)_

## License
Copyright (c) 2013 Manuel Bitto
Licensed under the MIT license.


text:
/**
 * Created by edoua on 30/07/2017.
 */
import {ExpressApp} from "./ExpressAnnotations";
import * as express from "express";
import * as glob from "glob";
import {Request, Response, Express, NextFunction} from "express-serve-static-core";

export abstract class AbstractExpressServer {

	@ExpressApp
	app : Express = express();

	private controllerLoaded : Promise<any> = Promise.resolve();

	constructor (public port : number) {
		this.doPrepareApp();
	}

	protected abstract doPrepareApp () : void;
	protected abstract initError (error : any) : void;

	listen () {
		this.controllerLoaded.then(_ => {
			this.app.use((error : any, request : Request, result : Response, next : NextFunction) => {
				this.errorHandler(error , request, result, next)
			});
			this.app.listen(this.port, () => this.listenHandler ());
		});
		return this;
	}

	protected abstract listenHandler () : void;

	loadController (controllers : string) {
		this.controllerLoaded = new Promise((resolve, reject) => {
			glob (controllers, (error : any, files : string[]) => {
				if (error) {
					reject(error);
					return;
				}
				for (let file of files) {
					let module = require(`${process.cwd()}/${file}`);
					for (let prop in module) {
						if (module.hasOwnProperty(prop) && typeof module[prop] == "function") {
							new module[prop] ();
						}
					}
				}
				resolve ();
			});
		}).catch(error => {
			this.initError(error);
		});
		return this;
	}

	protected errorHandler (error : any, req : Request, res : Response, next : NextFunction) {
		let status = error.status || 500;
		let err = error.error || error;
		res.status(status);
		if (typeof err == "object")
			res.json(err);
		else {
			res.send(err);
		}
	}
}


text:
using System;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.Net;
using System.Text;
using Newtonsoft.Json;
using System.Configuration;

namespace BlockScoreAPI
{
    public class BlockscoreAPI
    {
        private const string BaseUrl = @"https://api.blockscore.com/";
        private const char ApiVersion = '2';

        private static string _authKey;
        private string _verificationId;
        private string _questionSetId;

        /**
	 * Constructor function for all new blockscore instances
	 *
	 * Store key for later requests
	 *
	 * @param String key
	 * @throws Exception if not a valid authentication key
	 */

        public BlockscoreAPI()
        {
            string apikey = ConfigurationSettings.AppSettings["Blockscore_API_Key"];

            if (!string.IsNullOrEmpty(apikey))
                _authKey = apikey;
            else
                throw new Exception("blockscore: No key (or empty key) provided to constructor");
        }

     /**
	 * Verify US
	 * @param BlockScoreVerifyDomesticRequest All three names of consumer e.g. array('first'=>'Joe', 'middle'=>'', 'last'=>'Smith')
	 *                                  Date of birth in YYYY-MM-DD format
	 *                                  Last four digits of SSN
	 *                                  Full address of consumer e.g. 'street1'=>'20 Main', 'street2'=>'Ste 4', 'city'=>'Springfield', 'state'=>'IL', 'postal_code'=>'99999'
	 * @throws Exception if request fails (see private function request() for details)
	 * @return BlockScoreResponse
	 */

        public BlockScoreResponse VerifyUs(BlockScoreVerifyDomesticRequest request)
        {
            var formData = GetFormattedDomesticVerifyRequeset(request);

            return Request("POST","verifications", formData);
        }

        private static NameValueCollection GetFormattedDomesticVerifyRequeset(BlockScoreVerifyDomesticRequest request)
        {
            var formData = new NameValueCollection();
            formData["name[first]"] = request.FirstName;
            formData["name[middle]"] = request.MiddleName;
            formData["name[last]"] = request.LastName;
            formData["date_of_birth"] = request.DateOfBirth;
            formData["type"] = request.CitizenshipType;
            formData["identification[ssn]"] = request.LastFourDigitsOfSSN;
            formData["address[street1]"] = request.Street1;
            formData["address[street2]"] = request.Street2;
            formData["address[city]"] = request.City;
            formData["address[state]"] = request.State;
            formData["address[postal_code]"] = request.PostalCode;
            formData["address[country_code]"] = BlockScoreVerifyDomesticRequest.CountryCode;
            return formData;
        }

        /**
	 * Verify International
	 * @param BlockScoreResponse All three names of consumer plus gender e.g. array('first'=>'Joe', 'middle'=>'', 'last'=>'Smith', 'gender'=>'M')
	 *                           Date of birth in YYYY-MM-DD format
	 *                           Full passport number
	 *                           Full address of consumer e.g. 'street1'=>'Bahnhofstrasse 70', 'street2'=>'', 'city'=>'Zurich', 'state'=>'ZH', 'postal_code'=>'8001', 'country_code'=>'CH'
	 * @throws Exception if request fails (see private function request() for details)
	 * @return Array
	 */

        public BlockScoreResponse VerifyIntl(BlockScoreVerifyInternationalRequest request)
        {
            var formData = GetFromattedIntRequest(request);

            return Request("POST","verifications", formData);
        }

        private static NameValueCollection GetFromattedIntRequest(BlockScoreVerifyInternationalRequest request)
        {
            var formData = new NameValueCollection();
            formData["name[first]"] = request.FirstName;
            formData["name[middle]"] = request.MiddleName;
            formData["name[last]"] = request.LastName;
            formData["date_of_birth"] = request.DateOfBirth;
            formData["type"] = request.CitizenshipType;
            formData["identification[ssn]"] = request.PassportNumber;
            formData["address[street1]"] = request.Street1;
            formData["address[street2]"] = request.Street2;
            formData["address[city]"] = request.City;
            formData["address[state]"] = request.State;
            formData["address[postal_code]"] = request.PostalCode;
            formData["address[country_code]"] = request.CountryCode;
            return formData;
        }

        /**
	    * List past verifications
	    * @param Int offset How many items to offset the results (optional)
	    * @param Int count Number of results to show, 0-100 (optional)
	    * @param Int start_date Unix timestamp of start date (optional)
	    * @param Int end_date Unix timestamp of end date (optional)
	    * @throws Exception if request fails (see private function request() for details)
	    * @return Array
	    */

        public BlockScoreResponse ListVerificationResults(int offset = 0, int count = 100, int startDate = 0, int endDate = 0)
        {
            var webClient = new WebClient();

            var queryParameters = string.Format("verifications?offset={0}&count={1}", offset, count);
            if (startDate > 0)
                queryParameters += string.Format("&start_date={0}", startDate);
            if (endDate > 0)
                queryParameters += string.Format("&end_date={0}", endDate);

            return Request("Get",queryParameters);
        }

        /**
	    * List one verification by verification_id
	    * @param String erificationid Verification ID from prior request (optional, assuming prior request was with the same object)
	    * @throws Exception if empty/unset verification_id, or if request fails (see private function request() for details)
	    * @return BlockScoreResponse
	    */

        public BlockScoreResponse GetVerificationResult(string verificationid ="")
        {
            if (string.IsNullOrEmpty(verificationid) && string.IsNullOrEmpty((_verificationId)))
                throw new Exception("blockscore: No (or empty) verification_id provided to GetVerificationResult");
            if (string.IsNullOrEmpty(verificationid) && !string.IsNullOrEmpty(_verificationId))
                verificationid = _verificationId;

            return Request("Get", "verifications/" + verificationid);
        }

        /**
	    * Get question set
	    * @param String verificationid Verification ID from prior request (optional, assuming prior request was with the same object)
	    * @throws Exception if empty/unset verification_id, or if request fails (see private function request() for details)
	    * @return Array
	    */
        public BlockScoreQuestionsResponse QuestionSet(string verificationid = "")
        {
            if (string.IsNullOrEmpty(verificationid) && string.IsNullOrEmpty(_verificationId))
                throw new Exception("blockscore: No (or empty) verification_id provided to QuestionSet");
            else
            {if(string.IsNullOrEmpty(verificationid) && !string.IsNullOrEmpty(_verificationId))
                verificationid = _verificationId;}

            var formData = new NameValueCollection();
            formData["verification_id"] = verificationid;
            return (BlockScoreQuestionsResponse)Request("POST", "questions", formData);
        }

        /**
	    * Retrieve previously-requested question set
	    *  **** WARNING:  THIS ENDPOINT APPEARS TO BE BROKEN (404) AS OF 15-MAR-2014 ****
	    * @param String $questionsetid Question Set ID from prior request (optional, assuming prior request was with the same object)
	    * @throws Exception if empty/unset question_set_id, or if request fails (see private function request() for details)
	    * @return Array
	    */
        public BlockScoreResponse RetrieveQuestionSet(string questionsetid)
        {
            if(string.IsNullOrEmpty(questionsetid) && string.IsNullOrEmpty(_questionSetId))
                throw new Exception("blockscore: No (or empty) question_set_id provided to RetrieveQuestionSet");
            if (string.IsNullOrEmpty(questionsetid) && !string.IsNullOrEmpty(_questionSetId))
                questionsetid = _questionSetId;

            return Request("GET", "questions/"+questionsetid);
        }

        /*
	    * Check the answers to a set of challenge questions
	    * @param IList<BlockScoreAnswer> answers All answers by question ID, e.g. array( array('question_id'=>1, 'answer_id'=>2), array('question_id'=>2, 'answer_id'=>4) );
	    * @param String verificationid Verification ID from prior request (optional, assuming prior request was with the same object)
	    * @param String questionsetid Question Set ID from prior request (optional, assuming prior request was with the same object)
	    * @throws Exception if empty/unset verification_id/question_set_id, or if request fails (see private function request() for details)
	    * @return BlockScoreResponse
	    */
        public BlockScoreQuestionsScoreResponse CheckQuestionAnswers(IList<BlockScoreAnswer> answers, string verificationid = "", string questionsetid = "")
       {
		if(string.IsNullOrEmpty(verificationid) && string.IsNullOrEmpty(_verificationId))
			throw new Exception("blockscore: No (or empty) verification_id provided to CheckQuestionAnswers");
		else if(string.IsNullOrEmpty(verificationid) && !string.IsNullOrEmpty(_verificationId))
			verificationid = _verificationId;

		if(string.IsNullOrEmpty(questionsetid) && string.IsNullOrEmpty(_questionSetId))
			throw new Exception("blockscore: No (or empty) question_set_id provided to CheckQuestionAnswers");
		else if(string.IsNullOrEmpty(questionsetid) && !string.IsNullOrEmpty(_questionSetId))
			questionsetid = _questionSetId;

		if(answers.Count == 0)
			throw new Exception("blockscore: No (or empty) answer array provided to CheckQuestionAnswers");

            var formData = new NameValueCollection();
            formData["verification_id"] = verificationid;
            formData["question_set_id"] = questionsetid;
            var jsonAnswers  =JsonConvert.SerializeObject(answers);
           formData["answers"] = jsonAnswers;

           return (BlockScoreQuestionsScoreResponse)Request("POST", "questions/score", formData);
	}

        private static string Base64Encode(string plainText)
        {
            var plainTextBytes = Encoding.UTF8.GetBytes(plainText);
            return Convert.ToBase64String(plainTextBytes);
        }

        /**
	    * (Private) Build HTTP request
	    * @param String method E.g. GET or POST
	    * @param String verb Path to API method, e.g. 'verifications' or 'questions/score'
	    * @param NameValueCollection postData Path to API method, e.g. 'verifications' or 'questions/score'
	    * @throws Exception if request fails (HTTP error, API-level error, or response parsing error)
	    * @return Array
	    */

        private BlockScoreResponse Request(string method, string verb, NameValueCollection postData = null)
        {
            var webHeaderCollection = new WebHeaderCollection
            {
                "Accept: application/vnd.blockscore+json;version=" + ApiVersion,
                "Authorization: Basic " + Base64Encode(_authKey) + ":"
            };

            if (method == "POST")
            {
                webHeaderCollection.Add(verb == "questions/score"
                    ? "Content-type: application/json"
                    : "Content-type: application/x-www-form-urlencoded");
            }

            var client = new WebClient
            {
                Credentials = new NetworkCredential("YOUR API KEY HERE", ""),
                Headers = webHeaderCollection
            };

            var response = GetResponse(method, verb, postData, client);

            var blockScoreResponse = GetBlockScoreResponse(verb, response);

            if(blockScoreResponse != null &&
                (!string.IsNullOrEmpty(blockScoreResponse.id) ||
                !string.IsNullOrEmpty(blockScoreResponse.verification_id) ||
                !string.IsNullOrEmpty(blockScoreResponse.question_set_id)))
            {
                if(!string.IsNullOrEmpty(blockScoreResponse.id))
                    _verificationId = blockScoreResponse.id;
                if(!string.IsNullOrEmpty(blockScoreResponse.question_set_id))
                    _questionSetId =blockScoreResponse.question_set_id;
            }
            if(blockScoreResponse != null && blockScoreResponse.error != null)
                throw new Exception("blockscore: API Error "+blockScoreResponse.error.type +": "+blockScoreResponse.error.message);
            return blockScoreResponse;
        }

        private static BlockScoreResponse GetBlockScoreResponse(string verb, string response)
        {
            BlockScoreResponse blockScoreResponse = null;
            if (!string.IsNullOrEmpty(response))
                try
                {
                    blockScoreResponse = GetDesirializedResponse(verb, response);
                }
                catch (Exception e)
                {
                    throw new Exception("blockscore: Unable to retrieve " + verb + " : " + e.Message);
                }
            return blockScoreResponse;
        }

        private static BlockScoreResponse GetDesirializedResponse(string verb,string response)
        {
            if (verb == "verifications")
                return JsonConvert.DeserializeObject<BlockScoreverificationsResponse>(response);
            else if (verb == "questions")
                return JsonConvert.DeserializeObject<BlockScoreQuestionsResponse>(response);
            else if (verb == "questions/score")
                return JsonConvert.DeserializeObject<BlockScoreQuestionsScoreResponse>(response);
            return null;
        }

        private static string GetResponse(string method, string verb, NameValueCollection postData, WebClient client)
        {
            if (verb == "questions/score")
            {
                var request = Utility.ConvertToJsonRequest(postData);
                return client.UploadString(BaseUrl + verb, method, request);
            }

            var bytesResult = client.UploadValues(BaseUrl + verb, method, postData);

            return Encoding.Default.GetString(bytesResult);
        }
    }
}


text:
/*
 * view.h
 */
 /**
\ingroup clish
\defgroup clish_view view
@{

\brief This class is a container of commands.

A particular CLI session may contain a number of different views. Each
view may contain its own specific commands as well as those available at
a global scope.

*/
#ifndef _clish_view_h
#define _clish_view_h

typedef struct clish_view_s clish_view_t;

typedef enum {
	CLISH_RESTORE_NONE,
	CLISH_RESTORE_DEPTH,
	CLISH_RESTORE_VIEW
} clish_view_restore_e;

#include "target-utils/lub/list.h"
#include "target-utils/clish/command.h"
#include "target-utils/clish/nspace.h"
#include "target-utils/clish/var.h"

/*=====================================
 * VIEW INTERFACE
 *===================================== */
/*-----------------
 * meta functions
 *----------------- */
clish_view_t *clish_view_new(const char *name, const char *prompt);
int clish_view_bt_compare(const void *clientnode, const void *clientkey);
void clish_view_bt_getkey(const void *clientnode, lub_bintree_key_t * key);
size_t clish_view_bt_offset(void);

/*-----------------
 * methods
 *----------------- */
lub_bintree_t * clish_view__get_command_tree(clish_view_t *instance);
lub_list_t * clish_view__get_nspace_tree(clish_view_t *instance);
void clish_view_delete(clish_view_t * instance);
clish_command_t *clish_view_new_command(clish_view_t * instance,
	const char *name, const char *text);
void clish_view_delete_command(clish_view_t * instance,
	const char *name);
clish_command_t *clish_view_find_command(clish_view_t * instance,
	const char *name, bool_t inherit);
const clish_command_t *clish_view_find_next_completion(clish_view_t * instance,
	const char *iter_cmd, const char *line,
	clish_nspace_visibility_e field, bool_t inherit);
clish_command_t *clish_view_resolve_command(clish_view_t * instance,
	const char *line, bool_t inherit);
clish_command_t *clish_view_resolve_prefix(clish_view_t * instance,
	const char *line, bool_t inherit);
void clish_view_dump(clish_view_t * instance);
void clish_view_insert_nspace(clish_view_t * instance, clish_nspace_t * nspace);
void clish_view_clean_proxy(clish_view_t * instance);

/*-----------------
 * attributes
 *----------------- */
const char *clish_view__get_name(const clish_view_t * instance);
void clish_view__set_prompt(clish_view_t * instance, const char *prompt);
char *clish_view__get_prompt(const clish_view_t *instance);
void clish_view__set_depth(clish_view_t * instance, unsigned depth);
unsigned clish_view__get_depth(const clish_view_t * instance);
void clish_view__set_restore(clish_view_t * instance,
	clish_view_restore_e restore);
clish_view_restore_e clish_view__get_restore(const clish_view_t * instance);
int clish_view_insert_hotkey(const clish_view_t *instance, const char *key, const char *cmd);
const char *clish_view_find_hotkey(const clish_view_t *instance, int code);
void clish_view__set_access(clish_view_t *instance, const char *access);
char *clish_view__get_access(const clish_view_t *instance);

#endif				/* _clish_view_h */
/** @} clish_view */


text:
var gulp = require('gulp');
var _ = require('underscore');
var Elixir = require('laravel-elixir');
var inSequence = require('run-sequence');

/*
 |----------------------------------------------------------------
 | Default Task
 |----------------------------------------------------------------
 |
 | This task will run when the developer executes "gulp" on the
 | command line. We'll use this configuration object to know
 | which tasks should be fired when this task is executed.
 |
 */

gulp.task('default', function() {
    inSequence.apply(this, _.pluck(Elixir.tasks, 'name'));
});


text:
(function(){

module('data-method', {
  setup: function() {
    $('#qunit-fixture').append($('<a />', {
      href: '/echo', 'data-method': 'delete', text: 'destroy!'
    }));
  },
  teardown: function() {
    $(document).off('iframe:loaded');
  }
});

function submit(fn, options) {
  $(document).on('iframe:loaded', function(e, data) {
    fn(data);
    start();
  });

  $('#qunit-fixture').find('a')
    .trigger('click');
}

asyncTest('link with "data-method" set to "delete"', 3, function() {
  submit(function(data) {
    equal(data.REQUEST_METHOD, 'DELETE');
    strictEqual(data.params.authenticity_token, undefined);
    strictEqual(data.HTTP_X_CSRF_TOKEN, undefined);
  });
});

asyncTest('link with "data-method" and CSRF', 1, function() {
  $('#qunit-fixture')
    .append('<meta name="csrf-param" content="authenticity_token"/>')
    .append('<meta name="csrf-token" content="cf50faa3fe97702ca1ae"/>');

  submit(function(data) {
    equal(data.params.authenticity_token, 'cf50faa3fe97702ca1ae');
  });
});

asyncTest('link "target" should be carried over to generated form', 1, function() {
  $('a[data-method]').attr('target', 'super-special-frame');
  submit(function(data) {
    equal(data.params._target, 'super-special-frame');
  });
});

asyncTest('link with "data-method" and cross origin', 1, function() {
  var data = {};

  $('#qunit-fixture')
    .append('<meta name="csrf-param" content="authenticity_token"/>')
    .append('<meta name="csrf-token" content="cf50faa3fe97702ca1ae"/>');

  $(document).on('submit', 'form', function(e) {
    $(e.currentTarget).serializeArray().map(function(item) {
      data[item.name] = item.value;
    });

    return false;
  });

  var link = $('#qunit-fixture').find('a');

  link.attr('href', 'http://www.alfajango.com');

  link.trigger('click');

  start();

  notEqual(data.authenticity_token, 'cf50faa3fe97702ca1ae');
});

})();


text:
//
// Copyright (C) 2012 OpenSim Ltd.
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with this program; if not, see <http://www.gnu.org/licenses/>.
//

#include "inet/common/INETDefs.h"
#include "inet/networklayer/common/L3Address.h"
#include "inet/common/lifecycle/ILifecycle.h"
#include "inet/common/lifecycle/LifecycleOperation.h"

namespace inet {

class PingPayload;

// how many ping request's send time is stored
#define PINGTEST_HISTORY_SIZE    100

/**
 * Generates ping requests and calculates the packet loss and round trip
 * parameters of the replies.
 *
 * See NED file for detailed description of operation.
 */
class INET_API PingTestApp : public cSimpleModule, public ILifecycle
{
  protected:
    // parameters: for more details, see the corresponding NED parameters' documentation
    L3Address destAddr;
    L3Address srcAddr;
    std::vector<L3Address> destAddresses;
    int packetSize;
    cPar *sendIntervalp;
    int hopLimit;
    int count;
    simtime_t startTime;
    simtime_t stopTime;
    bool printPing;
    bool continuous;

    // state
    long sendSeqNo;    // to match the response with the request that caused the response
    long expectedReplySeqNo;
    simtime_t sendTimeHistory[PINGTEST_HISTORY_SIZE];

    // statistics
    cStdDev rttStat;
    static simsignal_t rttSignal;
    static simsignal_t numLostSignal;
    static simsignal_t outOfOrderArrivalsSignal;
    static simsignal_t pingTxSeqSignal;
    static simsignal_t pingRxSeqSignal;
    long lossCount;    // number of lost requests
    long outOfOrderArrivalCount;    // number of responses which arrived too late
    long numPongs;    // number of received Ping requests

  protected:
    virtual void initialize(int stage);
    virtual int numInitStages() const { return NUM_INIT_STAGES; }
    virtual void handleMessage(cMessage *msg);
    virtual void finish();

    virtual std::vector<L3Address> getAllAddresses();
    virtual void sendPing();
    virtual void scheduleNextPing(cMessage *timer);
    virtual void sendToICMP(cMessage *payload, const L3Address& destAddr, const L3Address& srcAddr, int hopLimit);
    virtual void processPingResponse(PingPayload *msg);
    virtual void countPingResponse(int bytes, long seqNo, simtime_t rtt);
    virtual bool handleOperationStage(LifecycleOperation *operation, int stage, IDoneCallback *doneCallback)
    { Enter_Method_Silent(); throw cRuntimeError("Unsupported lifecycle operation '%s'", operation->getClassName()); return true; }
};

} // namespace inet


text:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <groupId>LpaNew.Selenium</groupId>
  <artifactId>LpaNew.Selenium</artifactId>
  <version>0.0.1-SNAPSHOT</version>

  	<pluginRepositories>
		<pluginRepository>
			<id>public</id>
			<name>public</name>
			<url>http://maven.int.westgroup.com:8081/nexus/content/groups/public/</url>
			<releases>
				<enabled>true</enabled>
			</releases>
			<snapshots>
				<enabled>true</enabled>
			</snapshots>
		</pluginRepository>
	</pluginRepositories>

  <build>
      <resources>
          <resource>
              <filtering>true</filtering>
              <directory>/resources</directory>
              <includes>
                  <include>**/*.xml</include>
              </includes>
          </resource>
      </resources>
    <sourceDirectory>src</sourceDirectory>
    <plugins>
      <plugin>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>3.1</version>
        <configuration>
          <source/>
          <target/>
        </configuration>
      </plugin>
    </plugins>
  </build>
  <dependencies>
  	<dependency>
  		<groupId>org.springframework</groupId>
  		<artifactId>spring-core</artifactId>
  		<version>3.2.4.RELEASE</version>
  	</dependency>
  	<dependency>
  		<groupId>org.springframework</groupId>
  		<artifactId>spring-jdbc</artifactId>
  		<version>3.2.4.RELEASE</version>
  	</dependency>
  	<dependency>
  		<groupId>org.springframework</groupId>
  		<artifactId>spring-test</artifactId>
  		<version>3.2.4.RELEASE</version>
  	</dependency>
      <dependency>
          <groupId>org.springframework</groupId>
          <artifactId>spring-orm</artifactId>
          <version>3.2.4.RELEASE</version>
      </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-context</artifactId>
            <version>3.2.4.RELEASE</version>
        </dependency>
      <dependency>
     		<groupId>org.slf4j</groupId>
     		<artifactId>slf4j-simple</artifactId>
     		<version>1.7.5</version>
     	</dependency>
      <dependency>
          <groupId>org.codehaus.groovy</groupId>
          <artifactId>groovy-all</artifactId>
          <version>2.1.0</version>
      </dependency>
      <dependency>
          <groupId>com.notuvy</groupId>
          <artifactId>notuvyutil</artifactId>
          <version>0.0.10</version>
      </dependency>
      <dependency>
          <groupId>org.seleniumhq.selenium</groupId>
          <artifactId>selenium-java</artifactId>
          <version>2.35.0</version>
      </dependency>
      <dependency>
          <groupId>org.seleniumhq.selenium</groupId>
          <artifactId>selenium-chrome-driver</artifactId>
          <version>2.35.0</version>
      </dependency>
      <dependency>
          <groupId>org.seleniumhq.selenium</groupId>
          <artifactId>selenium-api</artifactId>
          <version>2.35.0</version>
      </dependency>
      <dependency>
          <groupId>commons-dbcp</groupId>
          <artifactId>commons-dbcp</artifactId>
          <version>1.1-RC2</version>
      </dependency>
      <dependency>
          <groupId>commons-pool</groupId>
          <artifactId>commons-pool</artifactId>
          <version>1.1</version>
      </dependency>
      <dependency>
          <groupId>cglib</groupId>
          <artifactId>cglib</artifactId>
          <version>2.2</version>
      </dependency>
      <dependency>
          <groupId>org.springframework</groupId>
          <artifactId>spring-beans</artifactId>
          <version>3.2.4.RELEASE</version>
      </dependency>
      <dependency>
          <groupId>com.oracle</groupId>
          <artifactId>ojdbc</artifactId>
          <version>14</version>
          <scope>system</scope>
          <systemPath>${basedir}/lib/ojdbc6.jar</systemPath>
      </dependency>

      <!--
      <dependency>
              <artifactId>LpaTestSuite</artifactId>
              <groupId>com.thomsonreuters.ctqed</groupId>
              <version>3.5.0</version>
              <scope>system</scope>
              <systemPath>${basedir}/lib/LpaNewJavaTests-3.5.0.jar</systemPath>
      </dependency>
       -->
  </dependencies>
</project>