text:
/***************************************************************
 * This file is generated by DatastoreWorker post-build script *
 *                      Do not edit!                           *
 **************************************************************/

/**
 * DatastoreWorker message types and definitions
 * Defines interface between client (hex editor) and worker
 */
module DatastoreWorker {
    export enum MessageType {
        InitializeRequest,  // Applies data object to worker
        UndoRequest,        // Undoing last operation
        RedoRequest,        // Redoing last undoed operation
        SaveRequest,        // Saving whole file to blob URL
        CloseRequest,       // Terminating worker

        InsertRequest,      // Inserts bytes into file
        OverwriteRequest,   // Overwrites bytes in file
        RemoveRequest,      // Removes bytes from files

        ReadRequest,        // Reads data block from file

        SuccessResponse,    // Operation completed successfully
        ErrorResponse,      // Error occured
        ReadResponse,       // Read operation completed
        SaveResponse        // Blob URL generated
    }

    export abstract class Message {
        type: MessageType;

        constructor(type: MessageType) {
            this.type = type;
        }
    }

    export abstract class MessageProcessor {
        protected onInitializeRequest(request: InitializeRequest) { }
        protected onUndoRequest(request: UndoRequest) { }
        protected onRedoRequest(request: RedoRequest) { }
        protected onSaveRequest(request: RedoRequest) { }
        protected onCloseRequest(request: CloseRequest) { }

        protected onInsertRequest(request: InsertRequest) { }
        protected onOverwriteRequest(request: OverwriteRequest) { }
        protected onRemoveRequest(request: RemoveRequest) { }

        protected onReadRequest(request: ReadRequest) { }

        protected onSuccessResponse(response: SuccessResponse) { }
        protected onErrorResponse(response: ErrorResponse) { }
        protected onReadResponse(response: ReadResponse) { }
        protected onSaveResponse(response: ReadResponse) { }

        /**
         * Translates message and calls suitable processing method
         * @param message Message object
         */
        process(message: Message) {
            switch (message.type) {
                case MessageType.InitializeRequest:
                    return this.onInitializeRequest(<InitializeRequest>message);
                case MessageType.UndoRequest:
                    return this.onUndoRequest(<UndoRequest>message);
                case MessageType.RedoRequest:
                    return this.onRedoRequest(<RedoRequest>message);
                case MessageType.SaveRequest:
                    return this.onSaveRequest(<SaveRequest>message);
                case MessageType.CloseRequest:
                    return this.onCloseRequest(<CloseRequest>message);
                case MessageType.InsertRequest:
                    return this.onInsertRequest(<InsertRequest>message);
                case MessageType.OverwriteRequest:
                    return this.onOverwriteRequest(<OverwriteRequest>message);
                case MessageType.RemoveRequest:
                    return this.onRemoveRequest(<RemoveRequest>message);
                case MessageType.ReadRequest:
                    return this.onReadRequest(<ReadRequest>message);
                case MessageType.SuccessResponse:
                    return this.onSuccessResponse(<SuccessResponse>message);
                case MessageType.ErrorResponse:
                    return this.onErrorResponse(<ErrorResponse>message);
                case MessageType.ReadResponse:
                    return this.onReadResponse(<ReadResponse>message);
                case MessageType.SaveResponse:
                    return this.onSaveResponse(<ReadResponse>message);
            }
        }
    }

    export enum ErrorResponseType {
        NoMoreOperationsOnStack
    }

    export class InitializeRequest extends Message {
        source: File;

        constructor(source: File) {
            super(MessageType.InitializeRequest);
            this.source = source;
        }
    }

    export class UndoRequest extends Message {
        constructor() {
            super(MessageType.UndoRequest);
        }
    }

    export class RedoRequest extends Message {
        constructor() {
            super(MessageType.RedoRequest);
        }
    }

    export class SaveRequest extends Message {
        constructor() {
            super(MessageType.SaveRequest);
        }
    }

    export class CloseRequest extends Message {
        constructor() {
            super(MessageType.CloseRequest);
        }
    }

    export class InsertRequest extends Message {
        offset: number;
        data: number[];

        constructor(offset: number, data: number[]) {
            super(MessageType.InsertRequest);
            this.offset = offset;
            this.data = data;
        }
    }

    export class OverwriteRequest extends Message {
        offset: number;
        data: number[];

        constructor(offset: number, data: number[]) {
            super(MessageType.OverwriteRequest);
            this.offset = offset;
            this.data = data;
        }
    }

    export class RemoveRequest extends Message {
        offset: number;
        length: number;

        constructor(offset: number, length: number) {
            super(MessageType.RemoveRequest);
            this.offset = offset;
            this.length = length;
        }
    }

    export class ReadRequest extends Message {
        offset: number;
        length: number;

        constructor(offset: number, length: number) {
            super(MessageType.ReadRequest);
            this.offset = offset;
            this.length = length;
        }
    }

    export class SuccessResponse extends Message {
        newFileSize: number;

        constructor(newFileSize: number = 0) {
            super(MessageType.SuccessResponse);
            this.newFileSize = newFileSize;
        }
    }

    export class ErrorResponse extends Message {
        errorType: ErrorResponseType;

        constructor(responseType: ErrorResponseType) {
            super(MessageType.ErrorResponse);
            this.errorType = responseType;
        }
    }

    export class ReadResponse extends Message {
        offset: number;
        data: number[];

        constructor(offset: number, data: number[]) {
            super(MessageType.ReadResponse);
            this.offset = offset;
            this.data = data;
        }
    }

    export class SaveResponse extends Message {
        blobURL: string

        constructor(blobURL: string) {
            super(MessageType.SaveResponse);
            this.blobURL = blobURL;
        }
    }
}

export = DatastoreWorker;


text:
var fast = require('../'),
    history = require('../test/history'),
    underscore = require('underscore'),
    lodash = require('lodash');

var input = [];

for (var i = 0; i < 1000; i++) {
  input.push(i);
}

exports['Array::lastIndexOf()'] = function () {
  return input.lastIndexOf(999) + input.lastIndexOf(1);
};

exports['fast.lastIndexOf()'] = function () {
  return fast.lastIndexOf(input, 999) + fast.lastIndexOf(input, 1);
};

exports['fast.lastIndexOf() v0.0.2'] = function () {
  return history.lastIndexOf_0_0_2(input, 999) + history.lastIndexOf_0_0_2(input, 1);
};

exports['underscore.lastIndexOf()'] = function () {
  return underscore.lastIndexOf(input, 999) + underscore.lastIndexOf(input, 1);
};

exports['lodash.lastIndexOf()'] = function () {
  return lodash.lastIndexOf(input, 999) + lodash.lastIndexOf(input, 1);
};

redpajama_set_name: RedPajamaGithub


text:
@interface PageContentViewController : UIViewController
@property (weak, nonatomic) IBOutlet UIImageView *backgroundImageView;
@property (weak, nonatomic) IBOutlet UITextView *titleLabel;
@property NSUInteger pageIndex;
@property NSString *titleText;
@property NSString *imageFile;
@end


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Newtonsoft.Json.Linq;

namespace EliteJournalReader.Events
{
    //When written: when the player's ship has been repaired by a repair drone
    //Parameters:
    //•	HullRepaired
    //•	CockpitRepaired
    //•	CorrosionRepaired

    //Each of these is a number indicating the amount of damage that has been repaired
    public class RepairDroneEvent : JournalEvent<RepairDroneEvent.RepairDroneEventArgs>
    {
        public RepairDroneEvent() : base("RepairDrone") { }

        public class RepairDroneEventArgs : JournalEventArgs
        {
            public double? HullRepaired { get; set; }
            public double? CockpitRepaired { get; set; }
            public double? CorrosionRepaired { get; set; }
        }
    }
}


text:
<?php

ini_set(
    'include_path',
    implode(
        PATH_SEPARATOR,
        array(
            implode(DIRECTORY_SEPARATOR, array('..', '..', '..', 'src', 'mg')),
            ini_get('include_path'),
        )
    )
);

class MyDependency
{

}

/**
 * @Component(name="myBeanDependency")
 */
class AnotherDependency
{
}

/**
 * This is our bean. Note how @Resource is used with and without
 * the name argument.
 */
class MyBean
{
    private $_someProperty;

    /**
     * @Resource(name="myBeanDependency")
     */
    protected $anotherDependency;
    protected $yetAnotherDependency;

    /**
     * @Resource
     */
    public function setDependency($value)
    {
        $this->_someProperty = $value;
    }

    /**
     * @Resource(name="myBeanDependency")
     */
    public function setMyOtherDependency($value)
    {
        $this->yetAnotherDependency = $value;
    }

    public function getDependency()
    {
        return $this->_someProperty;
    }
    public function __construct()
    {

    }
}
require_once 'Ding/Autoloader/Autoloader.php'; // Include ding autoloader.
\Ding\Autoloader\Autoloader::register(); // Call autoloader register for ding autoloader.
use Ding\Container\Impl\ContainerImpl;

// Here you configure the container, its subcomponents, drivers, etc.
$properties = array(
    'ding' => array(
        'log4php.properties' => __DIR__ . '/../log4php.properties',
        'factory' => array(
            'bdef' => array( // Both of these drivers are optional. They are both included just for the thrill of it.
                'xml' => array('filename' => 'beans.xml'),
                'annotation' => array('scanDir' => array(realpath(__DIR__)))
            ),
        ),
        // You can configure the cache for the bean definition, the beans, and the proxy definitions.
        // Other available implementations: zend, file, dummy, and memcached.
    	'cache' => array(
            'proxy' => array('impl' => 'apc'),
            'bdef' => array('impl' => 'apc'),
            'beans' => array('impl' => 'apc')
        )
    )
);
$container = ContainerImpl::getInstance($properties);
$bean = $container->getBean('myBeanName');
var_dump($bean);


text:
FROM debian:jessie

MAINTAINER Austin Ouyang

RUN apt-get update \
    && apt-get install -y vim \
    && apt-get install -y openssh-client \
    && apt-get install -y python \
    && apt-get install -y python-dev \
    && apt-get install -y python-pip \
    && apt-get install -y git

RUN pip install awscli

RUN git clone https://github.com/sstephenson/bats.git /root/bats

RUN /root/bats/install.sh /usr/local

ENV PEGASUS_HOME /root/pegasus
ENV PATH $PEGASUS_HOME:$PATH
ENV REM_USER ubuntu

COPY . /root/pegasus

RUN echo "source pegasus-completion.sh" >> /root/.bashrc

WORKDIR /root


text:
@interface FJBNotificationsApiInteractor ()

@end

@implementation FJBNotificationsApiInteractor

#pragma mark - Actions

- (void)markNotificationAsRead:(NSString *)notificationId onCompletionBlock:(void(^)())completionBlock
{
}

@end


text:
layout: page
title: Mercer Chemical Award Ceremony
date: 2016-05-24
author: Laura Wiggins
tags: weekly links, java
status: published
summary: In mattis luctus libero. Fusce id luctus.
banner: images/banner/meeting-01.jpg
booking:
  startDate: 09/05/2017
  endDate: 09/10/2017
  ctyhocn: CLUSMHX
  groupCode: MCAC
published: true
---
Vivamus ac dapibus eros. Nunc accumsan felis lectus, in vehicula felis porta eu. Vestibulum faucibus leo sit amet fermentum malesuada. Aliquam sodales finibus neque sed porttitor. Sed dapibus felis suscipit risus efficitur blandit. Fusce a commodo quam, convallis hendrerit erat. Etiam sit amet arcu ut dui blandit molestie. Mauris nec venenatis neque. In condimentum malesuada venenatis. Praesent viverra feugiat felis, a porta elit commodo sed.

* Maecenas pulvinar ligula viverra, ultricies arcu mattis, accumsan sapien
* Pellentesque quis massa vestibulum, imperdiet magna in, tincidunt massa
* Curabitur varius leo id lacus molestie posuere
* Nullam in mi posuere, malesuada velit vel, rutrum turpis.

Sed et tempus lectus. Proin pretium aliquet scelerisque. Etiam eget fringilla massa, sit amet consequat erat. Praesent sit amet arcu velit. Mauris vitae eros mattis risus ultrices ultrices at sit amet nulla. Sed et nisi gravida, dictum diam eu, condimentum tortor. Donec ullamcorper nisi ut libero lacinia semper. Suspendisse rhoncus nibh metus, sit amet gravida urna euismod sed. Praesent rhoncus cursus malesuada. Sed facilisis, eros ut commodo sagittis, tortor est pellentesque odio, vel laoreet enim elit a turpis. Suspendisse interdum nec orci eget aliquam.
Nam at augue bibendum elit pulvinar imperdiet vitae non risus. Nunc magna orci, accumsan sed iaculis ac, faucibus ac turpis. Duis venenatis convallis maximus. Donec vel ullamcorper dolor. Phasellus cursus blandit nunc in rhoncus. Maecenas molestie metus velit. Integer ultricies ornare neque, at fringilla nibh pellentesque ut. Vestibulum quis dui nec velit mollis ullamcorper sed sit amet ipsum.


text:
package org.quartzpowered.common.util;

import org.slf4j.Logger;

import javax.inject.Inject;
import javax.inject.Singleton;
import java.security.KeyPair;
import java.security.KeyPairGenerator;
import java.security.NoSuchAlgorithmException;
import java.security.SecureRandom;
import java.security.Key;
import java.security.KeyFactory;
import java.security.spec.X509EncodedKeySpec;

@Singleton
public class CryptoUtil {

    @Inject private Logger logger;

    private final SecureRandom random = new SecureRandom();

    public KeyPair generateRSAKeyPair() {
        KeyPair keyPair = null;
        try {
            KeyPairGenerator generator = KeyPairGenerator.getInstance("RSA");
            generator.initialize(1024);

            keyPair = generator.generateKeyPair();
        } catch (NoSuchAlgorithmException ex) {
            this.logger.error("Unable to generate RSA key pair", ex);
        }
        return keyPair;
    }

    public byte[] generateToken(int length) {
        byte[] token = new byte[length];
        this.random.nextBytes(token);
        return token;
    }

    public Key toX509(Key base) {
        Key key = null;
        try {
            X509EncodedKeySpec encodedKeySpec = new X509EncodedKeySpec(base.getEncoded());
            KeyFactory keyFactory = KeyFactory.getInstance("RSA");

            key = keyFactory.generatePublic(encodedKeySpec);
        } catch (Exception ex) {
            this.logger.error("Unable to generate X509 encoded key", ex);
        }
        return key;
    }
}


text:
class CreateEveAncestryNameAndDescriptionTranslationsForMobilityColumnBackend < ActiveRecord::Migration[6.0]
  def change
    rename_column :eve_ancestries, :name, :name_en
    add_column :eve_ancestries, :name_de, :string
    add_column :eve_ancestries, :name_fr, :string
    add_column :eve_ancestries, :name_ja, :string
    add_column :eve_ancestries, :name_ru, :string
    add_column :eve_ancestries, :name_zh, :string
    rename_column :eve_ancestries, :description, :description_en
    add_column :eve_ancestries, :description_de, :text
    add_column :eve_ancestries, :description_fr, :text
    add_column :eve_ancestries, :description_ja, :text
    add_column :eve_ancestries, :description_ru, :text
    add_column :eve_ancestries, :description_zh, :text
  end
end


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using ListViewPaginationDemo.ViewModel;
using Xamarin.Forms;
using Xamarin.Forms.Xaml;

namespace ListViewPaginationDemo.Views
{
	[XamlCompilation(XamlCompilationOptions.Compile)]
	public partial class ListViewPage : ContentPage
	{
        ListViewModel viewModel;
		public ListViewPage ()
		{
			InitializeComponent ();
            BindingContext = viewModel = new ListViewModel();
		}
        void Handle_PageChanged(object sender, Controls.PageEventArgs e)
        {
            viewModel.LoadData(e.PageIndex);
        }

        protected void HideListViewRefreshing(object sender, EventArgs e)
        {
            (sender as ListView).IsRefreshing = false;
        }
    }
}


text:
Simple Image Cropper that works on Desktop and Mobile.

This plugin widget depends on jQuery, jQueryUI, and FabricJS and is partly a learning experiment using these libraries.

see https://learn.jquery.com/plugins/stateful-plugins-with-widget-factory/

[![Build Status](https://travis-ci.org/chrisstoy/jquery-cropper.svg?branch=master)](https://travis-ci.org/chrisstoy/jquery-cropper)

##  Create a cropper widget

At a minimum, you must define an element that has a `<canvas>` as a child.  For example:

    <div class="crop-wrapper">
	    <canvas></canvas>
    </div>

Then, in your Javascript, attach the cropper widget to the outer `<div>` element. Example:

 `$('.crop-wrapper').cropper({ imgUrl: 'some image url here' });`

You can then access the current cropData as from the cropper() element

 `var cropData = $('.crop-wrapper').cropper('cropData');`

To get the original size of the image, get the 'imageSize':

 `var originalImageSize = $('.crop-wrapper').cropper('imageSize');`


text:
var known_devices = {};

chrome.usb.onDeviceRemoved.addListener(function(device) {
  if (device.device in known_devices) {
    chrome.test.sendMessage("success");
  } else {
    console.error("Unexpected device removed: " + device.device);
    chrome.test.sendMessage("failure");
  }
});

chrome.usb.getDevices({}, function(devices) {
  for (var device of devices) {
    known_devices[device.device] = device;
  }
  chrome.test.sendMessage("loaded");
});


text:
BndTools Syntax Highlighting for Atom
===============================================================================

Adds syntax highlighting for BndTools (`.bnd`) files.

![image](https://raw.githubusercontent.com/mari0car/language-bnd/master/images/preview2.png)

![image](https://raw.githubusercontent.com/mari0car/language-bnd/master/images/preview.png)


text:
'use strict';

/**
 * @class
 * Initializes a new instance of the ManagementGroup class.
 * @constructor
 * A management group that is connected to a workspace
 *
 * @member {number} [serverCount] The number of servers connected to the
 * management group.
 *
 * @member {boolean} [isGateway] Gets or sets a value indicating whether the
 * management group is a gateway.
 *
 * @member {string} [name] The name of the management group.
 *
 * @member {string} [id] The unique ID of the management group.
 *
 * @member {date} [created] The datetime that the management group was created.
 *
 * @member {date} [dataReceived] The last datetime that the management group
 * received data.
 *
 * @member {string} [version] The version of System Center that is managing the
 * management group.
 *
 * @member {string} [sku] The SKU of System Center that is managing the
 * management group.
 *
 */
class ManagementGroup {
  constructor() {
  }

  /**
   * Defines the metadata of ManagementGroup
   *
   * @returns {object} metadata of ManagementGroup
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'ManagementGroup',
      type: {
        name: 'Composite',
        className: 'ManagementGroup',
        modelProperties: {
          serverCount: {
            required: false,
            serializedName: 'properties.serverCount',
            type: {
              name: 'Number'
            }
          },
          isGateway: {
            required: false,
            serializedName: 'properties.isGateway',
            type: {
              name: 'Boolean'
            }
          },
          name: {
            required: false,
            serializedName: 'properties.name',
            type: {
              name: 'String'
            }
          },
          id: {
            required: false,
            serializedName: 'properties.id',
            type: {
              name: 'String'
            }
          },
          created: {
            required: false,
            serializedName: 'properties.created',
            type: {
              name: 'DateTime'
            }
          },
          dataReceived: {
            required: false,
            serializedName: 'properties.dataReceived',
            type: {
              name: 'DateTime'
            }
          },
          version: {
            required: false,
            serializedName: 'properties.version',
            type: {
              name: 'String'
            }
          },
          sku: {
            required: false,
            serializedName: 'properties.sku',
            type: {
              name: 'String'
            }
          }
        }
      }
    };
  }
}

module.exports = ManagementGroup;


text:
export CATKIN_TEST_RESULTS_DIR="/home/vibek/Human_intention/build/test_results"
export ROS_TEST_RESULTS_DIR="/home/vibek/Human_intention/build/test_results"

# modified environment variables
export CMAKE_PREFIX_PATH="/home/vibek/Human_intention/build/devel:$CMAKE_PREFIX_PATH"
export CPATH="/home/vibek/Human_intention/build/devel/include:$CPATH"
export LD_LIBRARY_PATH="/home/vibek/Human_intention/build/devel/lib:$LD_LIBRARY_PATH"
export PATH="/home/vibek/Human_intention/build/devel/bin:/opt/ros/groovy/bin:/opt/ros/groovy/share/ros/bin:/usr/lib/lightdm/lightdm:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games"
export PKG_CONFIG_PATH="/home/vibek/Human_intention/build/devel/lib/pkgconfig:$PKG_CONFIG_PATH"
export PYTHONPATH="/home/vibek/Human_intention/build/devel/lib/python2.7/dist-packages:/opt/ros/groovy/lib/python2.7/dist-packages:/opt/ros/groovy/share/ros/core/roslib/src"
export ROSLISP_PACKAGE_DIRECTORIES="/home/vibek/Human_intention/build/devel/share/common-lisp"


text:
@interface BOXFileUpdateRequestTests : BOXRequestTestCase
@end

@implementation BOXFileUpdateRequestTests

- (void)test_that_update_request_with_no_params_has_expected_URLRequest
{
    NSString *fileID = @"123";
    BOXFileUpdateRequest *request = [[BOXFileUpdateRequest alloc] initWithFileID:fileID];

    NSURLRequest *URLRequest = request.urlRequest;

    // URL assertions
    NSURL *expectedURL = [NSURL URLWithString:[NSString stringWithFormat:@"%@/%@/files/%@", BOXAPIBaseURL, BOXAPIVersion, fileID]];
    XCTAssertEqualObjects(expectedURL, URLRequest.URL);
    XCTAssertEqualObjects(@"PUT", URLRequest.HTTPMethod);

    // HTTP body assertions
    NSDictionary *expectedBodyDictionary = @{};
    NSDictionary *actualBodyDictionary = [NSJSONSerialization JSONObjectWithData:URLRequest.HTTPBody options:kNilOptions error:nil];
    XCTAssertEqualObjects(expectedBodyDictionary, actualBodyDictionary);
}

- (void)test_shared_link_properties
{
    NSString *fileID = @"123";
    BOXFileUpdateRequest *request = [[BOXFileUpdateRequest alloc] initWithFileID:fileID];

    XCTAssertEqualObjects([request itemIDForSharedLink], fileID);
    XCTAssertEqualObjects([request itemTypeForSharedLink], BOXAPIItemTypeFile);
}

- (void)test_that_update_request_with_all_possible_params_has_expected_URLRequest
{
    NSString *fileID = @"123";
    NSString *newName = @"Hello";
    NSString *newParentFolderID = @"456";
    NSString *newDescription = @"Star trek rules. Star wars sucks.";
    NSString *matchingEtag = @"5849054tsefs";

    BOXSharedLinkAccessLevel *newAccessLevel = BOXSharedLinkAccessLevelCollaborators;
    NSDate *newSharedLinkExpirationDate = [NSDate distantFuture];
    BOOL newSharedLinkPermissionCanDownload = YES;
    BOOL newSharedLinkPermissionCanPreview = YES;

    BOXFileUpdateRequest *request = [[BOXFileUpdateRequest alloc] initWithFileID:fileID];
    request.fileName = newName;
    request.fileDescription = newDescription;
    request.parentID = newParentFolderID;
    request.sharedLinkAccessLevel = newAccessLevel;
    request.sharedLinkExpirationDate = newSharedLinkExpirationDate;
    request.sharedLinkPermissionCanDownload = newSharedLinkPermissionCanDownload;
    request.sharedLinkPermissionCanPreview = newSharedLinkPermissionCanPreview;
    request.matchingEtag = matchingEtag;

    NSURLRequest *URLRequest = request.urlRequest;

    // URL assertions
    NSURL *expectedURL = [NSURL URLWithString:[NSString stringWithFormat:@"%@/%@/files/%@", BOXAPIBaseURL, BOXAPIVersion, fileID]];
    XCTAssertEqualObjects(expectedURL, URLRequest.URL);
    XCTAssertEqualObjects(@"PUT", URLRequest.HTTPMethod);

    // HTTP body assertions
    NSDictionary *expectedBodyDictionary = @{@"name" : newName,
                                             @"parent" : @{@"id" : newParentFolderID},
                                             @"description" : newDescription,
                                             @"shared_link" : @{@"access" : @"collaborators",
                                                                @"permissions" : @{@"can_download" : @1,
                                                                                @"can_preview" : @1},
                                                                @"unshared_at" : [newSharedLinkExpirationDate box_ISO8601String]}
                                             };
    NSDictionary *actualBodyDictionary = [NSJSONSerialization JSONObjectWithData:URLRequest.HTTPBody options:kNilOptions error:nil];
    XCTAssertEqualObjects(expectedBodyDictionary, actualBodyDictionary);

    // HTTP header assertions
    NSString *actualIfMatchHeader = [URLRequest.allHTTPHeaderFields objectForKey:@"If-Match"];
    XCTAssertEqualObjects(matchingEtag, actualIfMatchHeader);
}

- (void)test_that_expected_file_is_returned_when_request_is_performed
{
    // Canned response json.
    NSData *cannedResponseData = [self cannedResponseDataWithName:@"file_default_fields"];
    NSHTTPURLResponse *URLResponse = [self cannedURLResponseWithStatusCode:200 responseData:cannedResponseData];

    // Expected BoxFolder response object based on the same canned response json.
    NSDictionary *jsonDictionary = [NSJSONSerialization JSONObjectWithData:cannedResponseData options:kNilOptions error:nil];
    BOXFile *expectedFile = [[BOXFile alloc] initWithJSON:jsonDictionary];

    // Set up BOXFolderRequest and attach canned response to it.
    BOXFileUpdateRequest *request = [[BOXFileUpdateRequest alloc] initWithFileID:expectedFile.modelID];
    [self setCannedURLResponse:URLResponse cannedResponseData:cannedResponseData forRequest:request];

    // Peform request and assert that we received the expectedFolder as a response.
    XCTestExpectation *expectation = [self expectationWithDescription:@"expectation"];
    [request performRequestWithCompletion:^(BOXFile *file, NSError *error) {
        [self assertModel:expectedFile isEquivalentTo:file];
        XCTAssertNil(error);
        [expectation fulfill];
    }];
    [self waitForExpectationsWithTimeout:2.0 handler:nil];
}

@end


text:
<?php
/**
 * Created by Hisune EchartsPHP AutoGenerate.
 * @author: Hisune <hi@hisune.com>
 */

namespace Hisune\EchartsPHP\Doc\IDE;

use Hisune\EchartsPHP\Property;

/**
 * @property string $id
 *    Component ID, not specified by default. If specified, it can be used to refer the component in option or API.
 *
 * @property int $zlevel Default: 0
 *    zlevel value of all graphical elements in .
 *     zlevel is used to make layers with Canvas. Graphical elements with different zlevel values will be placed in different Canvases, which is a common optimization technique. We can put those frequently changed elements (like those with animations) to a separate zlevel. Notice that too many Canvases will increase memory cost, and should be used carefully on mobile phones to avoid crash.
 *     Canvases with bigger zlevel will be placed on Canvases with smaller zlevel.
 *
 * @property int $z Default: 2
 *    z value of all graphical elements in , which controls order of drawing graphical components. Components with smaller z values may be overwritten by those with larger z values.
 *     z has a lower priority to zlevel, and will not create new Canvas.
 *
 * @property string|int $left Default: 80
 *    Distance between parallel  component and the left side of the container.
 *     left value can be instant pixel value like 20; it can also be a percentage value relative to container width like 20%; and it can also be left, center, or right.
 *     If the left value is set to be left, center, or right, then the component will be aligned automatically based on position.
 *
 * @property string|int $top Default: 60
 *    Distance between parallel  component and the top side of the container.
 *     top value can be instant pixel value like 20; it can also be a percentage value relative to container width like 20%; and it can also be top, middle, or bottom.
 *     If the top value is set to be top, middle, or bottom, then the component will be aligned automatically based on position.
 *
 * @property string|int $right Default: 80
 *    Distance between parallel  component and the right side of the container.
 *     right value can be instant pixel value like 20; it can also be a percentage value relative to container width like 20%.
 *
 * @property string|int $bottom Default: 60
 *    Distance between parallel  component and the bottom side of the container.
 *     bottom value can be instant pixel value like 20; it can also be a percentage value relative to container width like 20%.
 *
 * @property string|int $width Default: 'auto'
 *    Width of parallel  component. Adaptive by default.
 *
 * @property string|int $height Default: 'auto'
 *    Height of parallel  component. Adaptive by default.
 *
 * @property string $layout Default: 'horizontal'
 *
 *
 *     Layout modes, whose optional values are:
 *
 *     horizontal: place each axis horizontally.
 *
 *     vertical: place each axis vertically.
 *
 * @property boolean $axisExpandable Default: false
 *
 *
 *
 *
 *     When dimension number is extremely large, say, more than 50 dimensions, there will be more than 50 axes, which may hardly display in a page.
 *     In this case, you may use parallel.axisExpandable to improve the display. See this example:
 *
 *
 *
 *
 *
 *
 *
 *     Whether to enable toggling axis on clicking.
 *
 * @property int $axisExpandCenter
 *
 *
 *     Index of the axis which is used as the center of expanding initially. It doesnt have a default value, and needs to be assigned manually.
 *     Please refer to parallel.axisExpandable for more information.
 *
 * @property int $axisExpandCount Default: 0
 *
 *
 *     Defines how many axes are at expanding state initially. Wed suggest you assign this value manually according to dimensions.
 *     Please refer to parallel.axisExpandCenter and parallel.axisExpandable.
 *
 * @property int $axisExpandWidth Default: 50
 *
 *
 *     Distance between two axes when at expanding state, in pixels.
 *     Please refer to parallel.axisExpandable for more information.
 *
 * @property string $axisExpandTriggerOn Default: 'click'
 *
 *
 *     Optional values:
 *
 *     click: Trigger expanding when mouse clicking.
 *     mousemove: Trigger expanding when mouse hovering.
 *
 * @property Parallel\ParallelAxisDefault $parallelAxisDefault
 *    When configuring multiple parallelAxis, there might be some common attributes in each axis configuration. To avoid writing them repeatly, they can be put under parallel.parallelAxisDefault. Before initializing axis, configurations in parallel.parallelAxisDefault will be merged into parallelAxis to generate the final axis configuration.
 *     See the sample.
 *
 * {_more_}
 */
class Parallel extends Property {}


text:
#import "APPLocalNotificationOptions.h"

@import UserNotifications;

@interface APPLocalNotificationOptions ()

// The dictionary which contains all notification properties
@property(nonatomic, retain) NSDictionary* dict;

@end

@implementation APPLocalNotificationOptions

@synthesize dict;

#pragma mark -
#pragma mark Initialization

/**
 * Initialize the object with the given options when calling on JS side:
 * notification.local.add(options)
 */
- (id) initWithDict:(NSDictionary*)dictionary
{
    self = [self init];

    self.dict = dictionary;

    return self;
}

#pragma mark -
#pragma mark Attributes

/**
 * The notification's ID.
 */
- (NSNumber*) id
{
    NSInteger id = [[dict objectForKey:@"id"] integerValue];

    return [NSNumber numberWithInteger:id];
}

/**
 * The notification's ID as a string.
 */
- (NSString*) identifier
{
    return [NSString stringWithFormat:@"%@", self.id];
}

/**
 * The notification's title.
 */
- (NSString*) title
{
    return [dict objectForKey:@"title"];
}

/**
 * The notification's title.
 */
- (NSString*) subtitle
{
    NSArray *parts = [self.title componentsSeparatedByString:@"\n"];

    return parts.count < 2 ? @"" : [parts objectAtIndex:1];
}

/**
 * The notification's message.
 */
- (NSString*) text
{
    return [dict objectForKey:@"text"];
}

/**
 * The notification's category.
 */
- (NSString*) category
{
    return [dict objectForKey:@"category"];
}

/**
 * The notification's badge number.
 */
- (NSNumber*) badge
{
    return [NSNumber numberWithInt:[[dict objectForKey:@"badge"] intValue]];
}

/**
 * The notification's sound path.
 */
- (UNNotificationSound*) sound
{
    NSString* path = [dict objectForKey:@"sound"];
    NSString* file;

    if ([self stringIsNullOrEmpty:path])
        return NULL;

    if ([path isEqualToString:@"res://platform_default"])
        return [UNNotificationSound defaultSound];

    if ([path hasPrefix:@"file:/"]) {
        file = [self soundNameForAsset:path];
    } else
    if ([path hasPrefix:@"res:"]) {
        file = [self soundNameForResource:path];
    }

    return [UNNotificationSound soundNamed:file];
}

/**
 * The notification's fire date.
 */
- (NSDate*) fireDate
{
    double timestamp = [[dict objectForKey:@"at"]
                        doubleValue];

    return [NSDate dateWithTimeIntervalSince1970:timestamp];
}

/**
 * If it's a repeating notification.
 */
- (BOOL) isRepeating
{
    NSString* interval = [dict objectForKey:@"every"];

    return ![self stringIsNullOrEmpty:interval];
}

#pragma mark -
#pragma mark Methods

/**
 * Specify how and when to trigger the notification.
 */
- (UNNotificationTrigger*) trigger
{
    return [self isRepeating] ? [self triggerWithDateMatchingComponents] : [self triggerWithTimeInterval];
}

/**
 * The notification's user info dict.
 */
- (NSDictionary*) userInfo
{
    if ([dict objectForKey:@"updatedAt"]) {
        NSMutableDictionary* data = [dict mutableCopy];

        [data removeObjectForKey:@"updatedAt"];

        return data;
    }

    return dict;
}

- (NSArray*) actions
{
  return [dict objectForKey:@"actions"];
}

#pragma mark -
#pragma mark Private

/**
 * Returns a trigger based on a custom time interval in seconds.
 */
- (UNTimeIntervalNotificationTrigger*) triggerWithTimeInterval
{
    return [UNTimeIntervalNotificationTrigger
            triggerWithTimeInterval:[self timeInterval] repeats:NO];
}

/**
 * Returns a trigger based on a calendar time.
 */
- (UNCalendarNotificationTrigger*) triggerWithDateMatchingComponents
{
    NSCalendar* cal = [[NSCalendar alloc]
                       initWithCalendarIdentifier:NSCalendarIdentifierGregorian];

    NSDateComponents *date = [cal components:[self repeatInterval]
                                    fromDate:[self fireDate]];

    [date setTimeZone:[NSTimeZone defaultTimeZone]];

    return [UNCalendarNotificationTrigger
            triggerWithDateMatchingComponents:date repeats:YES];
}

/**
 * Timeinterval between future fire date and now.
 */
- (double) timeInterval
{
    return MAX(0.01f, [self.fireDate timeIntervalSinceDate:[NSDate date]]);
}

/**
 * The notification's repeat interval.
 */
- (NSCalendarUnit) repeatInterval
{
    NSString* interval = [dict objectForKey:@"every"];
    NSCalendarUnit unitFlags = NSCalendarUnitYear|NSCalendarUnitMonth|NSCalendarUnitDay|NSCalendarUnitHour|NSCalendarUnitMinute|NSCalendarUnitSecond;

    if ([self stringIsNullOrEmpty:interval]) {
        return unitFlags;
    }
    else if ([interval isEqualToString:@"second"]) {
        return NSCalendarUnitYear|NSCalendarUnitMonth|NSCalendarUnitDay;
    }
    else if ([interval isEqualToString:@"minute"]) {
        return NSCalendarUnitYear|NSCalendarUnitMonth|NSCalendarUnitDay|NSCalendarUnitSecond;
    }
    else if ([interval isEqualToString:@"hour"]) {
        return NSCalendarUnitYear|NSCalendarUnitMonth|NSCalendarUnitDay|NSCalendarUnitMinute;
    }
    else if ([interval isEqualToString:@"day"]) {
        return NSCalendarUnitHour|NSCalendarUnitMinute;
    }
    else if ([interval isEqualToString:@"week"]) {
        return NSCalendarUnitWeekday|NSCalendarUnitHour|NSCalendarUnitMinute;
    }
    else if ([interval isEqualToString:@"month"]) {
        return NSCalendarUnitDay|NSCalendarUnitHour|NSCalendarUnitMinute;
    }
    else if ([interval isEqualToString:@"year"]) {
        return NSCalendarUnitMonth|NSCalendarUnitDay|NSCalendarUnitHour|NSCalendarUnitMinute;
    }

    return unitFlags;
}

/**
 * Convert relative path to valid sound name attribute.
 */
- (NSString*) soundNameForAsset:(NSString*)path
{
    return [path stringByReplacingOccurrencesOfString:@"file:/"
                                           withString:@"www"];
}

/**
 * Convert resource path to valid sound name attribute.
 */
- (NSString*) soundNameForResource:(NSString*)path
{
    return [path pathComponents].lastObject;
}

/**
 * If the string is empty.
 */
- (BOOL) stringIsNullOrEmpty:(NSString*)str
{
    return (!str.length);
}

@end


text:
<?php

namespace Ibuildings\QaTools\UnitTest\Tool\Behat\Configurator;

use Ibuildings\QaTools\Core\Build\Build;
use Ibuildings\QaTools\Core\Build\Snippet;
use Ibuildings\QaTools\Core\Build\Tool;
use Ibuildings\QaTools\Core\Configuration\TaskDirectory;
use Ibuildings\QaTools\Core\Configuration\TaskHelperSet;
use Ibuildings\QaTools\Core\Interviewer\Answer\YesOrNoAnswer;
use Ibuildings\QaTools\Core\Interviewer\AutomatedResponseInterviewer;
use Ibuildings\QaTools\Core\Project\Directory;
use Ibuildings\QaTools\Core\Project\Project;
use Ibuildings\QaTools\Core\Project\ProjectTypeSet;
use Ibuildings\QaTools\Test\MockeryTestCase;
use Ibuildings\QaTools\Tool\Behat\Configurator\BehatConfigurator;
use Ibuildings\QaTools\UnitTest\AddBuildTaskMatcher;
use Ibuildings\QaTools\UnitTest\InstallComposerDevDependencyTaskMatcher;
use Ibuildings\QaTools\UnitTest\WriteFileTaskMatcher;
use Mockery;

class BehatConfiguratorTest extends MockeryTestCase
{
    const TARGET_NAME = 'behat';

    /**
     * @var AutomatedResponseInterviewer
     */
    private $interviewer;

    /**
     * @var Mockery\MockInterface|TaskHelperSet
     */
    private $taskHelperSet;

    /**
     * @var Mockery\MockInterface|TaskDirectory
     */
    private $taskDirectory;

    protected function setUp()
    {
        $this->interviewer = new AutomatedResponseInterviewer();
        $this->taskHelperSet = Mockery::mock(TaskHelperSet::class);
        $this->taskDirectory = Mockery::spy(TaskDirectory::class);
        $this->taskDirectory->shouldReceive('getProject')->andReturn(
            new Project(
                'Xenophobic Xavier',
                new Directory('.'),
                new Directory('.'),
                new ProjectTypeSet(),
                false
            )
        );
    }

    /**
     * @test
     */
    public function installs_behat_when_desired()
    {
        $this->interviewer->recordAnswer(
            'Would you like to install Behat?',
            YesOrNoAnswer::yes()
        );

        $this->taskHelperSet
            ->shouldReceive('renderTemplate')
            ->with('behat.yml')
            ->andReturn('default:');
        $this->taskHelperSet
            ->shouldReceive('renderTemplate')
            ->with('FeatureContext.php.twig')
            ->andReturn('<?php');
        $this->taskHelperSet
            ->shouldReceive('renderTemplate')
            ->with('ant-build.xml.twig', ['targetName' => self::TARGET_NAME])
            ->andReturn('behat-snippet');

        $configurator = new BehatConfigurator();
        $configurator->configure($this->interviewer, $this->taskDirectory, $this->taskHelperSet);

        $this->taskDirectory->shouldHaveReceived(
            'registerTask',
            [InstallComposerDevDependencyTaskMatcher::forVersionOf('behat/behat', '^3.3')]
        );

        $this->taskDirectory
            ->shouldHaveReceived('registerTask')
            ->with(WriteFileTaskMatcher::contains('./behat.yml', 'default:'))
            ->once();
        $this->taskDirectory
            ->shouldHaveReceived('registerTask')
            ->with(WriteFileTaskMatcher::contains('./features/bootstrap/FeatureContext.php', '<?php'))
            ->once();

        $this->taskDirectory->shouldHaveReceived(
            'registerTask',
            [
                AddBuildTaskMatcher::with(
                    Build::main(),
                    Tool::withIdentifier(self::TARGET_NAME),
                    Snippet::withContentsAndTargetName('behat-snippet', self::TARGET_NAME)
                ),
            ]
        );
    }

    /**
     * @test
     */
    public function does_not_install_behat_when_not_desired()
    {
        $this->interviewer->recordAnswer(
            'Would you like to install Behat?',
            YesOrNoAnswer::no()
        );

        $configurator = new BehatConfigurator();
        $configurator->configure($this->interviewer, $this->taskDirectory, $this->taskHelperSet);

        $this->taskDirectory->shouldNotHaveReceived('registerTask');
    }
}


text:
<?php

namespace JMS\SecurityExtraBundle\Mapping;

/**
 * Contains class metadata information
 *
 * @author Johannes M. Schmitt <schmittjoh@gmail.com>
 */
class ClassMetadata
{
    private $reflection;
    private $methods;

    public function __construct(\ReflectionClass $class)
    {
        $this->reflection = $class;
        $this->methods = array();
    }

    public function addMethod($name, MethodMetadata $method)
    {
        $this->methods[$name] = $method;
    }

    public function getMethods()
    {
        return $this->methods;
    }

    public function getMethod($name)
    {
        return $this->methods[$name];
    }

    public function getReflection()
    {
        return $this->reflection;
    }

    public function hasMethod($name)
    {
        return isset($this->methods[$name]);
    }

    public function hasMethods()
    {
        return count($this->methods) > 0;
    }

    public function merge(ClassMetadata $metadata)
    {
        $reflection = $metadata->getReflection();

        if (false === $reflection->isInterface()) {
            throw new \InvalidArgumentException('You can only merge metadata from interfaces.');
        }
        if (false === $this->reflection->implementsInterface($reflection->getName())) {
            throw new \InvalidArgumentException(sprintf('"%s" does not implement "%s".', $this->reflection->getName(), $reflection->getName()));
        }

        foreach ($metadata->getMethods() as $name => $method) {
            if (!isset($this->methods[$name])) {
                $this->methods[$name] = new MethodMetadata($this->reflection->getMethod($name));
            }

            $this->methods[$name]->merge($method);
        }
    }
}


text:
from os.path import dirname, join
import sys
from setuptools import setup, find_packages

try:
    from wheel.bdist_wheel import bdist_wheel as _bdist_wheel
    import sys

    class bdist_wheel(_bdist_wheel):
        def finalize_options(self):
            _bdist_wheel.finalize_options(self)
            self.python_tag = 'py%i%i' % (sys.version_info.major, sys.version_info.minor)

except ImportError:
    bdist_wheel = None

with open(join(dirname(__file__), 'scrapy_rss/VERSION'), 'rt') as f:
    version = f.read().strip()

with open(join(dirname(__file__), 'requirements.txt'), 'rt') as f:
    install_requires = list(map(str.strip, f))

with open(join(dirname(__file__), 'tests', 'requirements.txt'), 'rt') as f:
    dev_requires = list(map(str.strip, f))

with open('README.rst') as readme:
    setup(
        name='scrapy-rss',
        version=version,
        url='https://github.com/woxcab/scrapy_rss',
        description='RSS Tools for Scrapy Framework',
        long_description=readme.read(),
        license='BSD',
        packages=find_packages(exclude=('tests',)),
        include_package_data=True,
        zip_safe=False,
        python_requires='>=2.7, !=3.0.*, !=3.1.*, !=3.2.*',
        classifiers=[
            'Framework :: Scrapy',
            'Development Status :: 4 - Beta',
            'Intended Audience :: Developers',
            'License :: OSI Approved :: BSD License',
            'Operating System :: OS Independent',
            'Programming Language :: Python',
            'Programming Language :: Python :: 2',
            'Programming Language :: Python :: 2.7',
            'Programming Language :: Python :: 3',
            'Programming Language :: Python :: 3.3',
            'Programming Language :: Python :: 3.4',
            'Programming Language :: Python :: 3.5',
            'Programming Language :: Python :: 3.6',
            'Programming Language :: Python :: 3.7',
            'Programming Language :: Python :: 3.8',
            'Programming Language :: Python :: 3.9',
            'Programming Language :: Python :: 3.10',
            'Topic :: Internet :: WWW/HTTP',
            'Topic :: Software Development :: Libraries :: Python Modules',
        ],
        install_requires=install_requires,
        extras_require={
            'testing': dev_requires
        },
        cmdclass={'bdist_wheel': bdist_wheel},
    )


text:
using ProgettoGIA.Model;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace ProgettoGIA.Presenter
{
    public abstract class Presenter<TControl> where TControl : Control
    {
        private readonly TControl _control;
        private readonly Gara _gara;

        public Presenter(TControl control)
        {
            if (control == null)
            {
                throw new ArgumentNullException("control");
            }

            _control = control;
            _gara = Gara.GetInstance();
            _gara.Changed += OnGaraChanged;
            InitializeControl();
        }

        public TControl Control
        {
            get { return _control; }
        }

        private void OnGaraChanged(object sender, EventArgs e)
        {
            RefreshControl();
        }

        protected virtual void InitializeControl(){}

        protected abstract void RefreshControl();
    }
}


text:
require 'rspec/formatters/illustration_formatter.rb'
require 'open3'

RSpec.configure do |c|
  c.illustration_html_formatter =
    lambda {|illustration|
    html = "
"

    if illustration.has_key?(:label) then
      html << "#{illustration[:label].to_s}"
    end

    if illustration[:html] then
      html << illustration[:html]
    else
      html << "
#{illustration[:content]}
"
    end

    return html << "
"
  }
end


text:
require 'active_support/core_ext'
require 'andand'
require 'grit'

require 'duiker/configuration'
require 'duiker/data'
require 'duiker/repo'
require 'duiker/version'

module Duiker
  extend self

  # Get configuration options
  # If a block is provided, it sets the contained
  # configuration options.
  def configure
    @configuration ||= Configuration.new
    if block_given?
      yield @configuration
    end
    @configuration
  end

  class Error < StandardError
  end
end


text:
using namespace PaintsNow;

SkyTransformVS::SkyTransformVS() {
	instanceBuffer.description.state.usage = IRender::Resource::BufferDescription::INSTANCED;
	globalBuffer.description.state.usage = IRender::Resource::BufferDescription::UNIFORM;
	vertexPositionBuffer.description.state.usage = IRender::Resource::BufferDescription::VERTEX;
}

String SkyTransformVS::GetShaderText() {
	return UnifyShaderCode(
		float4 position = float4(0, 0, 0, 1);
		position.xyz = vertexPosition;
		position = mult_vec(worldMatrix, position);
		rasterPosition = mult_vec(viewProjectionMatrix, position);
		worldPosition = position.xyz;
	);
}

TObject<IReflect>& SkyTransformVS::operator () (IReflect& reflect) {
	BaseClass::operator () (reflect);

	if (reflect.IsReflectProperty()) {
		ReflectProperty(instanceBuffer);
		ReflectProperty(globalBuffer);
		ReflectProperty(vertexPositionBuffer);

		ReflectProperty(worldMatrix)[instanceBuffer][BindInput(BindInput::TRANSFORM_WORLD)];
		ReflectProperty(viewProjectionMatrix)[globalBuffer][BindInput(BindInput::TRANSFORM_VIEWPROJECTION)];

		ReflectProperty(vertexPosition)[vertexPositionBuffer][BindInput(BindInput::POSITION)];
		ReflectProperty(rasterPosition)[BindOutput(BindOutput::HPOSITION)];
		ReflectProperty(worldPosition)[BindOutput(BindOutput::TEXCOORD)];
	}

	return *this;
}


text:
void fam_fields(mongoc_collection_t *collection)
{
   mongoc_find_and_modify_opts_t *opts;
   bson_t fields = BSON_INITIALIZER;
   bson_t *update;
   bson_t reply;
   bson_error_t error;
   bson_t query = BSON_INITIALIZER;
   bool success;

   /* Find Zlatan Ibrahimovic */
   BSON_APPEND_UTF8 (&query, "lastname", "Ibrahimovic");
   BSON_APPEND_UTF8 (&query, "firstname", "Zlatan");

   /* Return his goal tally */
   BSON_APPEND_INT32 (&fields, "goals", 1);

   /* Bump his goal tally */
   update = BCON_NEW ("$inc", "{",
      "goals", BCON_INT32 (1),
   "}");

   opts = mongoc_find_and_modify_opts_new ();
   mongoc_find_and_modify_opts_set_update (opts, update);
   mongoc_find_and_modify_opts_set_fields (opts, &fields);
   /* Return the new tally */
   mongoc_find_and_modify_opts_set_flags (opts, MONGOC_FIND_AND_MODIFY_RETURN_NEW);

   success = mongoc_collection_find_and_modify_with_opts (collection, &query, opts, &reply, &error);

   if (success) {
      char *str;

      str = bson_as_json (&reply, NULL);
      printf ("%s\n", str);
      bson_free (str);
   } else {
      fprintf(stderr, "Got error: \"%s\" on line %d\n", error.message, __LINE__);
   }

   bson_destroy (&reply);
   bson_destroy (update);
   bson_destroy (&fields);
   bson_destroy (&query);
   mongoc_find_and_modify_opts_destroy (opts);
}


text:
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="refresh" content="0; URL=cancel.php">
</head>
</html>


text:
<?php

namespace Sylius\Bundle\SearchBundle\Command;

use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;

/**
 * Command to populate a search index
 *
 * @author Argyrios Gounaris <agounaris@gmail.com>
 */
class IndexCommand extends ContainerAwareCommand
{
    /**
     * @see Symfony\Component\Console\Command\Command::configure()
     */
    protected function configure()
    {
        $this
            ->setName('sylius:search:index')
            ->setDescription('Populate the index')
        ;
    }

    /**
     * @param InputInterface  $input
     * @param OutputInterface $output
     */
    protected function execute(InputInterface $input, OutputInterface $output)
    {
        $output->writeln('Index populate command');

        $indexer = $this->getContainer()->get('sylius_search.command.indexer')->populate($this->getContainer()->get('doctrine.orm.entity_manager'));

        $output->writeln($indexer->getOutput());
    }
}


text:
'use strict';

require('./lib/swiper/swiper.js');
require('./lib/swiper/swiper.css');

require('../stylesheets/common.css');
require('../stylesheets/home.css');

require('./lib/marquee.js');

var Template=require('./core/Template.js');
var FetchApi=require('./core/FetchApi.js');
var WxShare=require('./core/WxShare.js');

var pageParams={};
var Apis={
	home:'/static/exj/home.data.log'
}

main();
function main(){
	renderMain();
	renderFooter();
}
function renderMain(){
	var info=new FetchApi({
        urlApi:Apis.home,
        type:'get'
    },function(){
		var pageTmpl=new Template({
			tmplName:require('../templates/home.tmpl'),
			tmplData:this.records
		});
		$('.container').html(pageTmpl.getHtml());
		var swiper = new Swiper('.swiper-container', {
	        pagination: '.swiper-pagination',
	        nextButton: '.swiper-button-next',
	        prevButton: '.swiper-button-prev',
	        paginationClickable: true,
	        //spaceBetween: 30,
	        centeredSlides: true,
	        autoplay: 5000,
	        loop:true,
	        autoplayDisableOnInteraction: false
	    });
	    $("#tab-2").marquee({
		    speed:3000,
		    rowHeight:20
		});
		var wxShare=new WxShare({
			img:'/wechat/v4.0/public/images/share.jpg',
			linkurl:'/wechat/v4.0/home.html',
			desc:'优致的家庭服务,一分钟找到靠谱家政手艺人!',
			title:'e享家'
		})
		bindEvents();
    });
}
function renderFooter(){
	var footer=new Template({
		tmplName:require('../templates/footer.tmpl'),
		tmplData:{current:1}
	});
	$('footer').html(footer.getHtml());
}
function bindEvents(){
	$('.swiper-slide').click(function(){
		var toUrl=$(this).data('goto');
		if(!!toUrl){
			window.location.href=toUrl;
		}
	})
	$('.top-left').click(function(){
		window.location.href='nurse.html';
	})
	$('.router').click(function(){
		var router=$(this).data('router');
		window.location.href=router;
	})
	$('.go-activity').click(function(){
		var toUrl=$(this).data('goto');
		if(!!toUrl){
			window.location.href=toUrl;
		}
	})
	$('.more').click(function(){
		window.location.href='comments.html';
	})
	$('.news').click(function(){
		window.location.href='news.html';
	})
}


text:
"""
Init Numba extension for Pandas Series.
"""

from . import types
from . import boxing
from . import pdimpl
from . import rewrites

import numba

# register Series in numba.types for using in objmode
setattr(numba.types, 'series', types.SeriesType)


text:
package kafka.examples.streams.wordcount;

/**
 * Created by PravinKumar on 13/7/17.
 */

import org.apache.kafka.clients.consumer.ConsumerConfig;
import org.apache.kafka.common.serialization.Serdes;
import org.apache.kafka.streams.KafkaStreams;
import org.apache.kafka.streams.KeyValue;
import org.apache.kafka.streams.StreamsConfig;
import org.apache.kafka.streams.kstream.*;

import java.util.Arrays;
import java.util.Locale;
import java.util.Properties;

/**
 * Demonstrates, using the high-level KStream DSL, how to implement the WordCount program
 * that computes a simple word occurrence histogram from an input text.
 *

 * In this example, the input stream reads from a topic named "streams-file-input", where the values of messages
 * represent lines of text; and the histogram output is written to topic "streams-wordcount-output" where each record
 * is an updated count of a single word.
 *

 * Before running this example you must create the input topic and the output topic (e.g. via
 * bin/kafka-topics.sh --create ...), and write some data to the input topic (e.g. via
 * bin/kafka-console-producer.sh). Otherwise you won't see any data arriving in the output topic.
 */
public class WordCountDemo {
    public static void main(String[] args) throws Exception {
        Properties props = new Properties();
        props.put(StreamsConfig.APPLICATION_ID_CONFIG, "streams-wordcount");
        props.put(StreamsConfig.BOOTSTRAP_SERVERS_CONFIG, "localhost:9092");
        props.put(StreamsConfig.DEFAULT_KEY_SERDE_CLASS_CONFIG, Serdes.String().getClass().getName());
        props.put(StreamsConfig.DEFAULT_VALUE_SERDE_CLASS_CONFIG, Serdes.String().getClass().getName());
// setting offset reset to earliest so that we can re-run the demo code with the same pre-loaded data
// Note: To re-run the demo, you need to use the offset reset tool:
// https://cwiki.apache.org/confluence/display/KAFKA/Kafka+Streams+Application+Reset+Tool
        props.put(ConsumerConfig.AUTO_OFFSET_RESET_CONFIG, "earliest");
        KStreamBuilder builder = new KStreamBuilder();
        KStream<String, String> source = builder.stream("streams-file-input1");
        KTable<String, Long> counts = source
                .flatMapValues(new ValueMapper<String, Iterable<String>>() {
                    @Override
                    public Iterable<String> apply(String value) {
                        return Arrays.asList(value.toLowerCase(Locale.getDefault()).split(" "));
                    }
                }).map(new KeyValueMapper<String, String, KeyValue<String, String>>() {
                    @Override
                    public KeyValue<String, String> apply(String key, String value) {
                        return new KeyValue<>(value, value);
                    }
                })
                .groupByKey()
                .count("Counts");

        counts.to(Serdes.String(), Serdes.Long(), "streams-wordcount-output");

        //.mapValues((count) -> String.valueOf(count));
// need to override value serde to Long type

        //counts.to("streams-wordcount-output");
        KafkaStreams streams = new KafkaStreams(builder, props);
        streams.start();

// usually the stream application would be running forever,
// in this example we just let it run for some time and stop since the input data is finite.
        Thread.sleep(5000L);
        streams.close();
    }
}


text:
    display:none;
}

.attribution {
    display:none;
}

.user-name-in-table, .user-affiliation-in-table {
    display:none;
}

#EditUser {
    display: none;
}

.author {
    display: none;
}


text:
An Ember component for realtime rendering of your app's components using an instance of the in browser codemirror code editor. This component was created for use within a documentation context, for providing examples of components and tweaking their attributes to see how they are affected in realtime. However, you may find other uses for it beyond this.

***

## Installation && Requirements

**Requirements**

This addon requires Node >= v4.3

**Installation**

```
# From the command line:
ember install ember-component-playground
```

***

## Usage

Create a component playground using the addon's primary export:

```handlebars
{{component-playground}}
```

This will create an empty code editor with a render preview. You can supply starting code to the component with the `code` attribute:

```handlebars
{{component-playground code="<h4>This is a totally radical component in my project:</h4> {{radical-component}}"}}
```

This will create a code editor with your code pre-populated and a rendered template in the render preview.

**Configuring the Editor**
The editor is a Ember DDAU version of the [CodeMirror](https://codemirror.net/) editor. The editor is configured to use handlebars syntax with the very beautiful [Panda Theme](https://github.com/PandaTheme) created by [Siamek Mokhtari](https://github.com/siamak) by default. Changing these defaults requires two steps, importing assets during the build and passing configurations to an editor instance.

Import the assets during the build by specifying which modes and themes you'd like to import in you `ember-cli-build` file:

```javascript
var app = new EmberApp(defaults, {
  // Configure assets to import for codemirror
  codemirror: {
    modes: ['javascript'],
    themes: ['monokai']
  },
});
```

Then pass props `mode` and `theme` to an instance of the playground:

```handlebars
{{component-playground mode="javascript" theme="monokai"}}
```

***

## How it Works

This addon provides a `{{component-playground}}` component. An instance of the [CodeMirror](https://codemirror.net/) editor component drives the text editor inside the playground. The component will attempt to compile any text entered and if successful it will render the output using a `{{partial}}`.

***

## Development && Contributing

Contributions are welcome! Project development is documented below:

#### Running

* `ember serve`
* Visit your app at [http://localhost:4200](http://localhost:4200).

#### Running Tests

* `npm test` (Runs `ember try:each` to test your addon against multiple Ember versions)
* `ember test`
* `ember test --server`

***

### TODO:

- [x] Make `panda-syntax` the default theme
- [x] Make `htmlhandlebars` the default mode
- [x] Make codemirror theme configurable
- [x] Document Node >= 4.3 requirements
- [] Ability to set default themes. Maybe by exporting your own component-playground instance pulled from the addon namespace
- [] Better how it works documentation for a high level overview
- [] Include picture in README of actual usage
- [x] Include `htmlhandlebars`
- [] Create block form instance with yielded partial name for extra context magics
- [x] Import css in treeForVendor b/c it's just structural
- [x] This addon MUST run before the cli-shim for configs to work


text:
from oslo_config import cfg

spice_opt_group = cfg.OptGroup('spice',
        title="SPICE console features",
        help="""
SPICE console feature allows you to connect to a guest virtual machine.
SPICE is a replacement for fairly limited VNC protocol.

Following requirements must be met in order to use SPICE:

* Virtualization driver must be libvirt
* spice.enabled set to True
* vnc.enabled set to False
* update html5proxy_base_url
* update server_proxyclient_address
""")

CLI_OPTS = [
    cfg.HostAddressOpt('html5proxy_host',
        default='0.0.0.0',
        help="""
IP address or a hostname on which the ``nova-spicehtml5proxy`` service
listens for incoming requests.

Related options:

* This option depends on the ``html5proxy_base_url`` option.
  The ``nova-spicehtml5proxy`` service must be listening on a host that is
  accessible from the HTML5 client.
"""),
    cfg.PortOpt('html5proxy_port',
        default=6082,
        help="""
Port on which the ``nova-spicehtml5proxy`` service listens for incoming
requests.

Related options:

* This option depends on the ``html5proxy_base_url`` option.
  The ``nova-spicehtml5proxy`` service must be listening on a port that is
  accessible from the HTML5 client.
""")
]

ALL_OPTS = [
    cfg.BoolOpt('enabled',
        default=False,
        help="""
Enable SPICE related features.

Related options:

* VNC must be explicitly disabled to get access to the SPICE console. Set the
  enabled option to False in the [vnc] section to disable the VNC console.
"""),
    cfg.BoolOpt('agent_enabled',
        default=True,
        help="""
Enable the SPICE guest agent support on the instances.

The Spice agent works with the Spice protocol to offer a better guest console
experience. However, the Spice console can still be used without the Spice
Agent. With the Spice agent installed the following features are enabled:

* Copy & Paste of text and images between the guest and client machine
* Automatic adjustment of resolution when the client screen changes - e.g.
  if you make the Spice console full screen the guest resolution will adjust to
  match it rather than letterboxing.
* Better mouse integration - The mouse can be captured and released without
  needing to click inside the console or press keys to release it. The
  performance of mouse movement is also improved.
"""),
    cfg.URIOpt('html5proxy_base_url',
        default='http://127.0.0.1:6082/spice_auto.html',
        help="""
Location of the SPICE HTML5 console proxy.

End user would use this URL to connect to the `nova-spicehtml5proxy``
service. This service will forward request to the console of an instance.

In order to use SPICE console, the service ``nova-spicehtml5proxy`` should be
running. This service is typically launched on the controller node.

Possible values:

* Must be a valid URL of the form:  ``http://host:port/spice_auto.html``
  where host is the node running ``nova-spicehtml5proxy`` and the port is
  typically 6082. Consider not using default value as it is not well defined
  for any real deployment.

Related options:

* This option depends on ``html5proxy_host`` and ``html5proxy_port`` options.
  The access URL returned by the compute node must have the host
  and port where the ``nova-spicehtml5proxy`` service is listening.
"""),
    cfg.StrOpt('server_listen',
        default='127.0.0.1',
        help="""
The  address where the SPICE server running on the instances should listen.

Typically, the ``nova-spicehtml5proxy`` proxy client runs on the controller
node and connects over the private network to this address on the compute
node(s).

Possible values:

* IP address to listen on.
"""),
    cfg.StrOpt('server_proxyclient_address',
        default='127.0.0.1',
        help="""
The address used by ``nova-spicehtml5proxy`` client to connect to instance
console.

Typically, the ``nova-spicehtml5proxy`` proxy client runs on the
controller node and connects over the private network to this address on the
compute node(s).

Possible values:

* Any valid IP address on the compute node.

Related options:

* This option depends on the ``server_listen`` option.
  The proxy client must be able to access the address specified in
  ``server_listen`` using the value of this option.
"""),
]

ALL_OPTS.extend(CLI_OPTS)

def register_opts(conf):
    conf.register_opts(ALL_OPTS, group=spice_opt_group)

def register_cli_opts(conf):
    conf.register_cli_opts(CLI_OPTS, group=spice_opt_group)

def list_opts():
    return {spice_opt_group: ALL_OPTS}


text:
RubyLint.registry.register('Fiber') do |defs|
  defs.define_constant('Fiber') do |klass|
    klass.inherits(defs.constant_proxy('Object', RubyLint.registry))

    klass.define_method('create') do |method|
      method.define_argument('callable')
    end

    klass.define_method('current')

    klass.define_method('new') do |method|
      method.define_optional_argument('size')

      method.returns { |object| object.instance }
    end

    klass.define_method('yield') do |method|
      method.define_rest_argument('args')
    end

    klass.define_instance_method('alive?')

    klass.define_instance_method('resume') do |method|
      method.define_rest_argument('args')
    end

    klass.define_instance_method('transfer') do |method|
      method.define_rest_argument('args')
    end
  end
end


text:
package com.groupdocs.comparison.examples.advanced_usage.comparison;

import com.groupdocs.comparison.Comparer;
import com.groupdocs.comparison.examples.SampleFiles;
import com.groupdocs.comparison.examples.Utils;
import com.groupdocs.comparison.options.CompareOptions;
import com.groupdocs.comparison.options.style.StyleSettings;

import java.awt.*;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.InputStream;
import java.io.OutputStream;
import java.nio.file.Path;

/**
 * This example demonstrates using some of compare settings
 */
public class CompareDocumentsSettingsStream {
    public static void run() throws Exception {

        String outputFileName = Utils.getOutputDirectoryPath(SampleFiles.RESULT_WORD, "CompareDocumentsSettingsStream");

        try (InputStream sourceStream = new FileInputStream(SampleFiles.SOURCE_WORD);
             InputStream targetStream = new FileInputStream(SampleFiles.TARGET1_WORD);
             OutputStream resultStream = new FileOutputStream(outputFileName);
             Comparer comparer = new Comparer(sourceStream)) {
            comparer.add(targetStream);

            {
                // Note: It is the same with commented code below
                final Path resultPath = comparer.compare(resultStream,
                        new CompareOptions.Builder()
                                .setInsertedItemStyle(
                                        new StyleSettings.Builder()
                                                .setHighlightColor(Color.RED)
                                                .setFontColor(Color.GREEN)
                                                .setUnderline(true)
                                                .build()
                                ).build());

                // Note: It is the same with the code above
//                final StyleSettings styleSettings = new StyleSettings();
//                styleSettings.setHighlightColor(Color.RED);
//                styleSettings.setFontColor(Color.GREEN);
//                styleSettings.setUnderline(true);
//                CompareOptions compareOptions = new CompareOptions();
//                compareOptions.setInsertedItemStyle(styleSettings);
//                final Path resultPath = comparer.compare(new FileOutputStream(outputFileName), compareOptions);
            }

        }
          System.out.println("\nDocuments compared successfully.\nCheck output in " + Utils.OUTPUT_PATH + ".");
    }
}


text:
<?php
/**
 * The following variables are available in this template:
 * - $this: the BootCrudCode object
 */
/** @var AweCrudCode $this */
?>
<?php echo "<?php".PHP_EOL ?>
/** @var <?php echo $this->controllerClass; ?> $this */
/** @var AweActiveForm $form */
<?php echo "\$form = \$this->beginWidget('bootstrap.widgets.TbActiveForm', array(
	'action' => Yii::app()->createUrl(\$this->route),
	'method' => 'get',
)); ?>\n"
; ?>

<?php foreach ($this->tableSchema->columns as $column): ?>
<?php
    $field = $this->generateInputField($this->modelClass, $column);
    if (strpos($field, 'password') !== false) {
        continue;
    }
    ?>

    <?php
    $cadena="echo ";
    if ( ( strtoupper($column->dbType) == 'DATETIME')  || ( strtoupper($column->dbType) == 'DATE') ) {
        $cadena = "";

    }

    ?>

<?php echo "<?php $cadena " . $this->generateActiveField($this->modelClass, $column) . "; ?>\n"; ?>

<?php endforeach; ?>
<div class="form-actions">
    <?php echo "<?php \$this->widget('bootstrap.widgets.TbButton', array(
			'type' => 'primary',
			'label' => Yii::t('AweCrud.app', 'Search'),
		)); ?>\n"; ?>
</div>

<?php echo "<?php \$this->endWidget(); ?>\n"; ?>


text:
{%extends display.admin%}

{%block pageContent%}

<form method="post" enctype="multipart/form-data" autocomplete="off">

{{page.title}}

          {{block("iWebsite")}}

          {{block("iGmail")}}

          {{block("iFacebook")}}
          {{block("iTwitter")}}
          {{block("iLinkedin")}}
          {{block("iInstagram")}}
          {{block("isave")}}

</form>
{%endblock%}

{%block iWebsite%}
{%trans "Website"%}

  <input type="url" name="website" id="website" placeholder='{%trans "like"%} https://ermile.com' value="{{dataRow.website}}" maxlength='40' minlength="1" pattern=".{1,40}">

{%endblock%}

{%block iInstagram%}
{%trans "Instagram"%}

  instagram.com/
  <input type="text" name="instagram" id="instagram" placeholder='{%trans "Instagram"%}' value="{{dataRow.instagram}}" maxlength='30' minlength="1">

{%endblock%}

{%block iFacebook%}
{%trans "Facebook"%}

  facebook.com/
  <input type="text" name="facebook" id="facebook" placeholder='{%trans "Facebook"%}' value="{{dataRow.facebook}}" maxlength='30' minlength="1">

{%endblock%}

{%block iTwitter%}
{%trans "Twitter"%}

  twitter.com/
  <input type="text" name="twitter" id="twitter" placeholder='{%trans "Twitter"%}' value="{{dataRow.twitter}}" maxlength='30' minlength="1">

{%endblock%}

{%block iLinkedin%}
{%trans "Linkedin"%}

  linkedin.com/
  <input type="text" name="linkedin" id="linkedin" placeholder='{%trans "Linkedin"%}' value="{{dataRow.linkedin}}" maxlength='30' minlength="1">

{%endblock%}

{%block iGmail%}
{%if value.gmail %}
{%trans "Gmail"%}

  <input type="email" name="gmail" id="gmail" placeholder='{%trans "Like"%} abc@gmail.com' value="{{dataRow.gmail}}" maxlength='50' readonly disabled>

{%endif%}
{%endblock%}

{%block isave%}

  <button class="btn success">{%trans "Save"%}</button>

{%endblock%}


text:
using System;
using System.ComponentModel.DataAnnotations;

namespace VideoApiWeb.Models {
  public class PerUserWebCache {
    [Key]
    public int EntryId { get; set; }
    public string WebUserUniqueId { get; set; }
    public byte[] CacheBits { get; set; }
    public DateTime LastWrite { get; set; }
  }
}


text:
// Copyright (c) 2014-2020 Dr. Colin Hirsch and Daniel Frey
// Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/

#ifndef TAO_PEGTL_MEMORY_INPUT_HPP
#define TAO_PEGTL_MEMORY_INPUT_HPP

#include <cassert>
#include <cstddef>
#include <cstdint>
#include <cstring>
#include <string>
#include <string_view>
#include <type_traits>
#include <utility>

#include "config.hpp"
#include "eol.hpp"
#include "normal.hpp"
#include "nothing.hpp"
#include "position.hpp"
#include "tracking_mode.hpp"

#include "internal/action_input.hpp"
#include "internal/at.hpp"
#include "internal/bump.hpp"
#include "internal/eolf.hpp"
#include "internal/iterator.hpp"
#include "internal/marker.hpp"
#include "internal/until.hpp"

namespace TAO_PEGTL_NAMESPACE
{
   namespace internal
   {
      template< tracking_mode, typename Eol, typename Source >
      class memory_input_base;

      template< typename Eol, typename Source >
      class memory_input_base< tracking_mode::eager, Eol, Source >
      {
      public:
         using iterator_t = internal::iterator;

         template< typename T >
         memory_input_base( const iterator_t& in_begin, const char* in_end, T&& in_source ) noexcept( std::is_nothrow_constructible_v< Source, T&& > )
            : m_begin( in_begin.data ),
              m_current( in_begin ),
              m_end( in_end ),
              m_source( std::forward< T >( in_source ) )
         {}

         template< typename T >
         memory_input_base( const char* in_begin, const char* in_end, T&& in_source ) noexcept( std::is_nothrow_constructible_v< Source, T&& > )
            : m_begin( in_begin ),
              m_current( in_begin ),
              m_end( in_end ),
              m_source( std::forward< T >( in_source ) )
         {}

         memory_input_base( const memory_input_base& ) = delete;
         memory_input_base( memory_input_base&& ) = delete;

         ~memory_input_base() = default;

         memory_input_base operator=( const memory_input_base& ) = delete;
         memory_input_base operator=( memory_input_base&& ) = delete;

         [[nodiscard]] const char* current() const noexcept
         {
            return m_current.data;
         }

         [[nodiscard]] const char* begin() const noexcept
         {
            return m_begin;
         }

         [[nodiscard]] const char* end( const std::size_t /*unused*/ = 0 ) const noexcept
         {
            return m_end;
         }

         [[nodiscard]] std::size_t byte() const noexcept
         {
            return m_current.byte;
         }

         [[nodiscard]] std::size_t line() const noexcept
         {
            return m_current.line;
         }

         [[nodiscard]] std::size_t byte_in_line() const noexcept
         {
            return m_current.byte_in_line;
         }

         void bump( const std::size_t in_count = 1 ) noexcept
         {
            internal::bump( m_current, in_count, Eol::ch );
         }

         void bump_in_this_line( const std::size_t in_count = 1 ) noexcept
         {
            internal::bump_in_this_line( m_current, in_count );
         }

         void bump_to_next_line( const std::size_t in_count = 1 ) noexcept
         {
            internal::bump_to_next_line( m_current, in_count );
         }

         [[nodiscard]] TAO_PEGTL_NAMESPACE::position position( const iterator_t& it ) const
         {
            return TAO_PEGTL_NAMESPACE::position( it, m_source );
         }

         void restart( const std::size_t in_byte = 0, const std::size_t in_line = 1, const std::size_t in_byte_in_line = 1 )
         {
            assert( in_line != 0 );
            assert( in_byte_in_line != 0 );

            m_current.data = m_begin;
            m_current.byte = in_byte;
            m_current.line = in_line;
            m_current.byte_in_line = in_byte_in_line;
         }

      protected:
         const char* const m_begin;
         iterator_t m_current;
         const char* const m_end;
         const Source m_source;
      };

      template< typename Eol, typename Source >
      class memory_input_base< tracking_mode::lazy, Eol, Source >
      {
      public:
         using iterator_t = const char*;

         template< typename T >
         memory_input_base( const internal::iterator& in_begin, const char* in_end, T&& in_source ) noexcept( std::is_nothrow_constructible_v< Source, T&& > )
            : m_begin( in_begin ),
              m_current( in_begin.data ),
              m_end( in_end ),
              m_source( std::forward< T >( in_source ) )
         {}

         template< typename T >
         memory_input_base( const char* in_begin, const char* in_end, T&& in_source ) noexcept( std::is_nothrow_constructible_v< Source, T&& > )
            : m_begin( in_begin ),
              m_current( in_begin ),
              m_end( in_end ),
              m_source( std::forward< T >( in_source ) )
         {}

         memory_input_base( const memory_input_base& ) = delete;
         memory_input_base( memory_input_base&& ) = delete;

         ~memory_input_base() = default;

         memory_input_base operator=( const memory_input_base& ) = delete;
         memory_input_base operator=( memory_input_base&& ) = delete;

         [[nodiscard]] const char* current() const noexcept
         {
            return m_current;
         }

         [[nodiscard]] const char* begin() const noexcept
         {
            return m_begin.data;
         }

         [[nodiscard]] const char* end( const std::size_t /*unused*/ = 0 ) const noexcept
         {
            return m_end;
         }

         [[nodiscard]] std::size_t byte() const noexcept
         {
            return std::size_t( current() - m_begin.data );
         }

         void bump( const std::size_t in_count = 1 ) noexcept
         {
            m_current += in_count;
         }

         void bump_in_this_line( const std::size_t in_count = 1 ) noexcept
         {
            m_current += in_count;
         }

         void bump_to_next_line( const std::size_t in_count = 1 ) noexcept
         {
            m_current += in_count;
         }

         [[nodiscard]] TAO_PEGTL_NAMESPACE::position position( const iterator_t it ) const
         {
            internal::iterator c( m_begin );
            internal::bump( c, std::size_t( it - m_begin.data ), Eol::ch );
            return TAO_PEGTL_NAMESPACE::position( c, m_source );
         }

         void restart()
         {
            m_current = m_begin.data;
         }

      protected:
         const internal::iterator m_begin;
         iterator_t m_current;
         const char* const m_end;
         const Source m_source;
      };

   }  // namespace internal

   template< tracking_mode P = tracking_mode::eager, typename Eol = eol::lf_crlf, typename Source = std::string >
   class memory_input
      : public internal::memory_input_base< P, Eol, Source >
   {
   public:
      static constexpr tracking_mode tracking_mode_v = P;

      using eol_t = Eol;
      using source_t = Source;

      using typename internal::memory_input_base< P, Eol, Source >::iterator_t;

      using action_t = internal::action_input< memory_input >;

      using internal::memory_input_base< P, Eol, Source >::memory_input_base;

      template< typename T >
      memory_input( const char* in_begin, const std::size_t in_size, T&& in_source ) noexcept( std::is_nothrow_constructible_v< Source, T&& > )
         : memory_input( in_begin, in_begin + in_size, std::forward< T >( in_source ) )
      {}

      template< typename T >
      memory_input( const std::string& in_string, T&& in_source ) noexcept( std::is_nothrow_constructible_v< Source, T&& > )
         : memory_input( in_string.data(), in_string.size(), std::forward< T >( in_source ) )
      {}

      template< typename T >
      memory_input( const std::string_view in_string, T&& in_source ) noexcept( std::is_nothrow_constructible_v< Source, T&& > )
         : memory_input( in_string.data(), in_string.size(), std::forward< T >( in_source ) )
      {}

      template< typename T >
      memory_input( std::string&&, T&& ) = delete;

      template< typename T >
      memory_input( const char* in_begin, T&& in_source ) noexcept( std::is_nothrow_constructible_v< Source, T&& > )
         : memory_input( in_begin, std::strlen( in_begin ), std::forward< T >( in_source ) )
      {}

      template< typename T >
      memory_input( const char* in_begin, const char* in_end, T&& in_source, const std::size_t in_byte, const std::size_t in_line, const std::size_t in_byte_in_line ) noexcept( std::is_nothrow_constructible_v< Source, T&& > )
         : memory_input( { in_begin, in_byte, in_line, in_byte_in_line }, in_end, std::forward< T >( in_source ) )
      {}

      memory_input( const memory_input& ) = delete;
      memory_input( memory_input&& ) = delete;

      ~memory_input() = default;

      memory_input operator=( const memory_input& ) = delete;
      memory_input operator=( memory_input&& ) = delete;

      [[nodiscard]] const Source& source() const noexcept
      {
         return this->m_source;
      }

      [[nodiscard]] bool empty() const noexcept
      {
         return this->current() == this->end();
      }

      [[nodiscard]] std::size_t size( const std::size_t /*unused*/ = 0 ) const noexcept
      {
         return std::size_t( this->end() - this->current() );
      }

      [[nodiscard]] char peek_char( const std::size_t offset = 0 ) const noexcept
      {
         return this->current()[ offset ];
      }

      [[nodiscard]] std::uint8_t peek_uint8( const std::size_t offset = 0 ) const noexcept
      {
         return static_cast< std::uint8_t >( peek_char( offset ) );
      }

      [[nodiscard]] iterator_t& iterator() noexcept
      {
         return this->m_current;
      }

      [[nodiscard]] const iterator_t& iterator() const noexcept
      {
         return this->m_current;
      }

      using internal::memory_input_base< P, Eol, Source >::restart;

      template< rewind_mode M >
      void restart( const internal::marker< iterator_t, M >& m ) noexcept
      {
         iterator() = m.iterator();
      }

      using internal::memory_input_base< P, Eol, Source >::position;

      [[nodiscard]] TAO_PEGTL_NAMESPACE::position position() const
      {
         return position( iterator() );
      }

      void discard() const noexcept {}

      void require( const std::size_t /*unused*/ ) const noexcept {}

      template< rewind_mode M >
      [[nodiscard]] internal::marker< iterator_t, M > mark() noexcept
      {
         return internal::marker< iterator_t, M >( iterator() );
      }

      [[nodiscard]] const char* at( const TAO_PEGTL_NAMESPACE::position& p ) const noexcept
      {
         return this->begin() + p.byte;
      }

      [[nodiscard]] const char* begin_of_line( const TAO_PEGTL_NAMESPACE::position& p ) const noexcept
      {
         return at( p ) - ( p.byte_in_line - 1 );
      }

      [[nodiscard]] const char* end_of_line( const TAO_PEGTL_NAMESPACE::position& p ) const noexcept
      {
         using input_t = memory_input< tracking_mode::lazy, Eol, const char* >;
         input_t in( at( p ), this->end(), "" );
         using grammar = internal::until< internal::at< internal::eolf > >;
         (void)normal< grammar >::match< apply_mode::nothing, rewind_mode::dontcare, nothing, normal >( in );
         return in.current();
      }

      [[nodiscard]] std::string_view line_at( const TAO_PEGTL_NAMESPACE::position& p ) const noexcept
      {
         const char* b = begin_of_line( p );
         return std::string_view( b, static_cast< std::size_t >( end_of_line( p ) - b ) );
      }
   };

   template< typename... Ts >
   memory_input( Ts&&... ) -> memory_input<>;

}  // namespace TAO_PEGTL_NAMESPACE

#endif


text:
import sys
from unittest.mock import patch

import pytest
from importlib import reload

import pynamodb.settings

@pytest.mark.parametrize('settings_str', [
    "session_cls = object()",
    "request_timeout_seconds = 5",
])
def test_override_old_attributes(settings_str, tmpdir):
    custom_settings = tmpdir.join("pynamodb_settings.py")
    custom_settings.write(settings_str)

    with patch.dict('os.environ', {'PYNAMODB_CONFIG': str(custom_settings)}):
        with pytest.warns(UserWarning) as warns:
            reload(pynamodb.settings)
    assert len(warns) == 1
    assert 'options are no longer supported' in str(warns[0].message)


text:
using System;
using System.Collections;
using System.IO;
using FluorineFx.Util;
using FluorineFx.IO;

namespace FluorineFx.IO.Mp3
{
    /// <summary>
    /// Mp3 handler interface.
    /// </summary>
    [CLSCompliant(false)]
    public interface IMp3File : IStreamableFile
    {
    }
}


text:
class ChangeColumnDisplayCountOnFeeds < ActiveRecord::Migration
  def change
    change_column :feeds, :display_count, :integer, :null => false, :default => Feed::DEFAULT_DISPLAY_COUNT
  end
end


text:
package com.dremio.service.statistics;

import com.dremio.exec.proto.CoordinationProtos;
import com.dremio.exec.proto.StatisticsRPC;
import com.dremio.exec.rpc.FutureBitCommand;
import com.dremio.exec.rpc.RpcFuture;
import com.dremio.exec.rpc.RpcOutcomeListener;
import com.dremio.services.fabric.ProxyConnection;
import com.dremio.services.fabric.api.FabricCommandRunner;

/**
 * To access StatisticsService from executor(client)
 */
class StatisticsTunnel {
  private static final org.slf4j.Logger logger = org.slf4j.LoggerFactory.getLogger(StatisticsTunnel.class);

  private final CoordinationProtos.NodeEndpoint ep;
  private final FabricCommandRunner manager;

  public StatisticsTunnel(CoordinationProtos.NodeEndpoint ep, FabricCommandRunner manager) {
    super();
    this.ep = ep;
    this.manager = manager;
  }

  /**
   * To get RequestStatisticsInfo
   */
  public static class RequestStatisticsInfo extends FutureBitCommand<StatisticsRPC.StatisticsInfoResp,
    ProxyConnection> {
    private final StatisticsRPC.StatisticsInfoReq statisticsInfoRequest;

    public RequestStatisticsInfo(StatisticsRPC.StatisticsInfoReq statisticsInfoRequest) {
      super();
      this.statisticsInfoRequest = statisticsInfoRequest;
    }

    @Override
    public void doRpcCall(RpcOutcomeListener<StatisticsRPC.StatisticsInfoResp> outcomeListener, ProxyConnection
      connection) {
      connection.send(outcomeListener, StatisticsRPC.RpcType.REQ_STATISTICS_INFO, statisticsInfoRequest, StatisticsRPC
        .StatisticsInfoResp.class);
    }
  }

  public RpcFuture<StatisticsRPC.StatisticsInfoResp> requestStatisticsInfos() {
    StatisticsRPC.StatisticsInfoReq statisticsInfoRequest = StatisticsRPC.StatisticsInfoReq.newBuilder().build();
    StatisticsTunnel.RequestStatisticsInfo b = new StatisticsTunnel.RequestStatisticsInfo(statisticsInfoRequest);
    manager.runCommand(b);
    return b.getFuture();
  }
}


text:
package org.caleydo.view.compounds.ui;

import gleem.linalg.Vec2f;

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

import org.caleydo.core.data.collection.EDimension;
import org.caleydo.core.util.collection.Pair.ComparablePair;
import org.caleydo.core.util.logging.Logger;
import org.caleydo.core.view.opengl.layout2.GLElement;
import org.caleydo.core.view.opengl.layout2.GLElementContainer;
import org.caleydo.core.view.opengl.layout2.GLSandBox;
import org.caleydo.core.view.opengl.layout2.basic.ScrollBar;
import org.caleydo.core.view.opengl.layout2.basic.ScrollingDecorator;
import org.caleydo.core.view.opengl.layout2.basic.ScrollingDecorator.IHasMinSize;
import org.caleydo.core.view.opengl.layout2.geom.Rect;
import org.caleydo.core.view.opengl.layout2.layout.GLLayouts;
import org.caleydo.core.view.opengl.layout2.layout.GLMinSizeProviders;
import org.caleydo.core.view.opengl.picking.APickingListener;
import org.caleydo.core.view.opengl.picking.Pick;

/**
 * element of this view
 *
 * @author Hendrik Strobelt
 *
 */
public class MultiCompoundsList extends GLElementContainer implements IHasMinSize {
	private static final Logger log = Logger.create(MultiCompoundsList.class);

	private static final float MIN_COMPOUND_WIDTH = 200;
	private static final float MIN_COMPOUND_HEIGHT = 200;
	private static final float COMPOUND_SPACING = 5;

	protected ScrollingDecorator scrollingDecorator;

	protected ScrollableCompoundsList body;

	// public MultiCompoundsElement(){
	//
	// }

	protected class ScrollableCompoundsList extends GLElementContainer {
		private List<ComparablePair<String, String>> smilesList;

		public ScrollableCompoundsList(final List<ComparablePair<String, String>> smilesList) {
			super();
			this.smilesList = smilesList;
			setLayout(new UniformSizeMatrixLayout(new Vec2f(MIN_COMPOUND_WIDTH, MIN_COMPOUND_HEIGHT), COMPOUND_SPACING));
			setMinSizeProvider(GLMinSizeProviders.createDefaultMinSizeProvider(300, 300));
			// setLayout(new GLSizeRestrictiveFlowLayout2(false, 5, GLPadding.ZERO));
			// setMinSizeProvider(GLMinSizeProviders.createVerticalFlowMinSizeProvider(this,
			// 5, GLPadding.ZERO));

			for (ComparablePair<String, String> smile : this.smilesList) {
				// add(new CompoundsElement(smile,400,400));
				final CompoundsElement el = new CompoundsElement(smile.getSecond(), smile.getFirst());
				el.onPick(new APickingListener() {
					@Override
					protected void clicked(Pick pick) {
						System.out.println(el.getName());
					}
				});
				add(el);
				// add(new CompoundsElement(smile.getSecond(), smile.getFirst(),300,300));
			}

		}

		@Override
		public void layout(int deltaTimeMs) {
			super.layout(deltaTimeMs);

			Rect clippingArea = scrollingDecorator.getClipingArea();

			for (GLElement child : this) {
				Rect bounds = child.getRectBounds();
				if (child.getVisibility() != EVisibility.NONE) {
					if (clippingArea.asRectangle2D().intersects(bounds.asRectangle2D())) {

						if (child.getVisibility() != EVisibility.PICKABLE) {
							child.setVisibility(EVisibility.PICKABLE);
							repaintAll();
						}
					} else {
						if (child.getVisibility() != EVisibility.HIDDEN) {
							child.setVisibility(EVisibility.HIDDEN);
							repaintAll();
						}
					}
				}
			}
		}

	}

	// List<ComparablePair<String, String>> smiles
	public MultiCompoundsList(final List<ComparablePair<String, String>> smilesList) {
		super();
		// setLayout(new GLSizeRestrictiveFlowLayout2(false, 1, GLPadding.ZERO));
		setLayout(GLLayouts.LAYERS);
		setMinSizeProvider(GLMinSizeProviders.createLayeredMinSizeProvider(this));

		body = new ScrollableCompoundsList(smilesList);

		scrollingDecorator = new ScrollingDecorator(body, new ScrollBar(true), new ScrollBar(false), 8,
				EDimension.RECORD);
		scrollingDecorator.setMinSizeProvider(new IHasMinSize() {
			@Override
			public Vec2f getMinSize() {
				float w = scrollingDecorator.getSize().x();
				int numColumns = (int) Math.max(1,
						Math.floor((w + COMPOUND_SPACING) / (MIN_COMPOUND_WIDTH + COMPOUND_SPACING)));
				int numRows = (int) Math.max(1, Math.ceil((float) body.size() / (float) numColumns));

				return new Vec2f(MIN_COMPOUND_WIDTH, numRows * MIN_COMPOUND_HEIGHT + (numRows - 1 * COMPOUND_SPACING));
			}
		});

		add(scrollingDecorator);
		relayout();

	}

	@Override
	public Vec2f getMinSize() {
		return super.getMinSize();
	}

	public static void main(String[] args) {
		// the tough one:
		ArrayList<ComparablePair<String, String>> list = new ArrayList<ComparablePair<String, String>>();
		list.add(new ComparablePair<String, String>("abc", "COC1=C(C(=CC=C1)OC)OCCNCC2COC3=CC=CC=C3O2.Cl"));
		list.add(new ComparablePair<String, String>("abc", "COC1=C(C(=CC=C1)OC)OCCNCC2COC3=CC=CC=C3O2.Cl"));
		list.add(new ComparablePair<String, String>("abc", "COC1=C(C(=CC=C1)OC)OCCNCC2COC3=CC=CC=C3O2.Cl"));
		list.add(new ComparablePair<String, String>("abc", "COC1=C(C(=CC=C1)OC)OCCNCC2COC3=CC=CC=C3O2.Cl"));
		list.add(new ComparablePair<String, String>("abc", "COC1=C(C(=CC=C1)OC)OCCNCC2COC3=CC=CC=C3O2.Cl"));
		list.add(new ComparablePair<String, String>("abc", "COC1=C(C(=CC=C1)OC)OCCNCC2COC3=CC=CC=C3O2.Cl"));

		GLSandBox.main(args, new MultiCompoundsList(list));

		// GLSandBox.main(args, new
		// CompoundsElement("CN2C(=O)N(C)C(=O)C1=C2N=CN1C"));
	}
}


text:
// Copyright (c) 2012 Ecma International.  All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.

/*---
es5id: 15.2.3.3-4-3
description: >
    Object.getOwnPropertyDescriptor returns an object representing an
    accessor desc for valid accessor properties
---*/

    var o = {};

    // dummy getter
    var getter = function () { return 1; }
    var d = { get: getter };

    Object.defineProperty(o, "foo", d);

    var desc = Object.getOwnPropertyDescriptor(o, "foo");

assert.sameValue(desc.get, getter, 'desc.get');
assert.sameValue(desc.set, undefined, 'desc.set');
assert.sameValue(desc.enumerable, false, 'desc.enumerable');
assert.sameValue(desc.configurable, false, 'desc.configurable');


text:
<?php

namespace Diskerror;

$t = file_get_contents('../text/voc2.txt');

// fwrite(STDOUT, stem($t) . "\n");

fwrite(STDOUT, print_r(stem($t, DISKERROR_STEM_RETURN_ARRAY), true));

// fwrite(STDOUT, stem($t, DISKERROR_STEM_RETURN_BIGRAM) . "\n");

// fwrite(STDOUT, print_r(stem($t, DISKERROR_STEM_RETURN_ARRAY|DISKERROR_STEM_RETURN_BIGRAM), true));


text:
{% from moi import r_client %}
{% from qiita_core.qiita_settings import qiita_config %}
{% from qiita_core.util import get_qiita_version %}
{% from qiita_pet import allowed_min_browser_versions %}
{% from qiita_pet.portal import portal_styling %}
{% set maintenance = r_client.get('maintenance') %}
{% set sysmessage = r_client.get('sysmessage') %}
{% set user = current_user %}
{% set qiita_version, qiita_sha = get_qiita_version() %}

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

    <title>{{portal_styling.title}}</title>
    <link rel="stylesheet" href="{% raw qiita_config.portal_dir %}/static/vendor/css/jquery-ui.min.css" type="text/css">
    <link rel="stylesheet" href="{% raw qiita_config.portal_dir %}/static/vendor/css/jquery-ui.structure.min.css" type="text/css">
    <link rel="stylesheet" href="{% raw qiita_config.portal_dir %}/static/vendor/css/jquery-ui.theme.min.css" type="text/css">
    <link rel="stylesheet" href="{% raw qiita_config.portal_dir %}/static/vendor/css/bootstrap.min.css" type="text/css">
    <link rel="stylesheet" href="{% raw qiita_config.portal_dir %}/static/vendor/css/bootstrap-theme.min.css" type="text/css">
    <link rel="stylesheet" href="{% raw qiita_config.portal_dir %}/static/vendor/css/chosen.css" type="text/css">
    <link rel="stylesheet" href="{% raw qiita_config.portal_dir %}/static/css/style.css" type="text/css">
    {% if portal_styling.custom_css %}

    {% end %}

    <link rel="shortcut icon" href="{% raw qiita_config.portal_dir %}/static/img/favicon.ico">

    {% block head %}{% end %}

    {% set level = globals().get('level', '') %}
    {% set message = globals().get('message', '') %}
    {% if maintenance is not None %}
      {# maintenance mode takes precidence #}
      {% set level = 'danger' %}
      {% set message = maintenance %}
    {% elif sysmessage is not None %}
      {# since this is a systemwide message, allow regular messages as well #}
      {% set message = sysmessage + "
" + str(message) %}
    {% end %}

          <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
            Toggle navigation

          </button>

            {% if user %}

              Analysis

Create new analysis

Create From Selected Samples

See Previous Analyses

              Study

Create Study

View Studies

              {% set user_level = user.level %}
              {% if user_level == 'admin' %}

              Admin

                {% if qiita_config.portal == "QIITA" %}

View Errors

View Studies awaiting approval

Edit study portal connections

                {% else %}

Admin tasks can only be done in the main Qiita portal

                {% end %}

              {% elif user_level == 'dev' %}

              Dev

View Errors

              {% end %}
            {% end %}

          {% if user %}

              Welcome {{user.id}}

              Log Out

              {% set user_messages = current_user.messages(5) %}
              {% set unread =  len(current_user.unread_messages) %}
               {% if unread > 0 %}({{unread}}){% end %}

              {% if user_messages %}
                {% for _, um, ts, read, _ in user_messages %}

{%raw um %}
{{ts}}

                {% end %}
              {% else %}

You have no messages

              {% end %}

  Studies

 Processed Data

 Samples

          {% elif  maintenance is None %}

              Forgot Password

          <form action="{% raw qiita_config.portal_dir %}/auth/create/" class="navbar-form navbar-right">
            <input type="submit" value="Sign up" class="btn btn-info">
          </form>
          <form class="navbar-form navbar-right" role="form" action="{% raw qiita_config.portal_dir %}/auth/login/" method="post">

              <input tabindex="1" type="text" id="username" name="username" placeholder="Email" class="form-control">

              <input tabindex="2" type="password" id="password" name="password" placeholder="Password" class="form-control">

            <button tabindex="3" type="submit" class="btn btn-success">Sign in</button>
          </form>
          {% end %}

              More Info

                  Help

                  Stats

                  GitHub

                  {% if qiita_sha=="" %}

                  {% else %}

                  {% end %}

                      Current version:

                      {{qiita_version}} {{qiita_sha[0:7]}}

              Current and Future Features

    {% if message != '' %}
        {% if level not in {'danger', 'success', 'info', 'warning'} %}
            {% set level = 'info' %}
        {% end %}

          ×

            {% raw message %}

    {% end %}

      {% block content %}{% end %}

      Thank you for using Qiita. For citations point to http://qiita.microbio.me.

This site only works with the following browsers

Chrome >= {{allowed_min_browser_versions['chrome']}}: You can download Chrome from here or you can find instructions on how to update it here

Safari >= {{allowed_min_browser_versions['safari']}}: You can update Safari following these instructions.

Firefox >= {{allowed_min_browser_versions['firefox']}}: For instructions on how to install or update Firefox go here.

Internet Explorer >= {{allowed_min_browser_versions['IE']}}: For instructions on how to update IE go here.