text:
import * as Rx from "rxjs/Rx";

function delayWithId(delay: number, id: number): Promise<number> {
        return new Promise<number>((resolve) => setTimeout(() => {
            console.log(id);
            resolve(id);
        }, delay * 1000));
    }

function runInParallel(delay1: number, delay2: number, delay3: number): void {
    console.log("runInParallel");
    const p1 = delayWithId(delay1, 1);
    const p2 = delayWithId(delay2, 2);
    const p3 = delayWithId(delay3, 3);

    const p1Source = Rx.Observable.fromPromise(p1);
    const p2Source = Rx.Observable.fromPromise(p2);
    const p3Source = Rx.Observable.fromPromise(p3);

    Rx.Observable
        .merge(p1Source)
        .merge(p2Source)
        .merge(p3Source)
        .subscribe(
            (id) => console.log(id),
            (error) => console.log(error),
            () => { console.log("Done"); },
    );
}

// runInParallel(5, 10, 1);

function runInOrderedParallel(delay1: number, delay2: number, delay3: number): void {
    console.log("runInOrderedParallel");

    const p1 = delayWithId(delay1, 1).then(() => delayWithId(delay2, 2));

    const p3 = delayWithId(delay3, 3);

    Rx.Observable
        .forkJoin(p1, p3)
        .subscribe(
            (id) => "",
            (error) => console.log(error),
            () => { console.log("DONE!"); },
    );
}

// runInOrderedParallel(5, 12, 16);

redpajama_set_name: RedPajamaGithub


text:
void packetdemux::init(double t,...) {
//The 'parameters' variable contains the parameters transferred from the editor.
va_list parameters;
va_start(parameters,t);
//To get a parameter: %Name% = va_arg(parameters,%Type%)
//where:
//      %Name% is the parameter name
//	%Type% is the parameter type

for (int i=0;i<8;i++) {
	Labels[i] = va_arg(parameters,char*);
 	printLog("[%g] PktDemux: Label %u = %s \n",t,i,Labels[i].data());
};

n=(int) va_arg(parameters,double);
printLog("[%g] PktDemux: Labels: %u \n",t,n);

sigma = INF;
}
double packetdemux::ta(double t) {
//This function returns a double.
return sigma;
}
void packetdemux::dint(double t) {
sigma=INF;
p=NULL;
}
void packetdemux::dext(Event x, double t) {
//The input event is in the 'x' variable.
//where:
//     'x.value' is the value (pointer to void)
//     'x.port' is the port number
//     'e' is the time elapsed since last transition

p = (Packet*)x.value;
FlowID = p->FlowID;

sigma = 0;
}
Event packetdemux::lambda(double t) {
//This function returns an Event:
//     Event(%&Value%, %NroPort%)
//where:
//     %&Value% points to the variable which contains the value.
//     %NroPort% is the port number (from 0 to n-1)

for (int i=0;i<8;i++) {
	if (Labels[i].compare(FlowID) == 0) {
			return Event(p,i);
		};
};

return Event(NULL,0);
}
void packetdemux::exit() {
//Code executed at the end of the simulation.
}


text:
package mods.battlegear2.api.weapons;

import net.minecraft.item.ItemStack;

public interface IPenetrateWeapon {
	/**
	 * The amount of damage bypassing armor
	 * @param stack The {@link net.minecraft.item.ItemStack} representative of the item dealing the hit.
	 * @return the amount of damage that bypasses armour
	 */
	public float getPenetratingPower(ItemStack stack);
}


text:
var mysql = require('mysql');
var config = require('../../config');
var db = require('../database/db_pool');
var Search = function(){

  //Takes an array of keywords,
  //Callback(array of list objects)
  this.getPapers = function(obj, callback){
    db.getConnection(function(err, connection) {
      try{
        if (err) {throw err;}
          var cases = [];
          var casesStr = "";
          if (obj.keywords.constructor === Array){
            for (var i in obj.keywords){
              var c = obj.keywords[i].replace("'"," ");
              cases.push(`searchable_keyword = '${c}'`);
            }
          }else{
            var c = obj.keywords.replace("'"," ");
            cases.push(`searchable_keyword = '${c}'`);
          }

          if (cases === []){
            throw new Error('No keywords provided');
          }else{
            casesStr = cases.join(' or ');
          }
          console.log(`test ${casesStr}`);

          var sql = `select papers_id, title, abstract, citation from ${config.db.database}.papers
                      inner join ${config.db.database}.searchable_keywords
                      on searchable_keywords.papers_fk = papers_id
                      where ${casesStr} group by title`;
          var inserts = ['papers_id', 'title', 'abstract', 'citation'];
          sql = mysql.format(sql, inserts);

        connection.query(sql, function(err, rows) {
          try{
            if (err) {throw err;}
            if (rows[0] == undefined) {throw new Error('No row data');}

            callback('', rows);
            connection.release();
          }catch (err){
            callback(err, []);
            console.log(err);
            connection.release();
          }
        });
      }catch(err){
          callback(err, []);
          console.log(err);
      }
    });
  }
}

module.exports = new Search;


text:
Tile-based settlement building tech demo. Educational project, not a serious business.

# Requirements
* C++11 compiler
* SFML 2.x (http://sfml-dev.org)
* SFGUI (https://github.com/TankOs/SFGUI)
* nlohmann's JSON library (https://github.com/nlohmann/json)
* spdlog (https://github.com/gabime/spdlog)
* redxdev's single-header entity component system (https://github.com/redxdev/ECS)

# Build

TBD

# Assets

Assets in 'bin/assets' directory are for testing purposes only.

They were found within the boundlessness of the Internet and some of them may have licensing issues. They will be removed upon request.

# Controls

| Control          | Action                            |
|------------------|-----------------------------------|
| WASD             | move camera                       |
| SPACE            | show available resources on tiles |
| Numpad ADD       | increase game speed               |
| Numpad SUBSTRACT | decrease game speed               |
| ESC              | quit game                         |
| Mouse LMB        | show terrain info                 |
| Mouse RMB + drag | move camera                       |
| Mouse wheel      | zoom                              |


text:
package me.beresnev.datastructures;

import java.util.Objects;

/**
 * @author Ignat Beresnev
 * @version 1.0
 * @since 03.03.17.
 */
public class OpenAddressing<K, V> {

    private static final float DEFAULT_LOAD_FACTOR = 0.75f;
    private static final int DEFAULT_CAPACITY = 16;
    private static final int DEFAULT_THRESHOLD = 12;
    private int capacity;
    private int threshold;
    private int size;
    private Node[] table;

    /**
     * This is an open-addressing implementation of a hash table, where there's
     * only one element in each bucket.
     *

     * ----------------------------- DISCLAIMER! ---------------------------
     * This class is written strictly to demonstrate what open addressing is!
     * By no means this it the finished code in it's best state. I've purposely
     * designed it so that the used probing method can be switched at any time (hardcoded).
     * If you want to use an Open Addressing hash table, choose only 1 probing method
     * and build your data structure around that.
     * ---------------------------------------------------------------------
     *

     * ALSO! Probing methods can be more or less efficient at particular load factors.
     * The default here is 0.75, which is somewhat in the middle, but I suggest you
     * do research and find appropriate load factor for chosen probing method.
     *
     * @see HashMap for hashing with chaining
     */
    public OpenAddressing() {
        capacity = DEFAULT_CAPACITY;
        threshold = DEFAULT_THRESHOLD;
        table = new Node[capacity];
    }

    /**
     * I'm actually not entirely sure if it's a good way to
     * calculate the second hash. I've written this based on examples and
     * theory I've seen online. 13 is a prime that is < than the table size.
     */
    private static int doubleHash(int h) {
        return 13 - h % 13;
    }

    /**
     * Very simplistic and NOT badhash-proof index calculation.
     *
     * @see HashMap#indexFor(int, int) for something more advanced
     */
    private static int indexFor(int hash, int length) {
        return Math.abs(hash % length);
    }

    /**
     * We help GC by removing references to obejects, and also change
     * the "deleted" node's state to available. The bucket from the node
     * is actually NOT null, but if someone wants to insert something it
     * (it sees the AVAILABLE state), then let it be. We won't lose anything.
     */
    private static void cleanNode(Node node) {
        node.key = null;
        node.value = null;
        node.hash = 0;
        node.state = State.AVAILABLE;
    }

    /**
     * Using the default probing method, finds and puts a node in the table.
     */
    public void put(K key, V value) {
        int hash = key.hashCode();
        int trueIndex = defaultProbing(table, false, key);
        if (trueIndex != -1) {
            table[trueIndex] = new Node<>(hash, key, value);
            if (size++ >= threshold)
                resize(2 * capacity);
        }
    }

    /**
     * @return value for given key if the key is present, null otherwise
     */
    @SuppressWarnings("unchecked")
    public V get(K key) {
        int index = defaultProbing(table, true, key);
        return (index != -1) ? (V) table[index].value : null;
    }

    /**
     * removes the node with the given key.
     */
    public void remove(K key) {
        int index = defaultProbing(table, true, key);
        if (index != -1) {
            cleanNode(table[index]);
            size--;
        }
    }

    /**
     * Method that allows you to quickly switch between different probing methods.
     *
     * @param table  table within which to probe
     * @param lookup if false, then we need an index with null / available
     *               state. If true, then we only need the index of the key
     * @param key    key either to insert / override, or to just find (if lookup true)
     * @return index depending on the lookup. If true, then of the key
     * if false, then the index of the available/empty bucket
     */
    private int defaultProbing(Node[] table, boolean lookup, K key) {
        //return linearProbing(table, lookup, key);
        //return quadraticProbing(table, lookup, key);
        return doubleProbing(table, lookup, key);
    }

    /**
     * Difference: indexFor(hash + trial, capacity), where trial - 0...n
     * If a collision occurs, linear probing basically goes directly to the
     * next bucket (current+1) and looks there. If it's occupied, go to the
     * next one. Repeat until an empty/required bucket is found.
     *

     * Problem: clusters. If there's 1 collision, then there will most likely be
     * a cluster of objects near it. Quite inefficient, especially in high-load
     * tables. Estimated amount of clusters is somewhere around O(logN)
     */
    private int linearProbing(Node[] table, boolean lookup, K key) {
        int capacity = table.length;
        int hash = key.hashCode();
        for (int trial = 0; trial < capacity; trial++) {
            int index = indexFor(hash + trial, capacity);

            Node current = table[index];
            if (!lookup && (current == null || current.state == State.AVAILABLE)) {
                return index;
            } else {
                if (current == null)
                    return -1;
                else if (hash == current.hash && (key == current.key || key.equals(current.key)))
                    return index;
            }
        }
        return -1;
    }

    /**
     * Difference: indexFor(hash + (trial * trial), where trial - 0...n
     * Jumps in indexes increase linearly, so it makes a bigger leap, allowing
     * you to avoid clusters. However, depending on your needs linear might end up
     * being the same or an even better choice.
     */
    private int quadraticProbing(Node[] table, boolean lookup, K key) {
        int capacity = table.length;
        int hash = key.hashCode();
        for (int trial = 0; trial < capacity; trial++) {
            int index = indexFor(hash + (trial * trial), capacity);

            Node current = table[index];
            if (!lookup && (current == null || current.state == State.AVAILABLE)) {
                return index;
            } else {
                if (current == null)
                    return -1;
                else if (hash == current.hash && (key == current.key || key.equals(current.key)))
                    return index;
            }
        }
        return -1;
    }

    /**
     * Difference: indexFor(hash + trial * doubleHash(hash)
     * Is thought to be better than other probing methods.
     *
     * @see #doubleHash(int) for second hash function
     */
    private int doubleProbing(Node[] table, boolean lookup, K key) {
        int capacity = table.length;
        int hash = key.hashCode();
        for (int trial = 0; trial < capacity; trial++) {
            int index = indexFor(hash + trial * doubleHash(hash), capacity);

            Node current = table[index];
            if (!lookup && (current == null || current.state == State.AVAILABLE)) {
                return index;
            } else {
                if (current == null)
                    return -1;
                else if (hash == current.hash && (key == current.key || key.equals(current.key)))
                    return index;
            }
        }
        return -1;
    }

    /**
     * @see HashMap#resize(int) for more details. This method is
     * actually the same.
     */
    private void resize(int newCapacity) {
        Node[] newTable = new Node[newCapacity];
        transferTo(newTable);
        table = newTable;
        capacity = newCapacity;
        threshold = (int) (newCapacity * DEFAULT_LOAD_FACTOR);
    }

    /**
     * Same as transferTo in HashMap class, the only difference is that
     * since we don't have chaining, we don't need to walk buckets. So
     * we just do a linear walk through the old table and re-index
     * elements and put them in the new table.
     *
     * @see HashMap#transferTo(HashMap.Node[]) for more details
     */
    @SuppressWarnings("unchecked")
    private void transferTo(Node[] newTable) {
        Node[] oldTable = table;
        for (int i = 0; i < oldTable.length; i++) {
            Node<K, V> current = oldTable[i];
            if (current != null) {
                oldTable[i] = null; // letting GC do its work
                int trueIndex = defaultProbing(newTable, false, current.key);
                if (trueIndex != -1) {
                    newTable[trueIndex] = current;
                }
            }
        }
    }

    /**
     * @return number of elements in the table
     */
    public int size() {
        return size;
    }

    private enum State {
        AVAILABLE, OCCUPIED
    }

    private static class Node<K, V> {
        private int hash;
        private K key;
        private V value;
        private State state;

        Node(int hash, K key, V value) {
            this.hash = hash;
            this.key = key;
            this.value = value;
            state = State.OCCUPIED;
        }

        public boolean equals(Object o) {
            if (o == this)
                return true;
            if (o instanceof Node) {
                Node e = ((Node) o);
                if (Objects.equals(key, e.key) && Objects.equals(value, e.value))
                    return true;
            }
            return false;
        }

        // overridden just because I've implemented equals
        // Standard Java SE HashMap.Entry hashCode() implementation
        public int hashCode() {
            return Objects.hashCode(key) ^ Objects.hashCode(value);
        }
    }
}


text:
from heapq import heappush, heappop, heapify
import numpy as np
from PIL import Image, ImageDraw, ImageMath
from random import seed, gauss, randrange, random
from sys import maxsize

seed(2)

reference = 'sonic.png'
im = Image.open(reference, 'r')
size = im.size

class Gene:
    """
    Each organism has multiple genes. Genes are what are mutated and modified.
    This gene contains a radius r, a rotation t and a color c
    """
    def __init__(self, *args, **kwargs):
        self.params = dict()
        for k, v in self.mutables.items():
            try:
                left, right = self.bounds[k]
            except KeyError:
                left, right = None, None
            if v == float:  # initialize to random, [0, 1]
                val = random() if not left else randrange(left, right)
                self.__setattr__(k, v(val))
            elif v == int:
                start, end = (0, 100) if not left else (left, right)
                self.__setattr__(k, v(randrange(start, end)))
            elif v == Position:
                xbnd, ybnd = size if not left else (left, right)
                val = v(randrange(0, xbnd), randrange(0, ybnd))
                self.__setattr__(k, val)
            else:
                self.__setattr__(k, v())

    def __str__(self):
        return str(self.params)

    def __repr__(self):
        return str(self)

class Color:
    """
    A color consists of four floating point values, one for each of RGBA
    """
    def __init__(self, r=0, g=0, b=0, a=1.0):
        self.rgba = (r, g, b, a)

        if r == g == b == 0 and a == 1.0:
            self.randomize()

    def randomize(self):
        self.rgba = (randrange(0, 255),
                     randrange(0, 255),
                     randrange(0, 255),
                     randrange(0, 255))

    def __str__(self):
        return "({}, {}, {}, {})".format(*self.rgba)

    def __repr__(self):
        return str(self)

class Position:
    def __init__(self, xpos=0.0, ypos=0.0):
        self.position = (xpos, ypos)

        if xpos == 0.0 and ypos == 0.0:
            self.randomize()

    def randomize(self):
        self.position = (random(), random())

    def __str__(self):
        return "({}, {})".format(*self.position)

    def __repr__(self):
        return str(self)

class TriangleGene(Gene):
    mutables = {'radius': float,
                'color': Color,
                'position': Position}

    bounds = {'position': size, 'radius': (30, 70)}

    @property
    def verts(self):
        x, y = self.position.position
        rad = self.radius
        return [(x - rad // 2, y), (x, y + rad), (x + rad // 2, y)]

    def __init__(self):
        super().__init__()

class Organism:
    initial_population_size = 200
    max_population = 600
    number_of_genes = 100
    mutation_rate = 0.01
    crossover_rate = 0.7
    kill_rate = 0.3
    gene_split_rate = 0.3

    """
    Ideas
    Fitness:
        - number of overlapping triangles
        avg area of triangle - setpoint

    Apply k-means clustering over two organisms to
    find similar high density fitness areas
    fitness chunks done in groups
    variable length genes

    """

    mutables = {'chromosome_length': float,
                'mutation_rate': float,
                'crossover_rate': float,
                'kill_rate': float}

    def __init__(self):
        self.genes = list(TriangleGene() for _ in range(self.number_of_genes))
        self.fitness = 0

    @staticmethod
    def fitness_of(arr):
        sub = np.subtract(im, arr)
        try:
            return 1/np.mean(sub)
        except ZeroDivisionError:
            return maxsize

    def crossover(self, other):
        pass

organisms = list(Organism() for _ in range(Organism.initial_population_size))

def draw_org(organism):
    img = Image.new("RGBA", size)
    draw = ImageDraw.Draw(img)
    for gene in organism.genes:
        draw.polygon(gene.verts, gene.color.rgba)

    return img

def draw_organisms(population, fn):
    total_fitness = 0
    for o in population:
        img = draw_org(o)
        fitness = o.fitness_of(img)
        total_fitness += fitness
        fn(id(o), fitness)

    print(total_fitness, total_fitness / len(population))

draw_organisms(organisms, print)


text:
/* Generated By:JavaCC: Do not edit this line. JavaCharStream.java Version 4.1 */
/* JavaCCOptions:STATIC=false */
package net.sourceforge.pmd.ast;

/**
 * An implementation of interface CharStream, where the stream is assumed to
 * contain only ASCII characters (with java-like unicode escape processing).
 */

public class JavaCharStream implements CharStream
{
/** Whether parser is static. */
  public static final boolean staticFlag = false;
  static final int hexval(char c) throws java.io.IOException {
    switch(c)
    {
       case '0' :
          return 0;
       case '1' :
          return 1;
       case '2' :
          return 2;
       case '3' :
          return 3;
       case '4' :
          return 4;
       case '5' :
          return 5;
       case '6' :
          return 6;
       case '7' :
          return 7;
       case '8' :
          return 8;
       case '9' :
          return 9;

       case 'a' :
       case 'A' :
          return 10;
       case 'b' :
       case 'B' :
          return 11;
       case 'c' :
       case 'C' :
          return 12;
       case 'd' :
       case 'D' :
          return 13;
       case 'e' :
       case 'E' :
          return 14;
       case 'f' :
       case 'F' :
          return 15;
    }

    throw new java.io.IOException(); // Should never come here
  }

/** Position in buffer. */
  public int bufpos = -1;
  int bufsize;
  int available;
  int tokenBegin;
  protected int bufline[];
  protected int bufcolumn[];

  protected int column = 0;
  protected int line = 1;

  protected boolean prevCharIsCR = false;
  protected boolean prevCharIsLF = false;

  protected java.io.Reader inputStream;

  protected char[] nextCharBuf;
  protected char[] buffer;
  protected int maxNextCharInd = 0;
  protected int nextCharInd = -1;
  protected int inBuf = 0;
  protected int tabSize = 8;

  protected void setTabSize(int i) { tabSize = i; }
  protected int getTabSize(int i) { return tabSize; }

  protected void ExpandBuff(boolean wrapAround)
  {
     char[] newbuffer = new char[bufsize + 2048];
     int newbufline[] = new int[bufsize + 2048];
     int newbufcolumn[] = new int[bufsize + 2048];

     try
     {
        if (wrapAround)
        {
           System.arraycopy(buffer, tokenBegin, newbuffer, 0, bufsize - tokenBegin);
           System.arraycopy(buffer, 0, newbuffer,
                                             bufsize - tokenBegin, bufpos);
           buffer = newbuffer;

           System.arraycopy(bufline, tokenBegin, newbufline, 0, bufsize - tokenBegin);
           System.arraycopy(bufline, 0, newbufline, bufsize - tokenBegin, bufpos);
           bufline = newbufline;

           System.arraycopy(bufcolumn, tokenBegin, newbufcolumn, 0, bufsize - tokenBegin);
           System.arraycopy(bufcolumn, 0, newbufcolumn, bufsize - tokenBegin, bufpos);
           bufcolumn = newbufcolumn;

           bufpos += (bufsize - tokenBegin);
        }
        else
        {
           System.arraycopy(buffer, tokenBegin, newbuffer, 0, bufsize - tokenBegin);
           buffer = newbuffer;

           System.arraycopy(bufline, tokenBegin, newbufline, 0, bufsize - tokenBegin);
           bufline = newbufline;

           System.arraycopy(bufcolumn, tokenBegin, newbufcolumn, 0, bufsize - tokenBegin);
           bufcolumn = newbufcolumn;

           bufpos -= tokenBegin;
        }
     }
     catch (Throwable t)
     {
        throw new RuntimeException(t.getMessage());
     }

     available = (bufsize += 2048);
     tokenBegin = 0;
  }

  protected void FillBuff() throws java.io.IOException
  {
     int i;
     if (maxNextCharInd == 4096)
        maxNextCharInd = nextCharInd = 0;

     try {
        if ((i = inputStream.read(nextCharBuf, maxNextCharInd,
                                            4096 - maxNextCharInd)) == -1)
        {
           inputStream.close();
           throw new java.io.IOException();
        }
        else
           maxNextCharInd += i;
        return;
     }
     catch(java.io.IOException e) {
        if (bufpos != 0)
        {
           --bufpos;
           backup(0);
        }
        else
        {
           bufline[bufpos] = line;
           bufcolumn[bufpos] = column;
        }
        throw e;
     }
  }

  protected char ReadByte() throws java.io.IOException
  {
     if (++nextCharInd >= maxNextCharInd)
        FillBuff();

     return nextCharBuf[nextCharInd];
  }

/** @return starting character for token. */
  public char BeginToken() throws java.io.IOException
  {
     if (inBuf > 0)
     {
        --inBuf;

        if (++bufpos == bufsize)
           bufpos = 0;

        tokenBegin = bufpos;
        return buffer[bufpos];
     }

     tokenBegin = 0;
     bufpos = -1;

     return readChar();
  }

  protected void AdjustBuffSize()
  {
     if (available == bufsize)
     {
        if (tokenBegin > 2048)
        {
           bufpos = 0;
           available = tokenBegin;
        }
        else
           ExpandBuff(false);
     }
     else if (available > tokenBegin)
        available = bufsize;
     else if ((tokenBegin - available) < 2048)
        ExpandBuff(true);
     else
        available = tokenBegin;
  }

  protected void UpdateLineColumn(char c)
  {
     column++;

     if (prevCharIsLF)
     {
        prevCharIsLF = false;
        line += (column = 1);
     }
     else if (prevCharIsCR)
     {
        prevCharIsCR = false;
        if (c == '\n')
        {
           prevCharIsLF = true;
        }
        else
           line += (column = 1);
     }

     switch (c)
     {
        case '\r' :
           prevCharIsCR = true;
           break;
        case '\n' :
           prevCharIsLF = true;
           break;
        case '\t' :
           column--;
           column += (tabSize - (column % tabSize));
           break;
        default :
           break;
     }

     bufline[bufpos] = line;
     bufcolumn[bufpos] = column;
  }

/** Read a character. */
  public char readChar() throws java.io.IOException
  {
     if (inBuf > 0)
     {
        --inBuf;

        if (++bufpos == bufsize)
           bufpos = 0;

        return buffer[bufpos];
     }

     char c;

     if (++bufpos == available)
        AdjustBuffSize();

     if ((buffer[bufpos] = c = ReadByte()) == '\\')
     {
        UpdateLineColumn(c);

        int backSlashCnt = 1;

        for (;;) // Read all the backslashes
        {
           if (++bufpos == available)
              AdjustBuffSize();

           try
           {
              if ((buffer[bufpos] = c = ReadByte()) != '\\')
              {
                 UpdateLineColumn(c);
                 // found a non-backslash char.
                 if ((c == 'u') && ((backSlashCnt & 1) == 1))
                 {
                    if (--bufpos < 0)
                       bufpos = bufsize - 1;

                    break;
                 }

                 backup(backSlashCnt);
                 return '\\';
              }
           }
           catch(java.io.IOException e)
           {
              if (backSlashCnt > 1)
                 backup(backSlashCnt-1);

              return '\\';
           }

           UpdateLineColumn(c);
           backSlashCnt++;
        }

        // Here, we have seen an odd number of backslash's followed by a 'u'
        try
        {
           while ((c = ReadByte()) == 'u')
              ++column;

           buffer[bufpos] = c = (char)(hexval(c) << 12 |
                                       hexval(ReadByte()) << 8 |
                                       hexval(ReadByte()) << 4 |
                                       hexval(ReadByte()));

           column += 4;
        }
        catch(java.io.IOException e)
        {
           throw new RuntimeException("Invalid escape character at line " + line +
                                         " column " + column + ".");
        }

        if (backSlashCnt == 1)
           return c;
        else
        {
           backup(backSlashCnt - 1);
           return '\\';
        }
     }
     else
     {
        UpdateLineColumn(c);
        return c;
     }
  }

  @Deprecated
  /**
   * @deprecated
   * @see #getEndColumn
   */
  public int getColumn() {
     return bufcolumn[bufpos];
  }

  @Deprecated
  /**
   * @deprecated
   * @see #getEndLine
   */
  public int getLine() {
     return bufline[bufpos];
  }

/** Get end column. */
  public int getEndColumn() {
     return bufcolumn[bufpos];
  }

/** Get end line. */
  public int getEndLine() {
     return bufline[bufpos];
  }

/** @return column of token start */
  public int getBeginColumn() {
     return bufcolumn[tokenBegin];
  }

/** @return line number of token start */
  public int getBeginLine() {
     return bufline[tokenBegin];
  }

/** Retreat. */
  public void backup(int amount) {

    inBuf += amount;
    if ((bufpos -= amount) < 0)
       bufpos += bufsize;
  }

/** Constructor. */
  public JavaCharStream(java.io.Reader dstream,
                 int startline, int startcolumn, int buffersize)
  {
    inputStream = dstream;
    line = startline;
    column = startcolumn - 1;

    available = bufsize = buffersize;
    buffer = new char[buffersize];
    bufline = new int[buffersize];
    bufcolumn = new int[buffersize];
    nextCharBuf = new char[4096];
  }

/** Constructor. */
  public JavaCharStream(java.io.Reader dstream,
                                        int startline, int startcolumn)
  {
     this(dstream, startline, startcolumn, 4096);
  }

/** Constructor. */
  public JavaCharStream(java.io.Reader dstream)
  {
     this(dstream, 1, 1, 4096);
  }
/** Reinitialise. */
  public void ReInit(java.io.Reader dstream,
                 int startline, int startcolumn, int buffersize)
  {
    inputStream = dstream;
    line = startline;
    column = startcolumn - 1;

    if (buffer == null || buffersize != buffer.length)
    {
      available = bufsize = buffersize;
      buffer = new char[buffersize];
      bufline = new int[buffersize];
      bufcolumn = new int[buffersize];
      nextCharBuf = new char[4096];
    }
    prevCharIsLF = prevCharIsCR = false;
    tokenBegin = inBuf = maxNextCharInd = 0;
    nextCharInd = bufpos = -1;
  }

/** Reinitialise. */
  public void ReInit(java.io.Reader dstream,
                                        int startline, int startcolumn)
  {
     ReInit(dstream, startline, startcolumn, 4096);
  }

/** Reinitialise. */
  public void ReInit(java.io.Reader dstream)
  {
     ReInit(dstream, 1, 1, 4096);
  }
/** Constructor. */
  public JavaCharStream(java.io.InputStream dstream, String encoding, int startline,
  int startcolumn, int buffersize) throws java.io.UnsupportedEncodingException
  {
     this(encoding == null ? new java.io.InputStreamReader(dstream) : new java.io.InputStreamReader(dstream, encoding), startline, startcolumn, buffersize);
  }

/** Constructor. */
  public JavaCharStream(java.io.InputStream dstream, int startline,
  int startcolumn, int buffersize)
  {
     this(new java.io.InputStreamReader(dstream), startline, startcolumn, 4096);
  }

/** Constructor. */
  public JavaCharStream(java.io.InputStream dstream, String encoding, int startline,
                        int startcolumn) throws java.io.UnsupportedEncodingException
  {
     this(dstream, encoding, startline, startcolumn, 4096);
  }

/** Constructor. */
  public JavaCharStream(java.io.InputStream dstream, int startline,
                        int startcolumn)
  {
     this(dstream, startline, startcolumn, 4096);
  }

/** Constructor. */
  public JavaCharStream(java.io.InputStream dstream, String encoding) throws java.io.UnsupportedEncodingException
  {
     this(dstream, encoding, 1, 1, 4096);
  }

/** Constructor. */
  public JavaCharStream(java.io.InputStream dstream)
  {
     this(dstream, 1, 1, 4096);
  }

/** Reinitialise. */
  public void ReInit(java.io.InputStream dstream, String encoding, int startline,
  int startcolumn, int buffersize) throws java.io.UnsupportedEncodingException
  {
     ReInit(encoding == null ? new java.io.InputStreamReader(dstream) : new java.io.InputStreamReader(dstream, encoding), startline, startcolumn, buffersize);
  }

/** Reinitialise. */
  public void ReInit(java.io.InputStream dstream, int startline,
  int startcolumn, int buffersize)
  {
     ReInit(new java.io.InputStreamReader(dstream), startline, startcolumn, buffersize);
  }
/** Reinitialise. */
  public void ReInit(java.io.InputStream dstream, String encoding, int startline,
                     int startcolumn) throws java.io.UnsupportedEncodingException
  {
     ReInit(dstream, encoding, startline, startcolumn, 4096);
  }
/** Reinitialise. */
  public void ReInit(java.io.InputStream dstream, int startline,
                     int startcolumn)
  {
     ReInit(dstream, startline, startcolumn, 4096);
  }
/** Reinitialise. */
  public void ReInit(java.io.InputStream dstream, String encoding) throws java.io.UnsupportedEncodingException
  {
     ReInit(dstream, encoding, 1, 1, 4096);
  }

/** Reinitialise. */
  public void ReInit(java.io.InputStream dstream)
  {
     ReInit(dstream, 1, 1, 4096);
  }

  /** @return token image as String */
  public String GetImage()
  {
     if (bufpos >= tokenBegin)
        return new String(buffer, tokenBegin, bufpos - tokenBegin + 1);
     else
        return new String(buffer, tokenBegin, bufsize - tokenBegin) +
                              new String(buffer, 0, bufpos + 1);
  }

  /** @return suffix */
  public char[] GetSuffix(int len)
  {
     char[] ret = new char[len];

     if ((bufpos + 1) >= len)
        System.arraycopy(buffer, bufpos - len + 1, ret, 0, len);
     else
     {
        System.arraycopy(buffer, bufsize - (len - bufpos - 1), ret, 0,
                                                          len - bufpos - 1);
        System.arraycopy(buffer, 0, ret, len - bufpos - 1, bufpos + 1);
     }

     return ret;
  }

  /** Set buffers back to null when finished. */
  public void Done()
  {
     nextCharBuf = null;
     buffer = null;
     bufline = null;
     bufcolumn = null;
  }

  /**
   * Method to adjust line and column numbers for the start of a token.
   */
  public void adjustBeginLineColumn(int newLine, int newCol)
  {
     int start = tokenBegin;
     int len;

     if (bufpos >= tokenBegin)
     {
        len = bufpos - tokenBegin + inBuf + 1;
     }
     else
     {
        len = bufsize - tokenBegin + bufpos + 1 + inBuf;
     }

     int i = 0, j = 0, k = 0;
     int nextColDiff = 0, columnDiff = 0;

     while (i < len &&
            bufline[j = start % bufsize] == bufline[k = ++start % bufsize])
     {
        bufline[j] = newLine;
        nextColDiff = columnDiff + bufcolumn[k] - bufcolumn[j];
        bufcolumn[j] = newCol + columnDiff;
        columnDiff = nextColDiff;
        i++;
     }

     if (i < len)
     {
        bufline[j] = newLine++;
        bufcolumn[j] = newCol + columnDiff;

        while (i++ < len)
        {
           if (bufline[j = start % bufsize] != bufline[++start % bufsize])
              bufline[j] = newLine++;
           else
              bufline[j] = newLine;
        }
     }

     line = bufline[j];
     column = bufcolumn[j];
  }

}
/* JavaCC - OriginalChecksum=f18b7eb3e3e62d2724487ac20028cf2f (do not edit this line) */


text:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="horizontal" >

    <LinearLayout
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_gravity="center"
        android:orientation="vertical"
        android:layout_marginLeft="10dp" >

        <TextView
            android:id="@+id/list_event_start_time"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="start" />

        <TextView
            android:id="@+id/list_event_end_time"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="end" />
    </LinearLayout>

    <TextView
        android:id="@+id/list_event_title"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_gravity="center"
        android:text="title"
        android:layout_marginLeft="50dp" />

</LinearLayout>


text: Game Designer for AudioAdventurer


text:
<?php
class Controller_Index_Index extends ypController {
	public function Index() {
		$this->redirect('Index/Home', TRUE);
	}

}

?>


text:
module.exports = {
  ngProvider: 'directive',
  ngModule: 'directives',
  ngName: 'todolistTodos',
  dependencies: [
    'todolist.util.template'
  ],
  fn: (templateFactory) => {
    return {
      restrict: 'E',
      controller: 'todolist.todos.controller',
      templateUrl: templateFactory.url('todos'),
      replace: true,
      scope: {
      },
      link: () => {}
    };
  }
};


text:
namespace sync_notifier {

namespace {

using ::testing::InSequence;
using ::testing::StrictMock;

class NonBlockingInvalidationNotifierTest : public testing::Test {
 public:
  NonBlockingInvalidationNotifierTest() {}

 protected:
  virtual void SetUp() {
    request_context_getter_ = new TestURLRequestContextGetter;
    notifier::NotifierOptions notifier_options;
    notifier_options.request_context_getter = request_context_getter_;
    invalidation_notifier_.reset(
        new NonBlockingInvalidationNotifier(notifier_options,
                                            "fake_client_info"));
    invalidation_notifier_->AddObserver(&mock_observer_);
  }

  virtual void TearDown() {
    invalidation_notifier_->RemoveObserver(&mock_observer_);
    invalidation_notifier_.reset();
    {
      // The request context getter gets deleted on the I/O thread. To prevent a
      // leak supply one here.
      BrowserThread io_thread(BrowserThread::IO, MessageLoop::current());
      request_context_getter_ = NULL;
    }
    MessageLoop::current()->RunAllPending();
  }

  MessageLoop message_loop_;
  scoped_refptr<net::URLRequestContextGetter> request_context_getter_;
  scoped_ptr<NonBlockingInvalidationNotifier> invalidation_notifier_;
  StrictMock<MockSyncNotifierObserver> mock_observer_;
  notifier::FakeBaseTask fake_base_task_;
};

TEST_F(NonBlockingInvalidationNotifierTest, Basic) {
  syncable::ModelTypeSet types;
  types.insert(syncable::BOOKMARKS);
  types.insert(syncable::AUTOFILL);

  invalidation_notifier_->SetState("fake_state");
  invalidation_notifier_->UpdateCredentials("foo@bar.com", "fake_token");
  invalidation_notifier_->UpdateEnabledTypes(types);
}

// TODO(akalin): Add synchronous operations for testing to
// NonBlockingInvalidationNotifierTest and use that to test it.

}  // namespace

}  // namespace sync_notifier


text:
 Returns a workflow definition for a site

**Namespace:** [Microsoft.SharePoint.Client](Microsoft.SharePoint.Client.md)
**Assembly:** OfficeDevPnP.Core.dll
## Syntax
```C#
public static WorkflowDefinition GetWorkflowDefinition(this Web web, String displayName, Boolean publishedOnly = True)
```
### Parameters
#### web
  Type: Microsoft.SharePoint.Client.Web
  the target web

#### displayName
  Type: System.String
  the workflow definition display name, which is displayed to users

#### (optional) publishedOnly
  Type: System.Boolean
  Defines whether to include only published definition, or all the definitions

### Return Value
Type: WorkflowDefinition
Returns a WorkflowDefinition object

## See also
- [WorkflowExtensions](Microsoft.SharePoint.Client.WorkflowExtensions.md)
- [Microsoft.SharePoint.Client](Microsoft.SharePoint.Client.md)


text:
import {MatSelectModule} from '@angular/material/select';
import {MatSelectHarness} from './select-harness';
import {runHarnessTests} from './shared.spec';

describe('Non-MDC-based MatSelectHarness', () => {
  runHarnessTests(MatSelectModule, MatSelectHarness);
});


text:
using System.Collections.Generic;
using System.ComponentModel;

namespace Thinktecture.Collections.Generic
{
   /// <summary>
   /// An abstraction for collections.
   /// </summary>
   /// <typeparam name="TImplementationItem">Type of the item of the implementation.</typeparam>
   /// <typeparam name="TImplementation">Type of the implementation.</typeparam>
   public interface INotNullCollectionAbstraction<TImplementationItem, out TImplementation> : INotNullCollectionAbstraction<TImplementationItem, TImplementationItem, TImplementation>
      where TImplementation : ICollection<TImplementationItem>
   {
   }

   /// <summary>
   /// An abstraction for collections.
   /// </summary>
   /// <typeparam name="TAbstractionItem">Type of the abstraction.</typeparam>
   /// <typeparam name="TImplementationItem">Type of the item of the implementation.</typeparam>
   /// <typeparam name="TImplementation">Type of the implementation.</typeparam>
   public interface INotNullCollectionAbstraction<TAbstractionItem, in TImplementationItem, out TImplementation> : IAbstraction<TImplementation>, ICollection<TAbstractionItem>
      where TImplementation : ICollection<TImplementationItem>
   {
      /// <summary>
      /// Gets inner instance of <typeparamref name="TImplementation"/>.
      /// It is not intended to be used directly. Use <see cref="CollectionExtensions.ToImplementation{TAbstractionItem,TImplementationItem,TImplementation}"/> instead.
      /// </summary>
      [EditorBrowsable(EditorBrowsableState.Never)]
      new TImplementation UnsafeConvert();

      /// <summary>
      /// Adds item to collection.
      /// </summary>
      /// <param name="item">Item to add.</param>
      void Add(TImplementationItem item);

      /// <summary>
      /// Gets an indicator whether the item is in collection or not.
      /// </summary>
      /// <param name="item">Item to check for.</param>
      /// <returns><c>true</c> if the item is in collection; <c>false</c> otherwise.</returns>
      bool Contains(TImplementationItem item);

      /// <summary>
      /// Copies the collection to provided array.
      /// </summary>
      /// <param name="array">Array to copy into.</param>
      /// <param name="arrayIndex">Index to start to insert from.</param>
      void CopyTo(TImplementationItem[] array, int arrayIndex);

      /// <summary>
      /// Removes the item from collection.
      /// </summary>
      /// <param name="item">Item to remove.</param>
      /// <returns><c>true</c> if the item has been removed; <c>false</c> otherwise.</returns>
      bool Remove(TImplementationItem item);
   }
}


text:
require 'nokogiri'
require 'open-uri'

BASE_URL = "http://www.useragentstring.com/pages/Browserlist/"
UA_FILE = "../lib/user_agents.txt"

begin
  doc = Nokogiri::HTML(open(BASE_URL))
rescue Exception => e
  puts e
end

File.open(UA_FILE, 'w') do |f|
  doc.xpath('//li/a').each do |item|
    f.write("#{item.content}\n")
  end
end


text:
<?php

namespace Google\Cloud\Vision\Tests\Unit\Annotation;

use Google\Cloud\Core\Testing\TestHelpers;
use Google\Cloud\Vision\Annotation\FeatureInterface;
use Google\Cloud\Vision\Annotation\LikelihoodTrait;
use PHPUnit\Framework\TestCase;

/**
 * @group vision
 */
class LikelihoodTraitTest extends TestCase
{
    private $stub;

    public function setUp()
    {
        $this->stub = TestHelpers::impl(LikelihoodTrait::class);
    }

    /**
     * @dataProvider likelihood
     */
    public function testLikelihoods($expected, $value, $strength)
    {
        $this->assertEquals($expected, $this->stub->call('likelihood', [
            $value,
            $strength
        ]));
    }

    public function likelihood()
    {
        return [
            [true, 'VERY_LIKELY', FeatureInterface::STRENGTH_HIGH],
            [false, 'LIKELY', FeatureInterface::STRENGTH_HIGH],
            [false, 'POSSIBLE', FeatureInterface::STRENGTH_HIGH],
            [true, 'VERY_LIKELY', FeatureInterface::STRENGTH_MEDIUM],
            [true, 'LIKELY', FeatureInterface::STRENGTH_MEDIUM],
            [false, 'POSSIBLE', FeatureInterface::STRENGTH_MEDIUM],
            [true, 'VERY_LIKELY', FeatureInterface::STRENGTH_LOW],
            [true, 'LIKELY', FeatureInterface::STRENGTH_LOW],
            [true, 'POSSIBLE', FeatureInterface::STRENGTH_LOW],
        ];
    }

    /**
     * @expectedException InvalidArgumentException
     */
    public function testErr()
    {
        $this->stub->call('likelihood', ['foo', 'bar']);
    }
}


text:
<?php

namespace Gema\AdminBundle\Controller;

use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template;

/**
 * @Route("/barra")¡
 */

class BarraController extends Controller
{
    /**
     * @Route("/navbar")
     * @Template()
     */
    public function navbarAction()
    {
        return array();
    }

    /**
     * @Route("/subnavbar")
     * @Template()
     */
    public function subnavbarAction()
    {
        return array();
    }
    /**
     * @Route("/extra")
     * @Template()
     */
    public function extraAction()
    {
        return array();
    }
    /**
     * @Route("/footer")
     * @Template()
     */
    public function footerAction()
    {
        return array();
    }

}


text:
<?php

class BackstageAppController extends AppController
{
	var $components = array('Typographer.TypeLayoutSchemePicker', 'Tradutore.TradLanguageSelector');
	var $helpers = array(
		'Typographer.TypeDecorator' => array(
			'name' => 'Decorator',
			'compact' => false,
			'receive_tools' => true
		),
		'Typographer.*TypeStyleFactory' => array(
			'name' => 'StyleFactory',
			'receive_automatic_classes' => true,
			'receive_tools' => true,
			'generate_automatic_classes' => false //significa que eu que vou produzir as classes automaticas
		),
		'Typographer.*TypeBricklayer' => array(
			'name' => 'Bl',
			'receive_tools' => true,
		),
		'Burocrata.*BuroBurocrata' => array(
			'name' => 'Buro'
		),
		'Popup.Popup'
	);
	var $layout = 'backstage';

/**
 * Overwrtiging the startupProcess method so we can set (forced)
 * the language before the pageSections load.
 *
 * @access public
 */
	function startupProcess()
	{
		$this->TradLanguageSelector->setInterfaceLanguage(Configure::read('Tradutore.mainLanguage'));
		parent::startupProcess();
	}

	function beforeRender()
	{
		parent::beforeRender();
		$this->TypeLayoutSchemePicker->pick('backstage'); //atenção que isto sobre-escreve a view escolhida
	}

	function beforeFilter()
	{
		parent::beforeFilter();
		StatusBehavior::setGlobalActiveStatuses(array('publishing_status' => array('active' => array('published','draft'), 'overwrite' => false)));
	}

}

?>


text:
{% extends "account/base_auth_2cols.html" %}
{% load i18n %}
{% load bootstrapcss %}

{% block head_title %}{% trans "Account" %}{% endblock %}

{% block left_side %}

{% trans "E-mail Addresses" %}

    {% if user.emailaddress_set.all %}

{% trans 'The following e-mail addresses are associated with your account:' %}

    <form action="{% url 'account_email' %}" method="post">
      {% csrf_token %}
      {% for emailaddress in user.emailaddress_set.all %}

          <input id="email_radio_{{forloop.counter}}" type="radio" name="email" {% if emailaddress.primary or user.emailaddress_set.count == 1 %}checked="checked"{%endif %} value="{{emailaddress.email}}"/>
          {{ emailaddress.email }}
          {% if emailaddress.verified %}
          {% trans "Verified" %}
          {% else %}
          {% trans "Unverified" %}
          {% endif %}
          {% if emailaddress.primary %}{% trans "Primary" %}{% endif %}

      {% endfor %}

        <button class="btn btn-primary" type="submit" name="action_primary" >{% trans 'Make Primary' %}</button>
        <button class="btn btn-info" type="submit" name="action_send" >{% trans 'Re-send Verification' %}</button>
        <button class="btn btn-danger" type="button" data-toggle="modal" data-target="#removeEmail" >{% trans 'Remove' %}</button>

              <button type="button" class="close" data-dismiss="modal" aria-label="Close">×</button>

{% trans "Warning" %}

              {% trans 'Do you really want to remove the selected e-mail address?' %}"

              <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
              <button class="btn btn-primary" type="submit" name="action_remove" >{% trans 'Remove' %}</button>

    </form>
    {% else %}

{% trans 'Warning:'%} {% trans "You currently do not have any e-mail address set up. You should really add an e-mail address so you can receive notifications, reset your password, etc." %}

    {% endif %}

{% trans "Add E-mail Address" %}

    <form method="post" action="{% url 'account_email' %}">
      {% csrf_token %}

        {{ form.email | addclass:'form-control' }}
        {% if form.email.errors %}{{ form.email.errors }}{% endif %}

      <button class="btn btn-primary" name="action_add" type="submit">{% trans "Add E-mail" %}</button>
    </form>

{% endblock %}

{% block right_side %}
{% include 'widget/w_settings_menu.html' with active_email=True %}
{% endblock %}


text:
@implementation LoadingState

#pragma mark - StatefulTableViewStateProtocol

- (void)enterStateWithData:(id)data
{
     [self.tableView insertRowsAtIndexPaths:@[ [NSIndexPath indexPathForRow:0 inSection:0] ] withRowAnimation:UITableViewRowAnimationBottom];

    [self.tableView setAllowsSelection:NO];

    // Simulate making call to network
    dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(5 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
        // Oops no data returned.
//        [self.statefulTableViewController transitionToState:STATE_DEMO_EMPTY_STATE withData:nil];

        // Got data
        [self.statefulTableViewController transitionToState:STATE_DEMO_POPULATED_STATE withData:[ComicData data]];
    });
}

- (void)leaveState
{
    [self.tableView deleteRowsAtIndexPaths:@[ [NSIndexPath indexPathForRow:0 inSection:0] ] withRowAnimation:UITableViewRowAnimationTop];
    [self.tableView setAllowsSelection:YES];
}

#pragma mark - UITableViewDatasource

- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
    return 1;
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    return 1;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    UITableViewCell * cell = [tableView dequeueReusableCellWithIdentifier:@"LoadingState"];

    UILabel * label = (id)[cell viewWithTag:1];
    label.alpha = 1.0;
    label.attributedText = [[NSAttributedString alloc] initWithString:@"Loading Data" attributes:@{ NSTextEffectAttributeName:NSTextEffectLetterpressStyle }];

    UIActivityIndicatorView * activity = (id)[cell viewWithTag:2];
    [activity startAnimating];
    activity.alpha = 1.0;

    return cell;
}

- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
{
    return tableView.frame.size.height;
}

#pragma mark - UITableViewDelegate

@end


text:
<!DOCTYPE html>

    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css">
    <link rel="stylesheet" type="text/css" href="/stylesheets/style.css">

The remote systems (Jive & GitHub) require you to grant access before proceeding.

        Authorize Jive

            Jive Authorized - OK

        Authorize GitHub

            GitHub Authorized - OK

                #

                        <input type="checkbox" name="options" value="bug">Bug

                        <input type="checkbox" name="options" value="duplicate">Duplicate

                        <input type="checkbox" name="options" value="enhancement">Enhancement

                        <input type="checkbox" name="options" value="question">Question

                        <input type="checkbox" name="options" value="invalid">Invalid

                        <input type="checkbox" name="options" value="wontfix">Won't Fix

                <button id="saveLabels" class="btn btn-primary btn-sm ">Apply Labels</button>


text:
RSpec.describe Dry::Types::Nominal do
  describe "json.nil" do
    subject(:type) { Dry::Types["json.nil"] }

    it_behaves_like "a constrained type", inputs: [
      Object.new, "foo", %w[foo]
    ]

    it "rejects empty string" do
      expect(type.("") { :fallback }).to eql(:fallback)
    end
  end

  describe "json.date" do
    subject(:type) { Dry::Types["json.date"] }

    it_behaves_like "a constrained type", inputs: [
      Object.new, "not-a-date"
    ]

    it "coerces to a date" do
      expect(type["2015-11-26"]).to eql(Date.new(2015, 11, 26))
    end

    it "accepts date" do
      date = Date.new(2015, 11, 26)

      expect(type[date]).to be(date)
    end
  end

  describe "json.date_time" do
    subject(:type) { Dry::Types["json.date_time"] }

    it_behaves_like "a constrained type", inputs: [
      Object.new, "not-a-date-time"
    ]

    it "coerces to a date time" do
      expect(type["2015-11-26 12:00:00"]).to eql(DateTime.new(2015, 11, 26, 12))
    end

    it "accepts datetime" do
      datetime = DateTime.new(2015, 11, 26, 12)
      expect(type[datetime]).to be(datetime)
    end
  end

  describe "json.time" do
    subject(:type) { Dry::Types["json.time"] }

    it_behaves_like "a constrained type", inputs: [
      Object.new, "not-a-time"
    ]

    it "coerces to a time" do
      expect(type["2015-11-26 12:00:00"]).to eql(Time.new(2015, 11, 26, 12))
    end

    it "accepts time" do
      time = Time.new(2015, 11, 26, 12)
      expect(type[time]).to be(time)
    end
  end

  describe "json.decimal" do
    subject(:type) { Dry::Types["json.decimal"] }

    it_behaves_like "a constrained type", inputs: [
      Object.new, nil, "", "not-a-decimal"
    ]

    it "coerces strings to a decimal" do
      expect(type["3.12"]).to eql(BigDecimal("3.12"))
    end

    it "coerces floats to a decimal" do
      expect(type[3.12]).to eql(BigDecimal("3.12"))
    end
  end

  describe "json.array" do
    subject(:type) { Dry::Types["json.array"].of(Dry::Types["nominal.integer"]) }

    it_behaves_like "a constrained type", inputs: [
      Object.new, "not-an-array"
    ]
  end

  describe "json.hash" do
    subject(:type) { Dry::Types["json.hash"].schema(age: Dry::Types["nominal.integer"]) }

    it_behaves_like "a constrained type", inputs: [
      Object.new, "not-a-hash"
    ]
  end

  describe "json.symbol" do
    subject(:type) { Dry::Types["json.symbol"] }

    it_behaves_like "a constrained type", inputs: [
      Object.new, 1
    ]

    it "coerces to a symbol" do
      expect(type["a"]).to eql(:a)
    end
  end
end


text:
(function() {
	'use strict';

	angular
		.module('ngInterview')
		.config(config);

	config.$inject = ['$locationProvider', '$routeProvider'];
	function config($locationProvider, $routeProvider) {
		$locationProvider.hashPrefix('!');
		$routeProvider.otherwise({redirectTo: '/students'});
	}
})();


text:
package bos

import (
	"net/http"
	"strconv"
	"testing"

	"github.com/guoyao/baidubce-sdk-go/bce"
	"github.com/guoyao/baidubce-sdk-go/util"
)

func TestNewObjectMetadataFromHeader(t *testing.T) {
	header := http.Header{
		"cache-control":       []string{"no-cache", "no-store"},
		"Content-Disposition": []string{"inline"},
		"Content-Length":      []string{"1024"},
		"Content-Range":       []string{"bytes=0-1024"},
		"Content-Type":        []string{"text/plain"},
		"Expires":             []string{"Tue, 03 Jan 2017 05:30:19 GMT"},
		"Etag":                []string{"abc123"},
		"x-bce-meta-name":     []string{"hello"},
	}
	metadata := NewObjectMetadataFromHeader(header)

	if metadata.CacheControl != "no-cache" {
		t.Error(util.FormatTest("NewObjectMetadataFromHeader", metadata.CacheControl, "no-cache"))
	}

	if metadata.ContentDisposition != "inline" {
		t.Error(util.FormatTest("NewObjectMetadataFromHeader", metadata.ContentDisposition, "inline"))
	}

	if metadata.ContentLength != 1024 {
		t.Error(util.FormatTest("NewObjectMetadataFromHeader", strconv.FormatInt(metadata.ContentLength, 10), strconv.Itoa(1024)))
	}

	if metadata.ContentRange != "bytes=0-1024" {
		t.Error(util.FormatTest("NewObjectMetadataFromHeader", metadata.ContentRange, "bytes=0-1024"))
	}

	if metadata.ContentType != "text/plain" {
		t.Error(util.FormatTest("NewObjectMetadataFromHeader", metadata.ContentType, "text/plain"))
	}

	if metadata.Expires != "Tue, 03 Jan 2017 05:30:19 GMT" {
		t.Error(util.FormatTest("NewObjectMetadataFromHeader", metadata.Expires, "Tue, 03 Jan 2017 05:30:19 GMT"))
	}

	if metadata.ETag != "abc123" {
		t.Error(util.FormatTest("NewObjectMetadataFromHeader", metadata.ETag, "abc123"))
	}

	if metadata.UserMetadata["x-bce-meta-name"] != "hello" {
		t.Error(util.FormatTest("NewObjectMetadataFromHeader", metadata.UserMetadata["x-bce-meta-name"], "hello"))
	}
}

func TestAddUserMetadata(t *testing.T) {
	metadata := &ObjectMetadata{}
	metadata.AddUserMetadata("x-bce-meta-name", "hello")

	if metadata.UserMetadata["x-bce-meta-name"] != "hello" {
		t.Error(util.FormatTest("AddUserMetadata", metadata.UserMetadata["x-bce-meta-name"], "hello"))
	}
}

func TestMergeToSignOption(t *testing.T) {
	option := &bce.SignOption{}
	header := http.Header{
		"cache-control":       []string{"no-cache", "no-store"},
		"Content-Disposition": []string{"inline"},
		"Content-Length":      []string{"1024"},
		"Content-Range":       []string{"bytes=0-1024"},
		"Content-Type":        []string{"text/plain"},
		"Expires":             []string{"Tue, 03 Jan 2017 05:30:19 GMT"},
		"Etag":                []string{"abc123"},
		"x-bce-meta-name":     []string{"hello"},
	}
	metadata := NewObjectMetadataFromHeader(header)
	metadata.ContentMD5 = "md5-value"
	metadata.ContentSha256 = "sha256-value"
	metadata.AddUserMetadata("server", "nginx")
	metadata.mergeToSignOption(option)

	if option.Headers["Cache-Control"] != "no-cache" {
		t.Error(util.FormatTest("mergeToSignOption", option.Headers["Cache-Control"], "no-cache"))
	}

	if option.Headers["Content-Disposition"] != "inline" {
		t.Error(util.FormatTest("mergeToSignOption", option.Headers["Content-Disposition"], "inline"))
	}

	if option.Headers["x-bce-meta-name"] != "hello" {
		t.Error(util.FormatTest("mergeToSignOption", option.Headers["x-bce-meta-name"], "hello"))
	}

	if option.Headers["x-bce-meta-server"] != "nginx" {
		t.Error(util.FormatTest("mergeToSignOption", option.Headers["x-bce-meta-server"], "nginx"))
	}

	if option.Headers["Content-MD5"] != "md5-value" {
		t.Error(util.FormatTest("mergeToSignOption", option.Headers["Content-MD5"], "md5-value"))
	}

	if option.Headers["x-bce-content-sha256"] != "sha256-value" {
		t.Error(util.FormatTest("mergeToSignOption", option.Headers["x-bce-content-sha256"], "sha256-value"))
	}
}

func TestGetETag(t *testing.T) {
	header := http.Header{"Etag": []string{"\"12345\""}}
	response := NewPutObjectResponse(header)
	etag := response.GetETag()

	if etag != "12345" {
		t.Error(util.FormatTest("GetETag", etag, "12345"))
	}
}

func TestGetCommonPrefixes(t *testing.T) {
	response := &ListObjectsResponse{
		CommonPrefixes: []map[string]string{
			map[string]string{"prefix": "prefix-0"},
			map[string]string{"prefix": "prefix-1"},
			map[string]string{"prefix": "prefix-2"},
		},
	}

	prefixes := response.GetCommonPrefixes()

	if len(prefixes) != len(response.CommonPrefixes) {
		t.Error(util.FormatTest("GetCommonPrefixes", strconv.Itoa(len(prefixes)), strconv.Itoa(len(response.CommonPrefixes))))
	}

	if prefixes[1] != response.CommonPrefixes[1]["prefix"] {
		t.Error(util.FormatTest("GetCommonPrefixes", prefixes[1], response.CommonPrefixes[1]["prefix"]))
	}
}

func TestMergeToSignOptionForCopyObjectRequest(t *testing.T) {
	option := &bce.SignOption{}
	request := CopyObjectRequest{
		SrcBucketName:  "source-bucket",
		SrcKey:         "source-bucket-key",
		DestBucketName: "dest-bucket",
		DestKey:        "dest-bucket-key",
		ObjectMetadata: &ObjectMetadata{
			CacheControl: "no-cache",
			ContentType:  "text/plain",
			UserMetadata: map[string]string{"request-id": "12345"},
		},
		SourceMatch:           "xxx",
		SourceNoneMatch:       "xxx",
		SourceModifiedSince:   "xxx",
		SourceUnmodifiedSince: "xxx",
	}

	request.mergeToSignOption(option)

	if len(option.Headers) != 8 {
		t.Error(util.FormatTest("CopyObjectRequest: MergeToSignOption", strconv.Itoa(len(option.Headers)), strconv.Itoa(8)))
	}

	if option.Headers["x-bce-metadata-directive"] != "replace" {
		t.Error(util.FormatTest("CopyObjectRequest: MergeToSignOption", option.Headers["x-bce-metadata-directive"], "replace"))
	}
}

func TestMergeToSignOptionForGetObjectRequest(t *testing.T) {
	lengthRange := "0-1024"
	expected := "bytes=" + lengthRange

	option := &bce.SignOption{}
	request := &GetObjectRequest{
		BucketName: "test-bucket-name",
		ObjectKey:  "test-object-key",
		Range:      lengthRange,
	}

	request.MergeToSignOption(option)

	if option.Headers["Range"] != expected {
		t.Error(util.FormatTest("GetObjectRequest: MergeToSignOption", option.Headers["Range"], expected))
	}
}

func TestErrorForDeleteMultipleObjectsError(t *testing.T) {
	deleteMultipleObjectsError := DeleteMultipleObjectsError{
		Key:     "error-key",
		Code:    "error-code",
		Message: "error-message",
	}

	result := deleteMultipleObjectsError.Error()
	expected := "error-message"

	if result != expected {
		t.Error(util.FormatTest("DeleteMultipleObjectsError: Error", result, expected))
	}

	deleteMultipleObjectsError = DeleteMultipleObjectsError{
		Key:  "error-key",
		Code: "error-code",
	}

	result = deleteMultipleObjectsError.Error()
	expected = "error-code"

	if result != expected {
		t.Error(util.FormatTest("DeleteMultipleObjectsError: Error", result, expected))
	}
}

func TestSort(t *testing.T) {
	request := CompleteMultipartUploadRequest{
		BucketName: "test-bucket",
		ObjectKey:  "test-object-key",
		UploadId:   "test-upload-id",
		Parts: []PartSummary{
			PartSummary{PartNumber: 2},
			PartSummary{PartNumber: 3},
			PartSummary{PartNumber: 1},
		},
	}

	result := request.Parts[0].PartNumber
	expected := 2

	if result != expected {
		t.Error(util.FormatTest("CompleteMultipartUploadRequest: Sort", strconv.Itoa(result), strconv.Itoa(expected)))
	}

	request.sort()

	result = request.Parts[0].PartNumber
	expected = 1

	if result != expected {
		t.Error(util.FormatTest("CompleteMultipartUploadRequest: Sort", strconv.Itoa(result), strconv.Itoa(expected)))
	}
}

func TestIsUserDefinedMetadata(t *testing.T) {
	expected := true
	result := IsUserDefinedMetadata("x-bce-meta-name")

	if result != expected {
		t.Error(util.FormatTest("IsUserDefinedMetadata", strconv.FormatBool(result), strconv.FormatBool(expected)))
	}

	expected = false
	result = IsUserDefinedMetadata("content-type")

	if result != expected {
		t.Error(util.FormatTest("IsUserDefinedMetadata", strconv.FormatBool(result), strconv.FormatBool(expected)))
	}
}

func TestToUserDefinedMetadata(t *testing.T) {
	expected := "x-bce-meta-name"
	result := ToUserDefinedMetadata("x-bce-meta-name")

	if result != expected {
		t.Error(util.FormatTest("ToUserDefinedMetadata", result, expected))
	}

	result = ToUserDefinedMetadata("name")

	if result != expected {
		t.Error(util.FormatTest("ToUserDefinedMetadata", result, expected))
	}

	expected = "x-bce-meta-content-type"
	result = ToUserDefinedMetadata("content-type")

	if result != expected {
		t.Error(util.FormatTest("ToUserDefinedMetadata", result, expected))
	}
}


text:
/// <reference path='fourslash.ts' />

//// [4,5,6,7].map(function /*x*/is/*y*/Even(n) {
////    return n % 2 === 0;
//// });

goTo.select("x", "y");
edit.applyRefactor({
    refactorName: "Convert arrow function or function expression",
    actionName: "Convert to arrow function",
    actionDescription: "Convert to arrow function",
    newContent: `[4,5,6,7].map((n) => n % 2 === 0);`,
});


text:
<?php namespace nyx\core\collections;

class Exception extends \RuntimeException
{
    /**
     * @var interfaces\Collection   The Collection in which this Exception occurred.
     */
    private $collection;

    /**
     * {@inheritdoc}
     *
     * @param   interfaces\Collection   $collection     The Collection in which this Exception occurred.
     */
    public function __construct(interfaces\Collection $collection, string $message, $code = 0, $previous = null)
    {
        parent::__construct($message, $code, $previous);
    }

    /**
     * Returns the Collection in which this Exception occurred.
     *
     * @return  interfaces\Collection
     */
    public function getCollection() : interfaces\Collection
    {
        return $this->collection;
    }
}


text:
@CHARSET "UTF-8";

.Container {
    padding: 0;
    margin: 0;
}

.Container li {
    list-style-type: none;
}

/* indent for all tree children excepts root */
.Node {
    background-image : url(img/i.gif);
    background-position : top left;
    background-repeat : repeat-y;
    margin-left: 18px;
    zoom: 1;
}

.IsRoot {
    margin-left: 0;
}

/* left vertical line (grid) for all nodes */
li:last-of-type {
    background-image: url(img/i_half.gif);
    background-repeat : no-repeat;
}

.ExpandOpen .Expand {
    background-image: url(img/expand_minus.gif);
}

/* closed is higher priority than open */
.ExpandClosed .Expand {
    background-image: url(img/expand_plus.gif);
}

/* highest priority */
.ExpandLeaf .Expand {
    background-image: url(img/expand_leaf.gif);
}

.Content {
    min-height: 18px;
    margin-left:18px;
}

* html  .Content {
    height: 18px;
}

.Expand {
    width: 18px;
    height: 18px;
    float: left;
}

.ExpandLoading   {
    width: 18px;
    height: 18px;
    float: left;
    background-image: url(img/expand_loading.gif);
}

.ExpandOpen .Container {
	display: block;
}

.ExpandClosed .Container {
	display: none;
}

.ExpandOpen .Expand, .ExpandClosed .Expand {
	cursor: pointer;
}
.ExpandLeaf .Expand {
	cursor: auto;
}

span.red {color:red;}


text:
SYNONYM

#### According to
Index Fungorum

#### Published in
null

#### Original name
Septoria fusicoccoides Sacc. & Roum.

### Remarks
null


text:
import unittest

from unittest.mock import patch, Mock, DEFAULT

from GUM_Dispenser.GUM_Dispenser_Main import check_for_setup, dispense_gum, main, initialize_log

from pathlib import Path

from GUM_Dispenser.GUM_Exceptions import ConfigurationNotFoundError, PackageNotFoundError, SourceModuleNotFoundError

from GUM_Dispenser.GUM_Exceptions import UserConfirmedInvalidSetup

import sys

class TestGumDispenserMain(unittest.TestCase):

    def setUp(self):

        self.base_pkg_dir = Path(sys.modules[__name__].__file__)

        self.base_pkg_dir = self.base_pkg_dir.resolve().parent.parent

    def test_initialize_log(self):

        test_arguments = {'debug' : True}

        with self.assertLogs('GUM Dispenser', level='INFO') as log_context:

            initialize_log(test_arguments)

        self.assertTrue('DEBUG' in log_context.output[1])

        test_arguments = {'debug': False}

        with self.assertLogs('GUM Dispenser', level='INFO') as log_context:
            initialize_log(test_arguments)

        self.assertTrue('INFO' in log_context.output[1])

    def test_check_for_setup(self):
        """Test GUM_Dispenser.GUM_Dispenser.check_for_setup"""

        # Test non-existent setup file and input as base directory

        test_arguments = {'setup_file' : 'nonexistent', 'path' : str(self.base_pkg_dir), 'debug' : False}

        self.assertEqual(str(self.base_pkg_dir), check_for_setup(test_arguments))

        # Test non-existent setup file and input as package directory

        test_arguments['path'] = str(self.base_pkg_dir.joinpath('GUM_Dispenser'))

        self.assertEqual(str(self.base_pkg_dir), check_for_setup(test_arguments))

        # Test with given directory containing setup

        test_arguments['setup_file'] = str(self.base_pkg_dir)

        self.assertEqual(str(self.base_pkg_dir), check_for_setup(test_arguments))

        # Test with direct path to setup.py given

        test_arguments['setup_file'] = str(self.base_pkg_dir.joinpath('setup.py'))

        self.assertEqual(str(self.base_pkg_dir), check_for_setup(test_arguments))

        # Test where no setup.py will be found

        test_arguments['setup_file'] = 'nonexistent'
        test_arguments['path'] = str(self.base_pkg_dir.parent)

        self.assertRaises(ConfigurationNotFoundError, check_for_setup, test_arguments)

    def test_dispense_gum(self):
        """Test GUM_Dispenser.GUM_Dispenser.dispense_gum"""

        # Test error handling
        # Here is InvalidSourcePathError

        test_arguments = {'path' : 'nonexistent', 'debug' : False}

        with self.assertLogs(logger='GUM Dispenser', level='ERROR') as log_context:

            dispense_gum(test_arguments)

        self.assertTrue("The given source path was not found on your system" in log_context.output[0])

        test_arguments = {'path' : self.base_pkg_dir}

        with patch('GUM_Dispenser.GUM_Dispenser_Main.check_for_setup', new=Mock(side_effect=ConfigurationNotFoundError)):

            with self.assertLogs(logger='GUM Dispenser', level='ERROR') as log_context:

                dispense_gum(test_arguments)

            self.assertTrue("We couldn't find a complete project definition" in log_context.output[0])

        with patch('GUM_Dispenser.GUM_Dispenser_Main.check_for_setup', new=Mock(side_effect=PackageNotFoundError(
                'nonexistent'))):

            with self.assertLogs(logger='GUM Dispenser', level='ERROR') as log_context:

                dispense_gum(test_arguments)

            self.assertTrue("The package nonexistent specified in your setup.py doesn't exist" in log_context.output[0])

        with patch('GUM_Dispenser.GUM_Dispenser_Main.check_for_setup', new=Mock(side_effect=SourceModuleNotFoundError)):

            with self.assertLogs(logger='GUM Dispenser', level='ERROR') as log_context:

                dispense_gum(test_arguments)

            self.assertTrue("Missing or bad path for .py source file" in log_context.output[0])

        with patch('GUM_Dispenser.GUM_Dispenser_Main.check_for_setup', new=Mock(side_effect=UserConfirmedInvalidSetup)):

            with self.assertLogs(logger='GUM Dispenser', level='ERROR') as log_context:

                dispense_gum(test_arguments)

            self.assertTrue("User requested program termination. Goodbye" in log_context.output[0])

        with patch('GUM_Dispenser.GUM_Dispenser_Main.check_for_setup', new=Mock(side_effect=KeyError)):

            with self.assertLogs(logger='GUM Dispenser', level='ERROR') as log_context:

                dispense_gum(test_arguments)

            self.assertTrue("Error:" in log_context.output[0])

        # Test that already checked functions are called as expected

        with patch.multiple('GUM_Dispenser.GUM_Dispenser_Main', check_for_setup=DEFAULT, parse_setup=DEFAULT,
                            describe_project=DEFAULT, generate_project_nomnoml=DEFAULT) as patched:

            dispense_gum(test_arguments)

            patched['check_for_setup'].assert_called_once()

            patched['parse_setup'].assert_called_once()

            patched['describe_project'].assert_called_once()

            patched['generate_project_nomnoml'].assert_called_once()

    def test_main(self):
        """Test GUM_Dispenser.GUM_Dispenser.main"""

        with patch.multiple('GUM_Dispenser.GUM_Dispenser_Main', argparse=DEFAULT, dispense_gum=DEFAULT,
                            initialize_log=DEFAULT) as patched:

            main()

            patched['dispense_gum'].assert_called_once()

if __name__ == '__main__':

    unittest.main()


text:
<!DOCTYPE html>

<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>Inner CSS3 Box Shadow</title>

The box shadow property has offered immense changes
		into how we build websites. You can portray box shadows on nearly any
		element, and they all generally look great. This piece of code will
		force inner shadows which is a lot harder to design around, but in the
		right cases it looks pristine.


text:
from __future__ import unicode_literals

from django.db import models
import re
from django.core import validators
from usuario import models as usuario
# Create your models here.

class Soat(models.Model):
    numeroS = models.CharField(max_length=50, unique=True, validators=[validators.RegexValidator(re.compile('^[0-9]+$'), ('numero no valida'), 'invalid')])
    fecha_expedicionS = models.DateField()
    fecha_expiracionS = models.DateField()

    def __str__(self):
        return self.numeroS
    #end def

    def __unicode__(self):
        return self.numeroS
    #end def

    class Meta:
        verbose_name = "Soat"
        verbose_name_plural = "Soats"
    # end class
#end class

class Tecno(models.Model):
    numeroT = models.CharField(max_length=50, unique=True, validators=[
                               validators.RegexValidator(re.compile('^[0-9]+$'), ('numero no valida'), 'invalid')])
    fecha_expedicionT = models.DateField()
    fecha_expiracionT = models.DateField()

    def __str__(self):
        return self.numeroT
    # end def

    def __unicode__(self):
        return self.numeroT
    # end def

    class Meta:
        verbose_name = "Tecnomecanica"
        verbose_name_plural = "Tecnomecanicas"
    # end class
#end class

TIPO_MOTORIZADO = ((1, 'Planta'), (2, 'Suscrito'))

class Moto(models.Model):
    tipo = models.CharField(max_length=50)
    marca = models.CharField(max_length=50)
    placa = models.CharField(max_length=6, unique=True)
    soat = models.OneToOneField(Soat)
    tecno = models.OneToOneField(Tecno)
    t_propiedad = models.CharField(
        ("Tarjeta de Propiedad"), max_length=50, unique=True)
    estado = models.BooleanField(default=True)

    def __str__(self):
        return self.placa
    # end def

    def __unicode__(self):
        return self.placa
    # end def

    class Meta:
        verbose_name = "Moto"
        verbose_name_plural = "Motos"
# end class

class Motorizado(models.Model):
    empleado = models.OneToOneField(usuario.Empleado)
    licencia = models.CharField(max_length=50, unique=True, validators=[validators.RegexValidator(re.compile('^[0-9]+$'), ('licencia no valida'), 'invalid')])
    identifier = models.CharField(max_length=20, blank=True, null=True)
    moto = models.OneToOneField(Moto)

    class Meta:
        verbose_name = "Motorizado"
        verbose_name_plural = "Motorizados"
    # end if

    def __str__(self):
        return str(self.empleado)
    # end if

    def __unicode__(self):
        return self.empleado.first_name
    # end if
#end class

class InfoMoto(models.Model):
    empleado = models.OneToOneField(usuario.Empleado)
    licencia = models.CharField(max_length=50, unique=True, validators=[validators.RegexValidator(re.compile('^[0-9]+$'), ('licencia no valida'), 'invalid')])
    identifier = models.CharField(max_length=20, blank=True, null=True)
    numeroS = models.CharField(max_length=50, unique=True, validators=[validators.RegexValidator(re.compile('^[0-9]+$'), ('numero no valida'), 'invalid')])
    fecha_expedicionS = models.DateField()
    fecha_expiracionS = models.DateField()
    numeroT = models.CharField(max_length=50, unique=True, validators=[
                               validators.RegexValidator(re.compile('^[0-9]+$'), ('numero no valida'), 'invalid')])
    fecha_expedicionT = models.DateField()
    fecha_expiracionT = models.DateField()
    tipo = models.CharField(max_length=50)
    marca = models.CharField(max_length=50)
    placa = models.CharField(max_length=6, unique=True)
    t_propiedad = models.CharField(
        ("Tarjeta de Propiedad"), max_length=50, unique=True)
    estado = models.BooleanField(default=True)

    class Meta:
        verbose_name = "Moto Informacion"
        verbose_name_plural = "Informaciones de Motos"
    # end if

    def __str__(self):
        return str(self.placa)
    # end if

    def __unicode__(self):
        return self.placa
    # end if