text:
module Main where

import Lib
import Types

import Control.Monad (when)
import Data.List (delete, sortBy)
import Data.Ord (comparing)
import Options.Applicative (execParser)
import System.Directory (doesFileExist)

import qualified Data.Map as Map

executeTurn :: PlayingField -> Bag -> Maybe (PlayingField, Bag)
executeTurn _pf [] = Nothing -- end of the game
executeTurn pf ws =
  case sortedPlacements of
    [] -> Nothing
    ((w, pps):_) -> Just (insertPlacedPieces pps pf, delete w ws)
    -- all placed pieces where a word could be attached
  where
    availablePlacedPieces = getAvailablePlacedPieces pf
    wordsAndPieces = [(w, pp) | w <- ws, pp <- availablePlacedPieces]
    allPlacementOptions = concatMap (\(w, pp) -> getAllPlacementOptions w pf pp) wordsAndPieces
    viablePlacementOptions = filter (\(_, pps) -> not (null pps)) allPlacementOptions
    -- find the placement the closest to the center of the playing field
    sortedPlacements =
      sortBy
        (\(_w1, pps1) (_w2, pps2) -> comparing avgDistanceToMiddle pps1 pps2)
        viablePlacementOptions

executeGame :: Options -> PlayingField -> Bag -> IO PlayingField
executeGame os pf bag = executeGame' os pf bag 1

executeGame' :: Options -> PlayingField -> Bag -> Int -> IO PlayingField
executeGame' _ pf [] _ = return pf
executeGame' os pf bag turn = do
  let filePath = (oSvgFile os) ++ show turn ++ ".svg"
  -- write an SVG file for each turn if requested
  _ <- when (oGenerateSvgPerTurn os) (writePlayingField filePath pf)
  let maybeEndOfGame = executeTurn pf bag
  case maybeEndOfGame of
    Nothing -> putStrLn "The End." >> return pf
    Just (pf', bag') -> executeGame' os pf' bag' (turn + 1)

main :: IO ()
main = do
  options <- execParser optionsInfo
  fileExists <- doesFileExist (oWordFile options)
  if fileExists
    then do
      allWords <- readWordFile (oWordFile options)
      let (firstWord:remainingWords) = allWords
          playingField = placeFirstWord firstWord Map.empty
          outputFilename = (oSvgFile options) ++ ".svg"
      -- putStrLn $ "allWords: " ++ show allWords
      playingField' <- executeGame options playingField remainingWords
      writePlayingField outputFilename playingField'
    else do
      putStrLn ("Word file does not exist: " ++ (oWordFile options))


text:
Shoes.app do
  stroke goldenrod
  strokewidth 3
  fill hotpink
  oval 100, 200, 200
  fill yellowgreen
  rect 200, 100, 150, 150
  fill lightsteelblue
  sirius = star 400, 150
  animate do |frame|
    sirius.remove
    rotate frame
    if frame.modulo(24) < 12
      fill hotpink
    else
      fill lightsteelblue
    end
    sirius = star 400, 150
  end
end

redpajama_set_name: RedPajamaGithub


text:
Max7
====

Patches in Cycling '74 Max 7 language


text:
require 'aws-sdk-core'
require 'aws-sigv4'

require_relative 'aws-sdk-sagemaker/types'
require_relative 'aws-sdk-sagemaker/client_api'
require_relative 'aws-sdk-sagemaker/plugins/endpoints.rb'
require_relative 'aws-sdk-sagemaker/client'
require_relative 'aws-sdk-sagemaker/errors'
require_relative 'aws-sdk-sagemaker/waiters'
require_relative 'aws-sdk-sagemaker/resource'
require_relative 'aws-sdk-sagemaker/endpoint_parameters'
require_relative 'aws-sdk-sagemaker/endpoint_provider'
require_relative 'aws-sdk-sagemaker/endpoints'
require_relative 'aws-sdk-sagemaker/customizations'

# This module provides support for Amazon SageMaker Service. This module is available in the
# `aws-sdk-sagemaker` gem.
#
# # Client
#
# The {Client} class provides one method for each API operation. Operation
# methods each accept a hash of request parameters and return a response
# structure.
#
#     sage_maker = Aws::SageMaker::Client.new
#     resp = sage_maker.add_association(params)
#
# See {Client} for more information.
#
# # Errors
#
# Errors returned from Amazon SageMaker Service are defined in the
# {Errors} module and all extend {Errors::ServiceError}.
#
#     begin
#       # do stuff
#     rescue Aws::SageMaker::Errors::ServiceError
#       # rescues all Amazon SageMaker Service API errors
#     end
#
# See {Errors} for more information.
#
# @!group service
module Aws::SageMaker

  GEM_VERSION = '1.153.0'

end


text:
package org.apache.tinkerpop.gremlin.groovy;

import org.apache.tinkerpop.gremlin.AbstractGremlinSuite;
import org.apache.tinkerpop.gremlin.AbstractGremlinTest;
import org.apache.tinkerpop.gremlin.GraphManager;
import org.apache.tinkerpop.gremlin.groovy.engine.GremlinExecutorOverGraphTest;
import org.apache.tinkerpop.gremlin.groovy.jsr223.GremlinGroovyScriptEngineFileSandboxTest;
import org.apache.tinkerpop.gremlin.groovy.jsr223.GremlinGroovyScriptEngineOverGraphTest;
import org.apache.tinkerpop.gremlin.groovy.jsr223.GremlinGroovyScriptEngineSandboxCustomTest;
import org.apache.tinkerpop.gremlin.groovy.jsr223.GremlinGroovyScriptEngineSandboxedStandardTest;
import org.apache.tinkerpop.gremlin.groovy.jsr223.GremlinGroovyScriptEngineTinkerPopSandboxTest;
import org.apache.tinkerpop.gremlin.groovy.jsr223.GroovyTranslatorTest;
import org.apache.tinkerpop.gremlin.groovy.loaders.SugarLoader;
import org.apache.tinkerpop.gremlin.groovy.loaders.SugarLoaderTest;
import org.apache.tinkerpop.gremlin.groovy.plugin.dsl.credential.CredentialGraphTest;
import org.apache.tinkerpop.gremlin.groovy.util.SugarTestHelper;
import org.apache.tinkerpop.gremlin.process.traversal.TraversalEngine;
import org.apache.tinkerpop.gremlin.structure.Graph;
import org.apache.tinkerpop.gremlin.structure.StructureStandardSuite;
import org.junit.runners.model.InitializationError;
import org.junit.runners.model.RunnerBuilder;

/**
 * The {@code GroovyEnvironmentSuite} is a JUnit test runner that executes the Gremlin Test Suite over a
 * {@link Graph} implementation.  This test suite covers ensures that a vendor implementation is compliant with
 * the Groovy "environment" which will typically ensure that the {@link Graph} will work as expected in the Gremlin
 * Console, Gremlin Server, and other Groovy environments.
 * <p/>
 * For more information on the usage of this suite, please see {@link StructureStandardSuite}.
 *
 * @author Stephen Mallette (http://stephen.genoprime.com)
 */
public class GroovyEnvironmentSuite extends AbstractGremlinSuite {

    /**
     * This list of tests in the suite that will be executed.  Gremlin developers should add to this list
     * as needed to enforce tests upon implementations.
     */
    private static final Class<?>[] allTests = new Class<?>[]{
            CredentialGraphTest.class,
            GremlinGroovyScriptEngineOverGraphTest.class,
            GremlinGroovyScriptEngineSandboxCustomTest.class,
            GremlinGroovyScriptEngineSandboxedStandardTest.class,
            GremlinGroovyScriptEngineTinkerPopSandboxTest.class,
            GremlinGroovyScriptEngineFileSandboxTest.class,
            GremlinExecutorOverGraphTest.class,
            GroovyTranslatorTest.class,
            SugarLoaderTest.class,
    };

    public GroovyEnvironmentSuite(final Class<?> klass, final RunnerBuilder builder) throws InitializationError {
        super(klass, builder, allTests, null, false, TraversalEngine.Type.STANDARD);
    }

    @Override
    public boolean beforeTestExecution(final Class<? extends AbstractGremlinTest> testClass) {
        unloadSugar();
        SugarLoader.load();
        return true;
    }

    @Override
    public void afterTestExecution(final Class<? extends AbstractGremlinTest> testClass) {
        unloadSugar();
    }

    private void unloadSugar() {
        try {
            SugarTestHelper.clearRegistry(GraphManager.getGraphProvider());
        } catch (Exception ex) {
            throw new RuntimeException(ex);
        }
    }
}


text:
<?xml version="1.0"?>
<!--
  Licensed to the Apache Software Foundation (ASF) under one or more
  contributor license agreements.  See the NOTICE file distributed with
  this work for additional information regarding copyright ownership.
  The ASF licenses this file to You under the Apache License, Version 2.0
  (the "License"); you may not use this file except in compliance with
  the License.  You may obtain a copy of the License at

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

  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License.
-->
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>

<configuration>

<!-- Hive Configuration can either be stored in this file or in the hadoop configuration files  -->
<!-- that are implied by Hadoop setup variables.                                                -->
<!-- Aside from Hadoop setup variables - this file is provided as a convenience so that Hive    -->
<!-- users do not have to edit hadoop configuration files (that may be managed as a centralized -->
<!-- resource).                                                                                -->

<!-- Hive Execution Parameters -->

<property>
  <name>javax.jdo.option.ConnectionURL</name>
  <value>jdbc:derby:;databaseName=/var/lib/hive/metastore/metastore_db;create=true</value>
  <description>JDBC connect string for a JDBC metastore</description>
</property>

<property>
  <name>javax.jdo.option.ConnectionDriverName</name>
  <value>org.apache.derby.jdbc.EmbeddedDriver</value>
  <description>Driver class name for a JDBC metastore</description>
</property>

<property>
  <name>hive.metastore.warehouse.dir</name>
  <value>/tmp</value>
  <description>location of default database for the warehouse</description>
</property>
</configuration>


text:
"""Plot the trained multi-task CTC posteriors (TIMIT corpus)."""

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

from os.path import join, abspath, isdir
import sys
import numpy as np
import tensorflow as tf
import yaml
import argparse

import matplotlib
matplotlib.use('Agg')
from matplotlib import pyplot as plt
plt.style.use('ggplot')
import seaborn as sns
sns.set_style("white")
blue = '#4682B4'
orange = '#D2691E'
green = '#006400'

sys.path.append(abspath('../../../'))
from experiments.timit.data.load_dataset_multitask_ctc import Dataset
from experiments.timit.visualization.core.plot.ctc import plot
from models.ctc.multitask_ctc import MultitaskCTC
from utils.directory import mkdir_join

parser = argparse.ArgumentParser()
parser.add_argument('--epoch', type=int, default=-1,
                    help='the epoch to restore')
parser.add_argument('--model_path', type=str,
                    help='path to the model to evaluate')
parser.add_argument('--eval_batch_size', type=str, default=1,
                    help='the size of mini-batch in evaluation')

def do_plot(model, params, epoch, eval_batch_size):
    """Plot the multi-task CTC posteriors.
    Args:
        model: the model to restore
        params (dict): A dictionary of parameters
        epoch (int): the epoch to restore
        eval_batch_size (int): the size of mini-batch in evaluation
    """
    # Load dataset
    test_data = Dataset(
        data_type='test', label_type_main=params['label_type_main'],
        label_type_sub=params['label_type_sub'],
        batch_size=eval_batch_size, splice=params['splice'],
        num_stack=params['num_stack'], num_skip=params['num_skip'],
        sort_utt=False, progressbar=True)

    # Define placeholders
    model.create_placeholders()

    # Add to the graph each operation (including model definition)
    _, logits_main, logits_sub = model.compute_loss(
        model.inputs_pl_list[0],
        model.labels_pl_list[0],
        model.labels_sub_pl_list[0],
        model.inputs_seq_len_pl_list[0],
        model.keep_prob_pl_list[0])
    posteriors_op_main, posteriors_op_sub = model.posteriors(
        logits_main, logits_sub)

    # Create a saver for writing training checkpoints
    saver = tf.train.Saver()

    with tf.Session() as sess:
        ckpt = tf.train.get_checkpoint_state(model.save_path)

        # If check point exists
        if ckpt:
            # Use last saved model
            model_path = ckpt.model_checkpoint_path
            if epoch != -1:
                model_path = model_path.split('/')[:-1]
                model_path = '/'.join(model_path) + '/model.ckpt-' + str(epoch)
            saver.restore(sess, model_path)
            print("Model restored: " + model_path)
        else:
            raise ValueError('There are not any checkpoints.')

        plot(session=sess,
             posteriors_op_main=posteriors_op_main,
             posteriors_op_sub=posteriors_op_sub,
             model=model,
             dataset=test_data,
             label_type_main=params['label_type_main'],
             label_type_sub=params['label_type_sub'],
             num_stack=params['num_stack'],
             save_path=mkdir_join(save_path, 'ctc_output'),
             show=False)

def plot(session, posteriors_op_main, posteriors_op_sub,
         model, dataset, label_type_main, label_type_sub,
         num_stack=1, save_path=None, show=False):
    """Visualize label posteriors of the multi-task CTC model.
    Args:
        session: session of training model
        posteriois_op_main: operation for computing posteriors in the main task
        posteriois_op_sub: operation for computing posteriors in the sub task
        model: model to evaluate
        dataset: An instance of a `Dataset` class
        label_type_main (string): character or character_capital_divide
        label_type_sub (string): phone39 or phone48 or phone61
        num_stack (int): the number of frames to stack
        save_path (string): path to save ctc outpus
        show (bool, optional): if True, show each figure
    """
    # Clean directory
    if isdir(save_path):
        shutil.rmtree(save_path)
        mkdir(save_path)

    for data, is_new_epoch in dataset:

        # Create feed dictionary for next mini batch
        inputs, _, _, inputs_seq_len, input_names = data
        feed_dict = {
            model.inputs_pl_list[0]: inputs,
            model.inputs_seq_len_pl_list[0]: inputs_seq_len,
            model.keep_prob_pl_list[0]: 1.0
        }

        batch_size, max_frame_num = inputs.shape[:2]
        probs_char = session.run(posteriors_op_main, feed_dict=feed_dict)
        probs_phone = session.run(posteriors_op_sub, feed_dict=feed_dict)
        probs_char = probs_char.reshape(-1, max_frame_num, model.num_classes)
        probs_phone = probs_phone.reshape(-1, max_frame_num, model.num_classes)

        # Visualize
        for i_batch in range(batch_size):
            prob_char = probs_char[i_batch][:int(inputs_seq_len[i_batch]), :]
            prob_phone = probs_phone[i_batch][:int(inputs_seq_len[i_batch]), :]

            plt.clf()
            plt.figure(figsize=(10, 4))
            frame_num = int(inputs_seq_len[i_batch])
            times_probs = np.arange(frame_num) * num_stack / 100

            # NOTE: Blank class is set to the last class in TensorFlow
            # Plot characters
            plt.subplot(211)
            for i in range(0, prob_char.shape[-1] - 1, 1):
                plt.plot(times_probs, prob_char[:, i])
            plt.plot(
                times_probs, prob_char[:, -1], ':', label='blank', color='grey')
            plt.xlabel('Time [sec]', fontsize=12)
            plt.ylabel('Characters', fontsize=12)
            plt.xlim([0, frame_num * num_stack / 100])
            plt.ylim([0.05, 1.05])
            plt.xticks(list(range(0, int(frame_num * num_stack / 100) + 1, 1)))
            plt.yticks(list(range(0, 2, 1)))
            plt.legend(loc="upper right", fontsize=12)

            # Plot phones
            plt.subplot(212)
            for i in range(0, prob_phone.shape[-1] - 1, 1):
                plt.plot(times_probs, prob_phone[:, i])
            plt.plot(
                times_probs, prob_phone[:, -1], ':', label='blank', color='grey')
            plt.xlabel('Time [sec]', fontsize=12)
            plt.ylabel('Phones', fontsize=12)
            plt.xlim([0, frame_num])
            plt.ylim([0.05, 1.05])
            plt.xticks(list(range(0, int(frame_num * num_stack / 100) + 1, 1)))
            plt.yticks(list(range(0, 2, 1)))
            plt.legend(loc="upper right", fontsize=12)

            if show:
                plt.show()

            # Save as a png file
            if save_path is not None:
                plt.savefig(
                    join(save_path, input_names[i_batch] + '.png'), dvi=500)

        if is_new_epoch:
            break

def main():

    args = parser.parse_args()

    # Load config file
    with open(os.path.join(args.model_path, 'config.yml'), "r") as f:
        config = yaml.load(f)
        params = config['param']

    # Except for a blank label
    if params['label_type_main'] == 'character':
        params['num_classes_main'] = 28
    elif params['label_type_main'] == 'character_capital_divide':
        params['num_classes_main'] = 72

    if params['label_type_sub'] == 'phone61':
        params['num_classes_sub'] = 61
    elif params['label_type_sub'] == 'phone48':
        params['num_classes_sub'] = 48
    elif params['label_type_sub'] == 'phone39':
        params['num_classes_sub'] = 39

    # Model setting
    model = MultitaskCTC(
        encoder_type=params['encoder_type'],
        input_size=params['input_size'] * params['num_stack'],
        num_units=params['num_units'],
        num_layers_main=params['num_layers_main'],
        num_layers_sub=params['num_layers_sub'],
        num_classes_main=params['num_classes_main'],
        num_classes_sub=params['num_classes_sub'],
        main_task_weight=params['main_task_weight'],
        lstm_impl=params['lstm_impl'],
        use_peephole=params['use_peephole'],
        parameter_init=params['weight_init'],
        clip_grad_norm=params['clip_grad_norm'],
        clip_activation=params['clip_activation'],
        num_proj=params['num_proj'],
        weight_decay=params['weight_decay'])

    model.save_path = args.model_path
    do_plot(model=model, params=params, epoch=args.epoch)

if __name__ == '__main__':
    main()


text:
<?php

/**
 * User Replies Created
 *
 * @package bbPress
 * @subpackage Theme
 */

?>

	<?php do_action( 'bbp_template_before_user_replies' ); ?>

<?php _e( 'Forum Replies Created', 'bbpress' ); ?>

			<?php if ( bbp_get_user_replies_created() ) : ?>

				<?php bbp_get_template_part( 'pagination', 'replies' ); ?>

				<?php bbp_get_template_part( 'loop',       'replies' ); ?>

				<?php bbp_get_template_part( 'pagination', 'replies' ); ?>

			<?php else : ?>

<?php bbp_is_user_home() ? _e( 'You have not replied to any topics.', 'bbpress' ) : _e( 'This user has not replied to any topics.', 'bbpress' ); ?>

			<?php endif; ?>

	<?php do_action( 'bbp_template_after_user_replies' ); ?>


text:
@echo off
pushd %~dp0
"%VS120COMNTOOLS%..\IDE\mstest" /test:Microsoft.Protocols.TestSuites.MS_WOPI.MS_WOPI_S02_Coauth.TestCase_S02_TC08_JoinCoauthoringSession_AllowFallbackToExclusiveIsTrue /testcontainer:..\..\MS-WOPI\TestSuite\bin\Debug\MS-WOPI_TestSuite.dll /runconfig:..\..\MS-WOPI\MS-WOPI.testsettings /unique
pause


text:
package io.opentelemetry.api.common;

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

class ArrayBackedAttributesBuilder implements AttributesBuilder {
  private final List<Object> data;

  ArrayBackedAttributesBuilder() {
    data = new ArrayList<>();
  }

  ArrayBackedAttributesBuilder(List<Object> data) {
    this.data = data;
  }

  @Override
  public Attributes build() {
    // If only one key-value pair AND the entry hasn't been set to null (by #remove(AttributeKey<T>)
    // or #removeIf(Predicate<AttributeKey<?>>)), then we can bypass sorting and filtering
    if (data.size() == 2 && data.get(0) != null) {
      return new ArrayBackedAttributes(data.toArray());
    }
    return ArrayBackedAttributes.sortAndFilterToAttributes(data.toArray());
  }

  @Override
  public <T> AttributesBuilder put(AttributeKey<Long> key, int value) {
    return put(key, (long) value);
  }

  @Override
  public <T> AttributesBuilder put(AttributeKey<T> key, T value) {
    if (key == null || key.getKey().isEmpty() || value == null) {
      return this;
    }
    data.add(key);
    data.add(value);
    return this;
  }

  @Override
  @SuppressWarnings({"unchecked", "rawtypes"})
  public AttributesBuilder putAll(Attributes attributes) {
    if (attributes == null) {
      return this;
    }
    // Attributes must iterate over their entries with matching types for key / value, so this
    // downcast to the raw type is safe.
    attributes.forEach((key, value) -> put((AttributeKey) key, value));
    return this;
  }

  @Override
  public <T> AttributesBuilder remove(AttributeKey<T> key) {
    if (key == null || key.getKey().isEmpty()) {
      return this;
    }
    return removeIf(
        entryKey ->
            key.getKey().equals(entryKey.getKey()) && key.getType().equals(entryKey.getType()));
  }

  @Override
  public AttributesBuilder removeIf(Predicate<AttributeKey<?>> predicate) {
    if (predicate == null) {
      return this;
    }
    for (int i = 0; i < data.size() - 1; i += 2) {
      Object entry = data.get(i);
      if (entry instanceof AttributeKey && predicate.test((AttributeKey<?>) entry)) {
        // null items are filtered out in ArrayBackedAttributes
        data.set(i, null);
        data.set(i + 1, null);
      }
    }
    return this;
  }

  static List<Double> toList(double... values) {
    Double[] boxed = new Double[values.length];
    for (int i = 0; i < values.length; i++) {
      boxed[i] = values[i];
    }
    return Arrays.asList(boxed);
  }

  static List<Long> toList(long... values) {
    Long[] boxed = new Long[values.length];
    for (int i = 0; i < values.length; i++) {
      boxed[i] = values[i];
    }
    return Arrays.asList(boxed);
  }

  static List<Boolean> toList(boolean... values) {
    Boolean[] boxed = new Boolean[values.length];
    for (int i = 0; i < values.length; i++) {
      boxed[i] = values[i];
    }
    return Arrays.asList(boxed);
  }
}


text:
<?php
namespace DreamFactory\Core\SqlDb\Database\Seeds;

use Illuminate\Database\Seeder;
use Illuminate\Database\Eloquent\Model;

class DatabaseSeeder extends Seeder
{
    /**
     * Run the database seeds.
     *
     * @return void
     */
    public function run()
    {
        Model::unguard();

        $this->call(ServiceTypeSeeder::class);
        $this->call(DbTableExtrasSeeder::class);
        $this->call(DbFieldExtrasSeeder::class);
        $this->call(ServiceSeeder::class);
    }
}


text:
[![Build Status](https://travis-ci.org/jeanralphaviles/comment_parser.svg?branch=master)](https://travis-ci.org/jeanralphaviles/comment_parser/branches)
[![PyPI status](https://img.shields.io/pypi/status/comment_parser.svg)](https://pypi.python.org/pypi/comment_parser/)
[![PyPI version shields.io](https://img.shields.io/pypi/v/comment_parser.svg)](https://pypi.python.org/pypi/comment_parser/)
[![PyPI license](https://img.shields.io/pypi/l/comment_parser.svg)](https://pypi.python.org/pypi/comment_parser/)
[![PyPI pyversions](https://img.shields.io/pypi/pyversions/comment_parser.svg)](https://pypi.python.org/pypi/comment_parser/)

Python module used to extract comments from source code files of various types.

## Installation

### Prerequisites

* libmagic

### Linux/Unix

```shell
sudo pip3 install comment_parser
```

### OSX and Windows
Additionally, complete the special installation requirements for
[python-magic](https://github.com/ahupp/python-magic).

## Usage

To use, simply run:

```python
>>> from comment_parser import comment_parser
>>> # Returns a list of comment_parser.parsers.common.Comments
>>> comment_parser.extract_comments('/path/to/source_file')
>>> # Or
>>> comment_parser.extract_comments_from_str('...')
```
### extract_comments signatures

```python
def extract_comments(filename, mime=None):
    """Extracts and returns the comments from the given source file.

    Args:
        filename: String name of the file to extract comments from.
        mime: Optional MIME type for file (str). Note some MIME types accepted
            don't comply with RFC2045. If not given, an attempt to deduce the
            MIME type will occur.
    Returns:
        Python list of parsers.common.Comment in the order that they appear in
            the source file.
    Raises:
        UnsupportedError: If filename is of an unsupported MIME type.
    """
    pass

def extract_comments_from_str(code, mime=None):
    """Extracts and returns comments from the given source string.

    Args:
        code: String containing code to extract comments from.
        mime: Optional MIME type for code (str). Note some MIME types accepted
            don't comply with RFC2045. If not given, an attempt to deduce the
            MIME type will occur.
    Returns:
        Python list of parsers.common.Comment in the order that they appear in
            the source code.
    Raises:
        UnsupportedError: If code is of an unsupported MIME type.
    """
    pass
```
### Comments Interface

```python
class Comment(object):
    """Represents comments found in source files."""
    def text(self):
        """Returns the comment's text.
        Returns:
            String
        """
        pass

    def line_number(self):
        """Returns the line number the comment was found on.
        Returns:
            Int
        """
        pass

    def is_multiline(self):
        """Returns whether this comment was a multiline comment.
        Returns:
            True if comment was a multiline comment, False if not.
        """
       pass

    def __str__(self):
        pass

    def __eq__(self, other):
        pass
```

## Development

### Running locally

Start python3 in the base of repository.

```python
from comment_parser import comment_parser
comment_parser.extract_comments('foo.c', mime='text/x-c')
```

### Running tests

```shell
python3 setup.py test
```

### Running pylint

```shell
pylint comment_parser
```

### Running formatter

```shell
yapf -rip --style=yapf .
```

### Deploying to PyPi

```shell
python3 setup.py sdist
twine upload dist/*
```

## Supported Programming Languages

| Language    | Mime String              |
|------------ |------------------------- |
| C           | text/x-c                 |
| C++/C#      | text/x-c++               |
| Go          | text/x-go                |
| HTML        | text/html                |
| Java        | text/x-java-source       |
| Javascript  | application/javascript   |
| Python      | text/x-python            |
| Python      | text/x-script.python     |
| Ruby        | text/x-ruby              |
| Shell       | text/x-shellscript       |
| XML         | text/xml                 |

And more to come!

*Check comment_parser.py for corresponding MIME types.*


text:
from django.conf.urls import *

from django.contrib import admin
admin.autodiscover()

urlpatterns = patterns('',
    # Examples:
    # url(r'^$', 'MapReduce.views.home', name='home'),
    # url(r'^blog/', include('blog.urls')),
    url(r'^$','MapReduceApp.views.home'),
)


text:
<!DOCTYPE html>

		<meta charset="UTF-8"/>
		<title>Learn to play piano</title>
		<link type="text/css" href="../css/style.css" rel="stylesheet">

Bach gave us God's word.Mozart gave us God's laughter.Beethoven gave us God's fire.God gave us Music that we might pray without words.

How to have fun with piano?

Must Know

How to number your fingers

What to read between lines & spaces

When is the best time to start

Useful links

Send a message

Purpose, Audience & Goal

Purpose

This website is to give preliminary information for people who are interested in learning piano.

Audience

This site is designed for absolute beginners to take the first step on learning piano. Also for parents who are interested to have some basic ideas for their children's piano journey.

Goal

 The goal is to reach people who like to learn and enjoy playing piano and encourage them to take first step with some fundamental information.

Persona

Name: David Wang

Age: 44

Status: David Wang and his wife both have full jobs. While they are busy with their own works, they still need to take care of their three young children. They have heard of many good benefits for their children to have piano lessons. But for their busy working schedule, they only have few minutes at night after their children go to bed to do the research.

Goal: This website can provide key information of how to start up, basic music theory and how to apply it on keyboards in a fast and effective way.

Use Case

David wang and his wife have been doing researches online for a while to find a way to take the first step of their children's piano lessons. The amount of information is huge. For they only have very little knowledge about piano and music, the overwhelming information makes it very difficult for them to make a final decision. When they find this website, because it has designed for absolute beginners and parents or grand parents who have no music background to take the first step. They fell this is a useful website for them.


text:
This package contains utility classes and in particular:

classes for handling properties in an extended way (see the Tutorial),

the Logger class for logging capabilities;

the leap subpackage, that is a replacement for
the Java collection framework that is not supported by J2ME.


text:
/********** Piece **********/
.piece {
    width: 30px;
    height: 30px;
    border-radius: 23px;
    display: inline-block;
    border: transparent 1px solid;
    box-shadow: 2px 5px 5px rgba(0, 0, 0, 0.5);
    background-size: cover;
}

.piece[data-color=white] { background-color: white; border-color: black; }
.piece[data-color=lightgrey] { background-color: lightgrey; border-color: black; }
.piece[data-color=grey] { background-color: grey;  border-color: black;}
.piece[data-color=darkgrey] { background-color: darkgrey;  border-color: black;}
.piece[data-color=black] { background-color: black;  border-color: white;}
.piece[data-color=red] { background-color: red;  border-color: black;}
.piece[data-color=blue] { background-color: blue;  border-color: black;}
.piece[data-color=green] { background-color: green;  border-color: black;}
.piece[data-color=yellow] { background-color: yellow;  border-color: black;}
.piece[data-color=pink] { background-color: pink;  border-color: black;}
.piece[data-color=lightgreen] { background-color: lightgreen;  border-color: black;}
.piece[data-color=lightblue] { background-color: lightblue;  border-color: black;}

.piece.icon {
    position: relative;
    border-width: 4px;
    background-color: inherit;
}

.piece.icon .data {
    position: absolute;
    opacity: 0;
    top: 18px;
    left: 34px;
    text-align: left;
    transition: opacity 0.4s ease-in-out;
    white-space: nowrap;
    border-bottom: 1px solid;
    border-color: inherit;
    background: white;
}

.piece.icon:hover .data {
    opacity: 1;
}

/********** Button **********/
.btn {
    padding: 5px;
    text-align: center;
}
.btn > svg {
    width: 16px;
    height: 16px;
}
.btn > svg > g {
    transform: translate(8px, 8px);
}
.btn > svg > g rect,
.btn > svg > g polygon {
    fill: dimgray;
}

/********** Client Layout **********/
html, body {
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
}
body {
    display: flex;
    flex-direction: column;
}
body > main {
    flex: 1 1 auto;
    overflow: auto;
}
body > header,
body > main,
body > footer {
    text-align: center;
}

/********** Board **********/
main {
    background-color: lightgrey;
}
#board {
    background-color: white;
    background-repeat: no-repeat no-repeat;
    background-size: contain;
}

/********** Board Animation **********/
#board {
    transition: all 0.2s ease-in-out;
}

/********** Pieces on Board **********/
#board {
    display: inline-block;
    position: relative;
    z-index: 0;
}
#board .piece {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1;
}
#board .piece.dragging {
    z-index: -1;
}

@media only screen and (max-width: 992px) {
    #nav-mobile input[type=text],
    #nav-mobile input[type=checkbox] + label {
        color: black;
    }
}


text:
import { Map } from 'App/Module/Map';
import { Tracker } from 'App/Service/Tracker';

export class TrackerMap extends Map
{
	constructor()
	{
		super();
		this.tracker = Tracker.getInstance();
	}
}


text:
package de.akquinet.gomobile.deploymentadmin;

import java.util.BitSet;
import java.util.jar.Attributes;

import org.osgi.service.deploymentadmin.DeploymentException;

/**
 * Objects of this class represent the meta data for a resource from a deployment package, this
 * can be either bundle resources or processed resources.
 */
public class AbstractInfo {

    private static final BitSet VALID_RESOURCE_PATH_CHARS;
    static
    {
        VALID_RESOURCE_PATH_CHARS = new BitSet();
        for ( int i = 'a'; i <= 'z'; i++ )
        {
            VALID_RESOURCE_PATH_CHARS.set( i );
        }
        for ( int i = 'A'; i <= 'Z'; i++ )
        {
            VALID_RESOURCE_PATH_CHARS.set( i );
        }
        for ( int i = '0'; i <= '9'; i++ )
        {
            VALID_RESOURCE_PATH_CHARS.set( i );
        }
        VALID_RESOURCE_PATH_CHARS.set( '.' );
        VALID_RESOURCE_PATH_CHARS.set( '-' );
        VALID_RESOURCE_PATH_CHARS.set( '_' );
        VALID_RESOURCE_PATH_CHARS.set( '/' );
    }

    private final String m_path;
    private final Attributes m_attributes;
    private final boolean m_missing;

    /**
     * Create an instance
     *
     * @param path Resource-id aka path of the resource
     * @param attributes Attributes containing the meta data of the resource
     * @throws DeploymentException If the specified attributes do not match the correct syntax for a deployment package resource.
     */
    public AbstractInfo(String path, Attributes attributes) throws DeploymentException {
        verifyEntryName(path);
        m_path = path;
        m_attributes = attributes;
        m_missing = parseBooleanHeader(attributes, Constants.DEPLOYMENTPACKAGE_MISSING);
    }

    /**
     * @return The path of the resource
     */
    public String getPath() {
        return m_path;
    }

    /**
     * Return the value of a header for this resource
     * @param header Name of the header
     * @return Value of the header specified by the given header name
     */
    public String getHeader(String header) {
        return m_attributes.getValue(header);
    }

    private void verifyEntryName(String name) throws DeploymentException {
        byte[] bytes = name.getBytes();
        boolean delimiterSeen = false;
        for(int j = 0; j < bytes.length; j++) {
            if(!VALID_RESOURCE_PATH_CHARS.get(bytes[j])) {
                throw new DeploymentException(DeploymentException.CODE_BAD_HEADER, "Resource ID '" + name +"' contains invalid character(s)");
            }
            if (bytes[j] == '/') {
                if (delimiterSeen) {
                    throw new DeploymentException(DeploymentException.CODE_BAD_HEADER, "Resource ID '" + name +"' contains multiple consequetive path seperators");
                } else {
                    delimiterSeen = true;
                }
            } else {
                delimiterSeen = false;
            }
        }
    }

    /**
     * Determine if a resource is missing or not
     * @return True if the actual data for this resource is not present, false otherwise
     */
    public boolean isMissing() {
        return m_missing;
    }

    /**
     * Parses a header that is allowed to have only boolean values.
     *
     * @param attributes Set of attributes containing the header
     * @param header The header to verify
     * @return true if the value of the header was "true", false if the value was "false"
     * @throws DeploymentException if the value was not "true" or "false"
     */
    protected boolean parseBooleanHeader(Attributes attributes, String header) throws DeploymentException {
        String value = attributes.getValue(header);
        if (value != null) {
            if ("true".equals(value)) {
                return true;
            } else if ("false".equals(value)){
                return false;
            } else {
                throw new DeploymentException(DeploymentException.CODE_BAD_HEADER, "Invalid '" + header + "' header for manifest " +
                    "entry '" + getPath() + "' header, should be either 'true' or 'false' or not present");
            }
        }
        return false;
    }

}


text:
function noopHandler(evt) {
  evt.stopPropagation();
  evt.preventDefault();
}

var redirect = false;

function drop(evt) {
	evt.stopPropagation();
	evt.preventDefault();

	var files = evt.dataTransfer.files;
	var count = files.length;

	// Only call the handler if 1 or more files was dropped.
	if (count == 1)
	{
		var file = files[0];

		var form = new FormData();
		form.append("addFile", "1");
		form.append("upldFile", file);

		calque=document.createElement('div');
		calque.id="loading";
		calque.innerHTML = '

0%
';
		document.body.appendChild(calque);

		var xhr = new XMLHttpRequest();

		console.log('Adding on progress');
		xhr.upload.onprogress = function(evt) {
		  console.log('loading');
		  console.log(evt.lengthComputable);
		  if (evt.lengthComputable)
		  {
		    var par = document.getElementById('p_progress');
		    var percentComplete = Math.round((evt.loaded / evt.total)*100);
		    console.log(percentComplete);
		    par.innerHTML = percentComplete+'%'
		  }

		}

		xhr.onload = function() {
			if(redirect){
				window.location = "admin.php?lien="+encodeURI(xhr.responseText);
			}else{
			  setChampAdminForm("c_lien",xhr.responseText);
			  makeChampAdminFormEditable("c_lien");
			}
			console.log("Upload complete.");
			calque.style.display="none";
		};
		xhr.open("post", "upload.php", true);
		xhr.send(form);
 	}
}

function initialisePassiveDrop()
{
	var dropbox = document.body;

	// init event handlers
	dropbox.addEventListener("dragenter", noopHandler, false);
	dropbox.addEventListener("dragexit", noopHandler, false);
	dropbox.addEventListener("dragover", noopHandler, false);
	dropbox.addEventListener("drop", drop, false);

	redirect = false;

	//dropbox.innerHTML = "Drop article pdf here...";
}

function initialiseActiveDrop()
{
	var dropbox = document.body;

	// init event handlers
	dropbox.addEventListener("dragenter", noopHandler, false);
	dropbox.addEventListener("dragexit", noopHandler, false);
	dropbox.addEventListener("dragover", noopHandler, false);
	dropbox.addEventListener("drop", drop, false);

	redirect = true;

	//dropbox.innerHTML = "Drop article pdf here...";
}


text:
//========================================================================
//Copyright 2004-2008 Mort Bay Consulting Pty. Ltd.
//------------------------------------------------------------------------
//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.
//========================================================================

package org.mortbay.jetty;
import java.io.IOException;
import java.nio.channels.SelectionKey;
import java.nio.channels.SocketChannel;

import org.mortbay.io.Buffer;
import org.mortbay.io.View;
import org.mortbay.io.nio.IndirectNIOBuffer;
import org.mortbay.io.nio.NIOBuffer;
import org.mortbay.io.nio.SelectChannelEndPoint;
import org.mortbay.io.nio.SelectorManager.SelectSet;
import org.mortbay.jetty.nio.SelectChannelConnector;

/**
 * HttpServer Tester.
 */
public class BusySelectChannelServerTest extends HttpServerTestBase
{
    public BusySelectChannelServerTest()
    {
        super(new SelectChannelConnector()
        {
            /* ------------------------------------------------------------ */
            /* (non-Javadoc)
             * @see org.mortbay.jetty.nio.SelectChannelConnector#newEndPoint(java.nio.channels.SocketChannel, org.mortbay.io.nio.SelectorManager.SelectSet, java.nio.channels.SelectionKey)
             */
            protected SelectChannelEndPoint newEndPoint(SocketChannel channel, SelectSet selectSet, SelectionKey key) throws IOException
            {
                return new ConnectorEndPoint(channel,selectSet,key)
                {
                    int write;
                    int read;
                    NIOBuffer one = new IndirectNIOBuffer(1);
                    NIOBuffer two = new IndirectNIOBuffer(2);
                    NIOBuffer three = new IndirectNIOBuffer(3);

                    /* ------------------------------------------------------------ */
                    /* (non-Javadoc)
                     * @see org.mortbay.io.nio.SelectChannelEndPoint#flush(org.mortbay.io.Buffer, org.mortbay.io.Buffer, org.mortbay.io.Buffer)
                     */
                    public int flush(Buffer header, Buffer buffer, Buffer trailer) throws IOException
                    {
                        int x=write++&0xff;
                        if (x<16)
                            return 0;
                        if (x<128)
                            return flush(header);
                        return super.flush(header,buffer,trailer);
                    }

                    /* ------------------------------------------------------------ */
                    /* (non-Javadoc)
                     * @see org.mortbay.io.nio.SelectChannelEndPoint#flush(org.mortbay.io.Buffer)
                     */
                    public int flush(Buffer buffer) throws IOException
                    {
                        int x=write++&0xff;
                        if (x<16)
                            return 0;
                        if (x<96)
                        {
                            View v = new View(buffer);
                            v.setPutIndex(v.getIndex()+1);
                            int l=super.flush(v);
                            if (l>0)
                                buffer.skip(l);
                            return l;
                        }
                        return super.flush(buffer);
                    }

                    /* ------------------------------------------------------------ */
                    /* (non-Javadoc)
                     * @see org.mortbay.io.nio.ChannelEndPoint#fill(org.mortbay.io.Buffer)
                     */
                    public int fill(Buffer buffer) throws IOException
                    {
                        int x=read++&0xff;
                        if (x<32)
                            return 0;

                        if (x<64 & buffer.space()>0)
                        {
                            one.clear();
                            int l=super.fill(one);
                            if (l>0)
                                buffer.put(one.peek(0));
                            return l;
                        }

                        if (x<96 & buffer.space()>0)
                        {
                            two.clear();
                            int l=super.fill(two);
                            if (l>0)
                                buffer.put(two.peek(0));
                            if (l>1)
                                buffer.put(two.peek(1));
                            return l;
                        }

                        if (x<128 & buffer.space()>0)
                        {
                            three.clear();
                            int l=super.fill(three);
                            if (l>0)
                                buffer.put(three.peek(0));
                            if (l>1)
                                buffer.put(three.peek(1));
                            if (l>2)
                                buffer.put(three.peek(2));
                            return l;
                        }

                        return super.fill(buffer);
                    }

                };
            }

        });
    }
}


text:
import io
import json
import os
import sys
import traceback

from collections import OrderedDict
from contextlib import contextmanager

from compliance_checker.suite import CheckSuite

# Py 3.4+ has contextlib.redirect_stdout to redirect stdout to a different
# stream, but use this decorated function in order to redirect output in
# previous versions
@contextmanager
def stdout_redirector(stream):
    old_stdout = sys.stdout
    sys.stdout = stream
    try:
        yield
    finally:
        sys.stdout = old_stdout

class ComplianceChecker(object):
    """
    Compliance Checker runner class.

    Ties together the entire compliance checker framework, is used from
    the command line or can be used via import.
    """

    # Consider using __init__ instead of so many classmethods
    @classmethod
    def run_checker(
        cls,
        ds_loc,
        checker_names,
        verbose,
        criteria,
        skip_checks=None,
        include_checks=None,
        output_filename="-",
        output_format=["text"],
        options=None,
    ):
        """
        Static check runner.

        @param  ds_loc          Dataset location (url or file)
        @param  checker_names   List of string names to run, should match keys of checkers dict (empty list means run all)
        @param  verbose         Verbosity of the output (0, 1, 2)
        @param  criteria        Determines failure (lenient, normal, strict)
        @param  output_filename Path to the file for output
        @param  skip_checks     Names of checks to skip
        @param  include_checks  Names of checks to include
        @param  output_format   Format of the output(s)

        @returns                If the tests failed (based on the criteria)
        """
        all_groups = []
        cs = CheckSuite(options=options or {})
        # using OrderedDict is important here to preserve the order
        # of multiple datasets which may be passed in
        score_dict = OrderedDict()
        if not isinstance(ds_loc, str):
            locs = ds_loc
        # if single dataset, put in list
        else:
            locs = [ds_loc]

        # Make sure output format is a list
        if isinstance(output_format, str):
            output_format = [output_format]

        for loc in locs:  # loop through each dataset and run specified checks
            ds = cs.load_dataset(loc)
            if include_checks:
                skip_flag = False
                checks_to_run = include_checks
            else:
                skip_flag = True
                checks_to_run = skip_checks

            score_groups = cs.run(ds, checks_to_run, skip_flag, *checker_names)
            for group in score_groups.values():
                all_groups.append(group[0])
            # TODO: consider wrapping in a proper context manager instead
            if hasattr(ds, "close"):
                ds.close()

            if not score_groups:
                raise ValueError(
                    "No checks found, please check the name of the checker(s) and that they are installed"
                )
            else:
                score_dict[loc] = score_groups

        # define a score limit to truncate the output to the strictness level
        # specified by the user
        if criteria == "normal":
            limit = 2
        elif criteria == "strict":
            limit = 1
        elif criteria == "lenient":
            limit = 3

        for out_fmt in output_format:
            if out_fmt == "text":
                if output_filename == "-":
                    cls.stdout_output(cs, score_dict, verbose, limit)
                # need to redirect output from stdout since print functions are
                # presently used to generate the standard report output
                else:
                    if len(output_format) > 1:
                        # Update file name if needed
                        output_filename = "{}.txt".format(
                            os.path.splitext(output_filename)[0]
                        )
                    with io.open(output_filename, "w", encoding="utf-8") as f:
                        with stdout_redirector(f):
                            cls.stdout_output(cs, score_dict, verbose, limit)

            elif out_fmt == "html":
                # Update file name if needed
                if len(output_format) > 1 and output_filename != "-":
                    output_filename = "{}.html".format(
                        os.path.splitext(output_filename)[0]
                    )
                cls.html_output(cs, score_dict, output_filename, ds_loc, limit)

            elif out_fmt in {"json", "json_new"}:
                # Update file name if needed
                if len(output_format) > 1 and output_filename != "-":
                    output_filename = "{}.json".format(
                        os.path.splitext(output_filename)[0]
                    )
                cls.json_output(cs, score_dict, output_filename, ds_loc, limit,
                                out_fmt)

            else:
                raise TypeError("Invalid format %s" % out_fmt)

            errors_occurred = cls.check_errors(score_groups, verbose)

        return (
            all(cs.passtree(groups, limit) for groups in all_groups),
            errors_occurred,
        )

    @classmethod
    def stdout_output(cls, cs, score_dict, verbose, limit):
        """
        Calls output routine to display results in terminal, including scoring.
        Goes to verbose function if called by user.

        @param cs           Compliance Checker Suite
        @param score_dict   Dict with dataset name as key, list of results as
                            value
        @param verbose      Integer value for verbosity level
        @param limit        The degree of strictness, 1 being the strictest, and going up from there.
        """

        for ds, score_groups in score_dict.items():
            for checker, rpair in score_groups.items():
                groups, errors = rpair
                score_list, points, out_of = cs.standard_output(
                    ds, limit, checker, groups
                )
                # send list of grouped result objects to stdout & reasoning_routine
                cs.standard_output_generation(
                    groups, limit, points, out_of, check=checker
                )
        return groups

    @classmethod
    def html_output(cls, cs, score_dict, output_filename, ds_loc, limit):
        """
        Generates rendered HTML output for the compliance score(s)
        @param cs              Compliance Checker Suite
        @param score_groups    List of results
        @param output_filename The file path to output to
        @param ds_loc          List of source datasets
        @param limit           The degree of strictness, 1 being the strictest, and going up from there.
        """
        checkers_html = []
        for ds, score_groups in score_dict.items():
            for checker, (groups, errors) in score_groups.items():
                checkers_html.append(cs.checker_html_output(checker, groups, ds, limit))

        html = cs.html_output(checkers_html)
        if output_filename == "-":
            print(html)
        else:
            with io.open(output_filename, "w", encoding="utf8") as f:
                f.write(html)

        return groups

    @classmethod
    def json_output(
        cls, cs, score_dict, output_filename, ds_loc, limit, output_type="json"
    ):
        """
        Generates JSON output for the ocmpliance score(s)
        @param cs              Compliance Checker Suite
        @param score_groups    List of results
        @param output_filename The file path to output to
        @param ds_loc          List of source datasets
        @param limit           The degree of strictness, 1 being the strictest,
                               and going up from there.
        @param output_type     Either 'json' or 'json_new'. json_new is the new
                               json output format that supports multiple datasets
        """
        results = {}
        # json output keys out at the top level by
        if len(score_dict) > 1 and output_type != "json_new":
            raise ValueError(
                "output_type must be set to 'json_new' if outputting multiple datasets to a single json file or stdout"
            )

        if output_type == "json":
            for ds, score_groups in score_dict.items():
                for checker, rpair in score_groups.items():
                    groups, errors = rpair
                    results[checker] = cs.dict_output(
                        checker,
                        groups,
                        ds,
                        limit,
                    )
        elif output_type == "json_new":
            for ds, score_groups in score_dict.items():
                for checker, rpair in score_groups.items():
                    groups, errors = rpair
                    results[ds] = {}
                    results[ds][checker] = cs.dict_output(checker, groups, ds, limit)
        json_results = json.dumps(results, indent=2, ensure_ascii=False)

        if output_filename == "-":
            print(json_results)
        else:
            with io.open(output_filename, "w", encoding="utf8") as f:
                f.write(json_results)

        return groups

    @classmethod
    def check_errors(cls, score_groups, verbose):
        """
        Reports any errors (exceptions) that occurred during checking to stderr.
        Goes to verbose function if called by user.

        @param score_groups List of results
        @param verbose      Integer value for verbosity level
        """
        errors_occurred = False
        for checker, rpair in score_groups.items():
            errors = rpair[-1]
            if len(errors):
                errors_occurred = True
                print(
                    "WARNING: The following exceptions occurred during the %s checker (possibly indicate compliance checker issues):"
                    % checker,
                    file=sys.stderr,
                )
                for check_name, epair in errors.items():
                    print(
                        "%s.%s: %s" % (checker, check_name, epair[0]), file=sys.stderr
                    )

                    if verbose > 0:
                        traceback.print_tb(
                            epair[1].tb_next.tb_next
                        )  # skip first two as they are noise from the running itself @TODO search for check_name
                        print(file=sys.stderr)

        return errors_occurred


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
Revis. gen. pl. (Leipzig) 3(2): 534 (1898)

#### Original name
Teichospora rhamni Fabre

### Remarks
null


text:
define(['Global'], function(G){
	var idCount = 0;
	return [
		{id: idCount++, name: 'cheat', title:'Cheat!', cost: {food :1}, income: {food: 10000, wood: 10000}, unlocked: G.variables.developmentMode, description: 'Gain loads of everything'},
		{id: idCount++, name: 'forage', title:'Forage', cooldown: 1000, income: {food: 1}, unlocked: true, description: 'Forage for food.'},
		{id: idCount++, name: 'chopWood', title:'Chop wood', cooldown: 1000, income: {wood: 1}, unlocked:false, description: 'Cut down some trees.'}
	];
});


text:
namespace switches {
const char kAuthCodeSwitchName[] = "authcode";
const char kHelpSwitchName[] = "help";
const char kHostNameSwitchName[] = "hostname";
const char kLoggingLevelSwitchName[] = "verbosity";
const char kRefreshTokenPathSwitchName[] = "refresh-token-path";
const char kSingleProcessTestsSwitchName[] = "single-process-tests";
const char kUserNameSwitchName[] = "username";
}

namespace {
const char kChromotingAuthScopeValues[] =
    "https://www.googleapis.com/auth/chromoting "
    "https://www.googleapis.com/auth/googletalk "
    "https://www.googleapis.com/auth/userinfo.email";

std::string GetAuthorizationCodeUri() {
  // Replace space characters with a '+' sign when formatting.
  bool use_plus = true;
  return base::StringPrintf(
      "https://accounts.google.com/o/oauth2/auth"
      "?scope=%s"
      "&redirect_uri=https://chromoting-oauth.talkgadget.google.com/"
      "talkgadget/oauth/chrome-remote-desktop/dev"
      "&response_type=code"
      "&client_id=%s"
      "&access_type=offline"
      "&approval_prompt=force",
      net::EscapeUrlEncodedData(kChromotingAuthScopeValues, use_plus).c_str(),
      net::EscapeUrlEncodedData(
          google_apis::GetOAuth2ClientID(google_apis::CLIENT_REMOTING),
          use_plus).c_str());
}

void PrintUsage() {
  printf("\n************************************\n");
  printf("*** Chromoting Test Driver Usage ***\n");
  printf("************************************\n");

  printf("\nUsage:\n");
  printf("  chromoting_test_driver --username=<example@gmail.com> [options]"
         " --hostname=<example hostname>\n");
  printf("\nRequired Parameters:\n");
  printf("  %s: Specifies which account to use when running tests\n",
         switches::kUserNameSwitchName);
  printf("  %s: Specifies which host to connect to when running tests\n",
         switches::kHostNameSwitchName);
  printf("\nOptional Parameters:\n");
  printf("  %s: Exchanged for a refresh and access token for authentication\n",
         switches::kAuthCodeSwitchName);
  printf("  %s: Displays additional usage information\n",
         switches::kHelpSwitchName);
  printf("  %s: Path to a JSON file containing username/refresh_token KVPs\n",
         switches::kRefreshTokenPathSwitchName);
  printf("  %s: Specifies the optional logging level of the tool (0-3)."
         " [default: off]\n",
      switches::kLoggingLevelSwitchName);
}

void PrintAuthCodeInfo() {
  printf("\n*******************************\n");
  printf("*** Auth Code Example Usage ***\n");
  printf("*******************************\n\n");

  printf("If this is the first time you are running the tool,\n");
  printf("you will need to provide an authorization code.\n");
  printf("This code will be exchanged for a long term refresh token which\n");
  printf("will be stored locally and used to acquire a short lived access\n");
  printf("token to connect to the remoting service apis and establish a\n");
  printf("remote host connection.\n\n");

  printf("Note: You may need to repeat this step if the stored refresh token");
  printf("\n      has been revoked or expired.\n");
  printf("      Passing in the same auth code twice will result in an error\n");

  printf("\nFollow these steps to produce an auth code:\n"
         " - Open the Authorization URL link shown below in your browser\n"
         " - Approve the requested permissions for the tool\n"
         " - Copy the 'code' value in the redirected URL\n"
         " - Run the tool and pass in copied auth code as a parameter\n");

  printf("\nAuthorization URL:\n");
  printf("%s\n", GetAuthorizationCodeUri().c_str());

  printf("\nRedirected URL Example:\n");
  printf("https://chromoting-oauth.talkgadget.google.com/talkgadget/oauth/"
         "chrome-remote-desktop/dev?code=4/AKtf...\n");

  printf("\nTool usage example with the newly created auth code:\n");
  printf("chromoting_test_driver --%s=example@gmail.com --%s=example_host_name"
         " --%s=4/AKtf...\n\n",
         switches::kUserNameSwitchName,
         switches::kHostNameSwitchName,
         switches::kAuthCodeSwitchName);
}

void PrintJsonFileInfo() {
  printf("\n****************************************\n");
  printf("*** Refresh Token File Example Usage ***\n");
  printf("****************************************\n\n");

  printf("In order to use this option, a valid JSON file must exist, be\n");
  printf("properly formatted, and contain a username/token KVP.\n");
  printf("Contents of example_file.json\n");
  printf("{\n");
  printf("  \"username1@fauxdomain.com\": \"1/3798Gsdf898shksdvfyi8sshad\",\n");
  printf("  \"username2@fauxdomain.com\": \"1/8974sdf87asdgadfgaerhfRsAa\",\n");
  printf("}\n\n");

  printf("\nTool usage example:\n");
  printf("chromoting_test_driver --%s=%s --%s=example_host_name"
         " --%s=./example_file.json\n\n",
         switches::kUserNameSwitchName, "username1@fauxdomain.com",
         switches::kHostNameSwitchName, switches::kRefreshTokenPathSwitchName);
}

}  // namespace

void OnHostlistRetrieved(
    base::Closure done_closure,
    std::vector<remoting::test::HostInfo>* hostlist,
    const std::vector<remoting::test::HostInfo>& retrieved_hostlist) {

  VLOG(1) << "OnHostlistRetrieved() Called";

  DCHECK(hostlist);

  *hostlist = retrieved_hostlist;

  VLOG(1) << "There are " << hostlist->size() << " hosts in the hostlist";

  done_closure.Run();
}

void OnAccessTokenRetrieved(
    base::Closure done_closure,
    std::string* access_token,
    const std::string& retrieved_access_token,
    const std::string& retrieved_refresh_token) {

  VLOG(1) << "OnAccessTokenRetrieved() Called";
  VLOG(1) << "Access Token: " << retrieved_access_token;

  *access_token = retrieved_access_token;

  done_closure.Run();
}

int main(int argc, char* argv[]) {
  testing::InitGoogleTest(&argc, argv);
  base::TestSuite test_suite(argc, argv);

  base::CommandLine* command_line = base::CommandLine::ForCurrentProcess();
  DCHECK(command_line);

  // Do not retry if tests fails.
  command_line->AppendSwitchASCII(switches::kTestLauncherRetryLimit, "0");

  // Different tests may require access to the same host if run in parallel.
  // To avoid shared resource contention, tests will be run one at a time.
  command_line->AppendSwitch(switches::kSingleProcessTestsSwitchName);

  if (command_line->HasSwitch(switches::kHelpSwitchName)) {
    PrintUsage();
    PrintJsonFileInfo();
    PrintAuthCodeInfo();
    return 0;
  }

  // Update the logging verbosity level is user specified one.
  std::string verbosity_level(
      command_line->GetSwitchValueASCII(switches::kLoggingLevelSwitchName));
  if (!verbosity_level.empty()) {
    // Turn on logging for the test_driver and remoting components.
    // This switch is parsed during logging::InitLogging.
    command_line->AppendSwitchASCII("vmodule",
                                    "*/remoting/*=" + verbosity_level);
    logging::LoggingSettings logging_settings;
    logging::InitLogging(logging_settings);
  }

  // The username is used to run the tests and determines which refresh token to
  // select in the refresh token file.
  std::string username =
      command_line->GetSwitchValueASCII(switches::kUserNameSwitchName);

  if (username.empty()) {
    LOG(ERROR) << "No username passed in, can't authenticate or run tests!";
    return -1;
  }
  VLOG(1) << "Running chromoting tests as: " << username;

  // Check to see if the user passed in a one time use auth_code for
  // refreshing their credentials.
  std::string auth_code =
      command_line->GetSwitchValueASCII(switches::kAuthCodeSwitchName);

  base::FilePath refresh_token_path =
     command_line->GetSwitchValuePath(switches::kRefreshTokenPathSwitchName);

  // The hostname determines which host to initiate a session with from the list
  // returned from the directory service.
  std::string hostname =
      command_line->GetSwitchValueASCII(switches::kHostNameSwitchName);

  if (hostname.empty()) {
    LOG(ERROR) << "No hostname passed in, connect to host requires hostname!";
    return -1;
  }
  VLOG(1) << "Chromoting tests will connect to: " << hostname;

  // TODO(TonyChun): Move this logic into a shared environment class.
  scoped_ptr<remoting::test::RefreshTokenStore> refresh_token_store =
      remoting::test::RefreshTokenStore::OnDisk(username, refresh_token_path);

  std::string refresh_token = refresh_token_store->FetchRefreshToken();
  if (auth_code.empty() && refresh_token.empty()) {
    // RefreshTokenStore already logs which specific error occured.
    return -1;
  }

  // Used for running network request tasks.
  // TODO(TonyChun): Move this logic into a shared environment class.
  base::MessageLoopForIO message_loop;

  // Uses the refresh token to get the access token from GAIA.
  remoting::test::AccessTokenFetcher access_token_fetcher;

  // A RunLoop that yields to the thread's MessageLoop.
  scoped_ptr<base::RunLoop> run_loop;

  // RunLoop to handle callback from GAIA.
  run_loop.reset(new base::RunLoop());

  std::string access_token;
  remoting::test::AccessTokenCallback access_token_callback =
      base::Bind(&OnAccessTokenRetrieved,
                 run_loop->QuitClosure(),
                 &access_token);

  if (!auth_code.empty()) {
    access_token_fetcher.GetAccessTokenFromAuthCode(auth_code,
                                                    access_token_callback);
  } else {
    DCHECK(!refresh_token.empty());
    access_token_fetcher.GetAccessTokenFromRefreshToken(refresh_token,
                                                        access_token_callback);
  }

  run_loop->Run();

  // RunLoop to handle callback from directory service.
  run_loop.reset(new base::RunLoop());

  std::vector<remoting::test::HostInfo> hostlist;
  remoting::test::HostListFetcher::HostlistCallback hostlist_request_callback =
      base::Bind(&OnHostlistRetrieved, run_loop->QuitClosure(), &hostlist);

  // Uses the access token to get the hostlist from the directory service.
  remoting::test::HostListFetcher hostlist_fetcher;
  hostlist_fetcher.RetrieveHostlist(access_token, hostlist_request_callback);

  run_loop->Run();

  return 0;
}


text:
import re
import irc
import var
import ini
import time
import feed
import handler

###########################################
#    Determining whether services will    #
#    be using STATUS or ACC for auth      #
#    check.                               #
###########################################

def set_auth_method ():
    irc.msg("NickServ", "STATUS {}".format(irc.botnick), raw = True)
    response = ""

    while not response:
        for message in feed.s_out():
            if not response and message.startswith(":NickServ"):
                response = message
            else:
                handler.read(message)

    if "STATUS" in response:
        var.settings["ident.method"] = "STATUS"
        ini.add_to_ini("Settings", "ident.method", "STATUS", "settings.ini")
    else:
        var.settings["ident.method"] = "ACC"
        ini.add_to_ini("Settings", "ident.method", "ACC", "settings.ini")

###########################################
#          NickServ auth check.           #
###########################################

def is_identified (user):

    # Check if --no-auth flag was used.
    if var.no_auth:
        return True

    # Determine auth command with services.
    if "ident.method" not in var.settings:
        set_auth_method()

    # Send set auth command.
    irc.msg("NickServ", "{} {}".format(var.settings["ident.method"], user), raw = True)
    response = ""

    while not response:
        for message in feed.s_out():
            if message.startswith(":NickServ"):
                response = message
            else:
                handler.read(message)

    # Checking with ident.method for NickServ auth.
    if var.settings["ident.method"] == "STATUS":
        return bool("STATUS {} 3".format(user) in response)
    elif var.settings["ident.method"] == "ACC":
        return bool("{} ACC 3".format(user) in response)

###########################################
#       Check if num is an integer.       #
###########################################

def is_number (num):
    try:
        int(num)
        return True
    except ValueError:
        return False

###########################################
#         Check if nick is valid.         #
###########################################

def nick_check ():
    # We'll give the server a 5 seconds window to reply.
    irc.ircsock.settimeout(5)

    try:
        msg_list = feed.s_out()
    except socket.timeout:
        msg_list = []

    for msg in msg_list:
        try:
            # Nick already in use, according to RFC 1459
            if msg.split()[1] == "433":
                return True
            # Erroneous nickname, according to RFC 1459
            elif msg.split()[1] == "432":
                return True
            else:
                handler.read(msg)
        except IndexError:
            handler.read(msg)

    irc.ircsock.settimeout(irc.timeout)
    return False

###########################################
#        Checking users's prefix.         #
###########################################

# Check prefix for user in channel.
def prefix (user, channel):
    irc.ircsock.send("NAMES {}\n".format(channel))
    prefix, loop = [], True

    while loop:
        for message in feed.s_out():
            if re.match(":[^\s]+ \d{3} " + "{} [@|*|=] {}".format(irc.botnick, channel), message):
                prefix += filter(bool, message.split(" :", 1)[1].split(" "))
            elif message.endswith("{} {} :End of /NAMES list.".format(irc.botnick, channel)):
                loop = False
            else:
                handler.read(message)

    # Now that the list is complete, let's make a dictionary.
    prefix = {nick[1:] if len(nick) > 1 else nick[0]:nick[0] for nick in prefix}

    # And look for user.
    if user in prefix:
        return prefix[user]
    elif user[1:] in prefix:
        return "Doesn't have a prefix."
    else:
        return "Not found."

###########################################
#          Making a CTCP request.         #
###########################################

def ctcp_req (user, request, *param):
    start = end = time.time()
    reply = ""

    # Check if the username is valid, so we don't waste our time.
    if not re.match("[a-zA-Z\[\]\\`_\^\{\|\}][a-zA-Z0-9\[\]\\`_\^\{\|\}]", user):
        return 1

    # Just for formality.
    request = request.upper()

    # Send the request.
    if param:
        irc.msg(user, "\001{} {}\001".format(request, param[0]), raw = True)
    else:
        irc.msg(user, "\001{}\001".format(request), raw = True)

    # Only listen for 20 seconds.
    while (not reply) and end - start < 20:
        for message in feed.s_out():
            if (
                (not reply) and
                request in message and
                message.startswith(":"+user) and
                " NOTICE " in message
            ):
                reply = message.split(request, 1)[1].strip("\001").lstrip()
            else:
                handler.read(message)

        end = time.time()

    # Return the reply, if it got one.
    if reply:
        return reply
    else:
        return ""

###########################################
#            Changing strings.            #
###########################################

# We want to get rid of certain characters.
def trim (string):
    if "\x03" in string:
        string = string.split("\x03")[0]
    if "\x02" in string:
        str = string.split("\x02")[0]
    if "\x1d" in string:
        str = string.split("\x1d")[0]
    if "\x0f" in string:
        str = string.split("\x0f")[0]
    return string

# We want to tag NSFW urls as NSFW.
def nsfw_check (url_pair):
    if "!" in url_pair.split(" ")[1]:
        url_pair = "[\x034NSFW\x0f] {}".format(url_pair.split(" ")[1].strip("!"))
    return url_pair

###########################################
#    Executing lines by the admin in      #
#    handler.py                           #
###########################################

def exec_python (channel, command):
    handler.exec_python(channel, command)


text:
#pragma once

#include "ocilibcpp/types.hpp"

// ReSharper disable CppClangTidyCertOop54Cpp

namespace ocilib
{

template<class T>
CollectionIterator<T>::CollectionIterator() : _elem()
{

}

template<class T>
CollectionIterator<T>::CollectionIterator(CollectionType *collection, unsigned int pos) : _elem(collection, pos)
{

}

template<class T>
CollectionIterator<T>::CollectionIterator(const CollectionIterator& other) : _elem(other._elem)
{

}

template<class T>
CollectionIterator<T>& CollectionIterator<T>::operator = (const CollectionIterator& other)
{
    if (this != &other)
    {
        _elem._pos = other._elem._pos;
        _elem._coll = other._elem._coll;
    }

	return *this;
}

template<class T>
CollectionIterator<T>& CollectionIterator<T>::operator += (difference_type value)
{
	_elem._pos += static_cast<unsigned int>(value);
	return *this;
}

template<class T>
CollectionIterator<T>& CollectionIterator<T>::operator -= (difference_type value)
{
	_elem._pos -= static_cast<unsigned int>(value);
	return *this;
}

template<class T>
T& CollectionIterator<T>::operator*()
{
	return _elem;
}

template<class T>
T* CollectionIterator<T>::operator->()
{
	return &_elem;
}

template<class T>
CollectionIterator<T>& CollectionIterator<T>::operator--()
{
	--_elem._pos;
	return *this;
}

template<class T>
CollectionIterator<T>& CollectionIterator<T>::operator++()
{
	++*(const_cast<unsigned int*>(&_elem._pos));
	return *this;
}

template<class T>
CollectionIterator<T> CollectionIterator<T>::operator++(int)
{
	CollectionIterator res(_elem._coll, _elem._pos);
	++(*this);
	return res;
}

template<class T>
CollectionIterator<T> CollectionIterator<T>::operator--(int)
{
	CollectionIterator res(_elem);
	--(*this);
	return res;
}

template<class T>
CollectionIterator<T>  CollectionIterator<T>::operator + (difference_type value)
{
	return CollectionIterator(_elem._coll, _elem._pos + static_cast<unsigned int>(value));
}

template<class T>
CollectionIterator<T> CollectionIterator<T>::operator - (difference_type value)
{
	return CollectionIterator(_elem._coll, _elem._pos - static_cast<unsigned int>(value));
}

template<class T>
typename CollectionIterator<T>::difference_type CollectionIterator<T>::operator - (const CollectionIterator & other)
{
	return static_cast<difference_type>(_elem._pos - other._elem._pos);
}

template<class T>
bool CollectionIterator<T>::operator == (const CollectionIterator& other)
{
	return _elem._pos == other._elem._pos && (static_cast<OCI_Coll *>(*_elem._coll)) == (static_cast<OCI_Coll *>(*other._elem._coll));
}

template<class T>
bool CollectionIterator<T>::operator != (const CollectionIterator& other)
{
	return !(*this == other);
}

template<class T>
bool CollectionIterator<T>::operator > (const CollectionIterator& other)
{
	return _elem._pos > other._elem._pos;
}

template<class T>
bool CollectionIterator<T>::operator < (const CollectionIterator& other)
{
	return _elem._pos < other._elem._pos;
}

template<class T>
bool CollectionIterator<T>::operator >= (const CollectionIterator& other)
{
	return _elem._pos >= other._elem._pos;
}

template<class T>
bool CollectionIterator<T>::operator <= (const CollectionIterator& other)
{
	return _elem._pos <= other._elem._pos;
}

}


text:
{-# LANGUAGE QuasiQuotes #-}
module Atomo.Kernel.Char where

import Data.Char

import Atomo

load :: VM ()
load = do
    [$p|(a: Char) control?|] =: lift1 isControl
    [$p|(a: Char) space?|] =: lift1 isSpace
    [$p|(a: Char) lower?|] =: lift1 isLower
    [$p|(a: Char) upper?|] =: lift1 isUpper
    [$p|(a: Char) alpha?|] =: lift1 isAlpha
    [$p|(a: Char) alphanum?|] =: lift1 isAlphaNum
    [$p|(a: Char) print?|] =: lift1 isPrint
    [$p|(a: Char) digit?|] =: lift1 isDigit
    [$p|(a: Char) oct-digit?|] =: lift1 isOctDigit
    [$p|(a: Char) hex-digit?|] =: lift1 isHexDigit
    [$p|(a: Char) letter?|] =: lift1 isLetter
    [$p|(a: Char) mark?|] =: lift1 isMark
    [$p|(a: Char) number?|] =: lift1 isNumber
    [$p|(a: Char) punctuation?|] =: lift1 isPunctuation
    [$p|(a: Char) symbol?|] =: lift1 isSymbol
    [$p|(a: Char) separator?|] =: lift1 isSeparator
    [$p|(a: Char) ascii?|] =: lift1 isAscii
    [$p|(a: Char) latin1?|] =: lift1 isLatin1
    [$p|(a: Char) ascii-upper?|] =: lift1 isAsciiLower
    [$p|(a: Char) ascii-lower?|] =: lift1 isAsciiUpper

    [$p|(a: Char) uppercase|] =: lift1 toUpper
    [$p|(a: Char) lowercase|] =: lift1 toLower
    [$p|(a: Char) titlecase|] =: lift1 toTitle

    [$p|(a: Char) from-digit|] =: lift1 (toInteger . digitToInt)
    [$p|(a: Integer) to-digit|] =: lift1 (intToDigit . fromInteger)

    [$p|(a: Char) ord|] =: lift1 (toInteger . ord)
    [$p|(a: Integer) chr|] =: lift1 (chr . fromInteger)

    [$p|(a: Char) category|] =: lift1 (c.generalCategory)
  where
    c UppercaseLetter = keyParticleN ["letter"] [particle "lowercase"]
    c LowercaseLetter = keyParticleN ["letter"] [particle "uppercase"]
    c TitlecaseLetter = keyParticleN ["letter"] [particle "titlecase"]
    c ModifierLetter = keyParticleN ["letter"] [particle "modified"]
    c OtherLetter = keyParticleN ["letter"] [particle "other"]
    c NonSpacingMark = keyParticleN ["mark"] [particle "non-spacing"]
    c SpacingCombiningMark = keyParticleN ["mark"] [particle "space-combining"]
    c EnclosingMark = keyParticleN ["mark"] [particle "enclosing"]
    c DecimalNumber = keyParticleN ["number"] [particle "decimal"]
    c LetterNumber = keyParticleN ["number"] [particle "letter"]
    c OtherNumber = keyParticleN ["number"] [particle "other"]
    c ConnectorPunctuation = keyParticleN ["punctuation"] [particle "connector"]
    c DashPunctuation = keyParticleN ["punctuation"] [particle "dash"]
    c OpenPunctuation = keyParticleN ["punctuation"] [particle "open"]
    c ClosePunctuation = keyParticleN ["punctuation"] [particle "close"]
    c InitialQuote = keyParticleN ["quote"] [particle "initial"]
    c FinalQuote = keyParticleN ["quote"] [particle "final"]
    c OtherPunctuation = keyParticleN ["punctuation"] [particle "other"]
    c MathSymbol = keyParticleN ["symbol"] [particle "math"]
    c CurrencySymbol = keyParticleN ["symbol"] [particle "currency"]
    c ModifierSymbol = keyParticleN ["symbol"] [particle "modifier"]
    c OtherSymbol = keyParticleN ["symbol"] [particle "other"]
    c Space = particle "space"
    c LineSeparator = keyParticleN ["separator"] [particle "line"]
    c ParagraphSeparator = keyParticleN ["separator"] [particle "paragraph"]
    c Control = particle "control"
    c Format = particle "format"
    c Surrogate = particle "surrogate"
    c PrivateUse = particle "private-use"
    c NotAssigned = particle "not-assigned"


text:
module ChefSpec
  module API
    module User
      ChefSpec.define_matcher :user

      #
      # Assert that a +user+ resource exists in the Chef run with the
      # action +:create+. Given a Chef Recipe that creates "apache2" as a
      # +user+:
      #
      #     user 'apache2' do
      #       action :create
      #     end
      #
      # The Examples section demonstrates the different ways to test a
      # +user+ resource with ChefSpec.
      #
      # @example Assert that a +user+ was created
      #   expect(chef_run).to create_user('apache2')
      #
      # @example Assert that a +user+ was created with predicate matchers
      #   expect(chef_run).to create_user('apache2').with_uid(1234)
      #
      # @example Assert that a +user+ was created with attributes
      #   expect(chef_run).to create_user('apache2').with(uid: 1234)
      #
      # @example Assert that a +user+ was created using a regex
      #   expect(chef_run).to create_user('apache2').with(uid: /\d+/)
      #
      # @example Assert that a +user+ was _not_ created
      #   expect(chef_run).to_not create_user('apache2')
      #
      #
      # @param [String, Regex] resource_name
      #   the name of the resource to match
      #
      # @return [ChefSpec::Matchers::ResourceMatcher]
      #
      def create_user(resource_name)
        ChefSpec::Matchers::ResourceMatcher.new(:user, :create, resource_name)
      end

      #
      # Assert that a +user+ resource exists in the Chef run with the
      # action +:remove+. Given a Chef Recipe that removes "apache2" as a
      # +user+:
      #
      #     user 'apache2' do
      #       action :remove
      #     end
      #
      # The Examples section demonstrates the different ways to test a
      # +user+ resource with ChefSpec.
      #
      # @example Assert that a +user+ was remove
      #   expect(chef_run).to remove_user('apache2')
      #
      # @example Assert that a +user+ was remove with predicate matchers
      #   expect(chef_run).to remove_user('apache2').with_uid(1234)
      #
      # @example Assert that a +user+ was remove with attributes
      #   expect(chef_run).to remove_user('apache2').with(uid: 1234)
      #
      # @example Assert that a +user+ was remove using a regex
      #   expect(chef_run).to remove_user('apache2').with(uid: /\d+/)
      #
      # @example Assert that a +user+ was _not_ remove
      #   expect(chef_run).to_not remove_user('apache2')
      #
      #
      # @param [String, Regex] resource_name
      #   the name of the resource to match
      #
      # @return [ChefSpec::Matchers::ResourceMatcher]
      #
      def remove_user(resource_name)
        ChefSpec::Matchers::ResourceMatcher.new(:user, :remove, resource_name)
      end

      #
      # Assert that a +user+ resource exists in the Chef run with the
      # action +:modify+. Given a Chef Recipe that modifies "apache2" as a
      # +user+:
      #
      #     user 'apache2' do
      #       action :modify
      #     end
      #
      # The Examples section demonstrates the different ways to test a
      # +user+ resource with ChefSpec.
      #
      # @example Assert that a +user+ was modified
      #   expect(chef_run).to modify_user('apache2')
      #
      # @example Assert that a +user+ was modified with predicate matchers
      #   expect(chef_run).to modify_user('apache2').with_uid(1234)
      #
      # @example Assert that a +user+ was modified with attributes
      #   expect(chef_run).to modify_user('apache2').with(uid: 1234)
      #
      # @example Assert that a +user+ was modified using a regex
      #   expect(chef_run).to modify_user('apache2').with(uid: /\d+/)
      #
      # @example Assert that a +user+ was _not_ modified
      #   expect(chef_run).to_not modify_user('apache2')
      #
      #
      # @param [String, Regex] resource_name
      #   the name of the resource to match
      #
      # @return [ChefSpec::Matchers::ResourceMatcher]
      #
      def modify_user(resource_name)
        ChefSpec::Matchers::ResourceMatcher.new(:user, :modify, resource_name)
      end

      #
      # Assert that a +user+ resource exists in the Chef run with the
      # action +:manage+. Given a Chef Recipe that manages "apache2" as a
      # +user+:
      #
      #     user 'apache2' do
      #       action :manage
      #     end
      #
      # The Examples section demonstrates the different ways to test a
      # +user+ resource with ChefSpec.
      #
      # @example Assert that a +user+ was managed
      #   expect(chef_run).to manage_user('apache2')
      #
      # @example Assert that a +user+ was managed with predicate matchers
      #   expect(chef_run).to manage_user('apache2').with_uid(1234)
      #
      # @example Assert that a +user+ was managed with attributes
      #   expect(chef_run).to manage_user('apache2').with(uid: 1234)
      #
      # @example Assert that a +user+ was managed using a regex
      #   expect(chef_run).to manage_user('apache2').with(uid: /\d+/)
      #
      # @example Assert that a +user+ was _not_ managed
      #   expect(chef_run).to_not manage_user('apache2')
      #
      #
      # @param [String, Regex] resource_name
      #   the name of the resource to match
      #
      # @return [ChefSpec::Matchers::ResourceMatcher]
      #
      def manage_user(resource_name)
        ChefSpec::Matchers::ResourceMatcher.new(:user, :manage, resource_name)
      end

      #
      # Assert that a +user+ resource exists in the Chef run with the
      # action +:lock+. Given a Chef Recipe that locks "apache2" as a
      # +user+:
      #
      #     user 'apache2' do
      #       action :lock
      #     end
      #
      # The Examples section demonstrates the different ways to test a
      # +user+ resource with ChefSpec.
      #
      # @example Assert that a +user+ was locked
      #   expect(chef_run).to lock_user('apache2')
      #
      # @example Assert that a +user+ was locked with predicate matchers
      #   expect(chef_run).to lock_user('apache2').with_uid(1234)
      #
      # @example Assert that a +user+ was locked with attributes
      #   expect(chef_run).to lock_user('apache2').with(uid: 1234)
      #
      # @example Assert that a +user+ was locked using a regex
      #   expect(chef_run).to lock_user('apache2').with(uid: /\d+/)
      #
      # @example Assert that a +user+ was _not_ locked
      #   expect(chef_run).to_not lock_user('apache2')
      #
      #
      # @param [String, Regex] resource_name
      #   the name of the resource to match
      #
      # @return [ChefSpec::Matchers::ResourceMatcher]
      #
      def lock_user(resource_name)
        ChefSpec::Matchers::ResourceMatcher.new(:user, :lock, resource_name)
      end

      #
      # Assert that a +user+ resource exists in the Chef run with the
      # action +:unlock+. Given a Chef Recipe that unlocks "apache2" as a
      # +user+:
      #
      #     user 'apache2' do
      #       action :unlock
      #     end
      #
      # The Examples section demonstrates the different ways to test a
      # +user+ resource with ChefSpec.
      #
      # @example Assert that a +user+ was unlocked
      #   expect(chef_run).to unlock_user('apache2')
      #
      # @example Assert that a +user+ was unlocked with predicate matchers
      #   expect(chef_run).to unlock_user('apache2').with_uid(1234)
      #
      # @example Assert that a +user+ was unlocked with attributes
      #   expect(chef_run).to unlock_user('apache2').with(uid: 1234)
      #
      # @example Assert that a +user+ was unlocked using a regex
      #   expect(chef_run).to unlock_user('apache2').with(uid: /\d+/)
      #
      # @example Assert that a +user+ was _not_ unlocked
      #   expect(chef_run).to_not unlock_user('apache2')
      #
      #
      # @param [String, Regex] resource_name
      #   the name of the resource to match
      #
      # @return [ChefSpec::Matchers::ResourceMatcher]
      #
      def unlock_user(resource_name)
        ChefSpec::Matchers::ResourceMatcher.new(:user, :unlock, resource_name)
      end

    end
  end
end


text:
class vCenterVMFromImageResourceModel(object):
    def __init__(self):
        self.vcenter_name = ''
        self.vcenter_image = ''
        self.vcenter_image_arguments = ''
        self.vm_cluster = ''
        self.vm_storage = ''
        self.vm_resource_pool = ''
        self.vm_location = ''
        self.auto_power_on = True
        self.auto_power_off = True
        self.wait_for_ip = True
        self.auto_delete = True
        self.autoload = True
        self.ip_regex = ''
        self.default_datacenter = ''
        self.refresh_ip_timeout = 0
        self.behavior_during_save = ''


text:
package sese

import (
	"encoding/xml"

	"github.com/fgrid/iso20022"
)

type Document03100104 struct {
	XMLName xml.Name                                                  `xml:"urn:iso:std:iso:20022:tech:xsd:sese.031.001.04 Document"`
	Message *SecuritiesSettlementConditionModificationStatusAdviceV04 `xml:"SctiesSttlmCondModStsAdvc"`
}

func (d *Document03100104) AddMessage() *SecuritiesSettlementConditionModificationStatusAdviceV04 {
	d.Message = new(SecuritiesSettlementConditionModificationStatusAdviceV04)
	return d.Message
}

// Scope
// An account servicer sends a SecuritiesSettlementConditionsModificationStatusAdvice to an account owner to advise the status of a modification request previously instructed by the account owner.
// The account servicer/owner relationship may be:
// - a central securities depository or another settlement market infrastructure acting on behalf of their participants
// - an agent (sub-custodian) acting on behalf of their global custodian customer, or
// - a custodian acting on behalf of an investment management institution or a broker/dealer.
//
// Usage
// A SecuritiesSettlementConditionsModificationRequest may contain requests on multiple transactions. However, one SecuritiesSettlementConditionsModificationStatusAdvice must be sent per transaction modified unless the SecuritiesSettlementConditionsModificationRequest is rejected as a whole.
// The message may also be used to:
// - re-send a message previously sent,
// - provide a third party with a copy of a message for information,
// - re-send to a third party a copy of a message for information
// using the relevant elements in the Business Application Header.
//
// ISO 15022 - 20022 Coexistence
// This ISO 20022 message is reversed engineered from ISO 15022. Both standards will coexist for a certain number of years. Until this coexistence period ends, the usage of certain data types is restricted to ensure interoperability between ISO 15022 and 20022 users. Compliance to these rules is mandatory in a coexistence environment.  The coexistence restrictions are described in a Textual Rule linked to the Message Items they concern. These coexistence textual rules are clearly identified as follows:  "CoexistenceXxxxRule".
type SecuritiesSettlementConditionModificationStatusAdviceV04 struct {

	// Identification of the SecuritiesSettlementConditionsModificationRequest.
	RequestReference *iso20022.Identification1 `xml:"ReqRef"`

	// Party that legally owns the account.
	AccountOwner *iso20022.PartyIdentification36Choice `xml:"AcctOwnr,omitempty"`

	// Account to or from which a securities entry is made.
	SafekeepingAccount *iso20022.SecuritiesAccount13 `xml:"SfkpgAcct,omitempty"`

	// Details of the request.
	RequestDetails *iso20022.RequestDetails11 `xml:"ReqDtls,omitempty"`

	// Provides details on the processing status of the request.
	ProcessingStatus *iso20022.ProcessingStatus18Choice `xml:"PrcgSts"`

	// Additional information that cannot be captured in the structured elements and/or any other specific block.
	SupplementaryData []*iso20022.SupplementaryData1 `xml:"SplmtryData,omitempty"`
}

func (s *SecuritiesSettlementConditionModificationStatusAdviceV04) AddRequestReference() *iso20022.Identification1 {
	s.RequestReference = new(iso20022.Identification1)
	return s.RequestReference
}

func (s *SecuritiesSettlementConditionModificationStatusAdviceV04) AddAccountOwner() *iso20022.PartyIdentification36Choice {
	s.AccountOwner = new(iso20022.PartyIdentification36Choice)
	return s.AccountOwner
}

func (s *SecuritiesSettlementConditionModificationStatusAdviceV04) AddSafekeepingAccount() *iso20022.SecuritiesAccount13 {
	s.SafekeepingAccount = new(iso20022.SecuritiesAccount13)
	return s.SafekeepingAccount
}

func (s *SecuritiesSettlementConditionModificationStatusAdviceV04) AddRequestDetails() *iso20022.RequestDetails11 {
	s.RequestDetails = new(iso20022.RequestDetails11)
	return s.RequestDetails
}

func (s *SecuritiesSettlementConditionModificationStatusAdviceV04) AddProcessingStatus() *iso20022.ProcessingStatus18Choice {
	s.ProcessingStatus = new(iso20022.ProcessingStatus18Choice)
	return s.ProcessingStatus
}

func (s *SecuritiesSettlementConditionModificationStatusAdviceV04) AddSupplementaryData() *iso20022.SupplementaryData1 {
	newValue := new(iso20022.SupplementaryData1)
	s.SupplementaryData = append(s.SupplementaryData, newValue)
	return newValue
}


text:
<?xml version="1.0"?>
<?xml-model
  href="http://download.ros.org/schema/package_format3.xsd"
  schematypens="http://www.w3.org/2001/XMLSchema"?>
<package format="3">
  <name>forward_command_controller</name>
  <version>0.21.0</version>
  <description>forward_command_controller</description>

  <maintainer email="bence.magyar.robotics@gmail.com">Bence Magyar</maintainer>
  <maintainer email="mathias.luedtke@ipa.fraunhofer.de">Mathias Lüdtke</maintainer>
  <maintainer email="enrique.fernandez.perdomo@gmail.com">Enrique Fernandez</maintainer>

  <license>BSD</license>

  <url type="website">https://github.com/ros-controls/ros_controllers/wiki</url>
  <url type="bugtracker">https://github.com/ros-controls/ros_controllers/issues</url>
  <url type="repository">https://github.com/ros-controls/ros_controllers</url>

  <author>Vijay Pradeep</author>
  <author>Adolfo Rodriguez Tsouroukdissian</author>

  <buildtool_depend>catkin</buildtool_depend>

  <build_depend>controller_interface</build_depend>
  <build_depend>hardware_interface</build_depend>
  <build_depend>realtime_tools</build_depend>
  <build_depend>roscpp</build_depend>
  <build_depend>std_msgs</build_depend>

  <build_export_depend>controller_interface</build_export_depend>
  <build_export_depend>hardware_interface</build_export_depend>
  <build_export_depend>realtime_tools</build_export_depend>
  <build_export_depend>roscpp</build_export_depend>
  <build_export_depend>std_msgs</build_export_depend>

  <export>
    <cpp cflags="-I${prefix}/include"/>
  </export>
</package>


text:
This is a GraphQL Schema for a Blog App where you can play and get familiar with GraphQL.

You can follow lessons at [Learn GraphQL](https://learngraphql.com) with this app.


text:
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <title>W28599_text</title>
        <link rel="stylesheet" type="text/css" href="style.css" />

                «

    <p class="styleSans18.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle>">DATED thiifflday of 4%[1 . 2013f

    <p class="styleSans59.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle>">SURFACE OWNER
Barbara Linvigt

Address: 14075 415' Street NW Alexander, ND 58831
Phone: 701 -770-1 1 52

    <p class="styleSans6.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle>">ACKNO'VLEDGMENT INDIVDUAI,
n"\

    <p class="styleSans44.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle>">STATE OF

COUNTY OF
I . ' \ BE IT REMEMBERED, That on (his  E day of 20 lélbefore me, a Notary Public, in and for said County and Stale, personally appeared ' V'
identical persons described in and who executed the within and Foregoing instrument and acknowledged to
me that lliey executed the same as their free and voluntary am and deed for the uses and purposes (herein set forth.
IN WITNESS WHEREOF, l have hereunto set my official signature and affixed my notarial sea], the day and year first above written.

JAMES DEMORRETl bfic—
$1019 01 North Dakota _,
NOTARY 5T My Commission Expires A . lb, 2018
My commission expires.

Notary Public

    <p class="styleSans12000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle>">

    <p class="styleSans12000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle>">


text:
/* global Enumerable */
/* global expect */
/// <reference path="../typings/mocha/mocha.d.ts"/>
'use strict';
describe('.first', function () {
    it('should have a first method', function () {
        var items = [1, 2, 3].asEnumerable();

        expect(items.first).to.exist;
    });

    it('should return the first item in the collection when no additional filter applied', function () {
        var items = [1, 2, 3].asEnumerable();

        expect(items.first()).to.equal(1);
    });

    it('should allow a filter to be used to find a value', function () {
        var items = [1, 2, 3].asEnumerable();

        var item = items.first(item => item == 2);

        expect(item).to.equal(2);
    });

    it('should only return one value even if multiple match the selector', function () {
        var items = [1, 2, 2, 3].asEnumerable();

        var item = items.first(item => item == 2);

        expect(item).to.equal(2);
    });

    it('should raise an error when no match is found', function () {
        var items = [1, 2, 3].asEnumerable();

        expect(() => items.first(x => false)).throws();
    });
});


text:
'use strict';

var mongoose = require('mongoose'),
	Schema = mongoose.Schema;

var colorSchema = new Schema({
	name: String,
	image: String,
	pictures: [String]
});

var sizeSchema = new Schema({
	name: String,
	stock: String
});

var productSchema = new Schema({
	name: String,
	price: Number,
	// imageUrl: String,
	categoryId: Number,
	description: String,
	colors: [colorSchema],
	sizes: [sizeSchema]
}, { _id: false });

// TODO
productSchema.statics.findFeatured = function _findFeatured(count, done) {
	this.find({}).lean().limit(count).exec(done);
};

productSchema.statics.findByCategory = function _findByCategory(categoryId, done) {
	this.find({
		categoryId: categoryId
	}).lean().exec(done);
};

module.exports = mongoose.model('Product', productSchema);