text:
import unittest

import psycopg2
from psycopg2.extensions import AsIs
from arbalest.redshift import TargetTable
from arbalest.sql import Database
from test import TABLE_NAME, CONNECTION
from arbalest.redshift.schema import JsonObject, Property

class TargetTableShould(unittest.TestCase):
    def setUp(self):
        self.schema = JsonObject(TABLE_NAME, Property('id', 'VARCHAR(36)'))
        self.database = Database(psycopg2.connect(CONNECTION))
        self.database.open()

    def tearDown(self):
        self.database.rollback()

    def assertColumns(self, table_name, schema):
        self.database.execute(
            "SELECT column_name, udt_name FROM information_schema.columns "
            "WHERE table_name = '%s'",
            (AsIs(table_name),))
        columns = self.database.cursor.fetchall()

        self.assertEqual(len(schema.schema), len(columns))

        for i, column in enumerate(columns):
            self.assertEqual(schema.schema[i].column_name.lower(), column[0])
            self.assertEqual(True, column[1] in schema.schema[i].type.lower())

    def test_not_exist(self):
        table = TargetTable(self.schema, self.database)

        self.assertEqual(False, table.exists())

    def test_exist(self):
        table = TargetTable(self.schema, self.database)
        table.create()

        self.assertEqual(True, table.exists())

    def test_create_when_column_name_not_defined(self):
        schema = JsonObject(TABLE_NAME,
                            Property('property1', 'VARCHAR(10)'),
                            Property('property2', 'TIMESTAMP'))
        table = TargetTable(schema, self.database)
        table.create()

        self.assertColumns(schema.table, schema)

    def test_create_when_column_name_defined(self):
        schema = JsonObject(TABLE_NAME,
                            Property('property1', 'VARCHAR(10)', 'someColumn'),
                            Property('property2', 'TIMESTAMP', 'anotherColumn'))
        table = TargetTable(schema, self.database)
        table.create()

        self.assertColumns(schema.table, schema)

    def test_stage_update_when_column_name_not_defined(self):
        schema = JsonObject(TABLE_NAME,
                            Property('property1', 'VARCHAR(10)'),
                            Property('property2', 'TIMESTAMP'))
        table = TargetTable(schema, self.database)
        table.stage_update()

        self.assertColumns(schema.update_table, schema)

    def test_stage_update_when_column_name_defined(self):
        schema = JsonObject(TABLE_NAME,
                            Property('property1', 'VARCHAR(10)', 'someColumn'),
                            Property('property2', 'TIMESTAMP', 'anotherColumn'))
        table = TargetTable(schema, self.database)
        table.stage_update()

        self.assertColumns(schema.update_table, schema)

    def test_promote_update(self):
        table = TargetTable(self.schema, self.database)
        table.stage_update()
        table.promote_update()

        self.assertColumns(self.schema.table, self.schema)

    def test_insert_update(self):
        table = TargetTable(self.schema, self.database)
        table.create()
        table.stage_update()
        self.database.execute("INSERT INTO %s VALUES('%s')",
                              (AsIs(TABLE_NAME), AsIs(1),))
        self.database.execute("INSERT INTO %s VALUES('%s')",
                              (AsIs(self.schema.update_table), AsIs(2),))
        self.database.execute("INSERT INTO %s VALUES('%s')",
                              (AsIs(self.schema.update_table), AsIs(3),))

        table.insert_update()

        self.database.execute(
            "SELECT * FROM %s",
            (AsIs(TABLE_NAME),))
        values = list(self.database.cursor.fetchall())

        self.assertEqual([('1',), ('2',), ('3',)], values)

    def test_drop(self):
        table = TargetTable(self.schema, self.database)
        table.create()
        table.drop()

        self.assertEqual(False, table.exists())


text:
package org.pac4j.saml.metadata;

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

/**
 * This is {@link SAML2MetadataContactPerson} that allows one to specify
 * contact information in saml2 metadata generation.
 *
 * @author Misagh Moayyed
 * @since 4.0.0
 */
public class SAML2MetadataContactPerson {
    private String givenName;
    private String surname;
    private List<String> emailAddresses = new ArrayList<>();
    private List<String> telephoneNumbers = new ArrayList<>();
    private String type = "technical";
    private String companyName;

    public void setGivenName(final String givenName) {
        this.givenName = givenName;
    }

    public void setSurname(final String surname) {
        this.surname = surname;
    }

    public void setEmailAddresses(final List<String> emailAddresses) {
        this.emailAddresses = emailAddresses;
    }

    public void setTelephoneNumbers(final List<String> telephoneNumbers) {
        this.telephoneNumbers = telephoneNumbers;
    }

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

    public void setCompanyName(final String companyName) {
        this.companyName = companyName;
    }

    public String getGivenName() {
        return givenName;
    }

    public String getSurname() {
        return surname;
    }

    public List<String> getEmailAddresses() {
        return emailAddresses;
    }

    public List<String> getTelephoneNumbers() {
        return telephoneNumbers;
    }

    public String getType() {
        return type;
    }

    public String getCompanyName() {
        return companyName;
    }
}

redpajama_set_name: RedPajamaGithub


text:
import {LoggerCommandBus} from './LoggerCommandBus';

describe('Infra/Command/LoggerCommandBus', () => {

  var mainCommandBus: any;
  var logger: any;

  beforeEach(() => {
    mainCommandBus = jasmine.createSpyObj('mainCommandBus', ['execute', 'register']);
    logger = jasmine.createSpyObj('logger', ['info', 'error']);
  });

  it("should log a command after it was handled", (done) => {
    let loggerCommandBus: LoggerCommandBus = new LoggerCommandBus(mainCommandBus, logger);
    let command: any = jasmine.createSpyObj('command', ['get', 'set', 'getMembers']);
    command.getMembers.and.returnValue({value: 'test'});

    mainCommandBus.execute.and.returnValue(new Promise<any>((resolve?: Function, reject?: Function) => {
      resolve(command);
    }));

    loggerCommandBus.execute(command).then((value: any) => {
      expect(logger.info).toHaveBeenCalledTimes(2);
      expect(logger.info).toHaveBeenCalledWith({value: 'test'});
      expect(logger.error).not.toHaveBeenCalled();
      done();
    });
  });

  it("should log the reason when a command fail", (done) => {
    let loggerCommandBus: LoggerCommandBus = new LoggerCommandBus(mainCommandBus, logger);
    let command: any = jasmine.createSpyObj('command', ['get', 'set', 'getMembers']);
    command.getMembers.and.returnValue({value: 'test'});

    let error: Error = new Error('test error');

    mainCommandBus.execute.and.returnValue(new Promise<any>((resolve?: Function, reject?: Function) => {
      reject(error);
    }));

    loggerCommandBus.execute(command).catch((value: any) => {
      expect(logger.info).not.toHaveBeenCalled();
      expect(logger.error).toHaveBeenCalledTimes(1);
      expect(logger.error).toHaveBeenCalledWith(error);
      done();
    });
  });

});


text:
module Connectwise
  module Model
    module ClassMethods
      def where(connection, *args, **attrs)
        conditions = attrs.empty? ? args.join(' ') : attrs_to_query(where_transform(attrs))
        resp = connection.call cw_api_name, "find_#{plural_class_name}".to_sym, {conditions: conditions}
        normalize_find_response(resp).map {|attrs| self.new(connection, find_transform(attrs)) }
      end

      def find(connection, id)
        if (attrs = connection.call(cw_api_name, "get_#{cw_model_name}".to_sym, {id: id}))
          self.new(connection, find_transform(attrs))
        else
          fail RecordNotFound
        end
      rescue ConnectionError
        raise RecordNotFound
      end

      def plural(plural)
        @plural_form = plural
      end

      def attrs_to_query(attrs)
        attrs.map do |k,v|
          str = k.to_s
          str.extend(Connectwise::Extensions::String)
          "#{str.camelize} like '#{v}'"
        end.join(' and ')
      end

      def cw_api_name
        base_class_name.downcase.to_sym
      end

      def cw_model_name
        base_class_name.downcase.to_sym
      end

      def plural_class_name
        ending = base_class_name[/[aeiou]$/] ? 'es' : 's'
        @plural_form ||= "#{base_class_name.downcase}#{ending}"
      end

      def where_transform(attrs)
        attrs
      end

      def find_transform(attrs)
        attrs
      end

      def save_transform(attrs)
        attrs
      end

      def transform(attrs)
        attrs
      end

      def model_name(model_name = self.name)
        @model_name ||= model_name
      end

      private
      def base_class_name
        model_name.split('::').last
      end

      def remove_root_node(resp)
        resp.values.first
      end

      def normalize_find_response(resp)
        resp = resp.nil? ? [] : remove_root_node(resp)
        resp.respond_to?(:to_ary) ? resp : [resp]
      end
    end

    def self.included(klass)
      klass.extend ClassMethods
    end

    def initialize(connection, **attributes)
      @connection = connection
      self.class.transform(attributes).each do |attr, value|
        public_send("#{attr}=", value) if respond_to?("#{attr}=")
      end
    end

    def save
      attrs = connection.call self.class.cw_api_name, "add_or_update_#{self.class.cw_model_name}".to_sym, {self.class.cw_model_name => to_cw_h}
      self.class.new(connection, self.class.save_transform(attrs))
    end

    def destroy
      connection.call self.class.cw_api_name, "delete_#{self.class.cw_model_name}".to_sym, {id: id}
      self
    end

    def persisted?
      !!id
    end

    def to_h
      defined_attributes.each_with_object({}) {|name, memo| memo[name] = public_send(name)}
    end

    def to_cw_h
      defined_attributes.each_with_object({}) {|name, memo| key = name.to_s.extend(Extensions::String); memo[key.camelize] = public_send(name)}
    end

    def defined_attributes
      instance_vars = instance_variables.map {|name| name.to_s.gsub(/@/, '').to_sym}
      public_methods.select{|method| instance_vars.include?(method) }
    end

    protected
    def connection
      @connection
    end
  end
end


text:
package org.apache.http.impl.client.cache;

import java.util.Date;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.http.Header;
import org.apache.http.HeaderElement;
import org.apache.http.HttpHost;
import org.apache.http.HttpRequest;
import org.apache.http.HttpStatus;
import org.apache.http.annotation.Immutable;
import org.apache.http.client.cache.HeaderConstants;
import org.apache.http.client.cache.HttpCacheEntry;
import org.apache.http.client.utils.DateUtils;

/**
 * Determines whether a given {@link HttpCacheEntry} is suitable to be
 * used as a response for a given {@link HttpRequest}.
 *
 * @since 4.1
 */
@Immutable
class CachedResponseSuitabilityChecker {

    private final Log log = LogFactory.getLog(getClass());

    private final boolean sharedCache;
    private final boolean useHeuristicCaching;
    private final float heuristicCoefficient;
    private final long heuristicDefaultLifetime;
    private final CacheValidityPolicy validityStrategy;

    CachedResponseSuitabilityChecker(final CacheValidityPolicy validityStrategy,
            final CacheConfig config) {
        super();
        this.validityStrategy = validityStrategy;
        this.sharedCache = config.isSharedCache();
        this.useHeuristicCaching = config.isHeuristicCachingEnabled();
        this.heuristicCoefficient = config.getHeuristicCoefficient();
        this.heuristicDefaultLifetime = config.getHeuristicDefaultLifetime();
    }

    CachedResponseSuitabilityChecker(final CacheConfig config) {
        this(new CacheValidityPolicy(), config);
    }

    private boolean isFreshEnough(final HttpCacheEntry entry, final HttpRequest request, final Date now) {
        if (validityStrategy.isResponseFresh(entry, now)) {
            return true;
        }
        if (useHeuristicCaching &&
                validityStrategy.isResponseHeuristicallyFresh(entry, now, heuristicCoefficient, heuristicDefaultLifetime)) {
            return true;
        }
        if (originInsistsOnFreshness(entry)) {
            return false;
        }
        final long maxstale = getMaxStale(request);
        if (maxstale == -1) {
            return false;
        }
        return (maxstale > validityStrategy.getStalenessSecs(entry, now));
    }

    private boolean originInsistsOnFreshness(final HttpCacheEntry entry) {
        if (validityStrategy.mustRevalidate(entry)) {
            return true;
        }
        if (!sharedCache) {
            return false;
        }
        return validityStrategy.proxyRevalidate(entry) ||
            validityStrategy.hasCacheControlDirective(entry, "s-maxage");
    }

    private long getMaxStale(final HttpRequest request) {
        long maxstale = -1;
        for(final Header h : request.getHeaders(HeaderConstants.CACHE_CONTROL)) {
            for(final HeaderElement elt : h.getElements()) {
                if (HeaderConstants.CACHE_CONTROL_MAX_STALE.equals(elt.getName())) {
                    if ((elt.getValue() == null || "".equals(elt.getValue().trim()))
                            && maxstale == -1) {
                        maxstale = Long.MAX_VALUE;
                    } else {
                        try {
                            long val = Long.parseLong(elt.getValue());
                            if (val < 0) {
                                val = 0;
                            }
                            if (maxstale == -1 || val < maxstale) {
                                maxstale = val;
                            }
                        } catch (final NumberFormatException nfe) {
                            // err on the side of preserving semantic transparency
                            maxstale = 0;
                        }
                    }
                }
            }
        }
        return maxstale;
    }

    /**
     * Determine if I can utilize a {@link HttpCacheEntry} to respond to the given
     * {@link HttpRequest}
     *
     * @param host
     *            {@link HttpHost}
     * @param request
     *            {@link HttpRequest}
     * @param entry
     *            {@link HttpCacheEntry}
     * @param now
     *            Right now in time
     * @return boolean yes/no answer
     */
    public boolean canCachedResponseBeUsed(final HttpHost host, final HttpRequest request, final HttpCacheEntry entry, final Date now) {
        if (!isFreshEnough(entry, request, now)) {
            log.trace("Cache entry was not fresh enough");
            return false;
        }

        if (isGet(request) && !validityStrategy.contentLengthHeaderMatchesActualLength(entry)) {
            log.debug("Cache entry Content-Length and header information do not match");
            return false;
        }

        if (hasUnsupportedConditionalHeaders(request)) {
            log.debug("Request contained conditional headers we don't handle");
            return false;
        }

        if (!isConditional(request) && entry.getStatusCode() == HttpStatus.SC_NOT_MODIFIED) {
            return false;
        }

        if (isConditional(request) && !allConditionalsMatch(request, entry, now)) {
            return false;
        }

        if (hasUnsupportedCacheEntryForGet(request, entry)) {
            log.debug("HEAD response caching enabled but the cache entry does not contain a " +
                      "request method, entity or a 204 response");
            return false;
        }

        for (final Header ccHdr : request.getHeaders(HeaderConstants.CACHE_CONTROL)) {
            for (final HeaderElement elt : ccHdr.getElements()) {
                if (HeaderConstants.CACHE_CONTROL_NO_CACHE.equals(elt.getName())) {
                    log.trace("Response contained NO CACHE directive, cache was not suitable");
                    return false;
                }

                if (HeaderConstants.CACHE_CONTROL_NO_STORE.equals(elt.getName())) {
                    log.trace("Response contained NO STORE directive, cache was not suitable");
                    return false;
                }

                if (HeaderConstants.CACHE_CONTROL_MAX_AGE.equals(elt.getName())) {
                    try {
                        final int maxage = Integer.parseInt(elt.getValue());
                        if (validityStrategy.getCurrentAgeSecs(entry, now) > maxage) {
                            log.trace("Response from cache was NOT suitable due to max age");
                            return false;
                        }
                    } catch (final NumberFormatException ex) {
                        // err conservatively
                        log.debug("Response from cache was malformed" + ex.getMessage());
                        return false;
                    }
                }

                if (HeaderConstants.CACHE_CONTROL_MAX_STALE.equals(elt.getName())) {
                    try {
                        final int maxstale = Integer.parseInt(elt.getValue());
                        if (validityStrategy.getFreshnessLifetimeSecs(entry) > maxstale) {
                            log.trace("Response from cache was not suitable due to Max stale freshness");
                            return false;
                        }
                    } catch (final NumberFormatException ex) {
                        // err conservatively
                        log.debug("Response from cache was malformed: " + ex.getMessage());
                        return false;
                    }
                }

                if (HeaderConstants.CACHE_CONTROL_MIN_FRESH.equals(elt.getName())) {
                    try {
                        final long minfresh = Long.parseLong(elt.getValue());
                        if (minfresh < 0L) {
                            return false;
                        }
                        final long age = validityStrategy.getCurrentAgeSecs(entry, now);
                        final long freshness = validityStrategy.getFreshnessLifetimeSecs(entry);
                        if (freshness - age < minfresh) {
                            log.trace("Response from cache was not suitable due to min fresh " +
                                    "freshness requirement");
                            return false;
                        }
                    } catch (final NumberFormatException ex) {
                        // err conservatively
                        log.debug("Response from cache was malformed: " + ex.getMessage());
                        return false;
                    }
                }
            }
        }

        log.trace("Response from cache was suitable");
        return true;
    }

    private boolean isGet(final HttpRequest request) {
        return request.getRequestLine().getMethod().equals(HeaderConstants.GET_METHOD);
    }

    private boolean entryIsNotA204Response(final HttpCacheEntry entry) {
        return entry.getStatusCode() != HttpStatus.SC_NO_CONTENT;
    }

    private boolean cacheEntryDoesNotContainMethodAndEntity(final HttpCacheEntry entry) {
        return entry.getRequestMethod() == null && entry.getResource() == null;
    }

    private boolean hasUnsupportedCacheEntryForGet(final HttpRequest request, final HttpCacheEntry entry) {
        return isGet(request) && cacheEntryDoesNotContainMethodAndEntity(entry) && entryIsNotA204Response(entry);
    }

    /**
     * Is this request the type of conditional request we support?
     * @param request The current httpRequest being made
     * @return {@code true} if the request is supported
     */
    public boolean isConditional(final HttpRequest request) {
        return hasSupportedEtagValidator(request) || hasSupportedLastModifiedValidator(request);
    }

    /**
     * Check that conditionals that are part of this request match
     * @param request The current httpRequest being made
     * @param entry the cache entry
     * @param now right NOW in time
     * @return {@code true} if the request matches all conditionals
     */
    public boolean allConditionalsMatch(final HttpRequest request, final HttpCacheEntry entry, final Date now) {
        final boolean hasEtagValidator = hasSupportedEtagValidator(request);
        final boolean hasLastModifiedValidator = hasSupportedLastModifiedValidator(request);

        final boolean etagValidatorMatches = (hasEtagValidator) && etagValidatorMatches(request, entry);
        final boolean lastModifiedValidatorMatches = (hasLastModifiedValidator) && lastModifiedValidatorMatches(request, entry, now);

        if ((hasEtagValidator && hasLastModifiedValidator)
            && !(etagValidatorMatches && lastModifiedValidatorMatches)) {
            return false;
        } else if (hasEtagValidator && !etagValidatorMatches) {
            return false;
        }

        if (hasLastModifiedValidator && !lastModifiedValidatorMatches) {
            return false;
        }
        return true;
    }

    private boolean hasUnsupportedConditionalHeaders(final HttpRequest request) {
        return (request.getFirstHeader(HeaderConstants.IF_RANGE) != null
                || request.getFirstHeader(HeaderConstants.IF_MATCH) != null
                || hasValidDateField(request, HeaderConstants.IF_UNMODIFIED_SINCE));
    }

    private boolean hasSupportedEtagValidator(final HttpRequest request) {
        return request.containsHeader(HeaderConstants.IF_NONE_MATCH);
    }

    private boolean hasSupportedLastModifiedValidator(final HttpRequest request) {
        return hasValidDateField(request, HeaderConstants.IF_MODIFIED_SINCE);
    }

    /**
     * Check entry against If-None-Match
     * @param request The current httpRequest being made
     * @param entry the cache entry
     * @return boolean does the etag validator match
     */
    private boolean etagValidatorMatches(final HttpRequest request, final HttpCacheEntry entry) {
        final Header etagHeader = entry.getFirstHeader(HeaderConstants.ETAG);
        final String etag = (etagHeader != null) ? etagHeader.getValue() : null;
        final Header[] ifNoneMatch = request.getHeaders(HeaderConstants.IF_NONE_MATCH);
        if (ifNoneMatch != null) {
            for (final Header h : ifNoneMatch) {
                for (final HeaderElement elt : h.getElements()) {
                    final String reqEtag = elt.toString();
                    if (("*".equals(reqEtag) && etag != null)
                            || reqEtag.equals(etag)) {
                        return true;
                    }
                }
            }
        }
        return false;
    }

    /**
     * Check entry against If-Modified-Since, if If-Modified-Since is in the future it is invalid as per
     * http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html
     * @param request The current httpRequest being made
     * @param entry the cache entry
     * @param now right NOW in time
     * @return  boolean Does the last modified header match
     */
    private boolean lastModifiedValidatorMatches(final HttpRequest request, final HttpCacheEntry entry, final Date now) {
        final Header lastModifiedHeader = entry.getFirstHeader(HeaderConstants.LAST_MODIFIED);
        Date lastModified = null;
        if (lastModifiedHeader != null) {
            lastModified = DateUtils.parseDate(lastModifiedHeader.getValue());
        }
        if (lastModified == null) {
            return false;
        }

        for (final Header h : request.getHeaders(HeaderConstants.IF_MODIFIED_SINCE)) {
            final Date ifModifiedSince = DateUtils.parseDate(h.getValue());
            if (ifModifiedSince != null) {
                if (ifModifiedSince.after(now) || lastModified.after(ifModifiedSince)) {
                    return false;
                }
            }
        }
        return true;
    }

    private boolean hasValidDateField(final HttpRequest request, final String headerName) {
        for(final Header h : request.getHeaders(headerName)) {
            final Date date = DateUtils.parseDate(h.getValue());
            return date != null;
        }
        return false;
    }
}


text:
"This is a website!" – Homestar Runner

## Previewing with Jekyll

The included `.ruby-version` and `Gemfile` should give rbenv and Bundler enough information to run the Jekyll server locally and preview the site.

```
git clone $THIS_REPO
cd $THIS_REPO_PATH

bundle install

jekyll server
```

If you don't want to fuss with rbenv or rvm, use the included Dockerfile to run the Jekyll server in a container.

```
git clone $THIS_REPO
cd $THIS_REPO_PATH

docker build -t globalspin-jekyll .

docker run -v $PWD:/site -p 4000:4000 globalspin-jekyll
```

Either way, Jekyll should serve the site at `http://localhost:4000`.


text:
require_relative '../lib/chess'

require 'minitest/autorun'

class BishopTest < Minitest::Test

  def test_bishop_moves
    board = Board.new(:empty)
    bishop = WhiteBishop.new(4,4)
    board.place(bishop)
    board.move(bishop,5,5)
    assert_equal bishop, board.at(5,5)
  end

  def test_bishop_moves_more_than_one_space
    board = Board.new(:empty)
    bishop = WhiteBishop.new(4,4)
    board.place(bishop)
    assert_silent do
      board.move(bishop,3,3)
      board.move(bishop,4,4)
      board.move(bishop,5,5)
      board.move(bishop,4,4)
      board.move(bishop,7,7)
      board.move(bishop,4,4)
      board.move(bishop,1,1)
      board.move(bishop,4,4)
      board.move(bishop,5,3)
      board.move(bishop,4,4)

      board.move(bishop,3,5)
      board.move(bishop,4,4)
      board.move(bishop,0,0)
      board.move(bishop,4,4)
      board.move(bishop,1,7)
    end
  end

  def test_bishop_cannot_move_vertically
    board = Board.new(:empty)
    bishop = WhiteBishop.new(4,4)
    board.place(bishop)
    assert_raises(Game::IllegalMove) do
      board.move(bishop,4,0)
    end
  end

  def test_bishop_cannot_jump
    board = Board.new()
    bishop = board.at(2,0)
    assert_raises(Game::IllegalMove) do
      board.move(bishop,5,3)
    end
  end

  def test_bishop_blocked_by_friend
    board = Board.new()
    bishop = board.at(2,0)
    assert_raises(Game::IllegalMove) do
      board.move(bishop,3,1)
    end
  end
end


text:
package scouter.pulse.webtime;

public enum WebStatusEnum {
	READY,
	ING,
	DONE,
	FAILED
}


text:
/* ** GENEREATED FILE - DO NOT MODIFY ** */
package com.wilutions.mslib.uccollaborationlib.impl;
import com.wilutions.com.*;

@SuppressWarnings("all")
@CoClass(guid="{F49BCDCD-91AC-9230-28EE-1B3055B750DE}")
public class IDistributionGroupImpl extends Dispatch implements com.wilutions.mslib.uccollaborationlib.IDistributionGroup {
  @DeclDISPID(-4)  public Object get_NewEnum() throws ComException {
    final Object obj = this._dispatchCall(-4,"_NewEnum", DISPATCH_PROPERTYGET,null);
    if (obj == null) return null;
    return (Object)obj;
  }
  @DeclDISPID(1610743809)  public Integer getCount() throws ComException {
    final Object obj = this._dispatchCall(1610743809,"Count", DISPATCH_PROPERTYGET,null);
    if (obj == null) return null;
    return (Integer)obj;
  }
  @DeclDISPID(1610743810)  public Boolean TryGetContact(final String _uri, final ByRef<com.wilutions.mslib.uccollaborationlib.IContact> _value) throws ComException {
    assert(_uri != null);
    assert(_value != null);
    final Object obj = this._dispatchCall(1610743810,"TryGetContact", DISPATCH_METHOD,null,_uri,_value);
    if (obj == null) return null;
    return (Boolean)obj;
  }
  @DeclDISPID(1610809344)  public com.wilutions.mslib.uccollaborationlib.GroupType getType() throws ComException {
    final Object obj = this._dispatchCall(1610809344,"Type", DISPATCH_PROPERTYGET,null);
    if (obj == null) return null;
    return com.wilutions.mslib.uccollaborationlib.GroupType.valueOf((Integer)obj);
  }
  @DeclDISPID(1610809345)  public String getName() throws ComException {
    final Object obj = this._dispatchCall(1610809345,"Name", DISPATCH_PROPERTYGET,null);
    if (obj == null) return null;
    return (String)obj;
  }
  @DeclDISPID(1610809346)  public String getId() throws ComException {
    final Object obj = this._dispatchCall(1610809346,"Id", DISPATCH_PROPERTYGET,null);
    if (obj == null) return null;
    return (String)obj;
  }
  @DeclDISPID(1610809347)  public com.wilutions.mslib.uccollaborationlib.IAsynchronousOperation AddContact(final com.wilutions.mslib.uccollaborationlib.IContact _contact, final Object _groupCallback, final Object _state) throws ComException {
    assert(_groupCallback != null);
    assert(_state != null);
    final Object obj = this._dispatchCall(1610809347,"AddContact", DISPATCH_METHOD,null,(_contact!=null?_contact:Dispatch.NULL),_groupCallback,_state);
    if (obj == null) return null;
    return Dispatch.as(obj, com.wilutions.mslib.uccollaborationlib.impl.IAsynchronousOperationImpl.class);
  }
  @DeclDISPID(1610809348)  public com.wilutions.mslib.uccollaborationlib.IAsynchronousOperation RemoveContact(final com.wilutions.mslib.uccollaborationlib.IContact pContact, final Object _groupCallback, final Object _state) throws ComException {
    assert(_groupCallback != null);
    assert(_state != null);
    final Object obj = this._dispatchCall(1610809348,"RemoveContact", DISPATCH_METHOD,null,(pContact!=null?pContact:Dispatch.NULL),_groupCallback,_state);
    if (obj == null) return null;
    return Dispatch.as(obj, com.wilutions.mslib.uccollaborationlib.impl.IAsynchronousOperationImpl.class);
  }
  @DeclDISPID(1610809349)  public com.wilutions.mslib.uccollaborationlib.IContactManager getContactManager() throws ComException {
    final Object obj = this._dispatchCall(1610809349,"ContactManager", DISPATCH_PROPERTYGET,null);
    if (obj == null) return null;
    return Dispatch.as(obj, com.wilutions.mslib.uccollaborationlib.impl.IContactManagerImpl.class);
  }
  @DeclDISPID(1610809350)  public Boolean CanInvoke(final com.wilutions.mslib.uccollaborationlib.GroupAction _action, final com.wilutions.mslib.uccollaborationlib.IContact _contact) throws ComException {
    assert(_action != null);
    final Object obj = this._dispatchCall(1610809350,"CanInvoke", DISPATCH_METHOD,null,_action.value,(_contact!=null?_contact:Dispatch.NULL));
    if (obj == null) return null;
    return (Boolean)obj;
  }
  @DeclDISPID(1610874880)  public String getEmailAddress() throws ComException {
    final Object obj = this._dispatchCall(1610874880,"EmailAddress", DISPATCH_PROPERTYGET,null);
    if (obj == null) return null;
    return (String)obj;
  }
  @DeclDISPID(1610874881)  public com.wilutions.mslib.uccollaborationlib.IGroupCollection getNestedGroups() throws ComException {
    final Object obj = this._dispatchCall(1610874881,"NestedGroups", DISPATCH_PROPERTYGET,null);
    if (obj == null) return null;
    return Dispatch.as(obj, com.wilutions.mslib.uccollaborationlib.impl.IGroupCollectionImpl.class);
  }
  @DeclDISPID(1610874882)  public com.wilutions.mslib.uccollaborationlib.IAsynchronousOperation Expand(final Object _groupCallback, final Object _state) throws ComException {
    assert(_groupCallback != null);
    assert(_state != null);
    final Object obj = this._dispatchCall(1610874882,"Expand", DISPATCH_METHOD,null,_groupCallback,_state);
    if (obj == null) return null;
    return Dispatch.as(obj, com.wilutions.mslib.uccollaborationlib.impl.IAsynchronousOperationImpl.class);
  }
  @DeclDISPID(1610874883)  public Boolean getIsExpanded() throws ComException {
    final Object obj = this._dispatchCall(1610874883,"IsExpanded", DISPATCH_PROPERTYGET,null);
    if (obj == null) return null;
    return (Boolean)obj;
  }
  @DeclDISPID(1610874884)  public com.wilutions.mslib.uccollaborationlib.IAsynchronousOperation GetAllMembers(final Object _groupCallback, final Object _state) throws ComException {
    assert(_groupCallback != null);
    assert(_state != null);
    final Object obj = this._dispatchCall(1610874884,"GetAllMembers", DISPATCH_METHOD,null,_groupCallback,_state);
    if (obj == null) return null;
    return Dispatch.as(obj, com.wilutions.mslib.uccollaborationlib.impl.IAsynchronousOperationImpl.class);
  }
  @DeclDISPID(1610874885)  public String getDescription() throws ComException {
    final Object obj = this._dispatchCall(1610874885,"Description", DISPATCH_PROPERTYGET,null);
    if (obj == null) return null;
    return (String)obj;
  }
  @DeclDISPID(1610874886)  public com.wilutions.mslib.uccollaborationlib.IAsynchronousOperation GetOwner(final Object _groupCallback, final Object _state) throws ComException {
    assert(_groupCallback != null);
    assert(_state != null);
    final Object obj = this._dispatchCall(1610874886,"GetOwner", DISPATCH_METHOD,null,_groupCallback,_state);
    if (obj == null) return null;
    return Dispatch.as(obj, com.wilutions.mslib.uccollaborationlib.impl.IAsynchronousOperationImpl.class);
  }
  public IDistributionGroupImpl(String progId) throws ComException {
    super(progId, "{340C54A6-35CF-4971-B540-72D7F040AC24}");
  }
  protected IDistributionGroupImpl(long ndisp) {
    super(ndisp);
  }
  public String toString() {
    return "[IDistributionGroupImpl" + super.toString() + "]";
  }
}


text:
                       __
                      /\ \                                                         __
     __  __    ___    \_\ \     __   _ __   ____    ___    ___   _ __    __       /\_\    ____
    /\ \/\ \ /' _ `\  /'_  \  /'__`\/\  __\/ ,__\  / ___\ / __`\/\  __\/'__`\     \/\ \  /',__\
    \ \ \_\ \/\ \/\ \/\ \ \ \/\  __/\ \ \//\__, `\/\ \__//\ \ \ \ \ \//\  __/  __  \ \ \/\__, `\
     \ \____/\ \_\ \_\ \___,_\ \____\\ \_\\/\____/\ \____\ \____/\ \_\\ \____\/\_\ _\ \ \/\____/
      \/___/  \/_/\/_/\/__,_ /\/____/ \/_/ \/___/  \/____/\/___/  \/_/ \/____/\/_//\ \_\ \/___/
                                                                                \ \____/
                                                                                \/___/

Underscore.js is a utility-belt library for JavaScript that provides
support for the usual functional suspects (each, map, reduce, filter...)
without extending any core JavaScript objects.
**It's available in _ES6_ and _UMD_ (_cjs_, _amd_, _iife_) formats**

**ES6 & Beyond usage**:

- partial importation of features (just import what you need, with a name that suits you).

 ```js
import _template from 'underscore-es/template';

 var basicTemplate = _template("Ok, i use <%= builder %> for my es6 and beyond stuff !");
 var result = basicTemplate({builder: 'rollup'});
 console.log( result );
 // => "Ok, i use rollup for my es6 and beyond stuff !"
 ```
 *__nb__: only `_chain` isn't available in this case.* <br/>
 *another way to use chaining feature here is through `_compose` or `_use`.*
 ```js
 import _use from 'underscore-es/use';
 import _initial from 'underscore-es/initial';
 import _filter from 'underscore-es/filter';
 import _union from 'underscore-es/union';
 import _last from 'underscore-es/last';

 function note (num) {return 'result: '+ (num + 10) + " / 20"}
 var test = _use([1, 2, 3, 6, 9])
           .do(_union, [1, 3, 11], [2, 6])
           .do([], Array.prototype.concat, [10, 14]) // or simply .do([], [].concat, [10, 14])
           .do(_filter, (num) => num % 2 == 0)
           .do(_initial)
           .do(_last)
           .do(note)
           .value();
 console.log( test );
 // => result: 20 / 20
 ```

 *import features depending of their category*
 ```js
 import * as $co from 'underscore-es/_collections';
 import * as $ar from 'underscore-es/_arrays';
 import * as $ob from 'underscore-es/_objects';
 import * as $fu from 'underscore-es/_functions';
 import * as $ut from 'underscore-es/_utilities';

 console.log( $ar._union([4,7], [7,0,3]) );
 // => [4, 7, 0, 3]
 ```

- global importation of all features

 ```js
 import _ from 'underscore-es'; // or from 'underscore-es/_namespace'

 _.chain([4,7])
  .union([7,0,3])
  .initial()
  .reverse()
  .head()
  .value()
  // => 0
 ```

- breaking changes

 Since this underscore source code has been rewritten to be more es6 friendly :

 *the `_.templateSettings` property is now `_.template.settings`*

 ```js
 import _template from 'underscore-es/template';

 _template.settings = {
    evaluate: /\{\{([\s\S]+?)\}\}/g,
    interpolate: /\{\{=([\s\S]+?)\}\}/g
 };

 var custom = _template('<ul>{{ for (var key in people) { }}<li>{{= people[key] }}</li>{{ } }}</ul>');
 var result = custom({people: {moe: 'Moe', larry: 'Larry', curly: 'Curly'}});
 console.log( result );
 // => <ul><li>Moe</li><li>Larry</li><li>Curly</li></ul>
 ```
 *the `_.iteratee` shall now (for global importation) be overwritten through `_.setIteratee([fn])` method*
 ```js
 import _iteratee, {_setIteratee} from './underscore-es/iteratee';
 import _countBy from './underscore-es/countBy';
 import _isRegExp from './underscore-es/isRegExp';
 import _filter from './underscore-es/filter';

 _setIteratee( function(value) {
    // RegEx values return a function that returns the number of matches
    if (_isRegExp(value)) return function(obj) {
       return (obj.match(value) || []).length;
    };
    return value;
 });

 // test some methods that claim to be transformed through `_iteratee`
 var collection = ['foo', 'bar', 'bbiz'];
 console.log(_countBy(collection, /b/g))
 // => {0: 1, 1: 1, 2: 1}
 console.log(_filter(collection, /b/g))
 // => ['bar', 'bbiz']
 ```

[Documentation](https://tnga.github.io/underscore-es) is the place to find what you need to know !

This project adheres to a [code of conduct](CODE_OF_CONDUCT.md). By participating, you are expected to uphold this code.

For support and questions, please use
[the gitter channel](https://gitter.im/jashkenas/underscore)
or [stackoverflow](http://stackoverflow.com/search?q=underscore.js)

Underscore is an open-sourced component of DocumentCloud:
https://github.com/documentcloud

Many thanks to our contributors:
https://github.com/tnga/underscore-es/contributors
https://github.com/jashkenas/underscore/contributors


text:
package com.jaamsim.Thresholds;

import com.jaamsim.input.BooleanInput;
import com.jaamsim.input.Keyword;

/**
 * SignalThreshold is a type of Threshold that is controlled directly by
 * another object. At present, it is required only for EntitySignal.
 * @author Harry
 *
 */
public class SignalThreshold extends Threshold {

	@Keyword(description = "The state for the SignalThreshold at the start of "
			+ "the simulation run: TRUE = Open, FALSE = Closed.",
	         exampleList = {"FALSE"})
	private final BooleanInput initState;

	{
		initState = new BooleanInput("InitialState", KEY_INPUTS, false);
		this.addInput(initState);
	}

	public SignalThreshold() {}

	@Override
	public void startUp() {
		super.startUp();
		this.setOpen(initState.getValue());
	}

	@Override
	public String getInitialState() {
		if (initState.getValue())
			return "Open";
		else
			return "Closed";
	}

}


text:
// Copyright (c) 2003-present, Jodd Team (jodd.org). All Rights Reserved.

package jodd.typeconverter.impl;

import jodd.typeconverter.TypeConversionException;
import jodd.typeconverter.TypeConverter;
import jodd.typeconverter.TypeConverterManager;
import jodd.typeconverter.TypeConverterManagerBean;
import jodd.util.CsvUtil;

import java.lang.reflect.Constructor;
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashSet;
import java.util.List;
import java.util.Set;

/**
 * Collection converter.
 */
public class CollectionConverter<T> implements TypeConverter<Collection<T>> {

	protected final TypeConverterManagerBean typeConverterManagerBean;
	protected final Class<? extends Collection> collectionType;
	protected final Class<T> targetComponentType;

	public CollectionConverter(
			Class<? extends Collection> collectionType,
			Class<T> targetComponentType) {
		this(TypeConverterManager.getDefaultTypeConverterManager(), collectionType, targetComponentType);
	}

	public CollectionConverter(
			TypeConverterManagerBean typeConverterManagerBean,
			Class<? extends Collection> collectionType,
			Class<T> targetComponentType) {

		this.typeConverterManagerBean = typeConverterManagerBean;
		this.collectionType = collectionType;
		this.targetComponentType = targetComponentType;
	}

	public Collection<T> convert(Object value) {
		if (value == null) {
			return null;
		}

		if (value instanceof Collection == false) {
			// source is not an array
	        return convertValueToCollection(value);
		}

		// source is a collection
		return convertCollectionToCollection((Collection)value);
	}

	/**
	 * Converts type using type converter manager.
	 */
	protected T convertType(Object value) {
		return typeConverterManagerBean.convertType(value, targetComponentType);
	}

	/**
	 * Creates new collection of target component type.
	 * Default implementation uses reflection to create
	 * an collection of target type. Override it for better performances.
	 */
	@SuppressWarnings("unchecked")
	protected Collection<T> createCollection(int length) {
		if (collectionType.isInterface()) {
			if (collectionType == List.class) {
				if (length > 0) {
					return new ArrayList<T>(length);
				} else {
					return new ArrayList<T>();
				}
			}

			if (collectionType == Set.class) {
				if (length > 0) {
					return new HashSet<T>(length);
				} else {
					return new HashSet<T>();
				}
			}

			throw new TypeConversionException("Unknown collection: " + collectionType.getName());
		}
		if (length > 0) {
			try {
				Constructor<Collection<T>> ctor = (Constructor<Collection<T>>) collectionType.getConstructor(int.class);
				return ctor.newInstance(Integer.valueOf(length));
			} catch (Exception ex) {
				// ignore exception
			}
		}

		try {
			return collectionType.newInstance();
		} catch (Exception ex) {
			throw new TypeConversionException(ex);
		}
	}

	/**
	 * Creates a collection with single element.
	 */
	protected Collection<T> convertToSingleElementCollection(Object value) {
		Collection<T> collection = createCollection(0);

		collection.add((T) value);

		return collection;
	}

	/**
	 * Converts non-collection value to collection.
 	 */
	protected Collection<T> convertValueToCollection(Object value) {
		if (value instanceof Iterable) {
			Iterable iterable = (Iterable) value;
			Collection<T> collection = createCollection(0);

			for (Object element : iterable) {
				collection.add(convertType(element));
			}
			return collection;
		}

		if (value instanceof CharSequence) {
			value = CsvUtil.toStringArray(value.toString());
		}

		Class type = value.getClass();

		if (type.isArray()) {
			// convert arrays
			Class componentType = type.getComponentType();

			if (componentType.isPrimitive()) {
				return convertPrimitiveArrayToCollection(value, componentType);
			} else {
				Object[] array = (Object[]) value;
				Collection<T> result = createCollection(array.length);
				for (Object a : array) {
					result.add(convertType(a));
				}
				return result;
			}
		}

		// everything else:
		return convertToSingleElementCollection(value);
	}

	/**
	 * Converts collection value to target collection.
	 * Each element is converted to target component type.
	 */
	protected Collection<T> convertCollectionToCollection(Collection value) {
		Collection<T> collection = createCollection(value.size());

		for (Object v : value) {
			collection.add(convertType(v));
		}

		return collection;
	}

	/**
	 * Converts primitive array to target collection.
	 */
	@SuppressWarnings("AutoBoxing")
	protected Collection<T> convertPrimitiveArrayToCollection(Object value, Class primitiveComponentType) {
		Collection<T> result = null;

		if (primitiveComponentType == int.class) {
			int[] array = (int[]) value;
			result = createCollection(array.length);
			for (int a : array) {
				result.add(convertType(a));
			}
		}
		else if (primitiveComponentType == long.class) {
			long[] array = (long[]) value;
			result = createCollection(array.length);
			for (long a : array) {
				result.add(convertType(a));
			}
		}
		else if (primitiveComponentType == float.class) {
			float[] array = (float[]) value;
			result = createCollection(array.length);
			for (float a : array) {
				result.add(convertType(a));
			}
		}
		else if (primitiveComponentType == double.class) {
			double[] array = (double[]) value;
			result = createCollection(array.length);
			for (double a : array) {
				result.add(convertType(a));
			}
		}
		else if (primitiveComponentType == short.class) {
			short[] array = (short[]) value;
			result = createCollection(array.length);
			for (short a : array) {
				result.add(convertType(a));
			}
		}
		else if (primitiveComponentType == byte.class) {
			byte[] array = (byte[]) value;
			result = createCollection(array.length);
			for (byte a : array) {
				result.add(convertType(a));
			}
		}
		else if (primitiveComponentType == char.class) {
			char[] array = (char[]) value;
			result = createCollection(array.length);
			for (char a : array) {
				result.add(convertType(a));
			}
		}
		else if (primitiveComponentType == boolean.class) {
			boolean[] array = (boolean[]) value;
			result = createCollection(array.length);
			for (boolean a : array) {
				result.add(convertType(a));
			}
		}
		return result;
	}

}


text:
#ifndef JUCE_MIDIINPUT_H_INCLUDED
#define JUCE_MIDIINPUT_H_INCLUDED

class MidiInput;

//==============================================================================
/**
    Receives incoming messages from a physical MIDI input device.

    This class is overridden to handle incoming midi messages. See the MidiInput
    class for more details.

    @see MidiInput
*/
class JUCE_API  MidiInputCallback
{
public:
    /** Destructor. */
    virtual ~MidiInputCallback()  {}

    /** Receives an incoming message.

        A MidiInput object will call this method when a midi event arrives. It'll be
        called on a high-priority system thread, so avoid doing anything time-consuming
        in here, and avoid making any UI calls. You might find the MidiBuffer class helpful
        for queueing incoming messages for use later.

        @param source   the MidiInput object that generated the message
        @param message  the incoming message. The message's timestamp is set to a value
                        equivalent to (Time::getMillisecondCounter() / 1000.0) to specify the
                        time when the message arrived.
    */
    virtual void handleIncomingMidiMessage (MidiInput* source,
                                            const MidiMessage& message) = 0;

    /** Notification sent each time a packet of a multi-packet sysex message arrives.

        If a long sysex message is broken up into multiple packets, this callback is made
        for each packet that arrives until the message is finished, at which point
        the normal handleIncomingMidiMessage() callback will be made with the entire
        message.

        The message passed in will contain the start of a sysex, but won't be finished
        with the terminating 0xf7 byte.
    */
    virtual void handlePartialSysexMessage (MidiInput* source,
                                            const uint8* messageData,
                                            int numBytesSoFar,
                                            double timestamp)
    {
        // (this bit is just to avoid compiler warnings about unused variables)
        (void) source; (void) messageData; (void) numBytesSoFar; (void) timestamp;
    }
};

//==============================================================================
/**
    Represents a midi input device.

    To create one of these, use the static getDevices() method to find out what inputs are
    available, and then use the openDevice() method to try to open one.

    @see MidiOutput
*/
class JUCE_API  MidiInput
{
public:
    //==============================================================================
    /** Returns a list of the available midi input devices.

        You can open one of the devices by passing its index into the
        openDevice() method.

        @see getDefaultDeviceIndex, openDevice
    */
    static StringArray getDevices();

    /** Returns the index of the default midi input device to use.

        This refers to the index in the list returned by getDevices().
    */
    static int getDefaultDeviceIndex();

    /** Tries to open one of the midi input devices.

        This will return a MidiInput object if it manages to open it. You can then
        call start() and stop() on this device, and delete it when no longer needed.

        If the device can't be opened, this will return a null pointer.

        @param deviceIndex  the index of a device from the list returned by getDevices()
        @param callback     the object that will receive the midi messages from this device.

        @see MidiInputCallback, getDevices
    */
    static MidiInput* openDevice (int deviceIndex,
                                  MidiInputCallback* callback);

   #if JUCE_LINUX || JUCE_MAC || JUCE_IOS || DOXYGEN
    /** This will try to create a new midi input device (Not available on Windows).

        This will attempt to create a new midi input device with the specified name,
        for other apps to connect to.

        Returns nullptr if a device can't be created.

        @param deviceName   the name to use for the new device
        @param callback     the object that will receive the midi messages from this device.
    */
    static MidiInput* createNewDevice (const String& deviceName,
                                       MidiInputCallback* callback);
   #endif

    //==============================================================================
    /** Destructor. */
    virtual ~MidiInput();

    /** Returns the name of this device. */
    const String& getName() const noexcept                      { return name; }

    /** Allows you to set a custom name for the device, in case you don't like the name
        it was given when created.
    */
    void setName (const String& newName) noexcept               { name = newName; }

    //==============================================================================
    /** Starts the device running.

        After calling this, the device will start sending midi messages to the
        MidiInputCallback object that was specified when the openDevice() method
        was called.

        @see stop
    */
    virtual void start();

    /** Stops the device running.

        @see start
    */
    virtual void stop();

protected:
    //==============================================================================
    String name;
    void* internal;

    explicit MidiInput (const String& name);

private:
    //==============================================================================
    JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (MidiInput)
};

#endif   // JUCE_MIDIINPUT_H_INCLUDED


text:
/**
 * @author 	Alberto Siena
**/

package eu.riscoss.client;

import com.google.gwt.resources.client.ImageResource;
import com.google.gwt.user.client.ui.Tree.Resources;

public interface DefTreeImages extends Resources {

	@Source("treeitem-closed.png")
	public ImageResource treeClosed();

	@Source("treeitem-leaf.png")
	public ImageResource treeLeaf();

	@Source("treeitem-open.png")
	public ImageResource treeOpen();

}


text:
@interface SLWebLoggerConnection : LHSConnection

@end


text:
"""TensorSpec factory for sparse tensors."""

from __future__ import absolute_import
from __future__ import division
from __future__ import print_function

from tensorflow.python.framework import dtypes
from tensorflow.python.framework import ops
from tensorflow.python.framework import tensor_shape
from tensorflow.python.framework import tensor_spec

def indexed_slices_tensor_spec(shape=None,
                               dtype=dtypes.float32,
                               num_slices=None,
                               has_dense_shape=True,
                               name=None):
  """Returns a tensor specification for a IndexedSlices.

  Returns an object which can be passed to `tf.function` (or other
  functions that expect `TensorSpec`s) to specify shape constraints
  for a `IndexedSlices` argument.

  Args:
    shape: The shape of the IndexedSlices, or `None` to allow any shape.
      The returned specification object depends only on `shape[1:]`.
    dtype: Data type of values in the IndexedSlices.
    num_slices: Number of slices.  Default allows for any number of slices.
    has_dense_shape: Indicates whether the IndexedSlices is expected to have a
      `dense_shape` component.
    name: Optional name prefix for the `TensorSpec`s.

  Returns:
    An object describing the `values`, `indices` and `dense_shape` tensors
    that comprise the `IndexedSlices`.
  """
  dtype = dtypes.as_dtype(dtype)
  shape = tensor_shape.TensorShape(shape)
  num_slices = tensor_shape.Shape([num_slices])

  values = tensor_spec.TensorSpec(
      num_slices.concatenate(shape[1:]), dtype, name)
  indices = tensor_spec.TensorSpec(num_slices, dtypes.int64,
                                   ("%s.indices" % name) if name else None)
  if has_dense_shape:
    dense_shape = tensor_spec.TensorSpec([shape.ndims], dtypes.int64,
                                         ("%s.dense_shape" %
                                          name) if name else None)
  else:
    dense_shape = None
  return ops.IndexedSlices(values, indices, dense_shape)


text:
{% load staticfiles mbase %}

						Mogo

						Mogo

					<button class="button navbar-burger" data-target="nav-menu">

					</button>

						{% include "topbar.html" %}


text:
package com.vaadin.tests.dd;

import static org.junit.Assert.assertEquals;

import org.junit.Test;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.interactions.Actions;
import org.openqa.selenium.support.ui.ExpectedCondition;

import com.vaadin.testbench.elements.ButtonElement;
import com.vaadin.testbench.elements.LabelElement;
import com.vaadin.testbench.elements.UIElement;
import com.vaadin.tests.tb3.MultiBrowserTest;

/**
 * Test for interrupting drag-and-drop.
 *
 * @author Vaadin Ltd
 */
public class DDInterruptTest extends MultiBrowserTest {

    private UIElement ui;

    @Override
    public void setup() throws Exception {
        super.setup();
        openTestURL("debug");
        ui = $(UIElement.class).first();
    }

    @Test
    public void testRegularDragging() {
        dragElement();
        assertNoNotifications();
        assertDragged(true);
    }

    @Test
    public void testTriggeredDragging() {
        $(ButtonElement.class).first().click();
        waitUntilTriggered(true);

        dragElement();

        waitUntilTriggered(false);
        assertNoNotifications();
        assertDragged(false);
    }

    private void dragElement() {
        LabelElement label = $(LabelElement.class).id("draggable");
        new Actions(driver).moveToElement(label).clickAndHold()
                .moveByOffset(400, 400).perform();
    }

    private void assertNoNotifications() {
        assertEquals("Notification found when there should have been none,", 0,
                findElements(By.className("v-Notification")).size());
    }

    private void assertDragged(boolean dragged) {
        assertEquals("Unexpected drag state,", dragged ? 1 : 0,
                findElements(By.className("v-ddwrapper-over-bottom")).size());
    }

    private void waitUntilTriggered(final boolean triggered) {
        waitUntil(new ExpectedCondition<Boolean>() {

            @Override
            public Boolean apply(WebDriver arg0) {
                return triggered == hasCssClass(ui, "triggered");
            }

            @Override
            public String toString() {
                return String.format("UI to %s stylename 'triggered'",
                        (triggered ? "get" : "lose"));
            }
        });
    }
}


text:
package weixin

import (
	"fmt"
	"net/url"
)

// 二维码
const (
	AccountCreateQRCodeURL     = "https://api.weixin.qq.com/cgi-bin/qrcode/create?access_token=%s"
	AccountGetQRCodeImgAddrURL = "https://mp.weixin.qq.com/cgi-bin/showqrcode?ticket=%s"
)

// QRCodeTicket 二维码ticket
type QRCodeTicket struct {
	WXError
	Ticket        string `json:"ticket"`         // 获取的二维码ticket,凭借此ticket可以在有效时间内换取二维码。
	ExpireSeconds int    `json:"expire_seconds"` // 该二维码有效时间,以秒为单位。 最大不超过2592000(即30天)。
	URL           string `json:"url"`            // 二维码图片解析后的地址,开发者可根据该地址自行生成需要的二维码图片
}

// CreateTemporaryQRCodeTicket 创建临时二维码
func CreateTemporaryQRCodeTicket(sceneId int, expireSeconds ...int) (ticket *QRCodeTicket, err error) {
	if len(expireSeconds) == 0 {
		expireSeconds = []int{30}
	} else if expireSeconds[0] >= 2592000 || expireSeconds[0] < 0 {
		expireSeconds[0] = 2592000
	}
	body := fmt.Sprintf(`{"expire_seconds": %d, "action_name": "QR_SCENE", "action_info": {"scene": {"scene_id": %d}}}`, expireSeconds[0], sceneId)
	return createQRCodeTicket(body)
}

// CreatePermanentQRCodeTicket 创建永久二维码
func CreatePermanentQRCodeTicket(sceneId int) (ticket *QRCodeTicket, err error) {
	body := fmt.Sprintf(`{"action_name": "QR_LIMIT_SCENE", "action_info": {"scene": {"scene_str": %d}}}`, sceneId)
	return createQRCodeTicket(body)
}

// CreatePermanentQRCodeTicketString 创建字符串形式的二维码
func CreatePermanentQRCodeTicketString(sceneId string) (ticket *QRCodeTicket, err error) {
	body := fmt.Sprintf(`{"action_name": "QR_LIMIT_STR_SCENE", "action_info": {"scene": {"scene_str": "%s"}}}`, sceneId)
	return createQRCodeTicket(body)
}

func createQRCodeTicket(js string) (ticket *QRCodeTicket, err error) {
	ticket = &QRCodeTicket{}
	url := fmt.Sprintf(AccountCreateQRCodeURL, AccessToken())
	err = Post(url, []byte(js), ticket)
	return ticket, err
}

// GetQRCodeImg 通过ticket换取二维码
func GetQRCodeImg(ticket string) string {
	return fmt.Sprintf(AccountGetQRCodeImgAddrURL, url.QueryEscape(ticket))
}


text:
<?xml version="1.0" encoding="utf-8"?>
<!-- EN-Revision: 20765 -->
<!-- Reviewed: no -->
<sect3 id="zend.controller.actionhelpers.flashmessenger">
    <title>FlashMessenger</title>

    <sect4 id="zend.controller.actionhelper.flashmessenger.introduction">
        <title>Introduction</title>

        <para>
            L'aide <emphasis>FlashMessenger</emphasis> vous permet de fournir les messages dont
            l'utilisateur pourrait avoir besoin dans la requête suivante. Pour accomplir ceci,
            <emphasis>FlashMessenger</emphasis> utilise
            <classname>Zend_Session_Namespace</classname> pour
            stocker les messages à retrouver dans la prochaine requête. C'est généralement une
            bonne idée si vous planifiez d'utiliser <classname>Zend_Session</classname> ou
            <classname>Zend_Session_Namespace</classname>, que vous initialisez avec
            <methodname>Zend_Session::start()</methodname> dans votre fichier d'amorçage. (Reportez
            vous à la documentation de
            <link linkend="zend.session.advanced_usage.starting_a_session">Zend_Session</link>pour
            plus de détails sur son utilisation.)
        </para>
    </sect4>

    <sect4 id="zend.controller.actionhelper.flashmessenger.basicusage">
        <title>Exemple d'utilisation basique</title>

        <para>
            L'exemple ci-dessous vous montre l'utilisation du flash messenger dans sa forme
            la plus basique. Quand l'action <filename>/some/my</filename> est appelée, il ajoute
            le message "Sauvegarde réalisée !". Une requête suivante vers l'action
            <filename>/some/my-next-request</filename> le retrouvera (ainsi que le détruira).
        </para>

        <programlisting language="php"><![CDATA[
class SomeController extends Zend_Controller_Action
{
    /**
     * FlashMessenger
     *
     * @var Zend_Controller_Action_Helper_FlashMessenger
     */
    protected $_flashMessenger = null;

    public function init()
    {
        $this->_flashMessenger = $this->_helper
                                      ->getHelper('FlashMessenger');
        $this->initView();
    }

    public function myAction()
    {
        /**
         * Méthode par défaut por obtenir l'instance de
         * Zend_Controller_Action_Helper_FlashMessenger à la demande
         */
        $this->_flashMessenger->addMessage('Sauvegarde réalisée !');
    }

    public function myNextRequestAction()
    {
        $this->view->messages = $this->_flashMessenger->getMessages();
        $this->render();
    }
}
]]></programlisting>
    </sect4>
</sect3>


text:
<?php
/*require_once __DIR__ . '/database.php';*/

abstract class Comment {
	/*
	Abstract class for a comment
	 */

	public function self_destruct() {
		/*
		(Null) -> Null
		Deletes self from database
		 */

		if ($this->comment_id) {
			if (get_class($this) == 'ProfileComment') {
				$sql = "DELETE FROM `profile_comments` WHERE comment_id = '$this->comment_id' LIMIT 1";
				$result = $this->dbc->query($sql)
				or die ($this->dbc->error);
				return true;
			}
			elseif (get_class($this) == 'GeneralComment') {
				$sql = "DELETE FROM `general_comments` WHERE comment_id = '$this->comment_id' LIMIT 1";
				$result = $this->dbc->query($sql)
				or die ($this->dbc->error);
				return true;

			}
		}
		else {
			return false;
		}
	}
}

class ThreadComment extends Comment {
	/*
	Comment on a thread on the site
	 */
	private $dbc;
	public $comment_id, $comment_text, $author, $date_posted, $thread, $parent;

	public static $defaults = array(
		'comment_id' => null,
		'comment_text' => null,
		'author' => null,
		'date_posted' => null,
		'parent' => null,
		'thread' => null
	);

	public function __construct(array $args) {
		$defaults = self::$defaults;
		$args = array_merge($defaults, $args);

		$this->dbc = Database::connection();
		$this->comment_id = $args['comment_id'];
		$this->comment_text = $args['comment_text'];
		$this->author = (is_a($args['author'], 'User')) ? $args['author'] : null;
		$this->date_posted = $args['date_posted'];
		$this->parent = (is_a($args['parent'], 'ThreadComment')) ? $args['parent'] : null;
		if ($this->parent) {
			$this->reply = true;
		}
		else {
			$this->reply = false;
		}
		$this->thread = (is_a($args['thread'], 'Thread')) ? $args['thread'] : null;
	}

	public function get_replies() {
		/*
		(Null) -> Null
		Attempts to fetch all comments to this comment
		 */
		if ($this->comment_id) {
			$sql = "SELECT ";
		}
	}

	public function increment_likes() {
		/*
		Attempts to increment likes
		 */
		if ($this->comment_id) {
			$sql = "UPDATE `general_comments` SET likes = likes + 1 WHERE comment_id = '$this->comment_id'";
			$result = $this->dbc->query($sql)
			or die ($this->dbc->error);
			return true;
		}
		else {
			return false;
		}
	}

	public function decrement_likes() {
		/*
		Attempts to increment likes
		 */
		if ($this->comment_id) {
			$sql = "UPDATE `general_comments` SET likes = likes - 1 WHERE comment_id = '$this->comment_id'";
			$result = $this->dbc->query($sql)
			or die ($this->dbc->error);
			return true;
		}
		else {
			return false;
		}
	}

}

class ProfileComment extends Comment {
	private $dbc;
	public $comment_id, $comment_text, $author, $date_posted, $profile, $likes;

	public static $defaults = array(
		'comment_id' => 0,
		'comment_text' => null,
		'author' => null,
		'date_posted' => null,
		'profile' => null
	);

	public function __construct(array $args = array()) {
		$defaults = self::$defaults;
		$args = array_merge($defaults, $args);

		$this->dbc = Database::connection();
		$this->comment_id = (is_numeric($args['comment_id'])) ? $args['comment_id'] : null;
		$this->comment_text = $args['comment_text'];
		$this->date_posted = $args['date_posted'];
		$this->author = (is_a($args['author'], 'User')) ? $args['author'] : null;
		$this->profile = (is_a($args['profile'], 'User')) ? $args['profile'] : null;
		$this->likes = (is_numeric($args['likes'])) ? $args['likes'] : 0;
	}
}


text:
package org.elder.sourcerer;

import com.google.common.collect.ImmutableMap;

import java.util.Map;
import java.util.UUID;

/**
 * Event payload with metadata and related information, for writing events.
 *
 * @param <T> The (base) type of events wrapped.
 */
public final class EventData<T> {
    private final String eventType;
    private final UUID eventId;
    private final ImmutableMap<String, String> metadata;
    private final T payload;

    public EventData(
            final String eventType,
            final UUID eventId,
            final Map<String, String> metadata,
            final T payload) {
        this.eventType = eventType;
        this.eventId = eventId;
        this.metadata = metadata == null ? null : ImmutableMap.copyOf(metadata);
        this.payload = payload;
    }

    public String getEventType() {
        return eventType;
    }

    public UUID getEventId() {
        return eventId;
    }

    public ImmutableMap<String, String> getMetadata() {
        return metadata;
    }

    public T getEvent() {
        return payload;
    }

    @Override
    public String toString() {
        return "EventData{" +
                "eventType='" + eventType + '\'' +
                ", eventId=" + eventId +
                ", metadata=" + metadata +
                ", payload=" + payload +
                '}';
    }
}


text:
//$Id: prnstrem.h 3127 2013-12-05 22:40:36Z jsibert $
#ifndef PRN_T
#define PRN_T
#include <sstream>
#include <fstream>

#ifndef FVAR_HPP
  class dvector;
  class ivector;
  class lvector;
  class dmatrix;
  class imatrix;
  class d3_array;
#endif

#ifndef __ADSTRING_HPP__
  class adstring;
#endif

/** Stream output to create comma-separated variables in a (".csv") file.
csvstream is a synonym via a typedef.
*/
class prnstream : protected std::ofstream
{
private:
  int count;
  void outstr(const char*, const char q = '\0');
  void outstr(const std::ostringstream&, const char q = '\0');
public:
  prnstream(const char* fn);
  prnstream& put(char);
  void close(void) { std::ofstream::close();}

  prnstream& operator << (const char*);
  prnstream& operator << (const short);
  prnstream& operator << (const int);
  prnstream& operator << (const long);
  prnstream& operator << (const float);
  prnstream& operator << (const double);

  prnstream& operator<< (prnstream& (*fn)(prnstream &));
  prnstream& operator<< (std::ios& (*_f)(std::ios&));

  friend prnstream& endl(prnstream& s);

/*
#if defined(__ZTC__) //&& (__ZTC__ <= 0x310)
  friend prnstream& pendl(prnstream& s);
  prnstream& operator << (const adstring& s);
#endif
*/
  prnstream& operator << (const adstring& s);
  prnstream& operator<<(dvector& z);
  prnstream& operator<<(ivector& z);
  prnstream& operator<<(lvector& z);
  prnstream& operator<<(imatrix& z);
  prnstream& operator<<(dmatrix& z);
  prnstream& operator<<(d3_array& z);

  int operator ! (void) { return(std::ofstream::operator ! ());}

};

typedef prnstream csvstream;

inline prnstream& prnstream::operator<< (prnstream& (*_f)(prnstream &))
					{ return (*_f)(*this); }

prnstream& endl(prnstream& s);

#endif // #ifndef PRN_T


text:
<!--
Copyright 2016 Google Inc. All Rights Reserved.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<web-app version='2.5' xmlns='http://java.sun.com/xml/ns/javaee' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd'>
  <listener>
    <listener-class>com.google.testapp.TestGuiceServletContextListener</listener-class>
  </listener>
  <filter>
    <filter-name>GuiceFilter</filter-name>
    <filter-class>com.google.inject.servlet.GuiceFilter</filter-class>
  </filter>
  <filter-mapping>
    <filter-name>GuiceFilter</filter-name>
    <url-pattern>/_ah/api/*</url-pattern>
  </filter-mapping>
</web-app>


text:
using CommandLine;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using TestFlask.CLI.Options;
using TestFlask.CLI.UnitTestGen.T4;

namespace TestFlask.CLI
{
    class Program
    {
        static int Main(string[] args)
        {
            return Parser.Default.ParseArguments<UnitTestGenOptions>(args)
                .MapResult(
                    (UnitTestGenOptions options) => RunGenerateUnitTests(options),
                     errs => 1);
        }

        private static int RunGenerateUnitTests(UnitTestGenOptions options)
        {
            MSTestGen testGenerator = new MSTestGen(options);

            string contents = testGenerator.TransformText();

            File.WriteAllText($"{options.ClassName}_Auto.cs", contents);

            Console.WriteLine("Tests are generated successfully! Press any key to exit...");
            Console.ReadLine();

            return 0;
        }
    }
}


text:
<component name="libraryTable">
  <library name="appcompat-v7-18.0.0">
    <CLASSES>
      <root url="jar://$PROJECT_DIR$/app/build/intermediates/exploded-aar/com.android.support/appcompat-v7/18.0.0/classes.jar!/" />
      <root url="file://$PROJECT_DIR$/app/build/intermediates/exploded-aar/com.android.support/appcompat-v7/18.0.0/res" />
    </CLASSES>
    <JAVADOC />
    <SOURCES />
  </library>
</component>


text:
"use strict";
var $__ParseTreeTransformer_46_js__,
    $___46__46__47_syntax_47_trees_47_ParseTrees_46_js__,
    $___46__46__47_syntax_47_PredefinedName_46_js__,
    $___46__46__47_util_47_StringSet_46_js__,
    $___46__46__47_syntax_47_TokenType_46_js__,
    $__ParseTreeFactory_46_js__,
    $__PrependStatements_46_js__;
var ParseTreeTransformer = ($__ParseTreeTransformer_46_js__ = require("./ParseTreeTransformer.js"), $__ParseTreeTransformer_46_js__ && $__ParseTreeTransformer_46_js__.__esModule && $__ParseTreeTransformer_46_js__ || {default: $__ParseTreeTransformer_46_js__}).ParseTreeTransformer;
var $__1 = ($___46__46__47_syntax_47_trees_47_ParseTrees_46_js__ = require("../syntax/trees/ParseTrees.js"), $___46__46__47_syntax_47_trees_47_ParseTrees_46_js__ && $___46__46__47_syntax_47_trees_47_ParseTrees_46_js__.__esModule && $___46__46__47_syntax_47_trees_47_ParseTrees_46_js__ || {default: $___46__46__47_syntax_47_trees_47_ParseTrees_46_js__}),
    Module = $__1.Module,
    Script = $__1.Script;
var ARGUMENTS = ($___46__46__47_syntax_47_PredefinedName_46_js__ = require("../syntax/PredefinedName.js"), $___46__46__47_syntax_47_PredefinedName_46_js__ && $___46__46__47_syntax_47_PredefinedName_46_js__.__esModule && $___46__46__47_syntax_47_PredefinedName_46_js__ || {default: $___46__46__47_syntax_47_PredefinedName_46_js__}).ARGUMENTS;
var StringSet = ($___46__46__47_util_47_StringSet_46_js__ = require("../util/StringSet.js"), $___46__46__47_util_47_StringSet_46_js__ && $___46__46__47_util_47_StringSet_46_js__.__esModule && $___46__46__47_util_47_StringSet_46_js__ || {default: $___46__46__47_util_47_StringSet_46_js__}).StringSet;
var $__4 = ($___46__46__47_syntax_47_TokenType_46_js__ = require("../syntax/TokenType.js"), $___46__46__47_syntax_47_TokenType_46_js__ && $___46__46__47_syntax_47_TokenType_46_js__.__esModule && $___46__46__47_syntax_47_TokenType_46_js__ || {default: $___46__46__47_syntax_47_TokenType_46_js__}),
    LET = $__4.LET,
    VAR = $__4.VAR;
var $__5 = ($__ParseTreeFactory_46_js__ = require("./ParseTreeFactory.js"), $__ParseTreeFactory_46_js__ && $__ParseTreeFactory_46_js__.__esModule && $__ParseTreeFactory_46_js__ || {default: $__ParseTreeFactory_46_js__}),
    createFunctionBody = $__5.createFunctionBody,
    createThisExpression = $__5.createThisExpression,
    createIdentifierExpression = $__5.createIdentifierExpression,
    createVariableDeclaration = $__5.createVariableDeclaration,
    createVariableDeclarationList = $__5.createVariableDeclarationList,
    createVariableStatement = $__5.createVariableStatement;
var prependStatements = ($__PrependStatements_46_js__ = require("./PrependStatements.js"), $__PrependStatements_46_js__ && $__PrependStatements_46_js__.__esModule && $__PrependStatements_46_js__ || {default: $__PrependStatements_46_js__}).prependStatements;
var TempVarStatement = function() {
  function TempVarStatement(name, initializer) {
    this.name = name;
    this.initializer = initializer;
  }
  return ($traceurRuntime.createClass)(TempVarStatement, {}, {});
}();
var TempScope = function() {
  function TempScope() {
    this.identifiers = [];
  }
  return ($traceurRuntime.createClass)(TempScope, {
    push: function(identifier) {
      this.identifiers.push(identifier);
    },
    pop: function() {
      return this.identifiers.pop();
    },
    release: function(obj) {
      for (var i = this.identifiers.length - 1; i >= 0; i--) {
        obj.release_(this.identifiers[i]);
      }
    }
  }, {});
}();
var VarScope = function() {
  function VarScope(options) {
    this.thisName = null;
    this.argumentName = null;
    this.tempVarStatements = [];
    this.declarationType_ = options.blockBinding && !options.transformOptions.blockBinding ? LET : VAR;
  }
  return ($traceurRuntime.createClass)(VarScope, {
    push: function(tempVarStatement) {
      this.tempVarStatements.push(tempVarStatement);
    },
    pop: function() {
      return this.tempVarStatements.pop();
    },
    release: function(obj) {
      for (var i = this.tempVarStatements.length - 1; i >= 0; i--) {
        obj.release_(this.tempVarStatements[i].name);
      }
    },
    isEmpty: function() {
      return !this.tempVarStatements.length;
    },
    createVariableStatement: function() {
      var declarations = [];
      var seenNames = new StringSet();
      for (var i = 0; i < this.tempVarStatements.length; i++) {
        var $__8 = this.tempVarStatements[i],
            name = $__8.name,
            initializer = $__8.initializer;
        if (seenNames.has(name)) {
          if (initializer)
            throw new Error('Invalid use of TempVarTransformer');
          continue;
        }
        seenNames.add(name);
        declarations.push(createVariableDeclaration(name, initializer));
      }
      return createVariableStatement(createVariableDeclarationList(this.declarationType_, declarations));
    }
  }, {});
}();
var TempVarTransformer = function($__super) {
  function TempVarTransformer(identifierGenerator, reporter, options) {
    $traceurRuntime.superConstructor(TempVarTransformer).call(this);
    this.identifierGenerator = identifierGenerator;
    this.reporter = reporter;
    this.options = options;
    this.tempVarStack_ = [new VarScope(this.options)];
    this.tempScopeStack_ = [new TempScope()];
    this.namePool_ = [];
  }
  return ($traceurRuntime.createClass)(TempVarTransformer, {
    transformStatements_: function(statements) {
      this.tempVarStack_.push(new VarScope(this.options));
      var transformedStatements = this.transformList(statements);
      var vars = this.tempVarStack_.pop();
      if (vars.isEmpty())
        return transformedStatements;
      var variableStatement = vars.createVariableStatement();
      vars.release(this);
      return prependStatements(transformedStatements, variableStatement);
    },
    transformScript: function(tree) {
      var scriptItemList = this.transformStatements_(tree.scriptItemList);
      if (scriptItemList === tree.scriptItemList) {
        return tree;
      }
      return new Script(tree.location, scriptItemList, tree.moduleName);
    },
    transformModule: function(tree) {
      var scriptItemList = this.transformStatements_(tree.scriptItemList);
      if (scriptItemList === tree.scriptItemList) {
        return tree;
      }
      return new Module(tree.location, scriptItemList, tree.moduleName);
    },
    transformFunctionBody: function(tree) {
      this.pushTempScope();
      var statements = this.transformStatements_(tree.statements);
      this.popTempScope();
      if (statements === tree.statements)
        return tree;
      return createFunctionBody(statements);
    },
    getTempIdentifier: function() {
      var name = this.getName_();
      this.tempScopeStack_[this.tempScopeStack_.length - 1].push(name);
      return name;
    },
    getName_: function() {
      return this.namePool_.length ? this.namePool_.pop() : this.identifierGenerator.generateUniqueIdentifier();
    },
    addTempVar: function() {
      var initializer = arguments[0] !== (void 0) ? arguments[0] : null;
      var vars = this.tempVarStack_[this.tempVarStack_.length - 1];
      var name = this.getName_();
      vars.push(new TempVarStatement(name, initializer));
      return name;
    },
    addTempVarForThis: function() {
      var varScope = this.tempVarStack_[this.tempVarStack_.length - 1];
      return varScope.thisName || (varScope.thisName = this.addTempVar(createThisExpression()));
    },
    addTempVarForArguments: function() {
      var varScope = this.tempVarStack_[this.tempVarStack_.length - 1];
      return varScope.argumentName || (varScope.argumentName = this.addTempVar(createIdentifierExpression(ARGUMENTS)));
    },
    pushTempScope: function() {
      this.tempScopeStack_.push(new TempScope());
    },
    popTempScope: function() {
      this.tempScopeStack_.pop().release(this);
    },
    release_: function(name) {
      this.namePool_.push(name);
    }
  }, {}, $__super);
}(ParseTreeTransformer);
Object.defineProperties(module.exports, {
  TempVarTransformer: {get: function() {
      return TempVarTransformer;
    }},
  __esModule: {value: true}
});


text:
(function()
{
	function getListElement( editor, listTag )
	{
		var range;
		try { range  = editor.getSelection().getRanges()[ 0 ]; }
		catch( e ) { return null; }

		range.shrink( CKEDITOR.SHRINK_TEXT );
		return range.getCommonAncestor().getAscendant( listTag, true );
	}

	var mapListStyle = {
		'a' : 'lower-alpha',
		'A' : 'upper-alpha',
		'i' : 'lower-roman',
		'I' : 'upper-roman',
		'1' : 'decimal',
		'disc' : 'disc',
		'circle': 'circle',
		'square' : 'square'
	};

	function listStyle( editor, startupPage )
	{
		if ( startupPage == 'bulletedListStyle' )
		{
			return {
				title : editor.lang.list.bulletedTitle,
				minWidth : 300,
				minHeight : 50,
				contents :
				[
					{
						elements :
						[
							{
								type : 'select',
								label : editor.lang.list.type,
								id : 'type',
								style : 'width: 150px; margin: auto;',
								items :
								[
									[ editor.lang.list.notset, '' ],
									[ editor.lang.list.circle, 'circle' ],
									[ editor.lang.list.disc,  'disc' ],
									[ editor.lang.list.square, 'square' ]
								],
								setup : function( element )
								{
									var value = element.getStyle( 'list-style-type' )
												|| mapListStyle[ element.getAttribute( 'type' ) ]
												|| element.getAttribute( 'type' )
												|| '';

									this.setValue( value );
								},
								commit : function( element )
								{
									var value = this.getValue();
									if ( value )
										element.setStyle( 'list-style-type', value );
									else
										element.removeStyle( 'list-style-type' );
								}
							}
						]
					}
				],
				onShow: function()
				{
					var editor = this.getParentEditor(),
						element = getListElement( editor, 'ul' );

					element && this.setupContent( element );
				},
				onOk: function()
				{
					var editor = this.getParentEditor(),
						element = getListElement( editor, 'ul' );

					element && this.commitContent( element );
				}
			};
		}
		else if ( startupPage == 'numberedListStyle'  )
		{
			return {
				title : editor.lang.list.numberedTitle,
				minWidth : 300,
				minHeight : 50,
				contents :
				[
					{
						elements :
						[
							{
								type : 'hbox',
								widths : [ '25%', '75%' ],
								children :
								[
									{
										label : editor.lang.list.start,
										type : 'text',
										id : 'start',
										setup : function( element )
										{
											var value = element.getAttribute( 'start' ) || 1;
											value && this.setValue( value );
										},
										commit : function( element )
										{
											element.setAttribute( 'start', this.getValue() );
										}
									},
									{
										type : 'select',
										label : editor.lang.list.type,
										id : 'type',
										style : 'width: 100%;',
										items :
										[
											[ editor.lang.list.notset, '' ],
											[ editor.lang.list.armenian, 'armenian' ],
											[ editor.lang.list.georgian, 'georgian' ],
											[ editor.lang.list.lowerRoman, 'lower-roman' ],
											[ editor.lang.list.upperRoman, 'upper-roman' ],
											[ editor.lang.list.lowerAlpha, 'lower-alpha' ],
											[ editor.lang.list.upperAlpha, 'upper-alpha' ],
											[ editor.lang.list.lowerGreek, 'lower-greek' ],
											[ editor.lang.list.decimal, 'decimal' ],
											[ editor.lang.list.decimalLeadingZero, 'decimal-leading-zero' ]
										],
										setup : function( element )
										{
											var value = element.getStyle( 'list-style-type' )
												|| mapListStyle[ element.getAttribute( 'type' ) ]
												|| element.getAttribute( 'type' )
												|| '';

											this.setValue( value );
										},
										commit : function( element )
										{
											var value = this.getValue();
											if ( value )
												element.setStyle( 'list-style-type', value );
											else
												element.removeStyle( 'list-style-type' );
										}
									}
								]
							}
						]
					}
				],
				onShow: function()
				{
					var editor = this.getParentEditor(),
						element = getListElement( editor, 'ol' );

					element && this.setupContent( element );
				},
				onOk: function()
				{
					var editor = this.getParentEditor(),
						element = getListElement( editor, 'ol' );

					element && this.commitContent( element );
				}
			};
		}
	}

	CKEDITOR.dialog.add( 'numberedListStyle', function( editor )
		{
			return listStyle( editor, 'numberedListStyle' );
		});

	CKEDITOR.dialog.add( 'bulletedListStyle', function( editor )
		{
			return listStyle( editor, 'bulletedListStyle' );
		});
})();


text:
package io.github.michaelfedora.fedorasmarket.persistance.shopreference;

import static io.github.michaelfedora.fedorasmarket.persistance.FmDataKeys.SHOP_REFERENCE;

import io.github.michaelfedora.fedorasmarket.shop.ShopReference;
import org.spongepowered.api.data.DataHolder;
import org.spongepowered.api.data.DataView;
import org.spongepowered.api.data.manipulator.DataManipulatorBuilder;
import org.spongepowered.api.data.persistence.AbstractDataBuilder;
import org.spongepowered.api.data.persistence.InvalidDataException;

import java.util.Optional;

/**
 * Created by Michael on 2/27/2016.
 */
public class ShopReferenceDataManipulatorBuilder extends AbstractDataBuilder<ShopReferenceData> implements DataManipulatorBuilder<ShopReferenceData, ImmutableShopReferenceData> {

    public ShopReferenceDataManipulatorBuilder() {
        super(ShopReferenceData.class, 1);
    }

    @Override
    public Optional<ShopReferenceData> buildContent(DataView container) throws InvalidDataException {
        if(!container.contains(SHOP_REFERENCE.getQuery()))
            return Optional.empty();

        ShopReference data = container.getSerializable(SHOP_REFERENCE.getQuery(), ShopReference.class).get();
        return Optional.of(new ShopReferenceData(data));
    }

    @Override
    public ShopReferenceData create() {
        return new ShopReferenceData(new ShopReference());
    }

    public ShopReferenceData createFrom(ShopReference data) {
        return new ShopReferenceData(data);
    }

    @Override
    public Optional<ShopReferenceData> createFrom(DataHolder dataHolder) {
        return create().fill(dataHolder);
    }
}


text:
package com.pinterest.secor.common;

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

/**
 * Topic partition group describes a kafka message topic-partitions pair.
 *
 * @author Henry Cai (hcai@pinterest.com)
 */
public class TopicPartitionGroup {
    private String mTopic;
    private int[] mPartitions;

    public TopicPartitionGroup(String topic, int[] partitions) {
        mTopic = topic;
        mPartitions = Arrays.copyOf(partitions, partitions.length);
    }

    public TopicPartitionGroup(TopicPartition tp) {
        this(tp.getTopic(), new int[]{tp.getPartition()});
    }

    public String getTopic() {
        return mTopic;
    }

    public int[] getPartitions() {
        return mPartitions;
    }

    public List<TopicPartition> getTopicPartitions() {
        List<TopicPartition> tps = new ArrayList<TopicPartition>();
        for (int p : mPartitions) {
            tps.add(new TopicPartition(mTopic, p));
        }
        return tps;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        TopicPartitionGroup that = (TopicPartitionGroup) o;

        if (!Arrays.equals(mPartitions, that.mPartitions)) return false;
        if (mTopic != null ? !mTopic.equals(that.mTopic) : that.mTopic != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = mTopic != null ? mTopic.hashCode() : 0;
        result = 31 * result + Arrays.hashCode(mPartitions);
        return result;
    }

    @Override
    public String toString() {
        return "TopicPartitionGroup{" +
                "mTopic='" + mTopic + '\'' +
                ", mPartitions=" + Arrays.toString(mPartitions) +
                '}';
    }
}


text:
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using JustConveyor.Contracts;
using JustConveyor.Contracts.Dependencies.Attributes;

namespace JustConveyor.Tests.TestProcessModel.Conveyor
{
	/// <summary>
	/// Class that supplies package with ints from initial array.
	/// </summary>
	[Injecting]
	public class IntSupplier : ConveySupplierContract
	{
		/// <summary>
		/// CTOR.
		/// </summary>
		/// <param name="ints">Initial array.</param>
		public IntSupplier(IEnumerable<int> ints)
		{
		    mInts = new Queue<int>(ints);
		}

		private readonly Queue<int> mInts;

        public async Task<Package> SupplyNextPackage()
	    {
	        await Task.Yield();

            if(mInts.Count == 0)
                return Package.Fake;

	        var el = mInts.Dequeue();
            return new Package { Id = $"id:{el}", Load = el };
	    }
	}
}


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<meta http-equiv="Content-Type" content="text/html" charset="UTF-8">
<title>com.fasterxml.sort (java-merge-sort 1.0.0 API)</title>
<meta name="date" content="2014-06-04">
<link rel="stylesheet" type="text/css" href="../../../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev Package

Next Package

Frames

No Frames

All Classes

Package com.fasterxml.sort

Interface Summary

Interface
Description

SortingState

Interface that defines how calling application can interact with a Sorter; both
 by accessing progress information and by requesting cancellation if necessary.

TempFileProvider

Interface used for object that can handle constructing of temporary files that are
 needed during sort and non-final merge phases.

Class Summary

Class
Description

DataReader<T>

DataReaderFactory<T>

DataWriter<T>

DataWriterFactory<T>

IteratingSorter<T>

Merger<T>

Object used to merge items from multiple input sources into one.

Merger.PairwiseMerger<T>

SortConfig

Configuration object used for changing details of sorting
 process.

Sorter<T>

Main entry point for sorting functionality; object that drives
 the sorting process from pre-sort to final output.

SorterBase<T>

Enum Summary

Enum
Description

SortingState.Phase

Different phases that sorter goes through

Exception Summary

Exception
Description

IterableSorterException

We need an unchecked exception to work with Iterator, and
 want a specific subtype to catch.

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev Package

Next Package

Frames

No Frames

All Classes

Copyright © 2012-2014 FasterXML. All Rights Reserved.