text:
using System;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices;
using Microsoft.DotNet.Cli.Utils;
using Xunit.Abstractions;

namespace Microsoft.NET.TestFramework.Commands
{
    public sealed class BuildCommand : MSBuildCommand
    {
        public BuildCommand(ITestOutputHelper log, string projectRootPath, string relativePathToProject = null, MSBuildTest msbuild = null)
            : base(log, "Build", projectRootPath, relativePathToProject, msbuild)
        {
        }
    }
}

redpajama_set_name: RedPajamaGithub


text:
/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package com.exalttech.trex.ui.views.streams.binders;

import java.io.Externalizable;
import java.io.IOException;
import java.io.ObjectInput;
import java.io.ObjectOutput;
import javafx.beans.property.SimpleStringProperty;
import javafx.beans.property.StringProperty;

/**
 * Cache size data binding model
 * @author GeorgeKH
 */
public class AdvancedPropertiesDataBinding extends AbstractStreamDataBinding implements Externalizable{

    StringProperty cacheSizeType = new SimpleStringProperty();
    StringProperty cacheValue = new SimpleStringProperty();

    /**
     * Constructor
     */
    public AdvancedPropertiesDataBinding(){
         setInitialValues();
    }

    /**
     * Return cache size type
     * @return
     */
    public StringProperty getCacheSizeType() {
        return cacheSizeType;
    }

    /**
     * Set cache size type
     * @param cacheSizeType
     */
    public void setCacheSizeType(StringProperty cacheSizeType) {
        this.cacheSizeType = cacheSizeType;
    }

    /**
     * Return cache value
     * @return
     */
    public StringProperty getCacheValue() {
        return cacheValue;
    }

    /**
     * Set cache value
     * @param cacheValue
     */
    public void setCacheValue(StringProperty cacheValue) {
        this.cacheValue = cacheValue;
    }

    /**
     * Set initial values
     */
    @Override
    protected void setInitialValues() {
        cacheSizeType.set("Auto");
        cacheValue.set("5000");
    }

     /**
     * Write serialized property values
     *
     * @param out
     * @throws IOException
     */
    @Override
    public void writeExternal(ObjectOutput out) throws IOException {
        out.writeObject(cacheSizeType.get());
        out.writeObject(cacheValue.get());
    }

    /**
     * Read serialized property values
     *
     * @param in
     * @throws IOException
     * @throws ClassNotFoundException
     */
    @Override
    public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
        cacheSizeType.set((String) in.readObject());
        cacheValue.set((String) in.readObject());
    }
}


text: ALTER TABLE `groups` ADD `sTextId` VARCHAR(255) NOT NULL DEFAULT '' AFTER `sName`;


text:
// $Id$

#include <errno.h>
#include <stdio.h>
#include <string.h>
#include <libgen.h>

#include "timelapse.h"
#include "startrail.h"
#include "stretch.h"
#include "stack.h"

typedef int (*pit_handler)(char *basename, int argc, char **argv);
typedef void (*pit_helper)(FILE *file, char *basename, char *cmd);

static int help_handler(char *basename, int argc, char **argv);
static void help_helper(FILE *file, char *basename, char *cmd);

static struct {
	const char *cmd;
	const char *desc;
	pit_handler handler;
	pit_helper helper;
} handlers[] = {
		{ "help", "show usage of command", help_handler, help_helper },
		{ "stretch", "strech contrast", stretch, stretch_help },
		{ "time", "create timelapse video", timelapse, timelapse_help },
		{ "star", "create star trail photograph", startrail, startrail_help },
		{ "stack", "create HDR image", stack, stack_help },
};
static int num_handlers = sizeof(handlers) / sizeof(handlers[0]);

#define MAX(a,b) a > b ? a : b;

static void help(FILE *file, char *basename)
{
	int i, max_cmd_len, max_desc_len;
	char fmt[256];

	fprintf(file, "Usage: %s <command> ...\n\n"
			"Commands:\n",
			basename);

	max_cmd_len = max_desc_len = 0;

	for (i = 0; i < num_handlers; i++) {
		max_cmd_len = MAX(max_cmd_len, strlen(handlers[i].cmd));
		max_desc_len = MAX(max_desc_len, strlen(handlers[i].desc));
	}

	for (i = 0; i < num_handlers; i++) {
		snprintf(fmt, sizeof(fmt), "    %%s%%%ds - %%s\n",
				max_cmd_len - strlen(handlers[i].cmd));
		fprintf(file, fmt, handlers[i].cmd, "", handlers[i].desc);
	}

	fprintf(file, "\n");
}

void help_helper(FILE *file, char *basename, char *cmd)
{
	fprintf(file, "Usage: %s %s <command>\n\n", basename, cmd);
}

int help_handler(char *basename, int argc, char **argv)
{
	int rc, i;
	char *name;
	pit_helper helper = NULL;

	if (argc < 2) {
		rc = EINVAL;
		help_helper(stderr, basename, argv[0]);
		goto finally;
	}

	name = argv[1];

	for (i = 0; i < num_handlers; i++) {
		if (!strcmp(name, handlers[i].cmd)) {
			helper = handlers[i].helper;
		}
	}

	if (!helper) {
		rc = EINVAL;
		fprintf(stderr, "Unknown command: %s\n\n", name);
		help(stderr, basename);
		goto finally;
	}

	(*helper)(stdout, basename, name);
	rc = 0;

finally:
	return rc;
}

int main(int argc, char **argv)
{
	int rc, i;
	char *name;
	pit_handler handler = NULL;

	name = basename(*argv++);
	argc--;

	if (argc < 1) {
		rc = EINVAL;
		help(stderr, name);
		goto finally;
	}

	for (i = 0; i < num_handlers; i++) {
		if (!strcmp(argv[0], handlers[i].cmd)) {
			handler = handlers[i].handler;
		}
	}

	if (!handler) {
		rc = EINVAL;
		fprintf(stderr, "Unknown command: %s\n\n", argv[0]);
		help(stderr, name);
		goto finally;
	}

	rc = (*handler)(name, argc, argv);

finally:
	return rc;
}


text:
class CreateGames < ActiveRecord::Migration
  def change
  	create_table :games do |t|
  		t.integer :deck_id
  		t.integer :user_id
  		t.timestamps
  	end
  end
end


text:
var expect = require('chai').expect;

describe('Brotli encoding', function () {
    var testrun;

    before(function (done) {
        this.run({
            collection: {
                item: [{
                    request: 'https://httpbin.org/brotli'
                }]
            }
        }, function (err, results) {
            testrun = results;
            done(err);
        });
    });

    it('should have completed the run', function () {
        expect(testrun).to.be.ok;
        expect(testrun.done.getCall(0).args[0]).to.be.null;
        expect(testrun).to.nested.include({
            'done.calledOnce': true,
            'start.calledOnce': true
        });
    });

    it('should have sent the request successfully', function () {
        expect(testrun).to.be.ok;
        expect(testrun).to.nested.include({
            'request.calledOnce': true
        });

        expect(testrun.request.getCall(0).args[0]).to.be.null;
    });

    it('should have decoded the brotli response', function () {
        var response = testrun.request.getCall(0).args[2];

        expect(response).to.have.property('code', 200);
        expect(response.headers.has('content-encoding', 'br')).to.be.true;
        expect(response.json()).to.have.property('brotli', true);
    });
});


text:
import {Directive, Host, Input, TemplateRef, ViewContainerRef} from '@angular/core';

import {ListWrapper} from '../facade/collection';
import {isBlank, isPresent, normalizeBlank} from '../facade/lang';

const _CASE_DEFAULT = new Object();

export class SwitchView {
  constructor(
      private _viewContainerRef: ViewContainerRef, private _templateRef: TemplateRef<Object>) {}

  create(): void { this._viewContainerRef.createEmbeddedView(this._templateRef); }

  destroy(): void { this._viewContainerRef.clear(); }
}

/**
 * Adds or removes DOM sub-trees when their match expressions match the switch expression.
 *
 * Elements within `NgSwitch` but without `NgSwitchCase` or `NgSwitchDefault` directives will be
 * preserved at the location as specified in the template.
 *
 * `NgSwitch` simply inserts nested elements based on which match expression matches the value
 * obtained from the evaluated switch expression. In other words, you define a container element
 * (where you place the directive with a switch expression on the
 * `[ngSwitch]="..."` attribute), define any inner elements inside of the directive and
 * place a `[ngSwitchCase]` attribute per element.
 *
 * The `ngSwitchCase` property is used to inform `NgSwitch` which element to display when the
 * expression is evaluated. If a matching expression is not found via a `ngSwitchCase` property
 * then an element with the `ngSwitchDefault` attribute is displayed.
 *
 * ### Example ([live demo](http://plnkr.co/edit/DQMTII95CbuqWrl3lYAs?p=preview))
 *
 * ```typescript
 * @Component({
 *   selector: 'app',
 *   template: `
 *     <p>Value = {{value}}</p>
 *     <button (click)="inc()">Increment</button>
 *
 *     <div [ngSwitch]="value">
 *       <p *ngSwitchCase="'init'">increment to start</p>
 *       <p *ngSwitchCase="0">0, increment again</p>
 *       <p *ngSwitchCase="1">1, increment again</p>
 *       <p *ngSwitchCase="2">2, stop incrementing</p>
 *       <p *ngSwitchDefault>> 2, STOP!</p>
 *     </div>
 *
 *     <!-- alternate syntax -->
 *
 *     <p [ngSwitch]="value">
 *       <template ngSwitchCase="init">increment to start</template>
 *       <template [ngSwitchCase]="0">0, increment again</template>
 *       <template [ngSwitchCase]="1">1, increment again</template>
 *       <template [ngSwitchCase]="2">2, stop incrementing</template>
 *       <template ngSwitchDefault>> 2, STOP!</template>
 *     </p>
 *   `,
 *   directives: [NgSwitch, NgSwitchCase, NgSwitchDefault]
 * })
 * export class App {
 *   value = 'init';
 *
 *   inc() {
 *     this.value = this.value === 'init' ? 0 : this.value + 1;
 *   }
 * }
 * ```
 *
 * @stable
 */
@Directive({selector: '[ngSwitch]'})
export class NgSwitch {
  private _switchValue: any;
  private _useDefault: boolean = false;
  private _valueViews = new Map<any, SwitchView[]>();
  private _activeViews: SwitchView[] = [];

  @Input()
  set ngSwitch(value: any) {
    // Empty the currently active ViewContainers
    this._emptyAllActiveViews();

    // Add the ViewContainers matching the value (with a fallback to default)
    this._useDefault = false;
    var views = this._valueViews.get(value);
    if (isBlank(views)) {
      this._useDefault = true;
      views = normalizeBlank(this._valueViews.get(_CASE_DEFAULT));
    }
    this._activateViews(views);

    this._switchValue = value;
  }

  /** @internal */
  _onCaseValueChanged(oldCase: any, newCase: any, view: SwitchView): void {
    this._deregisterView(oldCase, view);
    this._registerView(newCase, view);

    if (oldCase === this._switchValue) {
      view.destroy();
      ListWrapper.remove(this._activeViews, view);
    } else if (newCase === this._switchValue) {
      if (this._useDefault) {
        this._useDefault = false;
        this._emptyAllActiveViews();
      }
      view.create();
      this._activeViews.push(view);
    }

    // Switch to default when there is no more active ViewContainers
    if (this._activeViews.length === 0 && !this._useDefault) {
      this._useDefault = true;
      this._activateViews(this._valueViews.get(_CASE_DEFAULT));
    }
  }

  /** @internal */
  _emptyAllActiveViews(): void {
    var activeContainers = this._activeViews;
    for (var i = 0; i < activeContainers.length; i++) {
      activeContainers[i].destroy();
    }
    this._activeViews = [];
  }

  /** @internal */
  _activateViews(views: SwitchView[]): void {
    // TODO(vicb): assert(this._activeViews.length === 0);
    if (isPresent(views)) {
      for (var i = 0; i < views.length; i++) {
        views[i].create();
      }
      this._activeViews = views;
    }
  }

  /** @internal */
  _registerView(value: any, view: SwitchView): void {
    var views = this._valueViews.get(value);
    if (isBlank(views)) {
      views = [];
      this._valueViews.set(value, views);
    }
    views.push(view);
  }

  /** @internal */
  _deregisterView(value: any, view: SwitchView): void {
    // `_CASE_DEFAULT` is used a marker for non-registered cases
    if (value === _CASE_DEFAULT) return;
    var views = this._valueViews.get(value);
    if (views.length == 1) {
      this._valueViews.delete(value);
    } else {
      ListWrapper.remove(views, view);
    }
  }
}

/**
 * Insert the sub-tree when the `ngSwitchCase` expression evaluates to the same value as the
 * enclosing switch expression.
 *
 * If multiple match expression match the switch expression value, all of them are displayed.
 *
 * See {@link NgSwitch} for more details and example.
 *
 * @stable
 */
@Directive({selector: '[ngSwitchCase]'})
export class NgSwitchCase {
  // `_CASE_DEFAULT` is used as a marker for a not yet initialized value
  /** @internal */
  _value: any = _CASE_DEFAULT;
  /** @internal */
  _view: SwitchView;
  private _switch: NgSwitch;

  constructor(
      viewContainer: ViewContainerRef, templateRef: TemplateRef<Object>,
      @Host() ngSwitch: NgSwitch) {
    this._switch = ngSwitch;
    this._view = new SwitchView(viewContainer, templateRef);
  }

  @Input()
  set ngSwitchCase(value: any) {
    this._switch._onCaseValueChanged(this._value, value, this._view);
    this._value = value;
  }
}

/**
 * Default case statements are displayed when no match expression matches the switch expression
 * value.
 *
 * See {@link NgSwitch} for more details and example.
 *
 * @stable
 */
@Directive({selector: '[ngSwitchDefault]'})
export class NgSwitchDefault {
  constructor(
      viewContainer: ViewContainerRef, templateRef: TemplateRef<Object>,
      @Host() sswitch: NgSwitch) {
    sswitch._registerView(_CASE_DEFAULT, new SwitchView(viewContainer, templateRef));
  }
}


text:
<?php

/**
 * @file
 * Contains \Drupal\system\Tests\Lock\LockUnitTest.
 */

namespace Drupal\system\Tests\Lock;

use Drupal\Core\Lock\DatabaseLockBackend;
use Drupal\simpletest\KernelTestBase;

/**
 * Tests the Database lock backend.
 *
 * @group Lock
 */
class LockUnitTest extends KernelTestBase {

  /**
   * Database lock backend to test.
   *
   * @var \Drupal\Core\Lock\DatabaseLockBackend
   */
  protected $lock;

  /**
   * Modules to enable.
   *
   * @var array
   */
  public static $modules = array('system');

  protected function setUp() {
    parent::setUp();
    $this->lock = new DatabaseLockBackend($this->container->get('database'));
    $this->installSchema('system', 'semaphore');
  }

  /**
   * Tests backend release functionality.
   */
  public function testBackendLockRelease() {
    $success = $this->lock->acquire('lock_a');
    $this->assertTrue($success, 'Could acquire first lock.');

    // This function is not part of the backend, but the default database
    // backend implement it, we can here use it safely.
    $is_free = $this->lock->lockMayBeAvailable('lock_a');
    $this->assertFalse($is_free, 'First lock is unavailable.');

    $this->lock->release('lock_a');
    $is_free = $this->lock->lockMayBeAvailable('lock_a');
    $this->assertTrue($is_free, 'First lock has been released.');

    $success = $this->lock->acquire('lock_b');
    $this->assertTrue($success, 'Could acquire second lock.');

    $success = $this->lock->acquire('lock_b');
    $this->assertTrue($success, 'Could acquire second lock a second time within the same request.');

    $this->lock->release('lock_b');
  }

  /**
   * Tests backend release functionality.
   */
  public function testBackendLockReleaseAll() {
    $success = $this->lock->acquire('lock_a');
    $this->assertTrue($success, 'Could acquire first lock.');

    $success = $this->lock->acquire('lock_b');
    $this->assertTrue($success, 'Could acquire second lock.');

    $this->lock->releaseAll();

    $is_free = $this->lock->lockMayBeAvailable('lock_a');
    $this->assertTrue($is_free, 'First lock has been released.');

    $is_free = $this->lock->lockMayBeAvailable('lock_b');
    $this->assertTrue($is_free, 'Second lock has been released.');
  }
}


text:
@implementation CWSSecrets

+ (NSString *)secretForKey:(NSString *)key
{
    NSString *path = [[NSBundle mainBundle] pathForResource:@"Secrets" ofType:@"plist"];
    NSDictionary *secrets = [[NSDictionary alloc] initWithContentsOfFile:path];
    return [secrets objectForKey:key];
}

@end


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
Acta Mycol. Sin. 14(4): 248 (1995)

#### Original name
Coleosporium synuricola Y. Xue & L.P. Shao

### Remarks
null


text:
<?xml version="1.0" encoding="UTF-8"?>
<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>de.uni-stuttgart.jereth.fakesensor</groupId>
    <artifactId>fakesensor</artifactId>
    <version>1.0</version>
    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <configuration>
                    <source>1.8</source>
                    <target>1.8</target>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <configuration>
                    <archive>
                        <manifest>
                            <mainClass>Main</mainClass>
                            <addClasspath>true</addClasspath>
                            <classpathPrefix>classes/lib</classpathPrefix>
                        </manifest>
                    </archive>
                </configuration>
            </plugin>
            <plugin>
                <artifactId>maven-assembly-plugin</artifactId>
                <configuration>
                    <descriptorRefs>
                        <descriptorRef>jar-with-dependencies</descriptorRef>
                    </descriptorRefs>
                    <archive>
                        <manifest>
                            <mainClass>Main</mainClass>
                        </manifest>
                    </archive>
                </configuration>
            </plugin>
        </plugins>
    </build>

    <repositories>
        <repository>
            <id>bintray</id>
            <url>http://dl.bintray.com/andsel/maven/</url>
            <releases>
                <enabled>true</enabled>
            </releases>
            <snapshots>
                <enabled>false</enabled>
            </snapshots>
        </repository>
        <repository>
            <id>Eclipse Paho Repo</id>
            <url>https://repo.eclipse.org/content/repositories/paho-releases/</url>
        </repository>
    </repositories>

    <dependencies>
        <dependency>
            <groupId>com.sparkjava</groupId>
            <artifactId>spark-core</artifactId>
            <version>2.5</version>
        </dependency>
        <dependency>
            <groupId>com.googlecode.json-simple</groupId>
            <artifactId>json-simple</artifactId>
            <version>1.1</version>
        </dependency>
        <dependency>
            <groupId>io.moquette</groupId>
            <artifactId>moquette-broker</artifactId>
            <version>0.8</version>
        </dependency>
        <dependency>
            <groupId>org.eclipse.paho</groupId>
            <artifactId>org.eclipse.paho.client.mqttv3</artifactId>
            <version>1.1.0</version>
        </dependency>
        <dependency>
            <groupId>org.apache.kafka</groupId>
            <artifactId>kafka-clients</artifactId>
            <version>0.10.2.1</version>
        </dependency>
    </dependencies>

</project>


text:
package com.nexwave.stemmer.snowball;
import java.lang.reflect.InvocationTargetException;

public abstract class SnowballStemmer extends SnowballProgram {
    public abstract boolean stem();

    /**
     * Do stemming of a given String array and returns the stemmed set of words as an array.
     * @param words Word set to be stemmed
     * @return stemmed word array
     */
    public String[] doStem(String[] words){
        String[] stemmedWords = new String[words.length];
        for (int i = 0; i < words.length; i++) {
            String word = words[i];
            word = word.trim().toLowerCase();

            //Do the stemming of the given word.
            setCurrent(word);   //set the word to be stemmed
            stem();             //tell stemmer to stem

            stemmedWords[i] = getCurrent(); //Get the stemmed word and add it to the stemmedWords array
         }
        return stemmedWords;
    }
    //OXYGEN PATCH START, Stem only one word
    /**
     * Do stemming of a given String and returns the stemmed word.
     * @param word Word to be stemmed
     * @return stemmed word
     */
    public String doStem(String word){
        word = word.trim().toLowerCase();

        //Do the stemming of the given word.
        setCurrent(word);   //set the word to be stemmed
        stem();             //tell stemmer to stem

        String stemmedWord = getCurrent(); //Get the stemmed word.
        return stemmedWord;
    }
    //OXYGEN PATCH END
}


text:
define(['services/admin_data', 'durandal/app', 'viewmodels/admin/narudzbineDetalji'],
    function (datacontext, app, detalji) {

        var noveNarudzbine = ko.observableArray(),
            narudzbine = ko.observableArray(),
            isSaving = ko.observable(false),
            broj = ko.observable();

        function activate() {
            return datacontext.narudzbine(broj, noveNarudzbine, narudzbine);
        };

        function viewAttached(view) {
            $('#footable').footable();
            bindEventToList(view, '.td', idiNaDetalje);
        };

        function idiNaDetalje(narudzbina) {
            if (narudzbina) {
                app.showModal(new detalji(narudzbina)).then(function (responce) {
                    return true;
                });
            }
        };

        function bindEventToList(rootSelector, selector, callback) {
            $(rootSelector).on('click', selector, function () {
                var entity = ko.dataFor(this);
                callback(entity);
                return false;
            });
        };

        var hasChanges = ko.computed(function () {
            return datacontext.hasChanges();
        });

        function nazad() {
            ruter.navigateBack();
        };

        function ponisti() {
            datacontext.ponistiPromene();
        };

        function sacuvaj() {
            isSaving(true);
            return datacontext.sacuvajPromene().then(idiNaEdit).fin(complete);

            function idiNaEdit() {

            }

            function complete() {
                isSaving(false);
            }
        };

        var canSave = ko.computed(function () {
            return hasChanges() && !isSaving();
        });

        var vm = {
            activate: activate,
            viewAttached: viewAttached,
            noveNarudzbine: noveNarudzbine,
            narudzbine: narudzbine,
            nazad: nazad,
            ponisti: ponisti,
            sacuvaj: sacuvaj,
            canSave: canSave,
            hasChanges: hasChanges
        };
        return vm;
    });


text:
exports.openMainWindow = function(_tab) {
  _tab.open($.googleauth_window);
  Ti.API.info("This is child widow of : " +JSON.stringify(_tab));
  Ti.API.info("executing google authentication : ");
  //Alloy.Globals.googleAuth.authorize();
  googleAuthSheet.authorize();
};

var GoogleAuth = require('googleAuth');
var googleAuthSheet = new GoogleAuth({
	clientId : '306793301753-8ej6duert04ksb3abjutpie916l8hcc7.apps.googleusercontent.com',
	clientSecret : 'fjrsVudiK3ClrOKWxO5QvXYL',
	propertyName : 'googleToken',
	scope : ['https://spreadsheets.google.com/feeds', 'https://docs.google.com/feeds','https://www.googleapis.com/auth/calendar','https://www.googleapis.com/auth/calendar.readonly'],
	quiet: false
});


text:
using namespace lldb_private;

DataBufferLLVM::DataBufferLLVM(
    std::unique_ptr<llvm::WritableMemoryBuffer> MemBuffer)
    : Buffer(std::move(MemBuffer)) {
  assert(Buffer != nullptr &&
         "Cannot construct a DataBufferLLVM with a null buffer");
}

DataBufferLLVM::~DataBufferLLVM() {}

uint8_t *DataBufferLLVM::GetBytes() {
  return reinterpret_cast<uint8_t *>(Buffer->getBufferStart());
}

const uint8_t *DataBufferLLVM::GetBytes() const {
  return reinterpret_cast<const uint8_t *>(Buffer->getBufferStart());
}

lldb::offset_t DataBufferLLVM::GetByteSize() const {
  return Buffer->getBufferSize();
}


text:
"use strict";

var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard");

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");

Object.defineProperty(exports, "__esModule", {
  value: true
});
var _exportNames = {
  cardClasses: true
};
Object.defineProperty(exports, "default", {
  enumerable: true,
  get: function () {
    return _Card.default;
  }
});
Object.defineProperty(exports, "cardClasses", {
  enumerable: true,
  get: function () {
    return _cardClasses.default;
  }
});

var _Card = _interopRequireDefault(require("./Card"));

var _cardClasses = _interopRequireWildcard(require("./cardClasses"));

Object.keys(_cardClasses).forEach(function (key) {
  if (key === "default" || key === "__esModule") return;
  if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
  if (key in exports && exports[key] === _cardClasses[key]) return;
  Object.defineProperty(exports, key, {
    enumerable: true,
    get: function () {
      return _cardClasses[key];
    }
  });
});


text:
package client

import (
	"encoding/json"
	"fmt"

	"github.com/docker/docker/api/types"
	Cli "github.com/docker/docker/cli"
	"github.com/docker/docker/pkg/httputils"
	"github.com/docker/docker/pkg/ioutils"
	flag "github.com/docker/docker/pkg/mflag"
	"github.com/docker/docker/pkg/units"
)

// CmdInfo displays system-wide information.
//
// Usage: docker info
func (cli *DockerCli) CmdInfo(args ...string) error {
	cmd := Cli.Subcmd("info", nil, Cli.DockerCommands["info"].Description, true)
	cmd.Require(flag.Exact, 0)

	cmd.ParseFlags(args, true)

	serverResp, err := cli.call("GET", "/info", nil, nil)
	if err != nil {
		return err
	}

	defer serverResp.body.Close()

	info := &types.Info{}
	if err := json.NewDecoder(serverResp.body).Decode(info); err != nil {
		return fmt.Errorf("Error reading remote info: %v", err)
	}

	fmt.Fprintf(cli.out, "Containers: %d\n", info.Containers)
	fmt.Fprintf(cli.out, "Images: %d\n", info.Images)
	ioutils.FprintfIfNotEmpty(cli.out, "Server Version: %s\n", info.ServerVersion)
	ioutils.FprintfIfNotEmpty(cli.out, "Storage Driver: %s\n", info.Driver)
	if info.DriverStatus != nil {
		for _, pair := range info.DriverStatus {
			fmt.Fprintf(cli.out, " %s: %s\n", pair[0], pair[1])
		}
	}
	ioutils.FprintfIfNotEmpty(cli.out, "Execution Driver: %s\n", info.ExecutionDriver)
	ioutils.FprintfIfNotEmpty(cli.out, "Logging Driver: %s\n", info.LoggingDriver)
	ioutils.FprintfIfNotEmpty(cli.out, "Kernel Version: %s\n", info.KernelVersion)
	ioutils.FprintfIfNotEmpty(cli.out, "Operating System: %s\n", info.OperatingSystem)
	fmt.Fprintf(cli.out, "CPUs: %d\n", info.NCPU)
	fmt.Fprintf(cli.out, "Total Memory: %s\n", units.BytesSize(float64(info.MemTotal)))
	ioutils.FprintfIfNotEmpty(cli.out, "Name: %s\n", info.Name)
	ioutils.FprintfIfNotEmpty(cli.out, "ID: %s\n", info.ID)

	if info.Debug {
		fmt.Fprintf(cli.out, "Debug mode (server): %v\n", info.Debug)
		fmt.Fprintf(cli.out, " File Descriptors: %d\n", info.NFd)
		fmt.Fprintf(cli.out, " Goroutines: %d\n", info.NGoroutines)
		fmt.Fprintf(cli.out, " System Time: %s\n", info.SystemTime)
		fmt.Fprintf(cli.out, " EventsListeners: %d\n", info.NEventsListener)
		fmt.Fprintf(cli.out, " Init SHA1: %s\n", info.InitSha1)
		fmt.Fprintf(cli.out, " Init Path: %s\n", info.InitPath)
		fmt.Fprintf(cli.out, " Docker Root Dir: %s\n", info.DockerRootDir)
	}

	ioutils.FprintfIfNotEmpty(cli.out, "Http Proxy: %s\n", info.HTTPProxy)
	ioutils.FprintfIfNotEmpty(cli.out, "Https Proxy: %s\n", info.HTTPSProxy)
	ioutils.FprintfIfNotEmpty(cli.out, "No Proxy: %s\n", info.NoProxy)

	if info.IndexServerAddress != "" {
		u := cli.configFile.AuthConfigs[info.IndexServerAddress].Username
		if len(u) > 0 {
			fmt.Fprintf(cli.out, "Username: %v\n", u)
			fmt.Fprintf(cli.out, "Registry: %v\n", info.IndexServerAddress)
		}
	}

	// Only output these warnings if the server does not support these features
	if h, err := httputils.ParseServerHeader(serverResp.header.Get("Server")); err == nil {
		if h.OS != "windows" {
			if !info.MemoryLimit {
				fmt.Fprintf(cli.err, "WARNING: No memory limit support\n")
			}
			if !info.SwapLimit {
				fmt.Fprintf(cli.err, "WARNING: No swap limit support\n")
			}
			if !info.IPv4Forwarding {
				fmt.Fprintf(cli.err, "WARNING: IPv4 forwarding is disabled\n")
			}
			if !info.BridgeNfIptables {
				fmt.Fprintf(cli.err, "WARNING: bridge-nf-call-iptables is disabled\n")
			}
			if !info.BridgeNfIP6tables {
				fmt.Fprintf(cli.err, "WARNING: bridge-nf-call-ip6tables is disabled\n")
			}
		}
	}

	if info.Labels != nil {
		fmt.Fprintln(cli.out, "Labels:")
		for _, attribute := range info.Labels {
			fmt.Fprintf(cli.out, " %s\n", attribute)
		}
	}

	ioutils.FprintfIfTrue(cli.out, "Experimental: %v\n", info.ExperimentalBuild)
	if info.ClusterStore != "" {
		fmt.Fprintf(cli.out, "Cluster store: %s\n", info.ClusterStore)
	}

	if info.ClusterAdvertise != "" {
		fmt.Fprintf(cli.out, "Cluster advertise: %s\n", info.ClusterAdvertise)
	}
	return nil
}


text:
InformationService
===============
Источник: [AIXM](https://extranet.eurocontrol.int/http://webprisme.cfmu.eurocontrol.int/aixmwiki_public/bin/view/AIXM/Class_InformationService)

Тип: Feature

Вид обслуживания, состоящий из обеспечения команды воздушного судна и других участников выполнения полетов в полете и на земле авиационной, метеорологической информацией, информацией о движении и другой информацией.

## Наследование

#### Наследуется от класса:

- F Service

## Атрибуты

##### uuid

Наследуетcя из таблицы Service.

##### type
Тип данных: CodeServiceInformationType

Тип предоставляемой службой информации.

##### voice
Тип данных: CodeYesNoType

Обеспечена ли служба голосовым сообщением.

##### dataLink
Тип данных: CodeYesNoType

Доступна ли служба по каналу передачи данных.

##### recorded
Тип данных: CodeYesNoType

Передача информации записывается и проигрывается заново, в отличие от прямой трансляции.

##### flightOperations
Тип данных: CodeFlightDestinationType

Наследуетcя из таблицы Service.

##### rank
Тип данных: CodeFacilityRankingType

Наследуетcя из таблицы Service.

##### compliantICAO
Тип данных: CodeYesNoType

Наследуетcя из таблицы Service.

##### name
Тип данных: TextNameType

Наследуетcя из таблицы Service.

## Связи

### Один к одному:

- O ElevatedPoint

### Один ко многим:

- O ~~Note~~

### Многие ко многим:

- O ContactInformation
- O ~~CallsignDetail~~
- F ~~RadioCommunicationChannel~~
- F ~~VerticalStructure~~
- F ~~VOR~~
- F ~~Airspace~~
- F AirportHeliport
- O ~~RoutePortion~~
- F ~~Procedure~~
- F ~~HoldingPattern~~
- F ~~AerialRefuelling~~

### Многие к одному:

- F ~~Unit~~
- O ~~ServiceOperationalStatus~~


text:
#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
#  ▼ Cutscene Skipper
#  Author: Kread-EX
#  Version 1.03
#  Release date: 21/03/2012
#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=

#------------------------------------------------------------------------------
#  ▼ UPDATES
#------------------------------------------------------------------------------
# # 15/01/2013. Fixed another bug with message windows.
# # 14/01/2013. Fixed another major bug.
# # 22/03/2012. Fixed a critical bug!
#------------------------------------------------------------------------------
#  ▼ TERMS OF USAGE
#------------------------------------------------------------------------------
# #  You are free to adapt this work to suit your needs.
# #  You can use this work for commercial purposes if you like it.
# #  Credit is appreciated.
# #
# # For support:
# # grimoirecastle.wordpress.com
# # rpgmakerweb.com
#------------------------------------------------------------------------------
#  ▼ INTRODUCTION
#------------------------------------------------------------------------------
# # Allows the player to skip cutscenes by pressing a button. Only dialogue and
# # graphic processing is skipped - switch and variable control, or other back
# # end operations are still processed.
#------------------------------------------------------------------------------
#  ▼ INSTRUCTIONS
#------------------------------------------------------------------------------
# # Wrap your cutscene between two labels: "Cutscene" and "End Cutscene". While
# # the contents are processed, the player will be able to skip it by pressing
# # the button you chose in the config module.
# # Some commands will still be processed:
# # - Switches/Variables/Self Switches
# # - Gain gold/items/weapons/armors
# # - Change actor parameters
# # - Start/stop timer
# # - Show/erase picture
# # - Enable/disable menus
# # - Set vehicle location
# #
# # Other commands will be downright ignored and will have to be put outside of
# # the skippable cutscene.
#------------------------------------------------------------------------------
#  ▼ COMPATIBILITY
#------------------------------------------------------------------------------
# # List of aliases and overwrites:
# #
# # Input
# # self.trigger? (alias)
# #
# # Game_Temp
# # skip_cutscene (new attr method)
# #
# # Game_Interpreter
# # command_118 (alias)
# # cutscene? (new method)
# # execute_command (alias)
# #
# # Scene_Map
# # check_skip_hotkey (new method)
#------------------------------------------------------------------------------

($imported ||= {})['KRX-CutsceneSkipper'] = true

puts 'Load: Cutscene Skipper v1.03 by Kread-EX'

module KRX
#===========================================================================
# ■ CONFIGURATION
#===========================================================================
  SKIP_BUTTON = :CTRL
  SKIP_FADE_TIME = 20
#===========================================================================
# ■ CONFIGURATION ENDS HERE
#===========================================================================
end

class Game_Temp; attr_accessor(:skip_cutscene); end

#==============================================================================
# ■ Game_Interpreter
#==============================================================================

class Game_Interpreter
  #--------------------------------------------------------------------------
  # ● Sets a label
  #--------------------------------------------------------------------------
  alias_method(:krx_nocutscene_gi_118, :command_118)
  def command_118
    krx_nocutscene_gi_118
    @cutscene = true if @params[0] === 'Cutscene'
    @cutscene = false if @params[0] === 'End Cutscene'
  end
  #--------------------------------------------------------------------------
  # ● Determines if a cutscene is played
  #--------------------------------------------------------------------------
  def cutscene?
    @cutscene
  end
  #--------------------------------------------------------------------------
  # ● Execute command
  #--------------------------------------------------------------------------
  alias_method(:krx_nocutscene_gi_ec, :execute_command)
  def execute_command
    if @list[@index].code == 118 && @list[@index].parameters[0] === 'End Cutscene'
      $game_temp.skip_cutscene = false
      @cutscene = false
      Graphics.fadein(KRX::SKIP_FADE_TIME)
    end
    if cutscene? && $game_temp.skip_cutscene
      no_skip = (121..138).to_a + [201, 202, 231, 235, 236]
      return unless no_skip.include?(@list[@index].code)
    end
    krx_nocutscene_gi_ec
  end
end

#==============================================================================
# ■ Scene_Map
#==============================================================================

class Scene_Map < Scene_Base
  #--------------------------------------------------------------------------
  # ● Frame Update
  #--------------------------------------------------------------------------
  alias_method(:krx_nocutscene_sm_update, :update)
  def update
    check_skip_hotkey(KRX::SKIP_BUTTON)
    krx_nocutscene_sm_update
  end
  #--------------------------------------------------------------------------
  # ● Checks the input
  #--------------------------------------------------------------------------
  def check_skip_hotkey(sym)
    if $game_map.interpreter.cutscene?
      if Input.trigger?(sym)
        $game_temp.skip_cutscene = true
        $game_message.clear
        @message_window.clear_instance_variables
        @message_window.close
        Graphics.fadeout(KRX::SKIP_FADE_TIME)
      end
    end
  end
end


text:
$(function() {

  $('.js-seguir-follow').click(function(e) {
    var data = {
      user: $(this).data('user')
    }
    post('/social/follow', data, function() {
      window.top.location=window.top.location;
    });
  });

  $('.js-seguir-unfriend').click(function(e) {
    var user = $(this).data('user');
    $.ajax({
      type:'delete',
      url:'/social/friend/' + user,
      success:function() {
        // Cheat and just reload for now
        window.top.location=window.top.location;
      },
      fail: function(request, err, message) {
        if(message == 'Forbidden') {
          document.location = '/login?returnUrl=' + document.location.pathname;
        }
      }
    });
  });

  $('.js-seguir-unfollow').click(function(e) {
    var user = $(this).data('user');
    $.ajax({
      type:'delete',
      url:'/social/follow/' + user,
      success:function() {
        // Cheat and just reload for now
        window.top.location=window.top.location;
      },
      fail: function(request, err, message) {
        if(message == 'Forbidden') {
          document.location = '/login?returnUrl=' + document.location.pathname;
        }
      }
    });
  });

  $('#js-seguir-friendModal').on('show.bs.modal', function(event) {
      var button = $(event.relatedTarget)
      var user = button.data('user')
      var modal = $(this)
      modal.find('input.js-seguir-friend-request-user').val(user);
  });

  $('.js-seguir-friend-request').click(function(e) {
    var data = {
      user: $('#js-seguir-friendModal input.js-seguir-friend-request-user').val(),
      message: $('#js-seguir-friendModal textarea.js-seguir-friend-request-message').val() || ''
    }
    post('/social/friend', data, function() {
      // Cheat and just reload for now
      window.top.location=window.top.location;
    });
  });

  $('.js-seguir-accept-friend-request').click(function(e) {
    var data = {
      friend_request: $(this).data('friend-request')
    }
    post('/social/friend/accept', data, function() {
      // Cheat and just reload for now
      window.top.location=window.top.location;
    });
  });

  $('.js-seguir-post').click(function(e) {
    e.preventDefault();
    var data = {
      content: $('.js-seguir-post-content').val() || '',
      isprivate: $('.js-seguir-post-isprivate').is(':checked'),
      ispersonal: $('.js-seguir-post-ispersonal').is(':checked')
    }
    post('/social/post', data, function() {
      // Cheat and just reload for now
      window.top.location=window.top.location;
    });
  });

  $('.js-seguir-delete-post').click(function(e) {
    var post = $(this).data('post');
    $.ajax({
      type:'delete',
      url:'/social/post/' + post,
      success:function() {
        // Cheat and just reload for now
        window.top.location=window.top.location;
      },
      fail: function(request, err, message) {
        if(message == 'Forbidden') {
          document.location = '/login?returnUrl=' + document.location.pathname;
        }
      }
    });
  });

  function post(url, data, success) {
    $.post(url, data, success).fail(function(request, err, message) {
      if(message == 'Forbidden') {
        document.location = '/login?returnUrl=' + document.location.pathname;
      }
    });
  }

});


text:
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>

Delete Household Member

                Confirm: Are you sure you want to delete {{household_member.surname}}?

                <button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>
                Yes


text:
#include <sedml/SedDataSource.h>
#include <sedml/SedTypes.h>
#include <sbml/xml/XMLInputStream.h>

using namespace std;

LIBSEDML_CPP_NAMESPACE_BEGIN

/*
 * Creates a new SedDataSource with the given level, version, and package version.
 */
SedDataSource::SedDataSource(unsigned int level, unsigned int version)
  : SedBase(level, version)
  , mId("")
  , mName("")
  , mIndexSet("")
  , mSlices(level, version)

{
  // set an SedNamespaces derived object of this package
  setSedNamespacesAndOwn(new SedNamespaces(level, version));

  // connect to child objects
  connectToChild();
}

/*
 * Creates a new SedDataSource with the given SedNamespaces object.
 */
SedDataSource::SedDataSource(SedNamespaces* sedns)
  : SedBase(sedns)
  , mId("")
  , mName("")
  , mIndexSet("")
  , mSlices(sedns)

{
  // set the element namespace of this object
  setElementNamespace(sedns->getURI());

  // connect to child objects
  connectToChild();
}

/*
 * Copy constructor for SedDataSource.
 */
SedDataSource::SedDataSource(const SedDataSource& orig)
  : SedBase(orig)
{
  mId  = orig.mId;
  mName  = orig.mName;
  mIndexSet  = orig.mIndexSet;
  mSlices  = orig.mSlices;

  // connect to child objects
  connectToChild();
}

/*
 * Assignment for SedDataSource.
 */
SedDataSource&
SedDataSource::operator=(const SedDataSource& rhs)
{
  if (&rhs != this)
    {
      SedBase::operator=(rhs);
      mId  = rhs.mId;
      mName  = rhs.mName;
      mIndexSet  = rhs.mIndexSet;
      mSlices  = rhs.mSlices;

      // connect to child objects
      connectToChild();
    }

  return *this;
}

/*
 * Clone for SedDataSource.
 */
SedDataSource*
SedDataSource::clone() const
{
  return new SedDataSource(*this);
}

/*
 * Destructor for SedDataSource.
 */
SedDataSource::~SedDataSource()
{
}

/*
 * Returns the value of the "id" attribute of this SedDataSource.
 */
const std::string&
SedDataSource::getId() const
{
  return mId;
}

/*
 * Returns the value of the "name" attribute of this SedDataSource.
 */
const std::string&
SedDataSource::getName() const
{
  return mName;
}

/*
 * Returns the value of the "indexSet" attribute of this SedDataSource.
 */
const std::string&
SedDataSource::getIndexSet() const
{
  return mIndexSet;
}

/*
 * Returns true/false if id is set.
 */
bool
SedDataSource::isSetId() const
{
  return (mId.empty() == false);
}

/*
 * Returns true/false if name is set.
 */
bool
SedDataSource::isSetName() const
{
  return (mName.empty() == false);
}

/*
 * Returns true/false if indexSet is set.
 */
bool
SedDataSource::isSetIndexSet() const
{
  return (mIndexSet.empty() == false);
}

/*
 * Sets id and returns value indicating success.
 */
int
SedDataSource::setId(const std::string& id)
{
  return SyntaxChecker::checkAndSetSId(id, mId);
}

/*
 * Sets name and returns value indicating success.
 */
int
SedDataSource::setName(const std::string& name)
{
  {
    mName = name;
    return LIBSEDML_OPERATION_SUCCESS;
  }
}

/*
 * Sets indexSet and returns value indicating success.
 */
int
SedDataSource::setIndexSet(const std::string& indexSet)
{
  {
    mIndexSet = indexSet;
    return LIBSEDML_OPERATION_SUCCESS;
  }
}

/*
 * Unsets id and returns value indicating success.
 */
int
SedDataSource::unsetId()
{
  mId.erase();

  if (mId.empty() == true)
    {
      return LIBSEDML_OPERATION_SUCCESS;
    }
  else
    {
      return LIBSEDML_OPERATION_FAILED;
    }
}

/*
 * Unsets name and returns value indicating success.
 */
int
SedDataSource::unsetName()
{
  mName.erase();

  if (mName.empty() == true)
    {
      return LIBSEDML_OPERATION_SUCCESS;
    }
  else
    {
      return LIBSEDML_OPERATION_FAILED;
    }
}

/*
 * Unsets indexSet and returns value indicating success.
 */
int
SedDataSource::unsetIndexSet()
{
  mIndexSet.erase();

  if (mIndexSet.empty() == true)
    {
      return LIBSEDML_OPERATION_SUCCESS;
    }
  else
    {
      return LIBSEDML_OPERATION_FAILED;
    }
}

/*
 * Returns the  "SedListOfSlices" in this SedDataSource object.
 */
const SedListOfSlices*
SedDataSource::getListOfSlices() const
{
  return &mSlices;
}

/*
 * Removes the nth Slice from the SedListOfSlices.
 */
SedSlice*
SedDataSource::removeSlice(unsigned int n)
{
  return mSlices.remove(n);
}

/*
 * Removes the a Slice with given id from the SedListOfSlices.
 */
SedSlice*
SedDataSource::removeSlice(const std::string& sid)
{
  return mSlices.remove(sid);
}

/*
 * Return the nth Slice in the SedListOfSlices within this SedDataSource.
 */
SedSlice*
SedDataSource::getSlice(unsigned int n)
{
  return mSlices.get(n);
}

/*
 * Return the nth Slice in the SedListOfSlices within this SedDataSource.
 */
const SedSlice*
SedDataSource::getSlice(unsigned int n) const
{
  return mSlices.get(n);
}

/*
 * Return a Slice from the SedListOfSlices by id.
 */
SedSlice*
SedDataSource::getSlice(const std::string& sid)
{
  return mSlices.get(sid);
}

/*
 * Return a Slice from the SedListOfSlices by id.
 */
const SedSlice*
SedDataSource::getSlice(const std::string& sid) const
{
  return mSlices.get(sid);
}

/**
 * Adds a copy the given "SedSlice" to this SedDataSource.
 *
 * @param ss; the SedSlice object to add
 *
 * @return integer value indicating success/failure of the
 * function.  @if clike The value is drawn from the
 * enumeration #OperationReturnValues_t. @endif The possible values
 * returned by this function are:
 * @li LIBSEDML_OPERATION_SUCCESS
 * @li LIBSEDML_INVALID_ATTRIBUTE_VALUE
 */
int
SedDataSource::addSlice(const SedSlice* ss)
{
  if (ss == NULL) return LIBSEDML_INVALID_ATTRIBUTE_VALUE;

  mSlices.append(ss);
  return LIBSEDML_OPERATION_SUCCESS;
}

/**
 * Get the number of SedSlice objects in this SedDataSource.
 *
 * @return the number of SedSlice objects in this SedDataSource
 */
unsigned int
SedDataSource::getNumSlices() const
{
  return mSlices.size();
}

/**
 * Creates a new SedSlice object, adds it to this SedDataSources
 * SedDataSource and returns the SedSlice object created.
 *
 * @return a new SedSlice object instance
 *
 * @see addSedSlice(const SedSlice* ss)
 */
SedSlice*
SedDataSource::createSlice()
{
  SedSlice *temp = new SedSlice();

  if (temp != NULL) mSlices.appendAndOwn(temp);

  return temp;
}

/*
 * Returns the XML element name of this object
 */
const std::string&
SedDataSource::getElementName() const
{
  static const string name = "dataSource";
  return name;
}

/**
 * return the SEDML object corresponding to next XMLToken.
 */
SedBase*
SedDataSource::createObject(XMLInputStream& stream)
{
  SedBase* object = NULL;

  const string& name   = stream.peek().getName();

  if (name == "listOfSlices")
    {
      object = &mSlices;
    }

  connectToChild();

  return object;
}

/*
 * Read values from the given XMLAttributes set into their specific fields.
 */
void
SedDataSource::connectToChild()
{
  SedBase::connectToChild();

  mSlices.connectToParent(this);
}

/*
 * Returns the libSEDML type code for this SEDML object.
 */
int
SedDataSource::getTypeCode() const
{
  return SEDML_DATA_SOURCE;
}

/*
 * check if all the required attributes are set
 */
bool
SedDataSource::hasRequiredAttributes() const
{
  bool allPresent = true;

  if (isSetId() == false)
    allPresent = false;

  return allPresent;
}

/*
 * check if all the required elements are set
 */
bool
SedDataSource::hasRequiredElements() const
{
  bool allPresent = true;

  return allPresent;
}

/** @cond doxygen-libsedml-internal */

/*
 * write contained elements
 */
void
SedDataSource::writeElements(XMLOutputStream& stream) const
{
  SedBase::writeElements(stream);

  if (getNumSlices() > 0)
    {
      mSlices.write(stream);
    }
}

/** @endcond doxygen-libsedml-internal */

/** @cond doxygen-libsedml-internal */

/*
 * Accepts the given SedVisitor.
 */
bool
SedDataSource::accept(SedVisitor& v) const
{
  return false;

}

/** @endcond doxygen-libsedml-internal */

/** @cond doxygen-libsedml-internal */

/*
 * Sets the parent SedDocument.
 */
void
SedDataSource::setSedDocument(SedDocument* d)
{
  SedBase::setSedDocument(d);
  mSlices.setSedDocument(d);
}

/** @endcond doxygen-libsedml-internal */

/** @cond doxygen-libsedml-internal */

/*
 * Get the list of expected attributes for this element.
 */
void
SedDataSource::addExpectedAttributes(ExpectedAttributes& attributes)
{
  SedBase::addExpectedAttributes(attributes);

  attributes.add("id");
  attributes.add("name");
  attributes.add("indexSet");
}

/** @endcond doxygen-libsedml-internal */

/** @cond doxygen-libsedml-internal */

/*
 * Read values from the given XMLAttributes set into their specific fields.
 */
void
SedDataSource::readAttributes(const XMLAttributes& attributes,
                              const ExpectedAttributes& expectedAttributes)
{
  SedBase::readAttributes(attributes, expectedAttributes);

  bool assigned = false;

  //
  // id SId  ( use = "optional" )
  //
  assigned = attributes.readInto("id", mId, getErrorLog(), false);

  if (assigned == true)
    {
      // check string is not empty and correct syntax

      if (mId.empty() == true)
        {
          logEmptyString(mId, getLevel(), getVersion(), "<SedDataSource>");
        }
      else if (SyntaxChecker::isValidSBMLSId(mId) == false)
        {
          logError(SedInvalidIdSyntax);
        }
    }

  //
  // name string   ( use = "optional" )
  //
  assigned = attributes.readInto("name", mName, getErrorLog(), false);

  if (assigned == true)
    {
      // check string is not empty

      if (mName.empty() == true)
        {
          logEmptyString(mName, getLevel(), getVersion(), "<SedDataSource>");
        }
    }

  //
  // indexSet string   ( use = "optional" )
  //
  assigned = attributes.readInto("indexSet", mIndexSet, getErrorLog(), false);

  if (assigned == true)
    {
      // check string is not empty

      if (mIndexSet.empty() == true)
        {
          logEmptyString(mIndexSet, getLevel(), getVersion(), "<SedDataSource>");
        }
    }

}

/** @endcond doxygen-libsedml-internal */

/** @cond doxygen-libsedml-internal */

/*
 * Write values of XMLAttributes to the output stream.
 */
void
SedDataSource::writeAttributes(XMLOutputStream& stream) const
{
  SedBase::writeAttributes(stream);

  if (isSetId() == true)
    stream.writeAttribute("id", getPrefix(), mId);

  if (isSetName() == true)
    stream.writeAttribute("name", getPrefix(), mName);

  if (isSetIndexSet() == true)
    stream.writeAttribute("indexSet", getPrefix(), mIndexSet);

}

/** @endcond doxygen-libsedml-internal */

/*
 * Constructor
 */
SedListOfDataSources::SedListOfDataSources(unsigned int level,
    unsigned int version)
  : SedListOf(level, version)
{
  setSedNamespacesAndOwn(new SedNamespaces(level, version));
}

/*
 * Constructor
 */
SedListOfDataSources::SedListOfDataSources(SedNamespaces* sedns)
  : SedListOf(sedns)
{
  setElementNamespace(sedns->getURI());
}

/*
 * Returns a deep copy of this SedListOfDataSources
 */
SedListOfDataSources*
SedListOfDataSources::clone() const
{
  return new SedListOfDataSources(*this);
}

/*
 * Get a DataSource from the SedListOfDataSources by index.
*/
SedDataSource*
SedListOfDataSources::get(unsigned int n)
{
  return static_cast<SedDataSource*>(SedListOf::get(n));
}

/*
 * Get a DataSource from the SedListOfDataSources by index.
 */
const SedDataSource*
SedListOfDataSources::get(unsigned int n) const
{
  return static_cast<const SedDataSource*>(SedListOf::get(n));
}

/*
 * Get a DataSource from the SedListOfDataSources by id.
 */
SedDataSource*
SedListOfDataSources::get(const std::string& sid)
{
  return const_cast<SedDataSource*>(
           static_cast<const SedListOfDataSources&>(*this).get(sid));
}

/*
 * Get a DataSource from the SedListOfDataSources by id.
 */
const SedDataSource*
SedListOfDataSources::get(const std::string& sid) const
{
  vector<SedBase*>::const_iterator result;

  result = find_if(mItems.begin(), mItems.end(), SedIdEq<SedDataSource>(sid));
  return (result == mItems.end()) ? 0 : static_cast <SedDataSource*>(*result);
}

/**
 * Adds a copy the given "SedDataSource" to this SedListOfDataSources.
 *
 * @param sds; the SedDataSource object to add
 *
 * @return integer value indicating success/failure of the
 * function.  @if clike The value is drawn from the
 * enumeration #OperationReturnValues_t. @endif The possible values
 * returned by this function are:
 * @li LIBSEDML_OPERATION_SUCCESS
 * @li LIBSEDML_INVALID_ATTRIBUTE_VALUE
 */
int
SedListOfDataSources::addDataSource(const SedDataSource* sds)
{
  if (sds == NULL) return LIBSEDML_INVALID_ATTRIBUTE_VALUE;

  append(sds);
  return LIBSEDML_OPERATION_SUCCESS;
}

/**
 * Get the number of SedDataSource objects in this SedListOfDataSources.
 *
 * @return the number of SedDataSource objects in this SedListOfDataSources
 */
unsigned int
SedListOfDataSources::getNumDataSources() const
{
  return size();
}

/**
 * Creates a new SedDataSource object, adds it to this SedListOfDataSourcess
 * SedDataSource and returns the SedDataSource object created.
 *
 * @return a new SedDataSource object instance
 *
 * @see addSedDataSource(const SedDataSource* sds)
 */
SedDataSource*
SedListOfDataSources::createDataSource()
{
  SedDataSource *temp = new SedDataSource();

  if (temp != NULL) appendAndOwn(temp);

  return temp;
}

/*
 * Removes the nth DataSource from this SedListOfDataSources
 */
SedDataSource*
SedListOfDataSources::remove(unsigned int n)
{
  return static_cast<SedDataSource*>(SedListOf::remove(n));
}

/*
 * Removes the DataSource from this SedListOfDataSources with the given identifier
 */
SedDataSource*
SedListOfDataSources::remove(const std::string& sid)
{
  SedBase* item = NULL;
  vector<SedBase*>::iterator result;

  result = find_if(mItems.begin(), mItems.end(), SedIdEq<SedDataSource>(sid));

  if (result != mItems.end())
    {
      item = *result;
      mItems.erase(result);
    }

  return static_cast <SedDataSource*>(item);
}

/*
 * Returns the XML element name of this object
 */
const std::string&
SedListOfDataSources::getElementName() const
{
  static const string name = "listOfDataSources";
  return name;
}

/*
 * Returns the libSEDML type code for this SEDML object.
 */
int
SedListOfDataSources::getTypeCode() const
{
  return SEDML_LIST_OF;
}

/*
 * Returns the libSEDML type code for the objects in this LIST_OF.
 */
int
SedListOfDataSources::getItemTypeCode() const
{
  return SEDML_DATA_SOURCE;
}

/** @cond doxygen-libsedml-internal */

/*
 * Creates a new SedDataSource in this SedListOfDataSources
 */
SedBase*
SedListOfDataSources::createObject(XMLInputStream& stream)
{
  const std::string& name   = stream.peek().getName();
  SedBase* object = NULL;

  if (name == "dataSource")
    {
      object = new SedDataSource(getSedNamespaces());
      appendAndOwn(object);
    }

  return object;
}

/** @endcond doxygen-libsedml-internal */

/** @cond doxygen-libsedml-internal */

/*
 * Write the namespace for the Sed package.
 */
void
SedListOfDataSources::writeXMLNS(XMLOutputStream& stream) const
{
  XMLNamespaces xmlns;

  std::string prefix = getPrefix();

  if (prefix.empty())
    {
      if (getNamespaces() != NULL && !getNamespaces()->hasURI(SEDML_XMLNS_L1) && !getNamespaces()->hasURI(SEDML_XMLNS_L1V2) && !getNamespaces()->hasURI(SEDML_XMLNS_L1V3))
        {
          if (getVersion() == 2) xmlns.add(SEDML_XMLNS_L1V2, prefix);
          else if (getVersion() == 3) xmlns.add(SEDML_XMLNS_L1V3, prefix);
          else xmlns.add(SEDML_XMLNS_L1V2, prefix);
        }
    }

  stream << xmlns;
}

/** @endcond doxygen-libsedml-internal */

/**
 * write comments
 */
LIBSEDML_EXTERN
SedDataSource_t *
SedDataSource_create(unsigned int level, unsigned int version)
{
  return new SedDataSource(level, version);
}

/**
 * write comments
 */
LIBSEDML_EXTERN
void
SedDataSource_free(SedDataSource_t * sds)
{
  if (sds != NULL)
    delete sds;
}

/**
 * write comments
 */
LIBSEDML_EXTERN
SedDataSource_t *
SedDataSource_clone(SedDataSource_t * sds)
{
  if (sds != NULL)
    {
      return static_cast<SedDataSource_t*>(sds->clone());
    }
  else
    {
      return NULL;
    }
}

/**
 * write comments
 */
LIBSEDML_EXTERN
char *
SedDataSource_getId(SedDataSource_t * sds)
{
  if (sds == NULL)
    return NULL;

  return sds->getId().empty() ? NULL : safe_strdup(sds->getId().c_str());
}

/**
 * write comments
 */
LIBSEDML_EXTERN
char *
SedDataSource_getName(SedDataSource_t * sds)
{
  if (sds == NULL)
    return NULL;

  return sds->getName().empty() ? NULL : safe_strdup(sds->getName().c_str());
}

/**
 * write comments
 */
LIBSEDML_EXTERN
char *
SedDataSource_getIndexSet(SedDataSource_t * sds)
{
  if (sds == NULL)
    return NULL;

  return sds->getIndexSet().empty() ? NULL : safe_strdup(sds->getIndexSet().c_str());
}

/**
 * write comments
 */
LIBSEDML_EXTERN
int
SedDataSource_isSetId(SedDataSource_t * sds)
{
  return (sds != NULL) ? static_cast<int>(sds->isSetId()) : 0;
}

/**
 * write comments
 */
LIBSEDML_EXTERN
int
SedDataSource_isSetName(SedDataSource_t * sds)
{
  return (sds != NULL) ? static_cast<int>(sds->isSetName()) : 0;
}

/**
 * write comments
 */
LIBSEDML_EXTERN
int
SedDataSource_isSetIndexSet(SedDataSource_t * sds)
{
  return (sds != NULL) ? static_cast<int>(sds->isSetIndexSet()) : 0;
}

/**
 * write comments
 */
LIBSEDML_EXTERN
int
SedDataSource_setId(SedDataSource_t * sds, const char * id)
{
  return (sds != NULL) ? sds->setId(id) : LIBSEDML_INVALID_OBJECT;
}

/**
 * write comments
 */
LIBSEDML_EXTERN
int
SedDataSource_setName(SedDataSource_t * sds, const char * name)
{
  return (sds != NULL) ? sds->setName(name) : LIBSEDML_INVALID_OBJECT;
}

/**
 * write comments
 */
LIBSEDML_EXTERN
int
SedDataSource_setIndexSet(SedDataSource_t * sds, const char * indexSet)
{
  return (sds != NULL) ? sds->setIndexSet(indexSet) : LIBSEDML_INVALID_OBJECT;
}

/**
 * write comments
 */
LIBSEDML_EXTERN
int
SedDataSource_unsetId(SedDataSource_t * sds)
{
  return (sds != NULL) ? sds->unsetId() : LIBSEDML_INVALID_OBJECT;
}

/**
 * write comments
 */
LIBSEDML_EXTERN
int
SedDataSource_unsetName(SedDataSource_t * sds)
{
  return (sds != NULL) ? sds->unsetName() : LIBSEDML_INVALID_OBJECT;
}

/**
 * write comments
 */
LIBSEDML_EXTERN
int
SedDataSource_unsetIndexSet(SedDataSource_t * sds)
{
  return (sds != NULL) ? sds->unsetIndexSet() : LIBSEDML_INVALID_OBJECT;
}

LIBSEDML_EXTERN
int
SedDataSource_addSlice(SedDataSource_t * sds, SedSlice_t * ss)
{
  return (sds != NULL) ? sds->addSlice(ss) : LIBSBML_INVALID_OBJECT;
}

LIBSEDML_EXTERN
SedSlice_t *
SedDataSource_createSlice(SedDataSource_t * sds)
{
  return (sds != NULL) ? sds->createSlice() : NULL;
}

LIBSEDML_EXTERN
SedListOf_t *
SedDataSource_getSedListOfSlices(SedDataSource_t * sds)
{
  return (sds != NULL) ? (SedListOf_t *)sds->getListOfSlices() : NULL;
}

LIBSEDML_EXTERN
SedSlice_t *
SedDataSource_getSlice(SedDataSource_t * sds, unsigned int n)
{
  return (sds != NULL) ? sds->getSlice(n) : NULL;
}

LIBSEDML_EXTERN
SedSlice_t *
SedDataSource_getSliceById(SedDataSource_t * sds, const char * sid)
{
  return (sds != NULL) ? sds->getSlice(sid) : NULL;
}

LIBSEDML_EXTERN
unsigned int
SedDataSource_getNumSlices(SedDataSource_t * sds)
{
  return (sds != NULL) ? sds->getNumSlices() : SEDML_INT_MAX;
}

LIBSEDML_EXTERN
SedSlice_t *
SedDataSource_removeSlice(SedDataSource_t * sds, unsigned int n)
{
  return (sds != NULL) ? sds->removeSlice(n) : NULL;
}

LIBSEDML_EXTERN
SedSlice_t *
SedDataSource_removeSliceById(SedDataSource_t * sds, const char * sid)
{
  return (sds != NULL) ? sds->removeSlice(sid) : NULL;
}

/**
 * write comments
 */
LIBSEDML_EXTERN
int
SedDataSource_hasRequiredAttributes(SedDataSource_t * sds)
{
  return (sds != NULL) ? static_cast<int>(sds->hasRequiredAttributes()) : 0;
}

/**
 * write comments
 */
LIBSEDML_EXTERN
int
SedDataSource_hasRequiredElements(SedDataSource_t * sds)
{
  return (sds != NULL) ? static_cast<int>(sds->hasRequiredElements()) : 0;
}

/**
 * write comments
 */
LIBSEDML_EXTERN
SedDataSource_t *
SedListOfDataSources_getById(SedListOf_t * lo, const char * sid)
{
  if (lo == NULL)
    return NULL;

  return (sid != NULL) ? static_cast <SedListOfDataSources *>(lo)->get(sid) : NULL;
}

/**
 * write comments
 */
LIBSEDML_EXTERN
SedDataSource_t *
SedListOfDataSources_removeById(SedListOf_t * lo, const char * sid)
{
  if (lo == NULL)
    return NULL;

  return (sid != NULL) ? static_cast <SedListOfDataSources *>(lo)->remove(sid) : NULL;
}

LIBSEDML_CPP_NAMESPACE_END


text:
namespace RazorEngineCms.Migrations
{
    using System;
    using System.Data.Entity.Migrations;

    public partial class UpdatingPageModelProperties : DbMigration
    {
        public override void Up()
        {
            AddColumn("dbo.Pages", "HasParams", c => c.Boolean(nullable: false));
        }

        public override void Down()
        {
            DropColumn("dbo.Pages", "HasParams");
        }
    }
}


text:
import unittest
from datetime import datetime
from tasks import needs_reply as c

class TestCloseNoReply(unittest.TestCase):

    def test_has_needs_reply_label(self):
        self.assertEquals(c.has_needs_reply_label(None), False)
        self.assertEquals(c.has_needs_reply_label({}), False)

        self.assertEquals(c.has_needs_reply_label({
            'labels': None
        }), False)

        self.assertEquals(c.has_needs_reply_label({
            'labels': []
        }), False)

        self.assertEquals(c.has_needs_reply_label({
            'labels': [{
                'name': 'bug'
            }]
        }), False)

        self.assertEquals(c.has_needs_reply_label({
            'labels': [{
                'name': 'needs reply'
            }]
        }), True)

    def test_get_most_recent_datetime_need_reply_label_added(self):
        self.assertEquals(c.get_most_recent_datetime_need_reply_label_added(None), None)

        self.assertEquals(c.get_most_recent_datetime_need_reply_label_added([]), None)

        self.assertEquals(c.get_most_recent_datetime_need_reply_label_added([{
            'event': 'closed'
        }]), None)

        self.assertEquals(c.get_most_recent_datetime_need_reply_label_added([{
            'event': 'labeled'
        }]), None)

        self.assertEquals(c.get_most_recent_datetime_need_reply_label_added([{
            'event': 'labeled',
            'label': None
        }]), None)

        self.assertEquals(c.get_most_recent_datetime_need_reply_label_added([{
            'event': 'labeled',
            'label': []
        }]), None)

        self.assertEquals(c.get_most_recent_datetime_need_reply_label_added([{
            'event': 'labeled',
            'label': {
                'name': 'bug'
            }
        }]), None)

        self.assertEquals(c.get_most_recent_datetime_need_reply_label_added([{
            'event': 'labeled',
            'label': {
                'name': 'needs reply'
            }
        }]), None)

        self.assertEquals(c.get_most_recent_datetime_need_reply_label_added([{
            'event': 'labeled',
            'label': {
                'name': 'needs reply'
            },
            'created_at': '2000-01-02T00:00:00Z'
        }]), datetime(2000, 1, 2, 0, 0))

        self.assertEquals(c.get_most_recent_datetime_need_reply_label_added([{
            'event': 'labeled',
            'label': {
                'name': 'needs reply'
            },
            'created_at': '2000-01-02T00:00:00Z'
        },{
            'event': 'labeled',
            'label': {
                'name': 'needs reply'
            },
            'created_at': '2000-01-05T00:00:00Z'
        },{
            'event': 'labeled',
            'label': {
                'name': 'needs reply'
            },
            'created_at': '2000-01-03T00:00:00Z'
        },{
            'event': 'labeled',
            'label': {
                'name': 'bug'
            },
            'created_at': '2000-01-10T00:00:00Z'
        }]), datetime(2000, 1, 5, 0, 0))

    def test_get_most_recent_datetime_creator_response(self):
        self.assertEquals(
            c.get_most_recent_datetime_creator_response(None, None),
            None)

        self.assertEquals(
            c.get_most_recent_datetime_creator_response({
                'user': None
            }, None),
            None)

        self.assertEquals(
            c.get_most_recent_datetime_creator_response({
                'user': { 'login': None }
            }, None),
            None)

        self.assertEquals(
            c.get_most_recent_datetime_creator_response({
                'user': { 'login': 'steve' }
            }, None),
            None)

        self.assertEquals(
            c.get_most_recent_datetime_creator_response({
                'user': { 'login': 'steve' },
                'created_at': '2000-01-01T00:00:00Z'
            }, None),
            datetime(2000, 1, 1, 0, 0))

        self.assertEquals(
            c.get_most_recent_datetime_creator_response({
                'user': { 'login': 'steve' },
                'created_at': '2000-01-01T00:00:00Z'
            }, []),
            datetime(2000, 1, 1, 0, 0))

        self.assertEquals(
            c.get_most_recent_datetime_creator_response({
                'user': { 'login': 'steve' },
                'created_at': '2000-01-01T00:00:00Z'
            }, [
                { 'user': { 'login': 'bob' }, 'created_at': '2000-02-01T00:00:00Z' },
                { 'user': { 'login': 'steve' }, 'created_at': '2000-03-01T00:00:00Z' },
                { 'user': { 'login': 'don' }, 'created_at': '2000-04-01T00:00:00Z' },
            ]),
            datetime(2000, 3, 1, 0, 0))

    def test_has_replied_since_adding_label(self):
        self.assertEquals(
            c.has_replied_since_adding_label(datetime(2000, 1, 1), datetime(2000, 2, 1)), True)

        self.assertEquals(
            c.has_replied_since_adding_label(datetime(2000, 2, 1), datetime(2000, 1, 1)), False)

    def test_has_not_replied_in_timely_manner(self):
        self.assertEquals(
            c.has_replied_in_timely_manner(datetime(2000, 1, 1), datetime(2000, 2, 1), 10),
            False)

        self.assertEquals(
            c.has_replied_in_timely_manner(datetime(2000, 1, 1), datetime(2000, 1, 2), 10),
            True)

        self.assertEquals(
            c.has_replied_in_timely_manner(datetime(2000, 1, 1), datetime(2000, 1, 9), 10),
            True)

        self.assertEquals(
            c.has_replied_in_timely_manner(datetime(2000, 1, 1), datetime(2001, 1, 11), 10),
            False)

    def test_remove_needs_reply_comment(self):
        needs_reply_content_id = 'ionitron-needs-reply'

        issue = {
            'number': 1,
            'body': 'blah blah blah i dont get it'
        }
        issue_comments = [
            { 'body': 'asdf', 'id': 1 }
        ]
        r = c.remove_needs_reply_comment('drifty', 'ionic', issue, issue_comments=issue_comments, needs_reply_content_id=needs_reply_content_id, is_debug=True)
        self.assertEquals(r, 'no comment to remove')

        issue = {
            'number': 1,
            'body': 'blah blah blah i dont get it'
        }
        issue_comments = [
            { 'body': 'ionitron-needs-reply', 'id': 1 }
        ]
        r = c.remove_needs_reply_comment('drifty', 'ionic', issue, issue_comments=issue_comments, needs_reply_content_id=needs_reply_content_id, is_debug=True)
        self.assertEquals(r, 'removed auto comment')


text:
CREATE DATABASE fuji;
USE fuji;

CREATE TABLE events(
    id int not null auto_increment primary key,
    name tinytext not null,
    attributes text not null,
    created_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP
);

CREATE TABLE sessions(
    id int not null auto_increment primary key,
    user_id int not null,
    duration int,
    created_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP
);

CREATE TABLE users(
    id int not null auto_increment primary key,
    os tinytext,
    device tinytext,
    locale tinytext,
    voiceover boolean,
    bold_text boolean,
    reduce_motion boolean,
    reduce_transparency boolean,
    created_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP
);


text:
from scipy import sparse

from common import regexes, sqlhelper
from common.dbconnect import db
from common.dbhelper import SQLTable
from common.matrixutils import NamedMatrix, TotalOutputMatrix, FinalDemandMatrix

class IOMatrixGenerator:

    def __init__(self, transaction_table,
                 from_sector_name="from_sector",
                 to_sector_name="to_sector",
                 value_column_name="value",
                 final_demand_sectors=[],
                 universal_conditions=[]):

        self.strings = {
            "from_sector": from_sector_name,
            "to_sector": to_sector_name,
            "value_column": value_column_name,
            }

        self.set_table(transaction_table)
        self.set_fd_sectors(final_demand_sectors)

        self.pce_col = None
        self.fd_col = None

        self.condition_args = ()
        self.universal_conditions = universal_conditions
        self.harmonized_rows = None
        self.harmonized_columns = None

        self.exchange_rate_exceptions = {}

        self.from_blacklist = []
        self.to_blacklist = []

    def set_table(self, tablename):
        self.tablename = tablename
        self.strings["iotable"] = tablename
        self.sectors = None
        self.exchange_rate = 1

    def set_fd_sectors(self, sectors):
        self.strings["fd_sectors"] = sqlhelper.set_repr(sectors)
        self.fd_sectors = sectors

    def set_exchange_rate(self, rate):
        self.exchange_rate = rate

    def set_exchange_rate_exception(self, sector, rate):
        self.exchange_rate_exceptions[sector] = rate

    def get_exchange_rate(self, sector):
        if sector in self.exchange_rate_exceptions:
            return self.exchange_rate_exceptions[sector]
        else:
            return self.exchange_rate

    def set_harmonized_rows(self, rows):
        self.harmonized_rows = rows

    def set_harmonized_cols(self, cols):
        self.harmonized_cols = cols

    def blacklist_from_sectors(self, from_sectors):
        self.from_blacklist = from_sectors

    def blacklist_to_sectors(self, to_sectors):
        self.to_blacklist = to_sectors

    def generate_where(self, table_alias="", extra=[]):
        conditions = self.universal_conditions[:]
        if len(table_alias) and not table_alias.endswith("."):
            table_alias = table_alias + "."
        if len(self.from_blacklist):
            conditions.append("%s%s NOT IN %s" \
                % (table_alias, self.strings["from_sector"],
                   sqlhelper.set_repr(self.from_blacklist)))
        if len(self.to_blacklist):
            conditions.append("%s%s NOT IN %s" \
                % (table_alias, self.strings["to_sector"],
                   sqlhelper.set_repr(self.to_blacklist)))
        if len(conditions) > 0:
            return " AND ".join(conditions)
        return "TRUE"

    # sectors
    def generate_sector_stmt(self):
        strings = self.strings
        strings["conditions"] = self.generate_where()
        sql = """SELECT DISTINCT %(from_sector)s
                   FROM %(iotable)s
                  WHERE %(conditions)s""" % strings

        return db.prepare(sql)

    # clear cache
    def set_condition_args(self, *args):
        self.condition_args = args
        self.sectors = None

    # refresh list if get_sectors is called with different args
    def get_sectors(self):
        if self.sectors is None:
            stmt = self.generate_sector_stmt()
            self.sectors = [row[0] for row in stmt(*self.condition_args)]
        return self.sectors

    # total output
    def sql_for_total_output(self):
        strings = self.strings
        strings["conditions"] = self.generate_where()
        sql = """SELECT %(from_sector)s AS __from_sector,
                        sum(%(value_column)s) as %(value_column)s
                   FROM %(iotable)s
                  WHERE %(conditions)s
                  GROUP BY %(from_sector)s""" % strings

        return sql

    def generate_x_stmt(self):
        return db.prepare(self.sql_for_total_output())

    def get_x(self, use_exchange_rate=False):
        x = TotalOutputMatrix(rows=self.get_sectors())
        if self.harmonized_rows is not None:
            x.set_harmonized_rows(self.harmonized_rows)

        stmt = self.generate_x_stmt()
        result = stmt(*self.condition_args)
        for row in result:
            if use_exchange_rate:
                exchange_rate = self.get_exchange_rate(row[0])
                x.set_output(row[0], float(row[1]) * exchange_rate)
            else:
                x.set_output(row[0], row[1])
        return x

    # technical coefficients
    def generate_Z_stmt(self):
        strings = self.strings
        strings["conditions"] = self.generate_where()
        sql = """SELECT %(from_sector)s, %(to_sector)s,
                        %(value_column)s
                   FROM %(iotable)s
                  WHERE %(conditions)s
                    AND %(to_sector)s NOT IN %(fd_sectors)s""" % strings

        return db.prepare(sql)

    def get_Z(self):
        Z = NamedMatrix(square=True, rows=self.get_sectors())
        if self.harmonized_rows is not None:
            Z.set_harmonized_rows(self.harmonized_rows)

        stmt = self.generate_Z_stmt()
        result = stmt(*self.condition_args)
        for row in result:
            Z.set_element(row[0], row[1], row[2]) # from_sec, to_sec, value

        return Z

    def generate_A_stmt(self):
        strings = self.strings
        strings["x_sql"] = self.sql_for_total_output()
        strings["conditions"] = self.generate_where("z")

        sql = """SELECT z.%(from_sector)s, z.%(to_sector)s,
                        z.%(value_column)s / x.%(value_column)s as a
                   FROM %(iotable)s z,
                        (%(x_sql)s) x
                  WHERE %(conditions)s
                    AND z.%(to_sector)s NOT IN %(fd_sectors)s
                    AND z.%(to_sector)s = x.__from_sector
                    AND x.%(value_column)s <> 0""" % strings

        return db.prepare(sql)

    def get_A(self):
        A = NamedMatrix(square=True, rows=self.get_sectors())
        if self.harmonized_rows is not None:
            A.set_harmonized_rows(self.harmonized_rows)

        stmt = self.generate_A_stmt()
        result = stmt(*self.condition_args)
        for row in result:
            A.set_element(row[0], row[1], row[2]) # from_sec, to_sec, value

        return A

    def get_L(self):
        matrix_shell = self.get_A()
        A = matrix_shell.mat()

        if A.shape[0] != A.shape[1]:
            raise Exception("A is not square")
        eye = sparse.identity(A.shape[0])
        L = (eye - A).todense().getI()
        matrix_shell.matrix = L
        return matrix_shell

    def set_pce_col(self, pce_col):
        self.pce_col = pce_col

    def set_export_col(self, export_col):
        self.export_col = export_col

    def generate_Y_stmt(self):
        strings = self.strings
        strings["conditions"] = self.generate_where()
        sql = """SELECT %(from_sector)s, %(to_sector)s, %(value_column)s
                   FROM %(iotable)s
                  WHERE %(conditions)s
                    AND %(to_sector)s IN %(fd_sectors)s""" % strings
        return db.prepare(sql)

    def get_Y(self, use_exchange_rate=False):
        if self.pce_col is None or self.export_col is None:
            raise Exception("one or more final demand columns not set")

        Y = FinalDemandMatrix(self.pce_col, self.export_col,
                              rows=self.get_sectors(),
                              cols=self.fd_sectors)
        if self.harmonized_rows is not None:
            Y.set_harmonized_rows(self.harmonized_rows)

        stmt = self.generate_Y_stmt()
        result = stmt(*self.condition_args)
        for row in result:
            if use_exchange_rate:
                exchange_rate = self.get_exchange_rate(row[0])
                Y.set_element(row[0], row[1], row[2] * exchange_rate)
            else:
                Y.set_element(row[0], row[1], row[2])

        return Y

class EnvMatrixGenerator:

    def __init__(self, envtable,
                 ind_col_name="sector",
                 series_col_name="series",
                 value_col_name="value",
                 universal_conditions=[]):

        self.strings = {
            "ind_col": ind_col_name,
            "series_col": series_col_name,
            "value": value_col_name,
            }

        self.set_table(envtable)

        self.set_universal_conditions(universal_conditions)
        self.condition_args = ()

    def set_universal_conditions(self, conditions):
        if len(conditions):
            self.strings["basic_condition"] = \
                " AND ".join(conditions)
        else:
            self.strings["basic_condition"] = "TRUE"

    def set_table(self, tablename):
        self.tablename = tablename
        self.strings["envtable"] = tablename
        self.sectors = None

    # sectors
    def set_sectors(self, sectors):
        self.sectors = sectors

    def generate_sector_stmt(self):
        sql = """SELECT DISTINCT %(ind_col)s
                   FROM %(envtable)s
                  WHERE %(basic_condition)s
                  ORDER BY %(ind_col)s""" % self.strings
        return db.prepare(sql)

    # TODO: create common superclass for this and IOMatrixGenerator
    # containing the following two methods
    def set_condition_args(self, *args):
        self.condition_args = args
        self.sectors = None

    def get_sectors(self):
        if self.sectors is None:
            stmt = self.generate_sector_stmt()
            self.sectors = [row[0] for row in stmt(*self.condition_args)]
        return self.sectors

    # mapping matrix
    # TODO: stop using this, use generic selector in matrixutils instead
    def generate_map_stmt(self, maptable, env_col, other_col, conditions=[]):
        strings = {
            "maptable": maptable,
            "other_col": other_col,
            "self_col": env_col,
            }

        if len(conditions):
            strings["basic_condition"] = " AND ".join(conditions)
        else:
            strings["basic_condition"] = "TRUE"

        sql = """SELECT %(self_col)s, %(other_col)s
                   FROM %(maptable)s
                  WHERE %(basic_condition)s""" % strings
        return db.prepare(sql)

    def get_env_selector(self, maptable, env_col, other_col,
                         columns, conditions=[]):
        sel = NamedMatrix(square=False)
        sel.set_columns(columns)
        sel.set_rows(self.get_sectors())
        stmt = self.generate_map_stmt(maptable, env_col, other_col, conditions)
        result = stmt()
        for row in result:
            if sel.has_row(row[0]) and sel.has_column(row[1]):
                sel.set_element(row[0], row[1], 1)
        return sel

    # env matrix main
    def generate_env_stmt(self, series):
        strings = self.strings
        strings["series_list"] = sqlhelper.set_repr(series)

        sql = """SELECT %(ind_col)s, sum(%(value)s)
                   FROM %(envtable)s
                  WHERE %(basic_condition)s
                    AND %(series_col)s IN %(series_list)s
                  GROUP BY %(ind_col)s""" % strings

        return db.prepare(sql)

    def get_env_vector(self, series):
        if type(series) is str:
            series = [series]

        colname = "+".join(series)
        E = NamedMatrix(square=False,
                        rows=self.get_sectors(),
                        cols=[colname])
        stmt = self.generate_env_stmt(series)
        result = stmt(*self.condition_args)
        for row in result:
            E.set_element(row[0], colname, row[1])

        return E


text:
"""
Views for Flask app
"""
import urllib2
import json
import logging
import datetime
import calendar
import pygal
from pygal.style import LightenStyle
from flask import request, redirect, url_for, render_template, flash
from cftracker import app
from utils import *
import models

@app.route('/updateProblemSet/<count>')
def updateProblemSet(count):
    fetchProblemSet(count)
    flash('Successfully updated problemset')
    return redirect(url_for('start_page'))

@app.route('/', methods=['GET', 'POST'])
def start_page():
    if request.method == 'POST':
        handle = request.form['handle']
        if (not handle) or handle.find(' ') != -1:
            flash('Incorrect handle')
            return render_template('start_page.html')
        return redirect(url_for('user_page', handle=handle))
    return render_template('start_page.html')

@app.route('/user/<handle>')
def user_page(handle):
    try:
        response = urllib2.urlopen(
            'http://codeforces.com/api/user.info?handles=%s' % handle)
    except urllib2.HTTPError, err:
        if err.code == 400:
            flash('User not found')
            return redirect(url_for('start_page'))
        else:
            raise
    response_parsed = json.loads(response.read())
    userinfo = response_parsed['result'][0]

    suggested = []
    solved = []
    notSolved = []
    # 16 tags
    allTags = ['two pointers', 'divide and conquer', 'constructive algorithms',
               'sortings', 'string suffix structures', 'binary search',
               'data structures', 'trees', 'brute force', 'hashing', 'graphs',
               'strings', 'dp', 'math', 'greedy', 'implementation']
    allTagsSet = set(allTags)

    tags = request.args.get('tags')
    removeTag = request.args.get('removeTag')
    if not tags:
        tags = ''

    tagsList = set(tags.split(','))
    tagsList.remove('')
    if removeTag:
        tagsList.remove(removeTag)
    tagsList = list(tagsList)
    tags = ''
    for tag in tagsList:
        tags += (tag + ',')

    submissions_request = urllib2.urlopen(
        'http://codeforces.com/api/user.status?handle=%s&count=10000' % handle,
        timeout=60)
    submissions_parsed = json.loads(submissions_request.read())
    submissions = submissions_parsed['result']

    used = set()

    currentDate = datetime.datetime.now()
    monthLen = calendar.monthrange(currentDate.year, currentDate.month)[1]
    # logging.info(monthLen)
    dateSolved = [0] * monthLen
    tagSolved = dict()
    for tag in allTags:
        tagSolved[tag] = 0

    sortedArray = []

    for submission in submissions:
        contestId = submission['problem']['contestId']
        problemInd = submission['problem']['index']
        problemId = str(contestId) + problemInd
        problemTags = set(submission['problem']['tags'])

        if contestId > 100000:
            continue

        ok = True
        for tag in tagsList:
            if not (tag in problemTags):
                ok = False
                break
        if not ok:
            continue

        tagsRemove = []
        for tag in problemTags:
            if not (tag in allTagsSet):
                tagsRemove.append(tag)
        for tag in tagsRemove:
            problemTags.remove(tag)

        link = 'http://codeforces.com/contest/{}/problem/{}'.format(
            str(contestId), problemInd)

        if not (problemId in used):
            used.add(problemId)
            # logging.info(submission)
            if submission['verdict'] == 'OK':
                submissionTime = datetime.datetime.utcfromtimestamp(submission[
                    'creationTimeSeconds'])
                # logging.info(submissionTime.strftime("%Y-%m-%d"))
                if submissionTime.year == currentDate.year and \
                   submissionTime.month == currentDate.month:
                    dateSolved[submissionTime.day - 1] += 1
                for tag in problemTags:
                    tagSolved[tag] += 1
                solved.append({'problemId': problemId, 'link': link})
                qry = models.Problem.query(models.Problem.problemId ==
                                           problemId).fetch()
                # logging.info(qry)
                # if not qry:
                # logging.info("Problem not found, id = {}".format(problemId))
                # else:
                # sorted.append(qry[0].difficulty)
                if qry:
                    sortedArray.append(qry[0].difficulty)
            else:
                notSolved.append({'problemId': problemId, 'link': link})
    # print solved

    sortedArray.sort()
    solvedDifficultySum = 0
    countX = 0
    for i in xrange(40):
        if i == len(sortedArray):
            break
        solvedDifficultySum += sortedArray[-i - 1]
        countX += 1
    midSolved = 100
    if countX != 0 and solvedDifficultySum:
        midSolved = solvedDifficultySum / countX
    suggestedDifficulty = midSolved * 1.2
    suggesteddx = midSolved / 5
    logging.info("middle = {}\nnewDifficulty = {}\ndx = {}".format(
        str(midSolved), str(suggestedDifficulty), str(suggesteddx)))

    qry = models.Problem.query(
        models.Problem.difficulty >= (suggestedDifficulty - suggesteddx),
        models.Problem.difficulty <= (suggestedDifficulty + suggesteddx))
    for tag in tagsList:
        qry = qry.filter(models.Problem.tags == tag)
    while len(qry.fetch()) < 4 and suggesteddx <= 60000:
        suggesteddx *= 2
        qry = models.Problem.query(
            models.Problem.difficulty >= (suggestedDifficulty - suggesteddx),
            models.Problem.difficulty <= (suggestedDifficulty + suggesteddx))
        for tag in tagsList:
            qry = qry.filter(models.Problem.tags == tag)

    for problem in qry.fetch():
        problemId = problem.problemId
        contestId = problem.contestId
        problemInd = problem.problemInd
        link = link = 'http://codeforces.com/contest/{}/problem/{}'.format(
            str(contestId), problemInd)
        suggested.append({'problemId': problemId, 'link': link})

    suggested = suggested[:20]

    solved_ext = request.args.get('solved_ext')
    if not solved_ext:
        solved_ext = 0
    else:
        solved_ext = int(solved_ext)
    if solved_ext == 0:
        solved = solved[:20]

    notSolved_ext = request.args.get('notSolved_ext')
    if not notSolved_ext:
        notSolved_ext = 0
    else:
        notSolved_ext = int(notSolved_ext)
    if notSolved_ext == 0:
        notSolved = notSolved[:20]

    customStyle = LightenStyle('#337ab7')
    customStyle.background = '#eeeeee'
    customStyle.label_font_size = 14
    customStyle.tooltip_font_size = 25

    chart_type = request.args.get('chart_type')
    if not chart_type:
        chart_type = 0
    else:
        chart_type = int(chart_type)

    chart = None
    if chart_type == 0:
        chart = pygal.Bar(show_legend=False, style=customStyle, order_min=0)
        chart.title = 'Problems solved per tag'
        chart.x_labels = allTags
        chart.x_label_rotation = 45
        chart.show_x_labels = False
        chart.add(handle, [tagSolved[x] for x in allTags])
    else:
        chart = pygal.Line(show_legend=False, style=customStyle, order_min=0)
        chart.title = 'Problems solved per day'
        chart.x_labels = [x for x in xrange(1, len(dateSolved) + 1)]
        chart.add(handle, dateSolved)

    return render_template('user.html',
                           user=userinfo,
                           tags=tags,
                           tagsList=tagsList,
                           suggested=suggested,
                           solved=solved,
                           notSolved=notSolved,
                           solved_ext=solved_ext,
                           notSolved_ext=notSolved_ext,
                           allTags=allTags,
                           chart_type=chart_type,
                           chart=chart.render_data_uri())


text:
;(function($) {

$.extend({
  metadata : {
    defaults : {
      type: 'class',
      name: 'metadata',
      cre: /({.*})/,
      single: 'metadata'
    },
    setType: function( type, name ){
      this.defaults.type = type;
      this.defaults.name = name;
    },
    get: function( elem, opts ){
      var settings = $.extend({},this.defaults,opts);
      // check for empty string in single property
      if ( !settings.single.length ) settings.single = 'metadata';

      data = "{}";

      var getData = function(data) {
        if(typeof data != "string") return data;

        if( data.indexOf('{') < 0 ) {
          data = eval("(" + data + ")");
        }
      }

      var getObject = function(data) {
        if(typeof data != "string") return data;

        if ( data.indexOf( '{' ) <0 ) {
            data = "{" + data + "}";
        }
        data = eval("(" + data + ")");
        return data;
      }

      if ( settings.type == "html5" ) {
        return $(elem).data();
      } else {
        if ( settings.type == "class" ) {
          var m = settings.cre.exec( elem.className );
          if ( m )
            data = m[1];
        } else if ( settings.type == "elem" ) {
          if( !elem.getElementsByTagName ) return;
          var e = elem.getElementsByTagName(settings.name);
          if ( e.length )
            data = $.trim(e[0].innerHTML);
        } else if ( elem.getAttribute != undefined ) {
          var attr = elem.getAttribute( settings.name );
          if ( attr )
            data = attr;
        }
        object = getObject(data.indexOf("{") < 0 ? "{" + data + "}" : data);
      }

      return object;
    }
  }
});

/**
 * Returns the metadata object for the first member of the jQuery object.
 *
 * @name metadata
 * @descr Returns element's metadata object
 * @param Object opts An object contianing settings to override the defaults
 * @type jQuery
 * @cat Plugins/Metadata
 */
$.fn.metadata = function( opts ){
  return $.metadata.get( this[0], opts );
};

})(jQuery);


text:
package me.phoboslabs.illuminati.gatekeeper.api.service;

import me.phoboslabs.illuminati.common.util.ConvertUtil;
import me.phoboslabs.illuminati.elasticsearch.infra.EsClient;
import me.phoboslabs.illuminati.elasticsearch.infra.model.EsData;
import me.phoboslabs.illuminati.elasticsearch.infra.model.EsDataImpl;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;
import java.util.Map;

public abstract class BasicElasticsearchService {

    private final Logger logger = LoggerFactory.getLogger(this.getClass());
    private final static SimpleDateFormat SIMPLE_DATA_FORMAT = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
    private final EsClient eSclient;

    BasicElasticsearchService (EsClient eSclient) {
        this.eSclient = eSclient;
    }

    List<Map<String, Object>> requestToElasticsearch(String jsonString) {
        List<Map<String, Object>> resultList = null;

        try {
            String returnData = eSclient.getDataByJson(jsonString);
            EsData esData = new EsDataImpl(returnData);
            resultList = esData.getEsDataList();

            if (resultList == null) {
                return null;
            } else {
                for (Map<String, Object> data : resultList) {
                    if (data.containsKey("source")) {
                        this.convertJsonTimestampToDate(ConvertUtil.castToMapOf(String.class, Object.class, Map.class.cast(data.get("source"))));
                    }
                }
            }
        } catch (Exception ex) {
            this.logger.error("Exception occurred at getting data from Elasticsearch. {}", ex.getMessage(), ex);
            return null;
        }

        return resultList;
    }

    private void convertJsonTimestampToDate (Map<String, Object> mapData) {
        final String checkKey = "timestamp";

        if (mapData.containsKey(checkKey)) {
            try {
                double dbTimestamp = (double) mapData.get(checkKey);
                Date targetDate = new Date((long) dbTimestamp);
                String lastStringDate = SIMPLE_DATA_FORMAT.format(targetDate);
                mapData.put(checkKey, lastStringDate);
            } catch (Exception ex) {
                this.logger.error("Exception occurred at casting timestamp data. {}", ex.getMessage(), ex);
            }
        }

    }
}


text:
import { baseIsDate } from './_baseIsDate';
import { baseUnary } from './_baseUnary';
import { nodeUtil } from './_nodeUtil';

const nodeIsDate = nodeUtil && nodeUtil.isDate;

/**
 * Checks if `value` is classified as a `Date` _object.
 *
 * @param value The value to check.
 * Returns `true` if `value` is a _date _object, else `false`.
 *
 * isDate(new Date);
 * // => true
 *
 * isDate('Mon April 23 2012');
 * // => false
 */
const isDate: Function = nodeIsDate ? baseUnary(nodeIsDate) : baseIsDate;
export { isDate };


text:
package com.sun.xml.internal.ws.api.config.management;

import com.sun.xml.internal.ws.api.server.WSEndpoint;

/**
 * Interface to create a new WSEndpoint wrapper. This is intended to be implemented
 * by the configuration management to return a ManagedEndpoint that wraps the
 * original WSEndpoint instance.
 *
 * @author Fabian Ritzmann
 */
public interface ManagedEndpointFactory {

    /**
     * This method may return a WSEndpoint implementation that wraps the original
     * WSEndpoint instance. This allows to interject e.g. management code. If
     * management has not been enabled for this endpoint, it will return the original
     * WSEndpoint instance.
     *
     * @param <T> The endpoint implementation type.
     * @param endpoint The endpoint instance.
     * @param attributes The parameters with which the original endpoint instance
     *   was created.
     * @return A WSEndpoint that wraps the original WSEndpoint instance or the
     *   original WSEndpoint instance.
     */
    public <T> WSEndpoint<T> createEndpoint(WSEndpoint<T> endpoint, EndpointCreationAttributes attributes);

}


text:
module.exports = {
  detect: function() {
    return !!process.env.WERCKER_MAIN_PIPELINE_STARTED
  },

  configuration: function() {
    console.log('    Wercker CI Detected')
    return {
      service: 'wercker',
      build: process.env.WERCKER_MAIN_PIPELINE_STARTED,
      commit: process.env.WERCKER_GIT_COMMIT,
      build_url: process.env.WERCKER_BUILD_URL,
      branch: process.env.WERCKER_GIT_BRANCH,
      slug:
        process.env.WERCKER_GIT_OWNER +
        '/' +
        process.env.WERCKER_GIT_REPOSITORY,
    }
  },
}


text:
package net.shadowfacts.enfusion.machine.crank.base;

import nova.core.component.misc.Collider;
import nova.core.util.shape.Cuboid;
import org.apache.commons.math3.geometry.euclidean.threed.Vector3D;

/**
 * Custom collider sized specifically to the crank model.
 *
 * @author shadowfacts
 */
public class CrankCollider extends Collider {

	private BlockCrank crank;

	public CrankCollider(BlockCrank crank) {
		this.crank = crank;
		boundingBox = this::getBoundingBox;
		isOpaqueCube(false);
	}

	public Cuboid getBoundingBox() {
//		switch (crank.getSide()) {
//			case DOWN:
//				return new Cuboid(new Vector3D(0.2, 0, 0.2), new Vector3D(0.8, 0.6, 0.8));
//			case UP:
//				return new Cuboid(new Vector3D(0.2, 0.4, 0.2), new Vector3D(0.8, 1, 0.8));
//			case NORTH:
//				return new Cuboid();
//			case SOUTH:
//				return new Cuboid();
//			case WEST:
//				return new Cuboid();
//			case EAST:
//				return new Cuboid();
//			default:
//				return new Cuboid(new Vector3D(0, 0, 0), new Vector3D(1, 1, 1));
//		}

		return new Cuboid(new Vector3D(0.2, 0, 0.2), new Vector3D(0.8, 0.6, 0.8));
	}
}


text:
export const Undefined = void 0;

// ES5 output: var a=requestAnimationFrame;
// Invocation comparison: requestAnimationFrame(b) ~~~ a(b)
// Size delta per invocation: 24 - 4 = 20 bytes
// Size saved after: ceil(28 / 20) = 2 usages
export const requestAnimationFrame = self.requestAnimationFrame;

// ES5 output: var a=Array.isArray;
// Invocation comparison: Array.isArray(b) ~~~ a(b)
// Size delta per invocation: 16 - 4 = 12 bytes
// Size saved after: ceil(20 / 12) = 2 usages
export const isArray = Array.isArray;

// ES5 output: var a=Array.from;
// Invocation comparison: Array.from(b) ~~~ a(b)
// Size delta per invocation: 13 - 4 = 9 bytes
// Size saved after: ceil(17 / 9) = 2 usages
export const asArray = Array.from;

// ES5 output: var a=Object.keys;
// Invocation comparison: Object.Keys(b) ~~~ a(b)
// Size delta per invocation: 14 - 4 = 10 bytes
// Size saved after: ceil(18 / 10) = 2 usages
export const ObjectKeys = Object.keys;

// ES5 output: var a=self.document;
// Invocation comparison: document ~~~ a
// Size delta per invocation: 8 - 1 = 7 bytes
// Size saved after: ceil(20 / 7) = 3 usages
export const DOMDocument = self.document;

// ES5 output: function a(b){return"function"===typeof b};
// Invocation comparison: typeof a==='function' ~~~ a(b)
// Size delta per invocation: 21 - 4 = 17 bytes
// Size saved after: ceil(43 / 17) = 3 usages
export function isFunction(obj) {
    return typeof obj === 'function';
}

// ES5 output: function a(b){return"string"===typeof b};
// Invocation comparison: typeof a==='string' ~~~ a(b)
// Size delta per invocation: 19 - 4 = 15 bytes
// Size saved after: ceil(41 / 15) = 3 usages
export function isString(obj) {
    return typeof obj === 'string';
}

// ES5 output: function a(b){return"number"===typeof b};
// Invocation comparison: typeof a==='number' ~~~ a(b)
// Size delta per invocation: 19 - 4 = 15 bytes
// Size saved after: ceil(41 / 15) = 3 usages
export function isNumber(obj) {
    return typeof obj === 'number';
}

// ES5 declaration: var a=null;
// Invocation comparison: null ~~~ a
// Size delta per invocation: 4 - 1 = 3 bytes
// Size saved after: ceil(11 / 3) = 4 usages
export const Null = null;

// ES5 output: function a(b){return void 0===b};
// Invocation comparison: b===undefined ~~~ a(b)
// Size delta per invocation: 13 - 4 = 9 bytes
// Size saved after: ceil(33 / 9) = 4 usages
export function isUndefined(a) {
    return a === undefined;
}

// ES5 output: function a(b,c){return a.apply(b,c)};
// Invocation comparison A: a.apply(b,c,d) ~~~ a(b,c,d)
// Invocation comparison B: a.apply(b,c) ~~~ a(b,c)
// Size delta per invocation A: 14 - 8 = 6 bytes
// Size delta per invocation B: 12 - 6 = 6 bytes
// Size saved after: ceil(37 / 6) = 7 usages
export function apply(fn, context, params) {
    return fn.apply(context, params);
}

// ES5 output: function a(b){return null===b};
// Invocation comparison: b===null ~~~ a(b)
// Size delta per invocation: 8 - 4 = 4 bytes
// Size saved after: ceil(31 / 4) = 8 usages
export function isNull(a) {
    return a === null;
}