text:
import { Injectable } from '@angular/core';
import { Http, Headers } from '@angular/http';
import { HttpClient } from '../../_common/http-client';
import { Observable } from 'rxjs';

@Injectable()
export class NewsService {
  constructor(public http: HttpClient) {
  }

  /**
   * [toggleReadState 切换阅读状态]
   * @param  {[Object]} state [状态]
   */
  toggleReadState(from, state) {
    let creds = 'state=' + state + '&from=' + from;
    let headers = new Headers();
    headers.append('Content-Type', 'application/x-www-form-urlencoded');
    return this.http.post('updateReadState', creds, {
      headers: headers
    }).map(res => res.json());
  }

  /**
   * 获取新闻列表
   */
  getBloggerNews() {
    return this.http.get('blognews').map(res => res.json());
  }

}


text:
[![Build Status](https://travis-ci.org/jimmycuadra/template.svg?branch=master)](https://travis-ci.org/jimmycuadra/template)

**template** is a template engine for Rust that is compatible with Go's text/template package.

## License

[MIT](http://opensource.org/licenses/MIT)

redpajama_set_name: RedPajamaGithub


text:
<resources>
    <!-- Default screen margins, per the Android Design guidelines. -->
    <dimen name="activity_horizontal_margin">16dp</dimen>
    <dimen name="activity_vertical_margin">16dp</dimen>

    <dimen name="brother_pager_width">150dp</dimen>

    <dimen name="cover_pager_height">220dp</dimen>

    <dimen name="tab_height">48dp</dimen>

    <dimen name="pager_margin">-30dp</dimen>

    <dimen name="overlap_pager_margin">-60dp</dimen>
</resources>


text:
#import "NSObject.h"

@interface _PLPhotoLibraryFileReservation : NSObject
{
    int _fileDescriptor;
}

@property(nonatomic) int fileDescriptor; // @synthesize fileDescriptor=_fileDescriptor;
- (void)dealloc;
- (id)initWithFileDescriptor:(int)arg1;

@end


text:
package org.red5.server.net.servlet;

import java.io.IOException;

import javax.servlet.ServletConfig;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.http.HttpEntity;
import org.apache.http.HttpResponse;
import org.apache.http.HttpStatus;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.entity.InputStreamEntity;
import org.apache.http.impl.client.DefaultHttpClient;
import org.apache.http.params.CoreConnectionPNames;
import org.apache.http.util.EntityUtils;
import org.apache.mina.core.buffer.IoBuffer;
import org.red5.logging.Red5LoggerFactory;
import org.red5.server.util.HttpConnectionUtil;
import org.slf4j.Logger;

/**
 * Servlet to tunnel to the AMF gateway servlet.
 *
 * @author The Red5 Project (red5@osflash.org)
 * @author Paul Gregoire (mondain@gmail.com)
 */
public class AMFTunnelServlet extends HttpServlet {

	private static final long serialVersionUID = -35436145164322090L;

	protected Logger log = Red5LoggerFactory.getLogger(AMFTunnelServlet.class);

	private static final String REQUEST_TYPE = "application/x-amf";

	private static String postAcceptorURL = "http://localhost:8080/gateway";

	private static int connectionTimeout = 30000;

	@Override
	public void init(ServletConfig config) throws ServletException {
		super.init(config);
		//get the url for posting
		if (config.getInitParameter("tunnel.acceptor.url") != null) {
			postAcceptorURL = config.getInitParameter("tunnel.acceptor.url");
		}
		log.debug("POST acceptor URL: {}", postAcceptorURL);
		//get the connection timeout
		if (config.getInitParameter("tunnel.timeout") != null) {
			connectionTimeout = Integer.valueOf(config.getInitParameter("tunnel.timeout"));
		}
		log.debug("POST connection timeout: {}", postAcceptorURL);
	}

	/**
	 * Redirect to HTTP port.
	 */
	@Override
	protected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
		DefaultHttpClient client = HttpConnectionUtil.getClient();
		client.getParams().setParameter(CoreConnectionPNames.SO_TIMEOUT, connectionTimeout);
		//setup POST
		HttpPost post = null;
		try {
			post = new HttpPost(postAcceptorURL);
			String path = req.getContextPath();
			if (path == null) {
				path = "";
			}
			log.debug("Path: {}", path);
			if (req.getPathInfo() != null) {
				path += req.getPathInfo();
			}
			log.debug("Path 2: {}", path);
			int reqContentLength = req.getContentLength();
			if (reqContentLength > 0) {
				log.debug("Request content length: {}", reqContentLength);
				IoBuffer reqBuffer = IoBuffer.allocate(reqContentLength);
				ServletUtils.copy(req.getInputStream(), reqBuffer.asOutputStream());
				reqBuffer.flip();
				post.setEntity(new InputStreamEntity(reqBuffer.asInputStream(), reqContentLength));
				post.addHeader("Content-Type", REQUEST_TYPE);
				// get.setPath(path);
				post.addHeader("Tunnel-request", path);
				// execute the method
				HttpResponse response = client.execute(post);
				int code = response.getStatusLine().getStatusCode();
				log.debug("HTTP response code: {}", code);
				if (code == HttpStatus.SC_OK) {
					HttpEntity entity = response.getEntity();
					if (entity != null) {
						resp.setContentType(REQUEST_TYPE);
						// get the response as bytes
						byte[] bytes = EntityUtils.toByteArray(entity);
						IoBuffer resultBuffer = IoBuffer.wrap(bytes);
						resultBuffer.flip();
						ServletUtils.copy(resultBuffer.asInputStream(), resp.getOutputStream());
						resp.flushBuffer();
					}
				} else {
					resp.sendError(code);
				}
			} else {
				resp.sendError(HttpStatus.SC_BAD_REQUEST);
			}
		} catch (Exception ex) {
			log.error("", ex);
			post.abort();
		}
	}
}


text:
module RubequeSolutions
  class ReverseEachWord
    def reverse_each_word(sentence)
      sentence.split(' ').map{|word| word.reverse}.join(' ')
    end
  end
end


text:
`react-anything-sortable` is a ReactJS component that can sort any component passed as `this.props.children`. It is compatible with IE8 and all modern browsers.

It has no external dependencies but `React` itself.

[![Build Status](https://travis-ci.org/jasonslyvia/react-anything-sortable.svg)](https://travis-ci.org/jasonslyvia/react-anything-sortable)
[![npm version](https://badge.fury.io/js/react-anything-sortable.svg)](http://badge.fury.io/js/react-anything-sortable)
[![Bower version](https://badge.fury.io/bo/react-anything-sortable.svg)](http://badge.fury.io/bo/react-anything-sortable)

## Quick Demo

**Sort custom style children**

![react-anything-sortable](http://ww4.sinaimg.cn/large/831e9385gw1equswkpcfag209p02sgn5.gif)

**Sort images**

![react-anything-sortable](http://ww3.sinaimg.cn/mw690/831e9385gw1equstgvfmzg20a50360va.gif)

**Children with custom event handler**

![react-anything-sortable](http://ww4.sinaimg.cn/large/831e9385gw1eqy459cieqg20au02s0t4.gif)

## Installation

```
$ npm install --save react-anything-sortable
// or use bower
$ bower install --save react-anything-sortable
```

## How to use

You can check the straight-forward demo by examining `demo` folder, or here's a brief example.

In `YourComponent.jsx`

````
var React = require('react');
var Sortable = require('react-anything-sortable');
var YourSortableItem = require('./YourItem');

React.renderComponent(
<Sortable onSort={handleSort}>
  <YourItem sortData="1" />
  <YourItem sortData="2" />
</Sortable>
, document.body);
````

and in `YourItem.jsx`

**Notice: There's a breaking change in requring `SortableItemMixin` in version 0.2.0**

````
var React = require('react');
var SortableItemMixin = require('react-anything-sortable').SortableItemMixin;

var YourItem = React.createClass({
  mixins: [SortableItemMixin],

  render: function(){
    return this.renderWithSortable(
      <div>your item</div>
    );
  }
});
````

## Heads-up

1. Specify your style for `Sortable` and `Sortable Items`, check `demo/style.css`, **it is NOT optional!**
2. Don't forget the `this.renderWithSortable` call in `YourItem.jsx`
3. Specify `sortData` in `YourItem.jsx` so that `Sortable` can return the sorted array
4. Add `onSort` props to `Sortable` to be noticed when a sort operation finished
5. Since we can't track any children modification in `Sortable`, you have to use `key` to force update `Sortable` when adding/removing children.

## Tests

`$ npm run test`

## Contributors

1. [stayradiated](https://github.com/stayradiated)
2. [vizath](https://github.com/vizath)


text:
namespace
{

template<>
struct WorkloadFactoryHelper<armnn::ClWorkloadFactory>
{
    static armnn::IBackendInternal::IMemoryManagerSharedPtr GetMemoryManager()
    {
        armnn::ClBackend backend;
        return backend.CreateMemoryManager();
    }

    static armnn::ClWorkloadFactory GetFactory(
        const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager,
        const armnn::ModelOptions& modelOptions = {})
    {
        armnn::ClBackend backend;
        return armnn::ClWorkloadFactory(armnn::PolymorphicPointerDowncast<armnn::ClMemoryManager>(memoryManager),
                                        backend.CreateBackendSpecificModelContext(modelOptions));
    }

    static armnn::ClTensorHandleFactory GetTensorHandleFactory(
            const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager = nullptr)
    {

        return armnn::ClTensorHandleFactory(armnn::PolymorphicPointerDowncast<armnn::ClMemoryManager>(memoryManager));
    }
};

using ClWorkloadFactoryHelper = WorkloadFactoryHelper<armnn::ClWorkloadFactory>;

} // anonymous namespace


text:
/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package dk.sieker.logr.log;

import java.time.LocalDateTime;
import java.util.List;
import javax.persistence.Persistence;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import static org.junit.Assert.*;

/**
 *
 * @author sieker
 */
public class LogServiceTest {

    LogService service;

    @Before
    public void init() {
        service = new LogService();
        service.em = Persistence.createEntityManagerFactory("integration").createEntityManager();
        service.em.getTransaction().begin();
    }

    @After
    public void teardown() {
        service.em.getTransaction().rollback();
    }

    @Test
    public void simpleJPATest() throws Exception {
        List<Log> logs = service.getAll();
        assertTrue(logs.isEmpty());
        Log log = new Log();
        LocalDateTime now = LocalDateTime.now();
        log.setStartTime(now);
        Log l = service.create(log);
        logs = service.getAll();
        assertTrue(logs.size() == 1);
        assertEquals(logs.get(0).getStartTime(), now);
    }

}


text:
console.log('Version 0.1.3');

var aws = require('aws-sdk');

var ses = new aws.SES();
var s3 = new aws.S3();

exports.handler = function (event, context) {

    console.log("Event: " + JSON.stringify(event));

    // Check required parameters
    if (event.email == null) {
        context.fail('Bad Request: Missing required member: email');
        return;
    }

    var config = require('./config.js');

    // Make sure some expected results are present
    if (event.name == null) {
        event.name = event.email;
    }

    // Make sure we have a subject.
    // If the event didn't include it, then
    // pull it from the configuration.
    // If we still don't have a subject, then
    // just make one up.
    if (event.subject == null) {
        event.subject = config.defaultSubject;

        if (event.subject == null) {
            event.subject = "Mail from {{name}}";
        }
    }

    console.log('Loading template from ' + config.templateKey + ' in ' + config.templateBucket);

    // Read the template file
    s3.getObject({
        Bucket: config.templateBucket,
        Key: config.templateKey
    }, function (err, data) {
        if (err) {
            // Error
            console.log(err, err.stack);
            context.fail('Internal Error: Failed to load template from s3.')
        } else {
            var templateBody = data.Body.toString();
            console.log("Template Body: " + templateBody);

            // Convert newlines in the message
            if (event.message != null) {
                event.message = event.message
                .replace("\r\n", "
")
                .replace("\r", "
")
                .replace("\n", "
");
            }

            // Perform the substitutions
            var mark = require('markup-js');

            var subject = mark.up(event.subject, event);
            console.log("Final subject: " + subject);

            var message = mark.up(templateBody, event);
            console.log("Final message: " + message);

            var params = {
                Destination: {
                    ToAddresses: [
                        config.targetAddress
                    ]
                },
                Message: {

                    Subject: {
                        Data: subject,
                        Charset: 'UTF-8'
                    }
                },
                Source: config.fromAddress,
                ReplyToAddresses: [
                    event.name + '<' + event.email + '>'
                ]
            };

            var fileExtension = config.templateKey.split(".").pop();
            if (fileExtension.toLowerCase() == 'html') {
                params.Message.Body = {
                    Html: {
                        Data: message,
                        Charset: 'UTF-8'
                    }
                };
            } else if (fileExtension.toLowerCase() == 'txt') {
                params.Message.Body = {
                    Text: {
                        Data: message,
                        Charset: 'UTF-8'
                    }
                };
            } else {
                context.fail('Internal Error: Unrecognized template file extension: ' + fileExtension);
                return;
            }

            // Send the email
            ses.sendEmail(params, function (err, data) {
                if (err) {
                    console.log(err, err.stack);
                    context.fail('Internal Error: The email could not be sent.');
                } else {
                    console.log(data);           // successful response
                    context.succeed('The email was successfully sent to ' + event.email);
                }
            });
        }
    });
};


text:
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
<title>airbus_cobot_gui: __init__.py Source File</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
<link href="tabs.css" rel="stylesheet" type="text/css">

Main Page

Namespaces

Classes

Files

File List

src

airbus_cobot_gui

control_mode

control_mode/__init__.py

Go to the documentation of this file.

    1 ################################################################################

    2 #

    3 # Copyright Airbus Group SAS 2015

    4 # All rigths reserved.

    5 #

    6 # File Name : control_mode.py

    7 # Authors : Martin Matignon

    8 #

    9 # If you find any bug or if you have any question please contact

   10 # Adolfo Suarez Roos <adolfo.suarez@airbus.com>

   11 # Martin Matignon <martin.matignon.external@airbus.com>

   12 #

   13 #

   14 ################################################################################

   15

   16 from control_mode import ControlMode, \

   17                          ControlModeWidget

airbus_cobot_gui

Author(s):

autogenerated on Thu Dec 17 2015 11:42:05


text:
SPK_NAME = node
SPK_VERS = 0.10.6
SPK_REV = 1
SPK_ICON = src/nodejs.png

DEPENDS  = cross/$(SPK_NAME)

MAINTAINER = SynoCommunity
DESCRIPTION = Node.js is a platform built on Chrome\'s JavaScript runtime for easily building fast, scalable network applications.
STARTABLE = no
DISPLAY_NAME = Node.js
BETA = 1

HOMEPAGE   = http://nodejs.org/
LICENSE    = MIT

INSTALLER_SCRIPT = src/installer.sh
SSS_SCRIPT       = src/dsm-control.sh

INSTALL_PREFIX = /usr/local/$(SPK_NAME)

include ../../mk/spksrc.spk.mk


text:
namespace Microsoft.Azure.Management.CosmosDB
{
    using Microsoft.Rest;
    using Microsoft.Rest.Azure;
    using Models;
    using System.Collections;
    using System.Collections.Generic;
    using System.Threading;
    using System.Threading.Tasks;

    /// <summary>
    /// RestorableMongodbCollectionsOperations operations.
    /// </summary>
    public partial interface IRestorableMongodbCollectionsOperations
    {
        /// <summary>
        /// Show the event feed of all mutations done on all the Azure Cosmos
        /// DB MongoDB collections under a specific database.  This helps in
        /// scenario where container was accidentally deleted.  This API
        /// requires
        /// 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read'
        /// permission
        /// </summary>
        /// <param name='location'>
        /// Cosmos DB region, with spaces between words and each word
        /// capitalized.
        /// </param>
        /// <param name='instanceId'>
        /// The instanceId GUID of a restorable database account.
        /// </param>
        /// <param name='restorableMongodbDatabaseRid'>
        /// The resource ID of the MongoDB database.
        /// </param>
        /// <param name='startTime'>
        /// Restorable MongoDB collections event feed start time.
        /// </param>
        /// <param name='endTime'>
        /// Restorable MongoDB collections event feed end time.
        /// </param>
        /// <param name='customHeaders'>
        /// The headers that will be added to request.
        /// </param>
        /// <param name='cancellationToken'>
        /// The cancellation token.
        /// </param>
        /// <exception cref="Microsoft.Rest.Azure.CloudException">
        /// Thrown when the operation returned an invalid status code
        /// </exception>
        /// <exception cref="Microsoft.Rest.SerializationException">
        /// Thrown when unable to deserialize the response
        /// </exception>
        /// <exception cref="Microsoft.Rest.ValidationException">
        /// Thrown when a required parameter is null
        /// </exception>
        Task<AzureOperationResponse<IEnumerable<RestorableMongodbCollectionGetResult>>> ListWithHttpMessagesAsync(string location, string instanceId, string restorableMongodbDatabaseRid = default(string), string startTime = default(string), string endTime = default(string), Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
    }
}


text:
package org.elasticsearch.index.mapper;

import org.apache.lucene.util.BytesRef;
import org.apache.lucene.util.BytesRefBuilder;
import org.elasticsearch.action.DocumentRequest;
import org.elasticsearch.action.termvector.TermVectorRequest;
import org.elasticsearch.common.lucene.BytesRefs;

import java.util.Collection;
import java.util.Collections;
import java.util.List;

/**
 *
 */
public final class Uid {

    public static final char DELIMITER = '#';
    public static final byte DELIMITER_BYTE = 0x23;
    public static final BytesRef DELIMITER_BYTES = new BytesRef(new byte[]{DELIMITER_BYTE});

    private final String type;

    private final String id;

    public Uid(String type, String id) {
        this.type = type;
        this.id = id;
    }

    public String type() {
        return type;
    }

    public String id() {
        return id;
    }

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

        Uid uid = (Uid) o;

        if (id != null ? !id.equals(uid.id) : uid.id != null) return false;
        if (type != null ? !type.equals(uid.type) : uid.type != null) return false;

        return true;
    }

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

    @Override
    public String toString() {
        return createUid(type, id);
    }

    public BytesRef toBytesRef() {
        return createUidAsBytes(type, id);
    }

    public static BytesRef typePrefixAsBytes(BytesRef type) {
        BytesRefBuilder bytesRef = new BytesRefBuilder();
        bytesRef.append(type);
        bytesRef.append(DELIMITER_BYTES);
        return bytesRef.toBytesRef();
    }

    public static Uid createUid(String uid) {
        int delimiterIndex = uid.indexOf(DELIMITER); // type is not allowed to have # in it..., ids can
        return new Uid(uid.substring(0, delimiterIndex), uid.substring(delimiterIndex + 1));
    }

    public static BytesRef[] createUids(List<? extends DocumentRequest> requests) {
        BytesRef[] uids = new BytesRef[requests.size()];
        int idx = 0;
        for (DocumentRequest item : requests) {
            uids[idx++] = createUidAsBytes(item.type(), item.id());
        }
        return uids;
    }

    public static BytesRef createUidAsBytes(String type, String id) {
        return createUidAsBytes(new BytesRef(type), new BytesRef(id));
    }

    public static BytesRef createUidAsBytes(String type, BytesRef id) {
        return createUidAsBytes(new BytesRef(type), id);
    }

    public static BytesRef createUidAsBytes(BytesRef type, BytesRef id) {
        final BytesRef ref = new BytesRef(type.length + 1 + id.length);
        System.arraycopy(type.bytes, type.offset, ref.bytes, 0, type.length);
        ref.offset = type.length;
        ref.bytes[ref.offset++] = DELIMITER_BYTE;
        System.arraycopy(id.bytes, id.offset, ref.bytes, ref.offset, id.length);
        ref.offset = 0;
        ref.length = ref.bytes.length;
        return ref;
    }

    public static BytesRef createUidAsBytes(BytesRef type, BytesRef id, BytesRefBuilder spare) {
        spare.copyBytes(type);
        spare.append(DELIMITER_BYTES);
        spare.append(id);
        return spare.get();
    }

    public static BytesRef[] createTypeUids(Collection<String> types, Object ids) {
        return createTypeUids(types, Collections.singletonList(ids));
    }

    public static BytesRef[] createTypeUids(Collection<String> types, List<? extends Object> ids) {
        final int numIds = ids.size();
        BytesRef[] uids = new BytesRef[types.size() * ids.size()];
        BytesRefBuilder typeBytes = new BytesRefBuilder();
        BytesRefBuilder idBytes = new BytesRefBuilder();
        int index = 0;
        for (String type : types) {
            typeBytes.copyChars(type);
            for (int i = 0; i < numIds; i++, index++) {
                uids[index] = Uid.createUidAsBytes(typeBytes.get(), BytesRefs.toBytesRef(ids.get(i), idBytes));
            }
        }
        return uids;
    }

    public static String createUid(String type, String id) {
        return createUid(new StringBuilder(), type, id);
    }

    public static String createUid(StringBuilder sb, String type, String id) {
        return sb.append(type).append(DELIMITER).append(id).toString();
    }

    public static boolean hasDelimiter(BytesRef uid) {
        final int limit = uid.offset + uid.length;
        for (int i = uid.offset; i < limit; i++) {
            if (uid.bytes[i] == DELIMITER_BYTE) { // 0x23 is equal to '#'
                return true;
            }
        }
        return false;
    }

    public static BytesRef[] splitUidIntoTypeAndId(BytesRef uid) {
        int loc = -1;
        final int limit = uid.offset + uid.length;
        for (int i = uid.offset; i < limit; i++) {
            if (uid.bytes[i] == DELIMITER_BYTE) { // 0x23 is equal to '#'
                loc = i;
                break;
            }
        }

        if (loc == -1) {
            return null;
        }

        int idStart = loc + 1;
        return new BytesRef[] {
                new BytesRef(uid.bytes, uid.offset, loc - uid.offset),
                new BytesRef(uid.bytes, idStart, limit - idStart)
        };
    }

}


text:
/**
 * EncodingException.java
 */

package jonelo.sugar.util;

/**
 * Thrown to indicate that the application has attempted to specify
 * a non supported encoding
 */
public class EncodingException extends IllegalArgumentException {

    /**
     * Constructs a EncodingException with no detail message.
     */
    public EncodingException () {
      super();
    }

    /**
     * Constructs a EncodingException with the
     * specified detail message.
     *
     * @param   s   the detail message.
     */
    public EncodingException (String s) {
      super (s);
    }

}


text:
var app = require('../app');

// print stacktrace on development
app.use(function(err, req, res, next) {
	res.status(err.status || 500);
	res.render('error', {
		message: err.message,
		error: err
	});
});


text:
package fr.renoux.gaston

import java.util.concurrent.atomic.AtomicInteger

import fr.renoux.gaston.input.InputTranscription
import fr.renoux.gaston.model.impl.ProblemImpl
import fr.renoux.gaston.model.{Counts, Person, Slot, Topic}

object MinimalTestModel {

  object Persons {
    private val index = new AtomicInteger(0)
    val Leonardo = Person(index.getAndIncrement(), "Leonardo")
    val Raphael = Person(index.getAndIncrement(), "Raphael")
    val Donatello = Person(index.getAndIncrement(), "Donatello")
    val Michelangelo = Person(index.getAndIncrement(), "Michelangelo")
    val Bebop = Person(index.getAndIncrement(), "Bebop")
    val Rocksteady = Person(index.getAndIncrement(), "Rocksteady")

    val AllTurtles: Set[Person] = Set(Leonardo, Raphael, Donatello, Michelangelo)
    val AllEnemies: Set[Person] = Set(Bebop, Rocksteady)
    val All: Set[Person] = AllTurtles ++ AllEnemies
  }

  object Topics {
    private val index = new AtomicInteger(0)
    val Leading = Topic(index.getAndIncrement(), "leading")
    val Fighting = Topic(index.getAndIncrement(), "fighting")
    val Machines = Topic(index.getAndIncrement(), "machines")
    val Party = Topic(index.getAndIncrement(), "party")

    val Unassigned: Map[Slot, Topic] = Slots.All.flatten.map(s => s -> InputTranscription.unassignedTopic(index.getAndIncrement(), s)).toMap
    val Concrete: Set[Topic] = Set(Leading, Fighting, Machines, Party)
    val All: Set[Topic] = Concrete ++ Unassigned.values
  }

  object Slots {
    private val index = new AtomicInteger(0)
    val Morning = Slot(index.getAndIncrement(), "morning", Persons.All)
    val Afternoon = Slot(index.getAndIncrement(), "afternoon", Persons.All)
    val Evening = Slot(index.getAndIncrement(), "evening", Persons.All)
    val Night = Slot(index.getAndIncrement(), "night", Persons.All)

    val All: Seq[Seq[Slot]] = Seq(Seq(Morning, Afternoon, Evening, Night))
    val Count = All.flatten.size
  }

  object Problems {
    implicit val MinimalCounts = Counts(slots = Slots.Count, topics = Topics.All.size, persons = Persons.All.size)
    val Minimal = new ProblemImpl(Slots.All, Topics.All, Topics.Unassigned.toBitMap, Persons.All, Set.empty, Set.empty)
  }

}


text:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    >

    <org.andengine.opengl.view.RenderSurfaceView
        android:id="@+id/renderview"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent" />

</RelativeLayout>


text:
local PANEL = {};

function PANEL:Init ( )
	self.InventoryBlocks = {};

	local fakeX, fakeY = 1, 0;
	for x = 1, 3 do
		for y = 1, 5 do
			fakeY = fakeY + 1;
			if (fakeY > 5) then
				fakeY = 1;
				fakeX = fakeX + 1;
			end

			local newBlock = vgui.Create("perp2_trade_offer_block", self);
			newBlock.itemID = y + ((x - 1) * 5);
			newBlock.fXPos, newBlock.fYPos = fakeX, fakeY;
			self.InventoryBlocks[newBlock.itemID] = newBlock;
		end
	end

	self.Description = true;
	//self:SetSkin("ugperp")
end

function PANEL:PerformLayout ( )
	local bufferSize = 5;

	local curY = bufferSize;

	local blocksPerRow = (INVENTORY_HEIGHT * INVENTORY_WIDTH) / 5;

	for i, v in pairs(self.InventoryBlocks) do
		local x = v.fXPos;
		local y = v.fYPos;

		v:SetSize(self.SizeOfBlock, self.SizeOfBlock);
		v:SetPos((bufferSize * x) + ((x - 1) * self.SizeOfBlock), (bufferSize * y) + ((y - 1) * self.SizeOfBlock));
	end
end

function PANEL:Paint ( )
	SKIN:PaintFrame(self, true);
end

function PANEL:SetDescription ( ) end

vgui.Register("perp2_trade_offer", PANEL);


text:
package com.futureprocessing.documentjuggler.query;

import com.futureprocessing.documentjuggler.query.expression.QueryExpression;
import com.mongodb.DBObject;

public class QueryProcessor<MODEL> {

    private final Class<MODEL> modelClass;
    private final QueryMapper mapper;

    public QueryProcessor(Class<MODEL> modelClass) {
        this.modelClass = modelClass;
        this.mapper = QueryMapper.map(modelClass);
    }

    public DBObject process(QueryConsumer<MODEL> consumer) {
        if (consumer == null) {
            return null;
        }

        MODEL querier = QueryProxy.create(modelClass, mapper.get());
        consumer.accept(querier);

        return QueryProxy.extract(querier).toDBObject();
    }

    public DBObject process(QueryExpression<MODEL> expression) {
        return expression.evaluate(this);
    }

}


text:
'use strict';
const { existsSync, writeFileSync } = require('fs');
const { fork } = require('child_process');

describe('node::AtExit()', function () {
	this.slow(500);

	const source = (filename1, filename2) => `
		'use strict';
		const Database = require('../.');
		const db1 = new Database('${filename1.replace(/(?=\W)/g, '\\')}');
		const db2 = new Database('${filename2.replace(/(?=\W)/g, '\\')}');
		for (const db of [db1, db2]) {
			db.pragma('journal_mode = WAL');
			db.prepare('CREATE TABLE people (name TEXT)').run();
			db.prepare('INSERT INTO people VALUES (\\'foobar\\')').run();
		}
		const interval = setInterval(() => {}, 60000);
		const messageHandler = (message) => {
			if (message !== 'bar') return;
			clearInterval(interval);
			process.removeListener('message', messageHandler);
		};
		process.on('message', messageHandler);
		process.send('foo');
	`;

	it('should close all databases when the process exits gracefully', async function () {
		const filename1 = util.next();
		const filename2 = util.next();
		const jsFile = filename1 + '.js';
		writeFileSync(jsFile, source(filename1, filename2));
		await new Promise((resolve, reject) => {
			const child = fork(jsFile);
			child.on('error', reject);
			child.on('close', () => reject(new Error('Child process was closed prematurely')));
			child.on('message', (message) => {
				if (message !== 'foo') return;
				expect(existsSync(filename1)).to.be.true;
				expect(existsSync(filename1 + '-wal')).to.be.true;
				expect(existsSync(filename2)).to.be.true;
				expect(existsSync(filename2 + '-wal')).to.be.true;
				child.on('exit', resolve);
				child.send('bar');
			});
		});
		expect(existsSync(filename1)).to.be.true;
		expect(existsSync(filename1 + '-wal')).to.be.false;
		expect(existsSync(filename2)).to.be.true;
		expect(existsSync(filename2 + '-wal')).to.be.false;
	});
});


text:
// Copyright 2020 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "chrome/browser/ui/views/web_apps/frame_toolbar/web_app_toolbar_button_container.h"

#include "base/time/time.h"
#include "build/build_config.h"
#include "build/chromeos_buildflags.h"
#include "chrome/browser/download/bubble/download_bubble_prefs.h"
#include "chrome/browser/ui/browser_command_controller.h"
#include "chrome/browser/ui/browser_content_setting_bubble_model_delegate.h"
#include "chrome/browser/ui/ui_features.h"
#include "chrome/browser/ui/view_ids.h"
#include "chrome/browser/ui/views/extensions/extensions_toolbar_button.h"
#include "chrome/browser/ui/views/extensions/extensions_toolbar_container.h"
#include "chrome/browser/ui/views/frame/browser_view.h"
#include "chrome/browser/ui/views/frame/toolbar_button_provider.h"
#include "chrome/browser/ui/views/page_action/page_action_icon_controller.h"
#include "chrome/browser/ui/views/page_action/page_action_icon_params.h"
#include "chrome/browser/ui/views/web_apps/frame_toolbar/system_app_accessible_name.h"
#include "chrome/browser/ui/views/web_apps/frame_toolbar/web_app_content_settings_container.h"
#include "chrome/browser/ui/views/web_apps/frame_toolbar/web_app_frame_toolbar_utils.h"
#include "chrome/browser/ui/views/web_apps/frame_toolbar/web_app_menu_button.h"
#include "chrome/browser/ui/views/web_apps/frame_toolbar/web_app_origin_text.h"
#include "chrome/browser/ui/views/web_apps/frame_toolbar/window_controls_overlay_toggle_button.h"
#include "chrome/browser/ui/web_applications/app_browser_controller.h"
#include "chrome/common/chrome_features.h"
#include "ui/base/hit_test.h"
#include "ui/base/metadata/metadata_impl_macros.h"
#include "ui/views/layout/flex_layout.h"
#include "ui/views/window/hit_test_utils.h"

#if BUILDFLAG(IS_CHROMEOS_ASH)
#include "chrome/browser/ui/ash/system_web_apps/system_web_app_ui_utils.h"
#endif  // BUILDFLAG(IS_CHROMEOS_ASH)

namespace {

bool g_animation_disabled_for_testing = false;

}  // namespace

constexpr base::TimeDelta WebAppToolbarButtonContainer::kTitlebarAnimationDelay;
constexpr base::TimeDelta WebAppToolbarButtonContainer::kOriginFadeInDuration;
constexpr base::TimeDelta WebAppToolbarButtonContainer::kOriginPauseDuration;
constexpr base::TimeDelta WebAppToolbarButtonContainer::kOriginFadeOutDuration;

// static
base::TimeDelta WebAppToolbarButtonContainer::OriginTotalDuration() {
  // TimeDelta.operator+ uses time_internal::SaturatedAdd() which isn't
  // constexpr, so this needs to be a function to not introduce a static
  // initializer.
  return kOriginFadeInDuration + kOriginPauseDuration + kOriginFadeOutDuration;
}

WebAppToolbarButtonContainer::WebAppToolbarButtonContainer(
    views::Widget* widget,
    BrowserView* browser_view,
    ToolbarButtonProvider* toolbar_button_provider)
    : browser_view_(browser_view),
      toolbar_button_provider_(toolbar_button_provider),
      page_action_icon_controller_(
          std::make_unique<PageActionIconController>()) {
  views::FlexLayout* const layout =
      SetLayoutManager(std::make_unique<views::FlexLayout>());
  layout->SetOrientation(views::LayoutOrientation::kHorizontal)
      .SetInteriorMargin(gfx::Insets::VH(0, WebAppFrameRightMargin()))
      .SetDefault(
          views::kMarginsKey,
          gfx::Insets::VH(
              0, HorizontalPaddingBetweenPageActionsAndAppMenuButtons()))
      .SetCollapseMargins(true)
      .SetIgnoreDefaultMainAxisMargins(true)
      .SetCrossAxisAlignment(views::LayoutAlignment::kCenter)
      .SetDefault(views::kFlexBehaviorKey,
                  views::FlexSpecification(
                      views::LayoutOrientation::kHorizontal,
                      views::MinimumFlexSizeRule::kPreferredSnapToZero)
                      .WithWeight(0))
      .SetFlexAllocationOrder(views::FlexAllocationOrder::kReverse);

  const auto* app_controller = browser_view_->browser()->app_controller();

  // App's origin will not be shown in the borderless mode, it will only be
  // visible in App Settings UI.
  if (app_controller->HasTitlebarAppOriginText() &&
      !browser_view_->IsBorderlessModeEnabled()) {
    web_app_origin_text_ = AddChildView(
        std::make_unique<WebAppOriginText>(browser_view_->browser()));
  }

#if BUILDFLAG(IS_CHROMEOS_ASH)
  if (app_controller->system_app()) {
    AddChildView(std::make_unique<SystemAppAccessibleName>(
        app_controller->GetAppShortName()));
  }
#endif  // BUILDFLAG(IS_CHROMEOS_ASH)

  if (app_controller->AppUsesWindowControlsOverlay()) {
    window_controls_overlay_toggle_button_ = AddChildView(
        std::make_unique<WindowControlsOverlayToggleButton>(browser_view_));
    views::SetHitTestComponent(window_controls_overlay_toggle_button_,
                               static_cast<int>(HTCLIENT));
    ConfigureWebAppToolbarButton(window_controls_overlay_toggle_button_,
                                 toolbar_button_provider_);
    window_controls_overlay_toggle_button_->SetVisible(
        browser_view_->should_show_window_controls_overlay_toggle());
  }

  if (app_controller->HasTitlebarContentSettings()) {
    content_settings_container_ = AddChildView(
        std::make_unique<WebAppContentSettingsContainer>(this, this));
    views::SetHitTestComponent(content_settings_container_,
                               static_cast<int>(HTCLIENT));
  }

  // This is the point where we will be inserting page action icons.
  page_action_insertion_point_ = static_cast<int>(children().size());

  // Insert the default page action icons.
  PageActionIconParams params;
  params.types_enabled = app_controller->GetTitleBarPageActions();
  params.icon_color = gfx::kPlaceholderColor;
  params.between_icon_spacing =
      HorizontalPaddingBetweenPageActionsAndAppMenuButtons();
  params.browser = browser_view_->browser();
  params.command_updater = browser_view_->browser()->command_controller();
  params.icon_label_bubble_delegate = this;
  params.page_action_icon_delegate = this;
  page_action_icon_controller_->Init(params, this);

  bool create_extensions_container = true;
#if BUILDFLAG(IS_CHROMEOS_ASH)
  // Do not create the extensions or browser actions container if it is a
  // System Web App.
  create_extensions_container = !ash::IsSystemWebApp(browser_view_->browser());
#endif  // BUILDFLAG(IS_CHROMEOS_ASH)

  if (create_extensions_container) {
    // Extensions toolbar area with pinned extensions is lower priority than,
    // for example, the menu button or other toolbar buttons, and pinned
    // extensions should hide before other toolbar buttons.
    constexpr int kLowPriorityFlexOrder = 2;

    auto display_mode =
        base::FeatureList::IsEnabled(features::kDesktopPWAsElidedExtensionsMenu)
            ? ExtensionsToolbarContainer::DisplayMode::kAutoHide
            : ExtensionsToolbarContainer::DisplayMode::kCompact;
    extensions_container_ =
        AddChildView(std::make_unique<ExtensionsToolbarContainer>(
            browser_view_->browser(), display_mode));
    extensions_container_->SetProperty(
        views::kFlexBehaviorKey,
        views::FlexSpecification(
            extensions_container_->GetAnimatingLayoutManager()
                ->GetDefaultFlexRule())
            .WithOrder(kLowPriorityFlexOrder));
    views::SetHitTestComponent(extensions_container_,
                               static_cast<int>(HTCLIENT));
  }

  if (download::IsDownloadBubbleEnabled(browser_view_->browser()->profile())) {
    download_button_ = AddChildView(
        std::make_unique<DownloadToolbarButtonView>(browser_view_));
    views::SetHitTestComponent(download_button_, static_cast<int>(HTCLIENT));
  }

  if (app_controller->HasTitlebarMenuButton()) {
    web_app_menu_button_ =
        AddChildView(std::make_unique<WebAppMenuButton>(browser_view_));
    web_app_menu_button_->SetID(VIEW_ID_APP_MENU);
    ConfigureWebAppToolbarButton(web_app_menu_button_,
                                 toolbar_button_provider_);
    web_app_menu_button_->SetProperty(views::kFlexBehaviorKey,
                                      views::FlexSpecification());
  }

  browser_view_->immersive_mode_controller()->AddObserver(this);
  scoped_widget_observation_.Observe(widget);
}

WebAppToolbarButtonContainer::~WebAppToolbarButtonContainer() {
  ImmersiveModeController* immersive_controller =
      browser_view_->immersive_mode_controller();
  if (immersive_controller)
    immersive_controller->RemoveObserver(this);
}

void WebAppToolbarButtonContainer::UpdateStatusIconsVisibility() {
  if (content_settings_container_)
    content_settings_container_->UpdateContentSettingViewsVisibility();
  page_action_icon_controller_->UpdateAll();
}

void WebAppToolbarButtonContainer::SetColors(SkColor foreground_color,
                                             SkColor background_color,
                                             bool color_changed) {
  foreground_color_ = foreground_color;
  background_color_ = background_color;
  if (web_app_origin_text_) {
    web_app_origin_text_->SetTextColor(foreground_color_,
                                       /*show_text=*/color_changed);
  }
  if (window_controls_overlay_toggle_button_)
    window_controls_overlay_toggle_button_->SetColor(foreground_color_);

  if (content_settings_container_)
    content_settings_container_->SetIconColor(foreground_color_);
  if (extensions_container_)
    extensions_container_->SetIconColor(foreground_color_);
  page_action_icon_controller_->SetIconColor(foreground_color_);
  if (web_app_menu_button_)
    web_app_menu_button_->SetColor(foreground_color_);
  if (download_button_)
    download_button_->SetIconColor(foreground_color_);
}

views::FlexRule WebAppToolbarButtonContainer::GetFlexRule() const {
  // Prefer height consistency over accommodating edge case icons that may
  // bump up the container height (e.g. extension action icons with badges).
  // TODO(https://crbug.com/889745): Fix the inconsistent icon sizes found in
  // the right-hand container and turn this into a DCHECK that the container
  // height is the same as the app menu button height.
  const auto* const layout =
      static_cast<views::FlexLayout*>(GetLayoutManager());
  return base::BindRepeating(
      [](ToolbarButtonProvider* toolbar_button_provider,
         views::FlexRule input_flex_rule, const views::View* view,
         const views::SizeBounds& available_size) {
        const gfx::Size preferred = input_flex_rule.Run(view, available_size);
        return gfx::Size(
            preferred.width(),
            toolbar_button_provider->GetToolbarButtonSize().height());
      },
      base::Unretained(toolbar_button_provider_), layout->GetDefaultFlexRule());
}

void WebAppToolbarButtonContainer::DisableAnimationForTesting() {
  g_animation_disabled_for_testing = true;
}

void WebAppToolbarButtonContainer::AddPageActionIcon(
    std::unique_ptr<views::View> icon) {
  auto* icon_ptr =
      AddChildViewAt(std::move(icon), page_action_insertion_point_++);
  views::SetHitTestComponent(icon_ptr, static_cast<int>(HTCLIENT));
}

int WebAppToolbarButtonContainer::GetPageActionIconSize() const {
  return GetLayoutConstant(WEB_APP_PAGE_ACTION_ICON_SIZE);
}

gfx::Insets WebAppToolbarButtonContainer::GetPageActionIconInsets(
    const PageActionIconView* icon_view) const {
  const int icon_size = icon_view->GetImageView()->GetPreferredSize().height();
  if (icon_size == 0)
    return gfx::Insets();

  const int height = toolbar_button_provider_->GetToolbarButtonSize().height();
  const int inset_size = std::max(0, (height - icon_size) / 2);
  return gfx::Insets(inset_size);
}

// Methods for coordinate the titlebar animation (origin text slide, menu
// highlight and icon fade in).
bool WebAppToolbarButtonContainer::GetAnimate() const {
  return !g_animation_disabled_for_testing &&
         !browser_view_->immersive_mode_controller()->IsEnabled();
}

void WebAppToolbarButtonContainer::StartTitlebarAnimation() {
  if (!GetAnimate())
    return;

  if (web_app_origin_text_)
    web_app_origin_text_->StartFadeAnimation();
  if (web_app_menu_button_)
    web_app_menu_button_->StartHighlightAnimation();
  icon_fade_in_delay_.Start(
      FROM_HERE, OriginTotalDuration(), this,
      &WebAppToolbarButtonContainer::FadeInContentSettingIcons);
}

void WebAppToolbarButtonContainer::FadeInContentSettingIcons() {
  if (!GetAnimate())
    return;

  if (content_settings_container_)
    content_settings_container_->FadeIn();
}

void WebAppToolbarButtonContainer::ChildPreferredSizeChanged(
    views::View* child) {
  PreferredSizeChanged();
}

SkColor
WebAppToolbarButtonContainer::GetIconLabelBubbleSurroundingForegroundColor()
    const {
  return foreground_color_;
}

SkColor WebAppToolbarButtonContainer::GetIconLabelBubbleBackgroundColor()
    const {
  return background_color_;
}

bool WebAppToolbarButtonContainer::ShouldHideContentSettingImage() {
  return false;
}

content::WebContents*
WebAppToolbarButtonContainer::GetContentSettingWebContents() {
  return browser_view_->GetActiveWebContents();
}

ContentSettingBubbleModelDelegate*
WebAppToolbarButtonContainer::GetContentSettingBubbleModelDelegate() {
  return browser_view_->browser()->content_setting_bubble_model_delegate();
}

// ImmersiveModeController::Observer:
void WebAppToolbarButtonContainer::OnImmersiveRevealStarted() {
  // Don't wait for the fade in animation to make content setting icons
  // visible once in immersive mode.
  if (content_settings_container_)
    content_settings_container_->EnsureVisible();
}

// PageActionIconView::Delegate:
content::WebContents*
WebAppToolbarButtonContainer::GetWebContentsForPageActionIconView() {
  return browser_view_->GetActiveWebContents();
}

void WebAppToolbarButtonContainer::AddedToWidget() {
  if (GetAnimate()) {
    if (content_settings_container_)
      content_settings_container_->SetUpForFadeIn();
    animation_start_delay_.Start(
        FROM_HERE, kTitlebarAnimationDelay, this,
        &WebAppToolbarButtonContainer::StartTitlebarAnimation);
  }
}

BEGIN_METADATA(WebAppToolbarButtonContainer, views::View)
ADD_READONLY_PROPERTY_METADATA(bool, Animate)
END_METADATA


text:
RSpec.configure do |config|
  config.expect_with :rspec do |expectations|
    expectations.include_chain_clauses_in_custom_matcher_descriptions = true
  end

  config.mock_with :rspec do |mocks|
    mocks.verify_partial_doubles = true
  end

  config.before :suite do
    Pathname.new(Dir.pwd).join("tmp").mkpath
  end

  config.shared_context_metadata_behavior = :apply_to_host_groups

  config.filter_run_when_matching :focus
  config.disable_monkey_patching!
  config.warnings = false

  config.default_formatter = 'doc' if config.files_to_run.one?

  config.order = :random
  Kernel.srand config.seed
end

require 'hanami'
require 'hanami/utils/file_list'

Hanami::Utils::FileList["./spec/support/**/*.rb"].each do |file|
  next if file.include?("hanami-plugin")
  require file
end


text:
from django.test import TestCase
from django.contrib.auth.models import User
from django.shortcuts import reverse
from django.utils import timezone

import datetime
import decimal

from .models import Budget, BudgetCategory, Wallet, Transaction

class WalletViewsTests(TestCase):
    def setUp(self):
        # Create a user and give them some data to test with
        self.user = User.objects.create_user(id=1, username='test_user', email='test_user@gmail.com', password='tester123')
        self.user.save()
        self.other_user = User.objects.create_user(id=2, username='test_user2', email='test_user2@gmail.com',
                                             password='123tester')
        self.other_user.save()

        self.category = BudgetCategory.objects.create(id=1, user_id=1, user=self.user, name='groceries', is_income=False)
        self.category.save()

        self.wallet = Wallet.objects.create(id=1, user_id=1, name='checking', balance=100, created_time=timezone.now())
        self.wallet.save()
        self.other_wallet = Wallet.objects.create(id=2, user_id=2, name='debit card', balance=0, created_time=timezone.now())
        self.other_wallet.save()

        self.transaction = Transaction.objects.create(id=1, amount=10.50, category=self.category, category_id=1,
                                                      description='foo', created_time=timezone.now(),
                                                      wallet=self.wallet, wallet_id=1, user=self.user, user_id=1)
        self.transaction.save()

        self.budget = Budget.objects.create(budget_id=1, user_id=1, category_id=1, goal=100, month=datetime.date.today(), wallet_id=1, balance=0, user=self.user)
        self.budget.save()
        self.login()

    def login(self):
        self.client.login(username='test_user', password='tester123')

    def tearDown(self):
        self.budget.delete()
        self.wallet.delete()
        self.other_wallet.delete()
        self.category.delete()
        self.user.delete()
        self.other_user.delete()

    def test_get_all_wallets(self):
        resp = self.client.get(reverse('wallets'))
        self.assertEqual(resp.status_code, 200)
        wallets = resp.context['wallets']
        self.assertEqual(len(wallets), 1)
        self.assertEqual(wallets[0], self.wallet)

    def test_post_to_create_a_new_wallet(self):
        resp = self.client.post(reverse('wallets'),
                                {
                                    'name': 'credit card',
                                    'balance': '10.00'
                                })
        self.assertEqual(resp.status_code, 201)
        self.assertTrue(len(resp.context['alerts']['success']) == 1)
        wallets = resp.context['wallets']
        self.assertEqual(len(wallets), 2)
        wallet = Wallet.objects.get(user=self.user, name='credit card')
        self.assertEqual(wallet.balance, decimal.Decimal('10.00'))
        wallet.delete()

    def test_post_to_create_existing_wallet(self):
        resp = self.client.post(reverse('wallets'),
                                {
                                    'name': 'checking',
                                    'balance': '10.00'
                                })
        self.assertEqual(resp.status_code, 200)
        self.assertTrue(len(resp.context['alerts']['errors']) == 1)
        self.assertEqual(len(Wallet.objects.filter(user=self.user)), 1)
        wallet = Wallet.objects.get(id=1)
        self.assertEqual(wallet.balance, decimal.Decimal('100'))

    def test_new_wallet_view(self):
        resp = self.client.get(reverse('new_wallet'))
        self.assertEqual(resp.status_code, 200)

    def test_get_specific_wallet(self):
        resp = self.client.get('/pynny/wallets/1')
        self.assertEqual(resp.status_code, 200)
        wallet = resp.context['wallet']
        self.assertEqual(wallet, self.wallet)

    def test_get_nonexistent_wallet(self):
        resp = self.client.get('/pynny/wallets/95')
        self.assertEqual(resp.status_code, 404)
        self.assertEqual(len(resp.context['alerts']['errors']), 1)

    def test_get_someone_elses_wallet(self):
        resp = self.client.get('/pynny/wallets/2')
        self.assertEqual(resp.status_code, 403)
        self.assertEqual(len(resp.context['alerts']['errors']), 1)

    def test_post_to_delete_a_wallet(self):
        resp = self.client.post(
            '/pynny/wallets/1',
            {
                'action': 'delete'
            }
        )
        self.assertEqual(resp.status_code, 200)
        with self.assertRaises(Wallet.DoesNotExist):
            Wallet.objects.get(id=1)

    def test_edit_a_wallet_view(self):
        resp = self.client.post(
            '/pynny/wallets/1',
            {
                'action': 'edit'
            }
        )
        self.assertEqual(resp.status_code, 200)
        self.assertEqual(resp.context['wallet'], self.wallet)

    def test_edit_completion(self):
        resp = self.client.post(
            '/pynny/wallets/1',
            {
                'action': 'edit_complete',
                'name': 'savings'
            }
        )
        self.assertEqual(resp.status_code, 200)
        self.assertEqual(Wallet.objects.get(id=1).name, 'savings')
        self.assertEqual(len(resp.context['alerts']['success']), 1)


text:
typedef std::chrono::system_clock::time_point TimePt;
typedef std::chrono::duration<double> Duration;
typedef std::chrono::system_clock Clock;

void SourceIBFS::IBFSInit()
{
    auto start = Clock::now();

    const int n = m_graph->NumNodes();

    m_source_layers = std::vector<NodeQueue>(n+1);

    m_source_orphans.clear();

    auto& nodes = m_graph->GetNodes();
    auto& sNode = nodes[m_graph->GetS()];
    sNode.state = NodeState::S;
    sNode.dis = 0;
    m_source_layers[0].push_back(sNode);
    auto& tNode = nodes[m_graph->GetT()];
    tNode.state = NodeState::T;
    tNode.dis = 0;

    // saturate all s-i-t paths
    for (NodeId i = 0; i < n; ++i) {
        REAL min_cap = std::min(m_graph->m_c_si[i]-m_graph->m_phi_si[i],
                m_graph->m_c_it[i]-m_graph->m_phi_it[i]);
        m_graph->m_phi_si[i] += min_cap;
        m_graph->m_phi_it[i] += min_cap;
        if (m_graph->m_c_si[i] > m_graph->m_phi_si[i]) {
            auto& node = m_graph->node(i);
            node.state = NodeState::S;
            node.dis = 1;
            AddToLayer(i);
            node.parent_arc = m_graph->ArcsEnd(i);
            node.parent = m_graph->GetS();
        } else if (m_graph->m_c_it[i] > m_graph->m_phi_it[i]) {
            auto& node = m_graph->node(i);
            node.state = NodeState::T;
            node.parent_arc = m_graph->ArcsEnd(i);
            node.parent = m_graph->GetT();
        } else {
            ASSERT(m_graph->m_c_si[i] == m_graph->m_phi_si[i]
                && m_graph->m_c_it[i] == m_graph->m_phi_it[i]);
        }
    }
    m_initTime += Duration{ Clock::now() - start }.count();
}

void SourceIBFS::IBFS() {
    auto start = Clock::now();
    m_source_tree_d = 0;

    IBFSInit();

    // Set up initial current_q and search nodes to make it look like
    // we just finished scanning the source node
    NodeQueue* current_q = &(m_source_layers[0]);
    m_search_node_iter = current_q->end();
    m_search_node_end = current_q->end();

    while (!current_q->empty()) {
        if (m_search_node_iter == m_search_node_end) {
            // Swap queues and continue
            m_source_tree_d++;
            current_q = &(m_source_layers[m_source_tree_d]);
            m_search_node_iter = current_q->begin();
            m_search_node_end = current_q->end();
            if (!current_q->empty()) {
                Node& n = *m_search_node_iter;
                NodeId nodeIdx = n.id;
                ASSERT(n.state == NodeState::S);
                m_search_arc = m_graph->ArcsBegin(nodeIdx);
                m_search_arc_end = m_graph->ArcsEnd(nodeIdx);
            }
            continue;
        }
        Node& n = *m_search_node_iter;
        NodeId search_node = n.id;
        int distance = m_source_tree_d;
        ASSERT(n.dis == distance);
        // Advance m_search_arc until we find a residual arc
        while (m_search_arc != m_search_arc_end && !m_graph->NonzeroCap(m_search_arc, true))
            ++m_search_arc;

        if (m_search_arc != m_search_arc_end) {
            NodeId neighbor = m_search_arc.Target();
            NodeState neighbor_state = m_graph->node(neighbor).state;
            if (neighbor_state == n.state) {
                ASSERT(m_graph->node(neighbor).dis <= n.dis + 1);
                if (m_graph->node(neighbor).dis == n.dis+1) {
                    auto reverseArc = m_search_arc.Reverse();
                    if (reverseArc < m_graph->node(neighbor).parent_arc) {
                        m_graph->node(neighbor).parent_arc = reverseArc;
                        m_graph->node(neighbor).parent = search_node;
                    }
                }
                ++m_search_arc;
            } else if (neighbor_state == NodeState::N) {
                // Then we found an unlabeled node, add it to the tree
                m_graph->node(neighbor).state = n.state;
                m_graph->node(neighbor).dis = n.dis + 1;
                AddToLayer(neighbor);
                auto reverseArc = m_search_arc.Reverse();
                m_graph->node(neighbor).parent_arc = reverseArc;
                ASSERT(m_graph->NonzeroCap(m_graph->node(neighbor).parent_arc, false));
                m_graph->node(neighbor).parent = search_node;
                ++m_search_arc;
            } else {
                // Then we found an arc to the other tree
                ASSERT(neighbor_state == NodeState::T);
                ASSERT(m_graph->NonzeroCap(m_search_arc, true));
                Augment(m_search_arc);
                Adopt();
            }
        } else {
            // No more arcs to scan from this node, so remove from queue
            AdvanceSearchNode();
        }
    } // End while
    m_totalTime += Duration{ Clock::now() - start }.count();

    //std::cout << "Total time:      " << m_totalTime << "\n";
    //std::cout << "Init time:       " << m_initTime << "\n";
    //std::cout << "Augment time:    " << m_augmentTime << "\n";
    //std::cout << "Adopt time:      " << m_adoptTime << "\n";
}

void SourceIBFS::Augment(ArcIterator& arc) {
    auto start = Clock::now();

    NodeId i, j;
    i = arc.Source();
    j = arc.Target();
    REAL bottleneck = m_graph->ResCap(arc, true);
    NodeId current = i;
    NodeId parent = m_graph->node(current).parent;
    while (parent != m_graph->GetS()) {
        ASSERT(m_graph->node(current).state == NodeState::S);
        auto& a = m_graph->node(current).parent_arc;
        bottleneck = std::min(bottleneck, m_graph->ResCap(a, false));
        current = parent;
        parent = m_graph->node(current).parent;
    }
    ASSERT(m_graph->node(current).parent == m_graph->GetS());
    bottleneck = std::min(bottleneck, m_graph->m_c_si[current] - m_graph->m_phi_si[current]);

    current = j;
    ASSERT(m_graph->node(current).parent == m_graph->GetT());
    bottleneck = std::min(bottleneck, m_graph->m_c_it[current] - m_graph->m_phi_it[current]);
    ASSERT(bottleneck > 0);

    // Found the bottleneck, now do pushes on the arcs in the path
    Push(arc, true, bottleneck);
    current = i;
    parent = m_graph->node(current).parent;
    while (parent != m_graph->GetS()) {
        auto& a = m_graph->node(current).parent_arc;
        Push(a, false, bottleneck);
        current = parent;
        parent = m_graph->node(current).parent;
    }
    ASSERT(m_graph->node(current).parent == m_graph->GetS());
    m_graph->m_phi_si[current] += bottleneck;
    if (m_graph->m_phi_si[current] == m_graph->m_c_si[current])
        MakeOrphan(current);

    current = j;
    ASSERT(m_graph->node(current).parent == m_graph->GetT());
    m_graph->m_phi_it[current] += bottleneck;
    if (m_graph->m_phi_it[current] == m_graph->m_c_it[current])
        MakeOrphan(current);

    m_augmentTime += Duration{ Clock::now() - start }.count();
}

void SourceIBFS::Adopt() {
    auto start = Clock::now();
    while (!m_source_orphans.empty()) {
        Node& n = m_source_orphans.front();
        NodeId i = n.id;
        m_source_orphans.pop_front();
        int old_dist = n.dis;
        while (n.parent_arc != m_graph->ArcsEnd(i)
                && (m_graph->node(n.parent).state == NodeState::T
                    || m_graph->node(n.parent).state == NodeState::N
                    || m_graph->node(n.parent).dis != old_dist - 1
                    || !m_graph->NonzeroCap(n.parent_arc, false))) {
            ++n.parent_arc;
            if (n.parent_arc != m_graph->ArcsEnd(i))
                n.parent = n.parent_arc.Target();
        }
        if (n.parent_arc == m_graph->ArcsEnd(i)) {
            RemoveFromLayer(i);
            // We didn't find a new parent with the same label, so do a relabel
            n.dis = std::numeric_limits<int>::max()-1;
            for (auto newParentArc = m_graph->ArcsBegin(i); newParentArc != m_graph->ArcsEnd(i); ++newParentArc) {
                auto target = newParentArc.Target();
                if (m_graph->node(target).dis < n.dis
                        && (m_graph->node(target).state == NodeState::S
                            || m_graph->node(target).state == NodeState::S_orphan)
                        && m_graph->NonzeroCap(newParentArc, false)) {
                    n.dis = m_graph->node(target).dis;
                    n.parent_arc = newParentArc;
                    ASSERT(m_graph->NonzeroCap(n.parent_arc, false));
                    n.parent = target;
                }
            }
            n.dis++;
            int cutoff_distance = m_source_tree_d + 1;
            if (n.dis > cutoff_distance) {
                n.state = NodeState::N;
            } else {
                n.state = NodeState::S;
                AddToLayer(i);
            }
            // FIXME(afix) Should really assert that n.dis > old_dis
            // but current-arc heuristic isn't watertight at the moment...
            if (n.dis > old_dist) {
                for (auto arc = m_graph->ArcsBegin(i); arc != m_graph->ArcsEnd(i); ++arc) {
                    if (m_graph->node(arc.Target()).parent == i)
                        MakeOrphan(arc.Target());
                }
            }
        } else {
            ASSERT(m_graph->NonzeroCap(n.parent_arc, false));
            n.state = NodeState::S;
        }
    }
    m_adoptTime += Duration{ Clock::now() - start }.count();
}

void SourceIBFS::MakeOrphan(NodeId i) {
    Node& n = m_graph->node(i);
    if (n.state != NodeState::S && n.state != NodeState::T)
        return;
    if (n.state == NodeState::S) {
        n.state = NodeState::S_orphan;
        m_source_orphans.push_back(n);
    } else if (n.state == NodeState::T) {
        n.state = NodeState::N;
    }
}

void SourceIBFS::Push(ArcIterator& arc, bool forwardArc, REAL delta) {
    ASSERT(delta > 0);
    //ASSERT(delta > -1e-7);//Chen
    m_num_clique_pushes++;
    //std::cout << "Pushing on clique arc (" << arc.i << ", " << arc.j << ") -- delta = " << delta << std::endl;
    auto& c = m_graph->clique(arc.cliqueId());
    if (forwardArc)
        c.Push(arc.SourceIdx(), arc.TargetIdx(), delta);
    else
        c.Push(arc.TargetIdx(), arc.SourceIdx(), delta);
    for (NodeId n : c.Nodes()) {
        if (m_graph->node(n).state == NodeState::N)
            continue;
        auto& parent_arc = m_graph->node(n).parent_arc;
        if (parent_arc != m_graph->ArcsEnd(n) && parent_arc.cliqueId() == arc.cliqueId() && !m_graph->NonzeroCap(parent_arc, m_graph->node(n).state == NodeState::T)) {
            MakeOrphan(n);
        }
    }
}

/////////////// end of push relabel ///////////////////

void SourceIBFS::ComputeMinCut() {
    auto& labels = m_energy->GetLabels();
    for (NodeId i = 0; i < m_graph->NumNodes(); ++i) {
        if (m_graph->node(i).state == NodeState::T)
            labels[i] = 0;
        else if (m_graph->node(i).state == NodeState::S)
            labels[i] = 1;
        else {
            ASSERT(m_graph->node(i).state == NodeState::N);
            // Put N nodes on whichever side could still grow
            labels[i] = 0;
        }
    }
}

void SourceIBFS::Solve(SubmodularIBFS* energy) {
    m_energy = energy;
    m_graph = &energy->Graph();
    m_graph->ResetFlow();
    m_graph->UpperBoundCliques(energy->Params().ub, energy->Params().fixedVars, energy->GetLabels(), energy->NormStats());
    IBFS();
    ComputeMinCut();
}

void SourceIBFS::AddToLayer(NodeId i) {
    auto& node = m_graph->node(i);
    int dis = node.dis;
    if (node.state == NodeState::S) {
        m_source_layers[dis].push_back(node);
        if (node.dis == m_source_tree_d)
            m_search_node_end = m_source_layers[m_source_tree_d].end();
    } else {
        ASSERT(false);
    }
}

void SourceIBFS::RemoveFromLayer(NodeId i) {
    auto& node = m_graph->node(i);
    if (m_search_node_iter != m_search_node_end && &(*m_search_node_iter) == &node)
        AdvanceSearchNode();
    int dis = node.dis;
    if (node.state == NodeState::S || node.state == NodeState::S_orphan) {
        auto& layer = m_source_layers[dis];
        layer.erase(layer.iterator_to(node));
    } else {
        ASSERT(false);
    }
}

void SourceIBFS::AdvanceSearchNode() {
    m_search_node_iter++;
    if (m_search_node_iter != m_search_node_end) {
        Node& n = *m_search_node_iter;
        NodeId i = n.id;
        ASSERT(n.state == NodeState::S || n.state == NodeState::S_orphan);
        m_search_arc = m_graph->ArcsBegin(i);
        m_search_arc_end = m_graph->ArcsEnd(i);
    }
}


text:
require 'test_helper'

class SearchControllerTest < ActionController::TestCase
  test "should get jobs" do
    get :jobs
    assert_response :success
  end

  test "should get friends" do
    get :friends
    assert_response :success
  end

  test "should get posters" do
    get :posters
    assert_response :success
  end

end


text:
import { TestSuite, Test, BeforeAll } from "jec-juta";
import { expect } from "chai";
import { DomainRequestError } from "../../../../../../src/com/onsoft/glasscat/domains/errors/DomainRequestError";

@TestSuite({
  description: "Test the DomainRequestError class properties"
})
export class DomainRequestErrorTest {

  public error:DomainRequestError = null;

  @BeforeAll()
  public initTest():void {
    this.error = new DomainRequestError();
  }

  @Test({
    description: "should have a 'statusCode' property set to '-1'"
  })
  public statusCodeTest():void {
    expect(this.error).to.have.property("statusCode", null);
  }

  @Test({
    description: "should have a 'detailsCode' property set to 'httpErrors.error.description'"
  })
  public detailsCodeTest():void {
    expect(
      this.error
    ).to.have.property("detailsCode", "httpErrors.error.description");
  }

  @Test({
    description: "should have a 'message' property set to 'null'"
  })
  public messageTest():void {
    expect(this.error).to.have.property("message", null);
  }

}


text:
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) AutoRest Code Generator.

package com.azure.containers.containerregistry.implementation.models;

import com.azure.core.http.HttpHeaders;
import com.azure.core.http.HttpRequest;
import com.azure.core.http.rest.ResponseBase;

/** Contains all response data for the getTagsNext operation. */
public final class ContainerRegistriesGetTagsNextResponse
        extends ResponseBase<ContainerRegistriesGetTagsNextHeaders, TagList> {
    /**
     * Creates an instance of ContainerRegistriesGetTagsNextResponse.
     *
     * @param request the request which resulted in this ContainerRegistriesGetTagsNextResponse.
     * @param statusCode the status code of the HTTP response.
     * @param rawHeaders the raw headers of the HTTP response.
     * @param value the deserialized value of the HTTP response.
     * @param headers the deserialized headers of the HTTP response.
     */
    public ContainerRegistriesGetTagsNextResponse(
            HttpRequest request,
            int statusCode,
            HttpHeaders rawHeaders,
            TagList value,
            ContainerRegistriesGetTagsNextHeaders headers) {
        super(request, statusCode, rawHeaders, value, headers);
    }

    /** @return the deserialized response body. */
    @Override
    public TagList getValue() {
        return super.getValue();
    }
}


text:
set -e

cd ..

GO_OUTPUT="gen/go/protos"
PYTHON_OUTPUT="gen/python/protos"
SWAGGER_OUTPUT="gen/swagger/protos"

for privacy in public
do
  cd protos/$privacy

  LOCAL_GO_OUTPUT="../../$GO_OUTPUT/$privacy"
  LOCAL_PYTHON_OUTPUT="../../$PYTHON_OUTPUT/$privacy"
  LOCAL_SWAGGER_OUTPUT="../../$SWAGGER_OUTPUT/$privacy"

  mkdir -p $LOCAL_GO_OUTPUT $LOCAL_PYTHON_OUTPUT $LOCAL_SWAGGER_OUTPUT

  GATEWAY_FLAGS="-I. -I/usr/local/include -I${GOPATH}/src/github.com/grpc-ecosystem/grpc-gateway/third_party/googleapis"
  PYTHON_GRPC_FLAGS="--grpc_python_out=$LOCAL_PYTHON_OUTPUT --python_out=$LOCAL_PYTHON_OUTPUT"

  for protodir in $(find . -name '*.proto' | xargs -n 1 dirname | sort | uniq)
  do
      echo $PWD
      echo "Building $protodir for python"
      python3 -m grpc_tools.protoc $PYTHON_GRPC_FLAGS $GATEWAY_FLAGS $protodir/*.proto

      echo "Building $protodir for golang"
      python3 -m grpc_tools.protoc $GATEWAY_FLAGS \
      --go_out=plugins=grpc,paths=source_relative:$LOCAL_GO_OUTPUT \
      --grpc-gateway_out=logtostderr=true,paths=source_relative,allow_delete_body=true:$LOCAL_GO_OUTPUT \
      --swagger_out=logtostderr=true,allow_delete_body=true:$LOCAL_SWAGGER_OUTPUT \
      $protodir/*.proto
      echo ''
  done

  echo "Fixing python folders"
  python3 ../../scripts/fix_imports.py --python-output-dir $LOCAL_PYTHON_OUTPUT

  echo "Fixing swagger definitions"
  for f in $(find $LOCAL_SWAGGER_OUTPUT -type f)
  do
      sed 's,"/v1/,"/,' $f > /tmp/foo.txt
      cat /tmp/foo.txt | jq '.basePath = "/v1"' > $f
  done

  cd ../..
done

cp -R $PYTHON_OUTPUT/* ../client/verta/verta/_protos

echo "Creating swagger definitions for scala"
pushd ../client/scala
./swagger_codegen.sh
popd


text:
module NginxRecipeHelpers
  # pidfile is hard to determine on Debian systems.
  # Upstream packages and older distro releases use '/var/run/nginx.pid'
  # systemd based distros and Ubuntu 14.04 use '/run/nginx.pid' for their
  # packages
  def pidfile_location
    if (node['nginx']['repo_source'].nil? || node['nginx']['repo_source'] == 'distro') &&
       (node['init_package'] == 'systemd' || node['platform_version'].to_f == 14.04)
      '/run/nginx.pid'
    else
      '/var/run/nginx.pid'
    end
  end
end

Chef::Resource.send(:include, NginxRecipeHelpers)


text:
if defined?(ActiveRecord)
  module Napa
    module FilterByHash
      WARNING = 'Napa::FilterByHash is deprecated, this module will be removed in future releases'
      module ClassMethods
        def filter(search_hash = {})
          # pass an empty where clause to force results to be a relation that will be lazy evaluated
          results = where({})
          search_hash.each do |k, v|
            results = results.where(k => v)
          end
          results
        end
      end

      def self.included(base)
        ActiveSupport::Deprecation.warn WARNING, caller
        base.extend(ClassMethods)
      end
    end
  end
end


text:
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Authentic extends CI_Controller {
	public function __construct()
	{
		parent::__construct();
		$this->load->model("Accountmodel");
		$this->load->helper("string");
	}

	public function signin()
	{
		$data = array(
			"title" => "Sign in | Bookstore online!",
			"template" => "frontend/authentic/signin"
		);
		$this->load->view('shares/_frontend_layout',isset($data)?$data:NULL);
	}

	public function signup()
	{
		if($this->input->post("submit"))
		{
			$this->form_validation->set_rules("email", "email ", "trim|required|min_length[5]|valid_email|callback__check_email_signup");
			$this->form_validation->set_rules("fullname", "full name ", "trim|required|min_length[5]");
			$this->form_validation->set_rules("password", "password ", "trim|required|min_length[5]");
			$this->form_validation->set_rules("confirmpassword", "confirm password ", "trim|required|min_length[5]|matches[password]");
			$this->form_validation->set_rules("phone", "phone ", "trim|required|min_length[10]|max_length[11]|integer");
			$this->form_validation->set_error_delimiters('
', '
');
			if($this->form_validation->run())
			{
				$data = array(
					"email" => $this->input->post("email"),
					"password" => $this->input->post("password"),
					"salt" => random_string("alnum", 255),
					"useragent" => $_SERVER['HTTP_USER_AGENT'],
					"fullname" => $this->input->post("fullname")

				);

			}
		}

		$data = array(
			"title" => "Sign up | Bookstore online!",
			"template" => "frontend/authentic/signup"
		);
		$this->load->view('shares/_frontend_layout',isset($data)?$data:NULL);
	}

	public function _check_email_signup($mail = "")
	{
		if($this->Accountmodel->check_email($this->input->post("email")))
		{
			$this->form_validation->set_message('_check_email_signup', 'The %s really exists, try again!');
			return FALSE;
		}
		{
			return TRUE;
		}
	}

	public function _check_email_signin($mail = "")
	{
		if(!$this->Accountmodel->check_email($this->input->post("email")))
		{
			$this->form_validation->set_message('_check_email_signin', 'The %s really not exists, try again!');
			return FALSE;
		}
		{
			return TRUE;
		}
	}
}


text:
Tr3llo::Utils.require_directory(File.dirname(__FILE__) + "/card/*.rb")

module Tr3llo
  module Command
    module Card
      extend self

      def execute(subcommand, args)
        case subcommand
        when "list"
          board = Application.fetch_board!()

          Command::Card::List.execute(board.id)
        when "list-mine"
          board = Application.fetch_board!()
          user = Application.fetch_user!()

          Command::Card::ListMine.execute(board.id, user.id)
        when "add"
          board = Application.fetch_board!()
          Command::Card::Add.execute(board[:id])
        when "show"
          card_key, = args
          Utils.assert_string!(card_key, "card key is missing")

          Command::Card::Show.execute(card_key)
        when "edit"
          card_key, = args
          Utils.assert_string!(card_key, "card key is missing")

          Command::Card::Edit.execute(card_key)
        when "comments"
          card_key, = args
          Utils.assert_string!(card_key, "card key is missing")

          Command::Card::Comments.execute(card_key)
        when "comment"
          card_key, = args
          Utils.assert_string!(card_key, "card key is missing")

          Command::Card::Comment.execute(card_key)
        when "move"
          board = Application.fetch_board!()
          card_key, = args
          Utils.assert_string!(card_key, "card key is missing")

          Command::Card::Move.execute(card_key, board[:id])
        when "self-assign"
          user = Application.fetch_user!()
          card_key, = args
          Utils.assert_string!(card_key, "card key is missing")

          Command::Card::SelfAssign.execute(card_key, user[:id])
        when "assign"
          board = Application.fetch_board!()
          card_key, = args
          Utils.assert_string!(card_key, "card key is missing")

          Command::Card::Assign.execute(card_key, board[:id])
        when "archive"
          card_key, = args
          Utils.assert_string!(card_key, "card key is missing")

          Command::Card::Archive.execute(card_key)
        when "add-checklist"
          card_key, = args
          Utils.assert_string!(card_key, "card key is missing")

          Command::Card::AddChecklist.execute(card_key)
        when "edit-checklist"
          checklist_key, = args
          Utils.assert_string!(checklist_key, "checklist key is missing")

          Command::Card::EditChecklist.execute(checklist_key)
        when "remove-checklist"
          checklist_key, = args
          Utils.assert_string!(checklist_key, "checklist key is missing")

          Command::Card::RemoveChecklist.execute(checklist_key)
        when "add-item"
          checklist_key, = args
          Utils.assert_string!(checklist_key, "checklist key is missing")

          Command::Card::AddItem.execute(checklist_key)
        when "check-item"
          card_key, check_item_key, = args
          Utils.assert_string!(card_key, "card key is missing")
          Utils.assert_string!(check_item_key, "item key is missing")

          Command::Card::CheckItem.execute(card_key, check_item_key)
        when "uncheck-item"
          card_key, check_item_key, = args
          Utils.assert_string!(card_key, "card key is missing")
          Utils.assert_string!(check_item_key, "item key is missing")

          Command::Card::UncheckItem.execute(card_key, check_item_key)
        when "edit-item"
          card_key, check_item_key, = args
          Utils.assert_string!(card_key, "card key is missing")
          Utils.assert_string!(check_item_key, "item key is missing")

          Command::Card::EditItem.execute(card_key, check_item_key)
        when "remove-item"
          card_key, check_item_key, = args
          Utils.assert_string!(card_key, "card key is missing")
          Utils.assert_string!(check_item_key, "item key is missing")

          Command::Card::RemoveItem.execute(card_key, check_item_key)
        when "add-label"
          board = Application.fetch_board!()
          card_key, = args
          Utils.assert_string!(card_key, "card key is missing")

          Command::Card::AddLabel.execute(card_key, board[:id])
        else
          handle_invalid_subcommand(subcommand, args)
        end
      rescue InvalidArgumentError => exception
        Command::Card::Invalid.execute(exception.message)
      rescue InvalidCommandError => exception
        Command::Card::Invalid.execute(exception.message)
      rescue BoardNotSelectedError => exception
        Command::Card::Invalid.execute(exception.message)
      end

      private

      def handle_invalid_subcommand(subcommand, _args)
        case subcommand
        when String
          command_string = "card #{subcommand}"

          raise InvalidCommandError.new("#{command_string.inspect} is not a valid command")
        when NilClass
          raise InvalidCommandError.new("command is missing")
        end
      end
    end
  end
end


text:
class CallToAction {
public:

	// call this at the beginning
	void setup(ofxWWTweetParticleManager *manager);

	// call this when someone interacts.
	void justInteracted();

	// call this every draw. The method
	// will decide for itself when to draw.
	void draw();

private:
	float lastInteractionTime;
	float oldLastInteractionTime;
	ofImage image;
	ofxWWTweetParticleManager *manager;
	float fadeout;
};


text:
<?php

namespace Sistema\SisreimpBundle\Entity;

use Doctrine\ORM\EntityRepository;

/**
 * ContribuyenteRepository
 *
 * This class was generated by the Doctrine ORM. Add your own custom
 * repository methods below.
 */
class ContribuyenteRepository extends EntityRepository
{
}


text:
import textwrap

from mock import patch
from twitter.common.contextutil import temporary_file

from apache.aurora.client.cli import EXIT_COMMAND_FAILURE
from apache.aurora.client.cli.client import AuroraCommandLine
from apache.aurora.client.cli.util import AuroraClientCommandTest, FakeAuroraCommandContext

class TestClientCreateCommand(AuroraClientCommandTest):

  def test_list_configs(self):
    mock_context = FakeAuroraCommandContext()
    with patch('apache.aurora.client.cli.config.ConfigNoun.create_context',
        return_value=mock_context):
      with temporary_file() as fp:
        fp.write(self.get_valid_config())
        fp.flush()
        cmd = AuroraCommandLine()
        cmd.execute(['config', 'list', fp.name])
        assert mock_context.out == ['jobs=[west/bozo/test/hello]']
        assert mock_context.err == []

  def test_list_configs_invalid(self):
    mock_context = FakeAuroraCommandContext()
    with patch('apache.aurora.client.cli.config.ConfigNoun.create_context',
        return_value=mock_context):
      with temporary_file() as fp:
        fp.write(self.get_invalid_config("blather=..."))
        fp.flush()
        cmd = AuroraCommandLine()
        result = cmd.execute(['config', 'list', fp.name])
        assert result == EXIT_COMMAND_FAILURE
        assert mock_context.out == []
        assert any(line.startswith("Error loading configuration file: invalid syntax") for line in
            mock_context.err)

  def get_config_with_no_jobs(self):
    return textwrap.dedent("""
      HELLO_WORLD = Job(
        name = '%(job)s',
        role = '%(role)s',
        cluster = '%(cluster)s',
        environment = '%(env)s',
        instances = 20,
        update_config = UpdateConfig(
          batch_size = 5,
          restart_threshold = 30,
          watch_secs = 10,
          max_per_shard_failures = 2,
        ),
        task = Task(
          name = 'test',
          processes = [Process(name = 'hello_world', cmdline = 'echo {{thermos.ports[http]}}')],
          resources = Resources(cpu = 0.1, ram = 64 * MB, disk = 64 * MB),
        )
      )
      """)

  def test_list_configs_nojobs(self):
    mock_context = FakeAuroraCommandContext()
    with patch('apache.aurora.client.cli.config.ConfigNoun.create_context',
        return_value=mock_context):
      with temporary_file() as fp:
        fp.write(self.get_config_with_no_jobs())
        fp.flush()
        cmd = AuroraCommandLine()
        cmd.execute(['config', 'list', fp.name])
        assert mock_context.out == ["jobs=[]"]
        assert mock_context.err == []


text:
'''Autogenerated by xml_generate script, do not edit!'''
from OpenGL import platform as _p, arrays
# Code generation uses this
from OpenGL.raw.GLES1 import _types as _cs
# End users want this...
from OpenGL.raw.GLES1._types import *
from OpenGL.raw.GLES1 import _errors
from OpenGL.constant import Constant as _C

import ctypes
_EXTENSION_NAME = 'GLES1_OES_mapbuffer'
def _f( function ):
    return _p.createFunction( function,_p.PLATFORM.GLES1,'GLES1_OES_mapbuffer',error_checker=_errors._error_checker)
GL_BUFFER_ACCESS_OES=_C('GL_BUFFER_ACCESS_OES',0x88BB)
GL_BUFFER_MAPPED_OES=_C('GL_BUFFER_MAPPED_OES',0x88BC)
GL_BUFFER_MAP_POINTER_OES=_C('GL_BUFFER_MAP_POINTER_OES',0x88BD)
GL_WRITE_ONLY_OES=_C('GL_WRITE_ONLY_OES',0x88B9)
@_f
@_p.types(None,_cs.GLenum,_cs.GLenum,arrays.GLvoidpArray)
def glGetBufferPointervOES(target,pname,params):pass
@_f
@_p.types(ctypes.c_void_p,_cs.GLenum,_cs.GLenum)
def glMapBufferOES(target,access):pass
@_f
@_p.types(_cs.GLboolean,_cs.GLenum)
def glUnmapBufferOES(target):pass


text:
@interface MVPMatrixManager : NSObject
{
    Matrix3D modelViewStack[100];
    Matrix3D projectionMatrixStack[10];

    int currentModelViewMatrixIndex;
    int currentProjectionMatrixIndex;

    CGFloat zCoordinate;
    CGFloat zCoordinateStack[100];
}

@property (nonatomic) CGFloat zCoordinate;
+(id)sharedMVPMatrixManager;
-(void)pushModelViewMatrix;
-(void)popModelViewMatrix;
-(void)pushProjectionMatrix;
-(void)popProjectionMatrix;
-(void)setOrthoProjection: (GLfloat) left :(GLfloat) right :(GLfloat) bottom
                         :(GLfloat) top :(GLfloat) near :(GLfloat) far;
-(void)setFrustumProjection: (GLfloat) left :(GLfloat) right :(GLfloat) bottom
                           :(GLfloat) top :(GLfloat) zNear :(GLfloat) zFar;
-(void)setPerspectiveProjection:(GLfloat) fieldOfVision :(GLfloat) near :(GLfloat) far :(GLfloat) aspectRatio;
-(void)rotateByAngleInDegrees:(CGFloat)degrees InX:(CGFloat)x Y:(CGFloat)y Z:(CGFloat)z;
-(void)scaleByXScale:(CGFloat)xScale YScale:(CGFloat)yScale ZScale:(CGFloat)zScale;
-(void)translateInX:(CGFloat)x Y:(CGFloat)y Z:(CGFloat)z;
-(void)getMVPMatrix:(Matrix3D)mvpMatrix;
-(void)resetModelViewMatrixStack;
-(void)setIdentity;
@end


text:
import { expect, assert } from 'chai';
import { stub } from 'sinon';
import React from 'react';
import sd from 'skin-deep';
import { isElementOfType } from 'react-addons-test-utils';;
import { findWithRef } from 'react-shallow-testutils';
import shallowRender from '../../../../../../test-utils/shallow-render';

const props = {
  screenshotWidth: 500,
  screenshotHeight: 1000
};

export default describe('PreviewForegroundEmpty', () => {
  let component,
      render,
      errorStub;

  before(done => {
    errorStub = stub(console, 'error');
    component = require('pods/template/components/Preview/Foreground/Empty');
    render = shallowRender(component, props);
    done();
  });

  after(done => {
    errorStub.restore();
    done();
  });

  it('should pass propTypes check', () => {
    assert(!errorStub.called, `\n${errorStub.args.join('\n')}`);
  });

  it('should display a prompt', () => {
    let prompt = findWithRef(render.output, 'prompt');

    expect(prompt.props.children).to.equal('Add a screenshot');
  });

  it('should display expected screenshot dimensions', () => {
    let dimensions = findWithRef(render.output, 'screenshotDimensions');

    expect(dimensions.props.children).to.equal(`( ${props.screenshotWidth} x ${props.screenshotHeight} )`);
  });
});


text:
package org.apache.polygene.library.sql.generator.implementation.transformation;

import java.util.Iterator;
import java.util.Objects;
import org.apache.polygene.library.sql.generator.grammar.booleans.BinaryPredicate;
import org.apache.polygene.library.sql.generator.grammar.booleans.BooleanExpression;
import org.apache.polygene.library.sql.generator.grammar.booleans.BooleanTest;
import org.apache.polygene.library.sql.generator.grammar.booleans.BooleanTest.TestType;
import org.apache.polygene.library.sql.generator.grammar.booleans.Conjunction;
import org.apache.polygene.library.sql.generator.grammar.booleans.Disjunction;
import org.apache.polygene.library.sql.generator.grammar.booleans.MultiPredicate;
import org.apache.polygene.library.sql.generator.grammar.booleans.Negation;
import org.apache.polygene.library.sql.generator.grammar.booleans.UnaryPredicate;
import org.apache.polygene.library.sql.generator.grammar.common.NonBooleanExpression;
import org.apache.polygene.library.sql.generator.grammar.common.SQLConstants;
import org.apache.polygene.library.sql.generator.grammar.query.QueryExpression;
import org.apache.polygene.library.sql.generator.implementation.grammar.booleans.BooleanUtils;
import org.apache.polygene.library.sql.generator.implementation.transformation.spi.SQLProcessorAggregator;

/**
 * Currently not thread-safe.
 *
 *
 */
public class BooleanExpressionProcessing
{
    public static class UnaryPredicateProcessor extends AbstractProcessor<UnaryPredicate>
    {
        public enum UnaryOperatorOrientation
        {
            BEFORE_EXPRESSION, // After expression
            AFTER_EXPRESSION
            // Before expression
        }

        public static final UnaryOperatorOrientation DEFAULT_ORIENTATION = UnaryOperatorOrientation.AFTER_EXPRESSION;

        private final UnaryOperatorOrientation _orientation;
        private final String _operator;

        public UnaryPredicateProcessor( String operator )
        {
            this( DEFAULT_ORIENTATION, operator );
        }

        public UnaryPredicateProcessor( UnaryOperatorOrientation unaryOrientation, String unaryOperator )
        {
            super( UnaryPredicate.class );
            Objects.requireNonNull( unaryOrientation, "unary operator orientation" );
            Objects.requireNonNull( unaryOperator, "unary operator" );
            this._orientation = unaryOrientation;
            this._operator = unaryOperator;
        }

        protected void doProcess( SQLProcessorAggregator processor, UnaryPredicate predicate, StringBuilder builder )
        {
            UnaryOperatorOrientation orientation = this._orientation;
            if( orientation == UnaryOperatorOrientation.BEFORE_EXPRESSION )
            {
                builder.append( this._operator ).append( SQLConstants.TOKEN_SEPARATOR );
            }

            NonBooleanExpression exp = predicate.getValueExpression();
            Boolean isQuery = exp instanceof QueryExpression;
            if( isQuery )
            {
                builder.append( SQLConstants.OPEN_PARENTHESIS );
            }
            processor.process( exp, builder );
            if( isQuery )
            {
                builder.append( SQLConstants.CLOSE_PARENTHESIS );
            }

            if( orientation == UnaryOperatorOrientation.AFTER_EXPRESSION )
            {
                builder.append( SQLConstants.TOKEN_SEPARATOR ).append( this._operator );
            }
        }
    }

    public static class BinaryPredicateProcessor extends AbstractProcessor<BinaryPredicate>
    {
        private final String _operator;

        public BinaryPredicateProcessor( String binaryOperator )
        {
            super( BinaryPredicate.class );
            Objects.requireNonNull( binaryOperator, "binary operator" );

            this._operator = binaryOperator;
        }

        @Override
        protected void doProcess( SQLProcessorAggregator processor, BinaryPredicate predicate, StringBuilder builder )
        {
            processor.process( predicate.getLeft(), builder );
            builder.append( SQLConstants.TOKEN_SEPARATOR ).append( this._operator )
                   .append( SQLConstants.TOKEN_SEPARATOR );
            processor.process( predicate.getRight(), builder );
        }
    }

    public static class MultiPredicateProcessor extends AbstractProcessor<MultiPredicate>
    {
        private final String _operator;
        private final String _separator;
        private final Boolean _needParenthesis;

        public MultiPredicateProcessor( String multiOperator, String multiSeparator, Boolean needParenthesis )
        {
            super( MultiPredicate.class );
            Objects.requireNonNull( multiOperator, "multi-operator" );
            Objects.requireNonNull( multiSeparator, "multi separator" );
            Objects.requireNonNull( needParenthesis, "need parenthesis" );

            this._operator = multiOperator;
            this._separator = multiSeparator;
            this._needParenthesis = needParenthesis;
        }

        @Override
        protected void doProcess( SQLProcessorAggregator processor, MultiPredicate predicate, StringBuilder builder )
        {
            processor.process( predicate.getLeft(), builder );
            builder.append( SQLConstants.TOKEN_SEPARATOR ).append( this._operator )
                   .append( SQLConstants.TOKEN_SEPARATOR );
            if( this._needParenthesis )
            {
                builder.append( SQLConstants.OPEN_PARENTHESIS );
            }

            Iterator<NonBooleanExpression> iter = predicate.getRights().iterator();
            while( iter.hasNext() )
            {
                NonBooleanExpression next = iter.next();
                Boolean isQuery = next instanceof QueryExpression;

                if( isQuery )
                {
                    builder.append( SQLConstants.OPEN_PARENTHESIS );
                }

                processor.process( next, builder );

                if( isQuery )
                {
                    builder.append( SQLConstants.CLOSE_PARENTHESIS );
                }

                if( iter.hasNext() )
                {
                    builder.append( this._separator );
                }
            }

            if( this._needParenthesis )
            {
                builder.append( SQLConstants.CLOSE_PARENTHESIS );
            }
        }
    }

    public static class NegationProcessor extends AbstractProcessor<Negation>
    {
        public NegationProcessor()
        {
            super( Negation.class );
        }

        @Override
        protected void doProcess( SQLProcessorAggregator aggregator, Negation object, StringBuilder builder )
        {
            BooleanExpression negated = object.getNegated();
            if( !BooleanUtils.isEmpty( negated ) )
            {
                builder.append( SQLConstants.NOT ).append( SQLConstants.TOKEN_SEPARATOR );
                aggregator.process( negated, builder );
            }
        }
    }

    public static void processBinaryComposedObject( SQLProcessorAggregator aggregator, BooleanExpression left,
                                                    BooleanExpression right, StringBuilder builder, String operator )
    {
        Boolean leftEmpty = BooleanUtils.isEmpty( left );
        Boolean rightEmpty = BooleanUtils.isEmpty( right );
        if( !leftEmpty || !rightEmpty )
        {
            Boolean oneEmpty = leftEmpty || rightEmpty;
            if( !oneEmpty )
            {
                builder.append( SQLConstants.OPEN_PARENTHESIS );
            }
            aggregator.process( left, builder );

            if( !oneEmpty )
            {
                if( !leftEmpty )
                {
                    builder.append( SQLConstants.TOKEN_SEPARATOR );
                }
                builder.append( operator );
                if( !rightEmpty )
                {
                    builder.append( SQLConstants.TOKEN_SEPARATOR );
                }
            }

            aggregator.process( right, builder );
            if( !oneEmpty )
            {
                builder.append( SQLConstants.CLOSE_PARENTHESIS );
            }
        }
    }

    public static class ConjunctionProcessor extends AbstractProcessor<Conjunction>
    {

        public ConjunctionProcessor()
        {
            super( Conjunction.class );
        }

        @Override
        protected void doProcess( SQLProcessorAggregator aggregator, Conjunction object, StringBuilder builder )
        {
            processBinaryComposedObject( aggregator, object.getLeft(), object.getRight(), builder, SQLConstants.AND );
        }
    }

    public static class DisjunctionProcessor extends AbstractProcessor<Disjunction>
    {
        public DisjunctionProcessor()
        {
            super( Disjunction.class );
        }

        @Override
        protected void doProcess( SQLProcessorAggregator aggregator, Disjunction object, StringBuilder builder )
        {
            processBinaryComposedObject( aggregator, object.getLeft(), object.getRight(), builder, SQLConstants.OR );
        }
    }

    public static class BooleanTestProcessor extends AbstractProcessor<BooleanTest>
    {
        public BooleanTestProcessor()
        {
            super( BooleanTest.class );
        }

        @Override
        protected void doProcess( SQLProcessorAggregator aggregator, BooleanTest object, StringBuilder builder )
        {
            BooleanExpression testable = object.getBooleanExpression();
            builder.append( SQLConstants.OPEN_PARENTHESIS );
            aggregator.process( testable, builder );
            builder.append( SQLConstants.CLOSE_PARENTHESIS ).append( SQLConstants.IS )
                   .append( SQLConstants.TOKEN_SEPARATOR );
            if( object.getTestType() == TestType.IS_NOT )
            {
                builder.append( SQLConstants.NOT ).append( SQLConstants.TOKEN_SEPARATOR );
            }

            builder.append( object.getTruthValue().toString() );
        }
    }
}


text:
.PHONY: all clean

all: poster.pdf extras.pdf

qrfenicstools.pdf: qrfenicstools.tex
	latexmk -pdflatex=lualatex -pdf $<
	mv qrfenicstools.pdf graphics

qrposter.pdf: qrposter.tex
	latexmk -pdflatex=lualatex -pdf $<
	mv qrposter.pdf graphics

qrextras.pdf: qrextras.tex
	latexmk -pdflatex=lualatex -pdf $<
	mv qrextras.pdf graphics

domains.pdf: domains.tex
	latexmk -pdf -pdflatex="pdflatex --shell-escape %O %S" $<
	mv domains.pdf graphics

plot_Ih.pdf: plot_Ih.tex
	latexmk -pdf -pdflatex="pdflatex --shell-escape %O %S" $<
	mv plot_Ih.pdf graphics

plot_Ih_clement.pdf: plot_Ih_clement.tex
	latexmk -pdf -pdflatex="pdflatex --shell-escape %O %S" $<
	mv plot_Ih_clement.pdf graphics

plot_Ih_L2.pdf: plot_Ih_L2.tex
	latexmk -pdf -pdflatex="pdflatex --shell-escape %O %S" $<
	mv plot_Ih_L2.pdf graphics

rate_plot.pdf: rate_plot.tex rate_data.txt
	latexmk -pdf -pdflatex="pdflatex --shell-escape %O %S" $<
	mv rate_plot.pdf graphics

poster.pdf: poster.tex
	latexmk -pdf -pdflatex="pdflatex --shell-escape %O %S" $<

extras.pdf: extras.tex
	latexmk -pdf -pdflatex="pdflatex --shell-escape %O %S" $<

view:
	evince poster.pdf &

clean:
	latexmk -C


text:
<?php

// Generates something like: 1465965676_385e33f741.jpg
$newName = $file->getRandomName();


text:
package org.kie.dmn.core.assembler;

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

import javax.xml.namespace.QName;

import org.kie.api.io.ResourceWithConfiguration;
import org.kie.dmn.model.v1_1.Definitions;

public class DMNResource {

    private final QName modelID;
    private final ResourceWithConfiguration resAndConfig;
    private final Definitions definitions;
    private final List<QName> dependencies = new ArrayList<>();

    public DMNResource(QName modelID, ResourceWithConfiguration resAndConfig, Definitions definitions) {
        this.modelID = modelID;
        this.resAndConfig = resAndConfig;
        this.definitions = definitions;
    }

    public QName getModelID() {
        return modelID;
    }

    public ResourceWithConfiguration getResAndConfig() {
        return resAndConfig;
    }

    public Definitions getDefinitions() {
        return definitions;
    }

    public void addDependency(QName dep) {
        this.dependencies.add(dep);
    }

    public void addDependencies(List<QName> deps) {
        this.dependencies.addAll(deps);
    }

    public List<QName> getDependencies() {
        return dependencies;
    }

    @Override
    public String toString() {
        return "DMNResource [modelID=" + modelID + ", resource=" + resAndConfig.getResource().getSourcePath() + "]";
    }

}


text:
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xmlns="http://java.sun.com/xml/ns/javaee"
	xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
	xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
	id="WebApp_ID" version="2.5">
	<display-name>opamp</display-name>

	<servlet>
		<servlet-name>opamp-api</servlet-name>
		<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
		<load-on-startup>1</load-on-startup>
	</servlet>
	<servlet-mapping>
		<servlet-name>opamp-api</servlet-name>
		<url-pattern>/rest/*</url-pattern>
	</servlet-mapping>

	<welcome-file-list>
		<welcome-file>index.jsp</welcome-file>
	</welcome-file-list>
</web-app>


text:
////////////////////////////////////////////////////////////////////////////////
// Copyright (c) 2010-2017. Lapinin "lastrix" Sergey.                          /
//                                                                             /
// Permission is hereby granted, free of charge, to any person                 /
// obtaining a copy of this software and associated documentation              /
// files (the "Software"), to deal in the Software without                     /
// restriction, including without limitation the rights to use,                /
// copy, modify, merge, publish, distribute, sublicense, and/or                /
// sell copies of the Software, and to permit persons to whom the              /
// Software is furnished to do so, subject to the following                    /
// conditions:                                                                 /
//                                                                             /
// The above copyright notice and this permission notice shall be              /
// included in all copies or substantial portions of the Software.             /
//                                                                             /
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,             /
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES             /
// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND                    /
// NON INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT                /
// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,                /
// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING                /
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE                  /
// OR OTHER DEALINGS IN THE SOFTWARE.                                          /
////////////////////////////////////////////////////////////////////////////////

package org.asn1s.annotation;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

@Retention( RetentionPolicy.RUNTIME )
@Target( ElementType.TYPE )
public @interface Asn1Type
{
	/**
	 * Valid ASN.1 Type name
	 *
	 * @return string
	 */
	String name() default AnnotationUtils.DEFAULT;

	String module() default AnnotationUtils.DEFAULT;

	long[] moduleID() default {};

	Kind kind() default Kind.Sequence;

	boolean extensible() default false;

	enum Kind
	{
		Set,
		Sequence
	}
}