text:
from decimal import Decimal

import pytest

from mongoengine import (
    CachedReferenceField,
    DecimalField,
    Document,
    EmbeddedDocument,
    EmbeddedDocumentField,
    InvalidDocumentError,
    ListField,
    ReferenceField,
    StringField,
    ValidationError,
)
from tests.utils import MongoDBTestCase

class TestCachedReferenceField(MongoDBTestCase):
    def test_constructor_fail_bad_document_type(self):
        with pytest.raises(
            ValidationError, match="must be a document class or a string"
        ):
            CachedReferenceField(document_type=0)

    def test_get_and_save(self):
        """
        Tests #1047: CachedReferenceField creates DBRefs on to_python,
        but can't save them on to_mongo.
        """

        class Animal(Document):
            name = StringField()
            tag = StringField()

        class Ocorrence(Document):
            person = StringField()
            animal = CachedReferenceField(Animal)

        Animal.drop_collection()
        Ocorrence.drop_collection()

        Ocorrence(
            person="testte", animal=Animal(name="Leopard", tag="heavy").save()
        ).save()
        p = Ocorrence.objects.get()
        p.person = "new_testte"
        p.save()

    def test_general_things(self):
        class Animal(Document):
            name = StringField()
            tag = StringField()

        class Ocorrence(Document):
            person = StringField()
            animal = CachedReferenceField(Animal, fields=["tag"])

        Animal.drop_collection()
        Ocorrence.drop_collection()

        a = Animal(name="Leopard", tag="heavy")
        a.save()

        assert Animal._cached_reference_fields == [Ocorrence.animal]
        o = Ocorrence(person="teste", animal=a)
        o.save()

        p = Ocorrence(person="Wilson")
        p.save()

        assert Ocorrence.objects(animal=None).count() == 1

        assert a.to_mongo(fields=["tag"]) == {"tag": "heavy", "_id": a.pk}

        assert o.to_mongo()["animal"]["tag"] == "heavy"

        # counts
        Ocorrence(person="teste 2").save()
        Ocorrence(person="teste 3").save()

        count = Ocorrence.objects(animal__tag="heavy").count()
        assert count == 1

        ocorrence = Ocorrence.objects(animal__tag="heavy").first()
        assert ocorrence.person == "teste"
        assert isinstance(ocorrence.animal, Animal)

    def test_with_decimal(self):
        class PersonAuto(Document):
            name = StringField()
            salary = DecimalField()

        class SocialTest(Document):
            group = StringField()
            person = CachedReferenceField(PersonAuto, fields=("salary",))

        PersonAuto.drop_collection()
        SocialTest.drop_collection()

        p = PersonAuto(name="Alberto", salary=Decimal("7000.00"))
        p.save()

        s = SocialTest(group="dev", person=p)
        s.save()

        assert SocialTest.objects._collection.find_one({"person.salary": 7000.00}) == {
            "_id": s.pk,
            "group": s.group,
            "person": {"_id": p.pk, "salary": 7000.00},
        }

    def test_cached_reference_field_reference(self):
        class Group(Document):
            name = StringField()

        class Person(Document):
            name = StringField()
            group = ReferenceField(Group)

        class SocialData(Document):
            obs = StringField()
            tags = ListField(StringField())
            person = CachedReferenceField(Person, fields=("group",))

        Group.drop_collection()
        Person.drop_collection()
        SocialData.drop_collection()

        g1 = Group(name="dev")
        g1.save()

        g2 = Group(name="designers")
        g2.save()

        p1 = Person(name="Alberto", group=g1)
        p1.save()

        p2 = Person(name="Andre", group=g1)
        p2.save()

        p3 = Person(name="Afro design", group=g2)
        p3.save()

        s1 = SocialData(obs="testing 123", person=p1, tags=["tag1", "tag2"])
        s1.save()

        s2 = SocialData(obs="testing 321", person=p3, tags=["tag3", "tag4"])
        s2.save()

        assert SocialData.objects._collection.find_one({"tags": "tag2"}) == {
            "_id": s1.pk,
            "obs": "testing 123",
            "tags": ["tag1", "tag2"],
            "person": {"_id": p1.pk, "group": g1.pk},
        }

        assert SocialData.objects(person__group=g2).count() == 1
        assert SocialData.objects(person__group=g2).first() == s2

    def test_cached_reference_field_push_with_fields(self):
        class Product(Document):
            name = StringField()

        Product.drop_collection()

        class Basket(Document):
            products = ListField(CachedReferenceField(Product, fields=["name"]))

        Basket.drop_collection()
        product1 = Product(name="abc").save()
        product2 = Product(name="def").save()
        basket = Basket(products=[product1]).save()
        assert Basket.objects._collection.find_one() == {
            "_id": basket.pk,
            "products": [{"_id": product1.pk, "name": product1.name}],
        }
        # push to list
        basket.update(push__products=product2)
        basket.reload()
        assert Basket.objects._collection.find_one() == {
            "_id": basket.pk,
            "products": [
                {"_id": product1.pk, "name": product1.name},
                {"_id": product2.pk, "name": product2.name},
            ],
        }

    def test_cached_reference_field_update_all(self):
        class Person(Document):
            TYPES = (("pf", "PF"), ("pj", "PJ"))
            name = StringField()
            tp = StringField(choices=TYPES)
            father = CachedReferenceField("self", fields=("tp",))

        Person.drop_collection()

        a1 = Person(name="Wilson Father", tp="pj")
        a1.save()

        a2 = Person(name="Wilson Junior", tp="pf", father=a1)
        a2.save()

        a2 = Person.objects.with_id(a2.id)
        assert a2.father.tp == a1.tp

        assert dict(a2.to_mongo()) == {
            "_id": a2.pk,
            "name": "Wilson Junior",
            "tp": "pf",
            "father": {"_id": a1.pk, "tp": "pj"},
        }

        assert Person.objects(father=a1)._query == {"father._id": a1.pk}
        assert Person.objects(father=a1).count() == 1

        Person.objects.update(set__tp="pf")
        Person.father.sync_all()

        a2.reload()
        assert dict(a2.to_mongo()) == {
            "_id": a2.pk,
            "name": "Wilson Junior",
            "tp": "pf",
            "father": {"_id": a1.pk, "tp": "pf"},
        }

    def test_cached_reference_fields_on_embedded_documents(self):
        with pytest.raises(InvalidDocumentError):

            class Test(Document):
                name = StringField()

            type(
                "WrongEmbeddedDocument",
                (EmbeddedDocument,),
                {"test": CachedReferenceField(Test)},
            )

    def test_cached_reference_auto_sync(self):
        class Person(Document):
            TYPES = (("pf", "PF"), ("pj", "PJ"))
            name = StringField()
            tp = StringField(choices=TYPES)

            father = CachedReferenceField("self", fields=("tp",))

        Person.drop_collection()

        a1 = Person(name="Wilson Father", tp="pj")
        a1.save()

        a2 = Person(name="Wilson Junior", tp="pf", father=a1)
        a2.save()

        a1.tp = "pf"
        a1.save()

        a2.reload()
        assert dict(a2.to_mongo()) == {
            "_id": a2.pk,
            "name": "Wilson Junior",
            "tp": "pf",
            "father": {"_id": a1.pk, "tp": "pf"},
        }

    def test_cached_reference_auto_sync_disabled(self):
        class Persone(Document):
            TYPES = (("pf", "PF"), ("pj", "PJ"))
            name = StringField()
            tp = StringField(choices=TYPES)

            father = CachedReferenceField("self", fields=("tp",), auto_sync=False)

        Persone.drop_collection()

        a1 = Persone(name="Wilson Father", tp="pj")
        a1.save()

        a2 = Persone(name="Wilson Junior", tp="pf", father=a1)
        a2.save()

        a1.tp = "pf"
        a1.save()

        assert Persone.objects._collection.find_one({"_id": a2.pk}) == {
            "_id": a2.pk,
            "name": "Wilson Junior",
            "tp": "pf",
            "father": {"_id": a1.pk, "tp": "pj"},
        }

    def test_cached_reference_embedded_fields(self):
        class Owner(EmbeddedDocument):
            TPS = (("n", "Normal"), ("u", "Urgent"))
            name = StringField()
            tp = StringField(verbose_name="Type", db_field="t", choices=TPS)

        class Animal(Document):
            name = StringField()
            tag = StringField()

            owner = EmbeddedDocumentField(Owner)

        class Ocorrence(Document):
            person = StringField()
            animal = CachedReferenceField(Animal, fields=["tag", "owner.tp"])

        Animal.drop_collection()
        Ocorrence.drop_collection()

        a = Animal(
            name="Leopard", tag="heavy", owner=Owner(tp="u", name="Wilson Júnior")
        )
        a.save()

        o = Ocorrence(person="teste", animal=a)
        o.save()
        assert dict(a.to_mongo(fields=["tag", "owner.tp"])) == {
            "_id": a.pk,
            "tag": "heavy",
            "owner": {"t": "u"},
        }
        assert o.to_mongo()["animal"]["tag"] == "heavy"
        assert o.to_mongo()["animal"]["owner"]["t"] == "u"

        # Check to_mongo with fields
        assert "animal" not in o.to_mongo(fields=["person"])

        # counts
        Ocorrence(person="teste 2").save()
        Ocorrence(person="teste 3").save()

        count = Ocorrence.objects(animal__tag="heavy", animal__owner__tp="u").count()
        assert count == 1

        ocorrence = Ocorrence.objects(
            animal__tag="heavy", animal__owner__tp="u"
        ).first()
        assert ocorrence.person == "teste"
        assert isinstance(ocorrence.animal, Animal)

    def test_cached_reference_embedded_list_fields(self):
        class Owner(EmbeddedDocument):
            name = StringField()
            tags = ListField(StringField())

        class Animal(Document):
            name = StringField()
            tag = StringField()

            owner = EmbeddedDocumentField(Owner)

        class Ocorrence(Document):
            person = StringField()
            animal = CachedReferenceField(Animal, fields=["tag", "owner.tags"])

        Animal.drop_collection()
        Ocorrence.drop_collection()

        a = Animal(
            name="Leopard",
            tag="heavy",
            owner=Owner(tags=["cool", "funny"], name="Wilson Júnior"),
        )
        a.save()

        o = Ocorrence(person="teste 2", animal=a)
        o.save()
        assert dict(a.to_mongo(fields=["tag", "owner.tags"])) == {
            "_id": a.pk,
            "tag": "heavy",
            "owner": {"tags": ["cool", "funny"]},
        }

        assert o.to_mongo()["animal"]["tag"] == "heavy"
        assert o.to_mongo()["animal"]["owner"]["tags"] == ["cool", "funny"]

        # counts
        Ocorrence(person="teste 2").save()
        Ocorrence(person="teste 3").save()

        query = Ocorrence.objects(
            animal__tag="heavy", animal__owner__tags="cool"
        )._query
        assert query == {"animal.owner.tags": "cool", "animal.tag": "heavy"}

        ocorrence = Ocorrence.objects(
            animal__tag="heavy", animal__owner__tags="cool"
        ).first()
        assert ocorrence.person == "teste 2"
        assert isinstance(ocorrence.animal, Animal)


text:
package com.tjh.swivel.config.model;

/**
 * Enums representing the standard Http Response codes
 */
public enum HttpResponseCode {
    CONTINUE(100, "Continue"),
    SWITCHING_PROTOCOLS(101, "Switching Protocols"),

    OK(200, "OK"),
    CREATED(201, "Created"),
    ACCEPTED(202, "Accepted"),
    NON_AUTHORITATIVE(203, "Non-Authoritative"),
    NO_CONTENT(204, "No Content"),
    RESET_CONTENT(205, "Reset Content"),
    PARTIAL_CONTENT(206, "Partial Content"),

    MULTIPLE_CHOICES(300, "Multiple Choices"),
    MOVED_PERMANENTLY(301, "Moved Permanently"),
    FOUND(302, "Found"),
    SEE_OTHER(303, "See Other"),
    NOT_MODIFIED(304, "Not Modified"),
    USE_PROXY(305, "Use Proxy"),
    TEMPORARY_REDIRECT(307, "Temporay Redirect"),

    BAD_REQUEST(400, "Bad Request"),
    UNAUTHORIZED(401, "Unauthorized"),
    PAYMENT_REQUIRED(402, "Payment Required"),
    FORBIDDEN(403, "Forbidden"),
    NOT_FOUND(404, "Not Found"),
    METHOD_NOT_ALLOWED(405, "Method Not Allowed"),
    NOT_ACCEPTABLE(406, "Not Acceptable"),
    PROXY_AUTH_REQUIRED(407, "Proxy Authentication Required"),
    REQUEST_TIMEOUT(408, "Request Timeout"),
    CONFLICT(409, "Conflict"),
    GONE(410, "Gone"),
    LENGTH_REQUIRED(411, "Length Required"),
    PRECONDITION_FAILED(412, "Precondition Failed"),
    REQUEST_ENTITY_TOO_LARGE(413, "Request Entity Too Large"),
    REQUEST_URI_TOO_LONG(414, "Request URI Too Long"),
    UNSUPPORTED_MEDIA_TYPE(415, "Unsupported Media Type"),
    REQUESTED_RANGE_NOT_SATISFIABLE(416, "Requested Range Not Satisfiable"),
    EXPECTATION_FAILED(417, "Expectation Failed"),

    INTERNAL_SERVER_ERROR(500, "Internal Server Error"),
    NOT_IMPLEMENTED(501, "Not Implemented"),
    BAD_GATEWAY(502, "Bad Gateway"),
    SERVICE_UNAVAILABLE(503, "Service Unavailable"),
    GATEWAY_TIMEOUT(504, "Gateway Timeout"),
    HTTP_VERSION_NOT_SUPPORTED(505, "HTTP Version Not Supported");

    private final int code;
    private final String reason;

    HttpResponseCode(int code, String reason) {
        this.code = code;
        this.reason = reason;
    }

    public int getCode() { return code; }

    public String getReason() { return reason; }
}

redpajama_set_name: RedPajamaGithub


text:
Vous avez reçu une invitation à prendre en charge un cours au sein de l'IED en {{ ec.code_ec }} {{ ec.lib_ec }}

Pour valider cette demande, nous avons besoin de votre numéro obtenu à l'adresse suivante :

Si vous n'avez pas encore créer un compte sur , Veuillez le faire et revenir ici ensuite.

            Numéro de candidature

              <input type="text"
                   ng-model="numero" placeholder="numero de candidature"
                     ng-keyup="$event.keyCode == 13 ? searchPersonne(numero) : null"
                   class="form-control">

            <button class="btn btn-primary" ng-click="searchPersonne(numero)">Chercher</button>

Veuillez verifier votre identité

Numéro de candidature :

{{ personne.numero }}

Nom :

{{ personne.nom_pat }}

Prenom :

{{ personne.prenom }}

Email :

{{ personne.mail | lowercase }}

<button class="btn btn-success" ng-click="confirme_personne(numero)"> Je confirme</button>

<button class="btn btn-warning" ng-click="reset()"> Je recommence</button>

Vous avez bien valider votre invitation à prendre en charge un cours au sein de l'IED en {{ ec.code_ec }} {{ ec.lib_ec }}


text:
<?php

namespace Caxy\AuditLogBundle\Model;

use Doctrine\Common\Collections\Collection;
use Doctrine\Common\Collections\ArrayCollection;

class Version implements VersionInterface
{
    protected $id;
    protected $updateType;
    protected $versionGroup;
    protected $contentRecords;

    /**
     * {@inheritDoc}
     */
    public function getUpdateType()
    {
        return $this->updateType;
    }

    /**
     * {@inheritDoc}
     */
    public function setUpdateType(UpdateTypeInterface $updateType)
    {
        $this->updateType = $updateType;

        return $this;
    }

    /**
     * {@inheritDoc}
     */
    public function getVersionGroup()
    {
        return $this->versionGroup;
    }

    /**
     * {@inheritDoc}
     */
    public function setVersionGroup(VersionGroupInterface $versionGroup)
    {
        $this->versionGroup = $versionGroup;

        return $this;
    }

    /**
     * {@inheritDoc}
     */
    public function getId()
    {
        return $this->id;
    }

    /**
     * @return Collection
     */
    public function getContentRecords()
    {
        return $this->contentRecords ?: $this->contentRecords = new ArrayCollection();
    }

    /**
     * @param ContentRecordInterface $contentRecord
     *
     * @return self
     */
    public function addContentRecord(ContentRecordInterface $contentRecord)
    {
        if (!$this->getContentRecords()->contains($contentRecord)) {
            $this->getContentRecords()->add($contentRecord);
        }

        return $this;
    }

    /**
     * @param ContentRecordInterface $contentRecord
     *
     * @return self
     */
    public function removeContentRecord(ContentRecordInterface $contentRecord)
    {
        if ($this->getContentRecords()->contains($contentRecord)) {
            $this->getContentRecords()->removeElement($contentRecord);
        }

        return $this;
    }
}


text:
package org.apache.wicket.markup.parser.filter;

import java.text.ParseException;

import org.apache.wicket.markup.ComponentTag;
import org.apache.wicket.markup.MarkupElement;
import org.apache.wicket.markup.WicketTag;
import org.apache.wicket.markup.parser.AbstractMarkupFilter;
import org.apache.wicket.util.string.AppendingStringBuffer;

/**
 * Handler that sets unique tag id for every inline script and style element in <wicket:head>,
 * unless the element already has one.
 This is needed to be able to detect multiple ajax
 * header contribution. Tags that are not inline (stript with src attribute set and link with href
 * attribute set) do not require id, because the detection is done by comparing URLs.
 *

 * Tags with wicket:id are not processed. To setOutputWicketId(true) on attached
 * component is developer's responsibility. FIXME: Really? And if so, document properly
 *
 * @author Matej Knopp
 */
public class HeadForceTagIdHandler extends AbstractMarkupFilter
{
	/** Common prefix for all id's generated by this filter */
	private final String headElementIdPrefix;

	/** Unique value per markup file */
	private int counter = 0;

	/** we are in wicket:head */
	private boolean inHead = false;

	/**
	 * Construct.
	 *
	 * @param markupFileClass
	 *            Used to generated the a common prefix for the id
	 */
	public HeadForceTagIdHandler(final Class< ? > markupFileClass)
	{
		// generate the prefix from class name
		final AppendingStringBuffer buffer = new AppendingStringBuffer(markupFileClass.getName());
		for (int i = 0; i < buffer.getValue().length; ++i)
		{
			if (Character.isLetterOrDigit(buffer.getValue()[i]) == false)
			{
				buffer.getValue()[i] = '-';
			}
		}

		buffer.append("-");
		headElementIdPrefix = buffer.toString();
	}

	/**
	 * @see org.apache.wicket.markup.parser.IMarkupFilter#nextTag()
	 */
	public MarkupElement nextTag() throws ParseException
	{
		final ComponentTag tag = (ComponentTag)getParent().nextTag();

		if (tag != null)
		{
			// is it a <wicket:head> tag?
			if (tag instanceof WicketTag && ((WicketTag)tag).isHeadTag())
			{
				inHead = tag.isOpen();
			}
			// no, it's not. Are we in <wicket:head> ?
			else if (inHead == true)
			{
				// is the tag open and has empty wicket:id?
				if ((tag instanceof WicketTag == false) && (tag.getId() == null) &&
					(tag.isOpen() || tag.isOpenClose()) && needId(tag))
				{
					if (tag.getAttributes().get("id") == null)
					{
						tag.getAttributes().put("id", headElementIdPrefix + nextValue());
						tag.setModified(true);
					}
				}
			}
		}

		return tag;
	}

	/**
	 *
	 * @param tag
	 * @return true, if id is needed
	 */
	private final boolean needId(final ComponentTag tag)
	{
		final String name = tag.getName().toLowerCase();
		if (name.equals("script") && tag.getAttributes().containsKey("src") == false)
		{
			return true;
		}
		else if (name.equals("style") && tag.getAttributes().containsKey("href") == false)
		{
			return true;
		}

		return false;
	}

	/**
	 *
	 * @return The next value
	 */
	private final int nextValue()
	{
		return counter++;
	}
}


text:
linecache module
================

.. automodule:: linecache
    :members:
    :undoc-members:
    :show-inheritance:


text:
// Copyright (C) 2011 Chan Wai Shing
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//      http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package org.stepic.droid.code.highlight.prettify.parser;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.TreeMap;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

/**
 * Common Utilities.
 * Some of the functions are port from JavaScript.
 *
 * @author Chan Wai Shing <cws1989@gmail.com>
 */
public class Util {

    protected Util() {
    }

    /**
     * Treat a variable as an boolean in JavaScript style. Note this function can
     * only handle string, integer and boolean currently. All other data type, if
     * null, return false, not null return true.
     *
     * @param var the variable to get value from
     * @return the boolean value
     */
    public static Boolean getVariableValueAsBoolean(Object var) {
        Boolean returnResult = null;

        if (var == null) {
            returnResult = false;
        } else if (var instanceof String) {
            returnResult = !((String) var).isEmpty();
        } else if (var instanceof Integer) {
            returnResult = ((Integer) var) != 0;
        } else if (var instanceof Boolean) {
            returnResult = (Boolean) var;
        } else {
            returnResult = true;
        }

        return returnResult;
    }

    /**
     * Treat a variable as an integer in JavaScript style. Note this function can
     * only handle integer and boolean currently.
     *
     * @param var the variable to get value from
     * @return the integer value
     * @throws IllegalArgumentException the data type of {@code var} is neither
     * integer nor boolean.
     */
    public static Integer getVariableValueAsInteger(Object var) {
        if (var == null) {
            throw new NullPointerException("argument 'var' cannot be null");
        }

        Integer returnResult = -1;

        if (var instanceof Integer) {
            returnResult = (Integer) var;
        } else if (var instanceof Boolean) {
            // Javascript treat true as 1
            returnResult = (Boolean) var ? 1 : 0;
        } else {
            throw new IllegalArgumentException("'var' is neither integer nor boolean");
        }

        return returnResult;
    }

    /**
     * Get all the matches for {@code string} compiled by {@code pattern}. If
     * {@code isGlobal} is true, the return results will only include the
     * group 0 matches. It is similar to string.match(regexp) in JavaScript.
     *
     * @param pattern the regexp
     * @param string the string
     * @param isGlobal similar to JavaScript /g flag
     *
     * @return all matches
     */
    public static String[] match(Pattern pattern, String string, boolean isGlobal) {
        if (pattern == null) {
            throw new NullPointerException("argument 'pattern' cannot be null");
        }
        if (string == null) {
            throw new NullPointerException("argument 'string' cannot be null");
        }

        List<String> matchesList = new ArrayList<>();

        Matcher matcher = pattern.matcher(string);
        while (matcher.find()) {
            matchesList.add(matcher.group(0));
            if (!isGlobal) {
                for (int i = 1, iEnd = matcher.groupCount(); i <= iEnd; i++) {
                    matchesList.add(matcher.group(i));
                }
            }
        }

        return matchesList.toArray(new String[matchesList.size()]);
    }

    /**
     * Test whether the {@code string} has at least one match by
     * {@code pattern}.
     *
     * @param pattern the regexp
     * @param string the string to test
     *
     * @return true if at least one match, false if no match
     */
    public static boolean test(Pattern pattern, String string) {
        if (pattern == null) {
            throw new NullPointerException("argument 'pattern' cannot be null");
        }
        if (string == null) {
            throw new NullPointerException("argument 'string' cannot be null");
        }
        return pattern.matcher(string).find();
    }

    /**
     * Join the {@code strings} into one string.
     *
     * @param strings the string list to join
     *
     * @return the joined string
     */
    public static String join(List<String> strings) {
        if (strings == null) {
            throw new NullPointerException("argument 'strings' cannot be null");
        }
        return join(strings.toArray(new String[strings.size()]));
    }

    /**
     * Join the {@code strings} into one string with {@code delimiter} in
     * between.
     *
     * @param strings the string list to join
     * @param delimiter the delimiter
     *
     * @return the joined string
     */
    public static String join(List<String> strings, String delimiter) {
        if (strings == null) {
            throw new NullPointerException("argument 'strings' cannot be null");
        }
        return join(strings.toArray(new String[strings.size()]), delimiter);
    }

    /**
     * Join the {@code strings} into one string.
     *
     * @param strings the string list to join
     *
     * @return the joined string
     */
    public static String join(String[] strings) {
        return join(strings, null);
    }

    /**
     * Join the {@code strings} into one string with {@code delimiter} in
     * between. It is similar to RegExpObject.test(string) in JavaScript.
     *
     * @param strings the string list to join
     * @param delimiter the delimiter
     *
     * @return the joined string
     */
    public static String join(String[] strings, String delimiter) {
        if (strings == null) {
            throw new NullPointerException("argument 'strings' cannot be null");
        }

        StringBuilder sb = new StringBuilder();

        if (strings.length != 0) {
            sb.append(strings[0]);
            for (int i = 1, iEnd = strings.length; i < iEnd; i++) {
                if (delimiter != null) {
                    sb.append(delimiter);
                }
                sb.append(strings[i]);
            }
        }

        return sb.toString();
    }

    /**
     * Remove identical adjacent tags from {@code decorations}.
     *
     * @param decorations see {@link org.stepic.droid.code.highlight.prettify.parser.Job#decorations}
     * @param source the source code
     *
     * @return the {@code decorations} after treatment
     *
     * @throws IllegalArgumentException the size of {@code decoration} is not
     * a multiple of 2
     */
    public static List<Object> removeDuplicates(List<Object> decorations, String source) {
        if (decorations == null) {
            throw new NullPointerException("argument 'decorations' cannot be null");
        }
        if (source == null) {
            throw new NullPointerException("argument 'source' cannot be null");
        }
        if ((decorations.size() & 0x1) != 0) {
            throw new IllegalArgumentException("the size of argument 'decorations' should be a multiple of 2");
        }

        List<Object> returnList = new ArrayList<>();

        // use TreeMap to remove entrys with same pos
        Map<Integer, Object> orderedMap = new TreeMap<>();
        for (int i = 0, iEnd = decorations.size(); i < iEnd; i += 2) {
            orderedMap.put((Integer) decorations.get(i), decorations.get(i + 1));
        }

        // remove adjacent style
        String previousStyle = null;
        for (Integer pos : orderedMap.keySet()) {
            String style = (String) orderedMap.get(pos);
            if (previousStyle != null && previousStyle.equals(style)) {
                continue;
            }
            returnList.add(pos);
            returnList.add(style);
            previousStyle = style;
        }

        // remove last zero length tag
        int returnListSize = returnList.size();
        if (returnListSize >= 4 && returnList.get(returnListSize - 2).equals(source.length())) {
            returnList.remove(returnListSize - 2);
            returnList.remove(returnListSize - 2);
        }

        return returnList;
    }
}


text:
from html.parser import HTMLParser
import sys
import re
import csv

class CypressResultParser(HTMLParser):
    def __init__(self):
        HTMLParser.__init__(self)
        self.in_measure_section = False
        self.in_h4 = False
        self.data = []
        self.skip_column = True
        self.in_td = False
        self.current_data = ""
        self.detail_links = dict()
        self.in_link = False
        self.current_link = None

    def handle_starttag(self, tag, attrs):
        if tag == 'h4':
            self.in_h4 = True
        if self.in_measure_section:
            if tag == "tr":
                self.current_row = []
            if tag == "td":
                self.in_td = True
            if tag == 'a' and self.in_td:
                for a in attrs:
                    if a[0] == 'href':
                        self.current_link = a[1]
#            print("Encountered a start tag:", tag)
    def handle_endtag(self, tag):
        if tag == 'h4':
            self.in_h4 = False
        if tag == "section" and self.in_measure_section:
#            print("found end of measure section")
            self.in_measure_section = False
        if self.in_measure_section:
            if tag == "tr":
#                print("adding row " + str(self.current_row))
                if len(self.current_row) > 0:
                    row = []
                    for col in self.current_row:
                        col = re.sub('^(CMS[^/]*).*', '\\1', col)
                        col = re.sub('.*/(.*)', '\\1', col)
                        if col == '':
                            col = None
                        else:
                            col = col.lower()
                        row.append(col)
                    row.append(self.current_row[0])
                    row.append(self.current_link)
                    self.data.append(row)
                self.skip_column = True
            if tag == "td":
                if not self.skip_column:
#                    print("adding data" + self.current_data)
                    data = self.current_data
                    self.current_row.append(data)
                self.current_data = ""
                self.in_td = False
                self.skip_column = False
#            print("Encountered an end tag :", tag)
    def handle_data(self, data):
        if self.in_h4 and "MEASURES" in data:
            self.in_measure_section = True
        if self.in_measure_section:
            if self.in_td:
                self.current_data = self.current_data + data.strip()
#            print("Encountered some data  :", data)

s=sys.stdin.read()
parser=CypressResultParser()
parser.feed(s)

csvfile = open('answer_summary.csv', 'w', newline='')
awriter = csv.writer(csvfile, quoting=csv.QUOTE_MINIMAL)
prev = None
num = 0
for row in parser.data:
    if row[0] == prev:
        num = num + 1
    else:
        num = 0
    prev = row[0]
    row.append(re.sub('[a-z]*([0-9]*).*', 'measure_\\1_' + str(num) + '_patient_summary', row[0]))
    awriter.writerow(row)


text:
package com.amazonaws.services.appconfig.model.transform;

import javax.annotation.Generated;

import com.amazonaws.SdkClientException;
import com.amazonaws.services.appconfig.model.*;

import com.amazonaws.protocol.*;
import com.amazonaws.annotation.SdkInternalApi;

/**
 * GetHostedConfigurationVersionRequestMarshaller
 */
@Generated("com.amazonaws:aws-java-sdk-code-generator")
@SdkInternalApi
public class GetHostedConfigurationVersionRequestMarshaller {

    private static final MarshallingInfo<String> APPLICATIONID_BINDING = MarshallingInfo.builder(MarshallingType.STRING)
            .marshallLocation(MarshallLocation.PATH).marshallLocationName("ApplicationId").build();
    private static final MarshallingInfo<String> CONFIGURATIONPROFILEID_BINDING = MarshallingInfo.builder(MarshallingType.STRING)
            .marshallLocation(MarshallLocation.PATH).marshallLocationName("ConfigurationProfileId").build();
    private static final MarshallingInfo<Integer> VERSIONNUMBER_BINDING = MarshallingInfo.builder(MarshallingType.INTEGER)
            .marshallLocation(MarshallLocation.PATH).marshallLocationName("VersionNumber").build();

    private static final GetHostedConfigurationVersionRequestMarshaller instance = new GetHostedConfigurationVersionRequestMarshaller();

    public static GetHostedConfigurationVersionRequestMarshaller getInstance() {
        return instance;
    }

    /**
     * Marshall the given parameter object.
     */
    public void marshall(GetHostedConfigurationVersionRequest getHostedConfigurationVersionRequest, ProtocolMarshaller protocolMarshaller) {

        if (getHostedConfigurationVersionRequest == null) {
            throw new SdkClientException("Invalid argument passed to marshall(...)");
        }

        try {
            protocolMarshaller.marshall(getHostedConfigurationVersionRequest.getApplicationId(), APPLICATIONID_BINDING);
            protocolMarshaller.marshall(getHostedConfigurationVersionRequest.getConfigurationProfileId(), CONFIGURATIONPROFILEID_BINDING);
            protocolMarshaller.marshall(getHostedConfigurationVersionRequest.getVersionNumber(), VERSIONNUMBER_BINDING);
        } catch (Exception e) {
            throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);
        }
    }

}


text:
<?php

declare(strict_types=1);

namespace Cortex\Foundation\Console\Commands;

use Illuminate\Support\Str;
use Illuminate\Console\ConfirmableTrait;
use Cortex\Foundation\Traits\ConsoleMakeModuleCommand;
use Illuminate\Database\Console\Factories\FactoryMakeCommand as BaseFactoryMakeCommand;

class FactoryMakeCommand extends BaseFactoryMakeCommand
{
    use ConfirmableTrait;
    use ConsoleMakeModuleCommand;

    /**
     * Get the destination class path.
     *
     * @param string $name
     *
     * @throws \Exception
     *
     * @return string
     */
    protected function getPath($name): string
    {
        $name = Str::replaceFirst($this->rootNamespace(), $this->moduleName().DIRECTORY_SEPARATOR.'database'.DIRECTORY_SEPARATOR.'factories'.DIRECTORY_SEPARATOR, $name);

        if (! $this->files->exists($path = $this->laravel['path'].DIRECTORY_SEPARATOR.$this->moduleName().DIRECTORY_SEPARATOR)) {
            throw new \Exception("Invalid path: $path");
        }

        return $this->laravel['path'].DIRECTORY_SEPARATOR.str_replace('\\', DIRECTORY_SEPARATOR, $name).'.php';
    }

    /**
     * Qualify the given model class base name.
     *
     * @param string $model
     *
     * @return string
     */
    protected function qualifyModel(string $model)
    {
        $model = ltrim($model, '\\/');

        $model = str_replace('/', '\\', $model);

        $rootNamespace = $this->rootNamespace();

        if (Str::startsWith($model, $rootNamespace)) {
            return $model;
        }

        return $rootNamespace.'Models\\'.$model;
    }
}


text:
namespace AssemblyLine.DAL.Entities
{
    public class MeetingMember
    {
        public int Id { get; set; }

        public virtual User User { get; set; }

        public MeetingMembershipStatus Status { get; set; }
    }
}


text:
<?php

namespace Catalog\ContentBundle\lib;

use Catalog\ContentBundle\lib\AccessTokenAuthentication;

class SOAPMicrosoftTranslator {

    function getSoap($accessToken, $wsdlUrl){
        try {
            //Authorization header string.
            $authHeader = "Authorization: Bearer ". $accessToken;
            $contextArr = array(
                'http'   => array(
                    'header' => $authHeader
            )
            );
            //Create a streams context.
            $objContext = stream_context_create($contextArr);
            $optionsArr = array (
                'soap_version'   => 'SOAP_1_2',
                'encoding'          => 'UTF-8',
                'exceptions'      => true,
                'trace'          => true,
                'cache_wsdl'     => 'WSDL_CACHE_NONE',
                'stream_context' => $objContext,
                'user_agent'     => 'PHP-SOAP/'.PHP_VERSION."\r\n".$authHeader
            );
            //Call Soap Client.
            return new \SoapClient($wsdlUrl, $optionsArr);
        } catch(Exception $e){
            var_dump($e); exit;
        }
    }
}


text:
                Joins

                    <input type="search"
                           class="form-control search"
                           placeholder="Search"
                           ng-model="query">

                   {{join.name || '(no name)'}}
                   {{join.detail.name || '(no detail)'}}
                       as '{{join.detail.alias}}'

        <ng-include src="'views/partials/join.html'"></ng-include>


text:
#include "tensorflow/core/profiler/internal/tfprof_show_multi.h"

#include <memory>
#include <set>

#include "absl/strings/str_cat.h"
#include "absl/strings/str_format.h"
#include "tensorflow/core/platform/env.h"
#include "tensorflow/core/platform/regexp.h"
#include "tensorflow/core/profiler/internal/tfprof_scope.h"

namespace tensorflow {
namespace tfprof {

const MultiGraphNodeProto& TFMultiShow::Show(const string& prefix,
                                             const Options& opts) {
  if (opts.output_type == kOutput[0]) {
    Timeline timeline(opts.step, opts.output_options.at(kTimelineOpts[0]));
    return ShowInternal(opts, &timeline)->proto();
  } else {
    const ShowMultiNode* ret = ShowInternal(opts, nullptr);
    if (opts.output_type == kOutput[1]) {
      absl::PrintF("%s%s", prefix, ret->formatted_str);
      fflush(stdout);
    } else if (opts.output_type == kOutput[2]) {
      Status s = WriteStringToFile(Env::Default(),
                                   opts.output_options.at(kFileOpts[0]),
                                   prefix + ret->formatted_str);
      if (!s.ok()) {
        absl::FPrintF(stderr, "%s\n", s.ToString());
      }
    } else if (opts.output_type == kOutput[3] ||
               opts.output_type == kOutput[4]) {
    } else {
      absl::FPrintF(stderr, "Unknown output type: %s\n", opts.output_type);
    }
    return ret->proto();
  }
}

bool TFMultiShow::ShouldShow(const ShowMultiNode* node, const Options& opts,
                             int depth) const {
  // Always show kTFProfRoot.
  if (node->name() == kTFProfRoot) return true;

  // TODO(xpan): Think more carefully about node filtering in code view.
  // Unlike graph/scope view, which users want to see the exact leaf op.
  // In code view, users want to see the middle code traces they wrote.
  //
  // This is a subtle difference from scope/graph view. Usually mostly
  // want to see the middle code traces (i.e. their own codes.), instead
  // of the TensorFlow internal codes traces.
  if (node->proto().total_requested_bytes() < opts.min_bytes ||
      node->proto().total_peak_bytes() < opts.min_peak_bytes ||
      node->proto().total_residual_bytes() < opts.min_residual_bytes ||
      node->proto().total_output_bytes() < opts.min_output_bytes ||
      node->proto().total_exec_micros() < opts.min_micros ||
      node->proto().total_accelerator_exec_micros() <
          opts.min_accelerator_micros ||
      node->proto().total_cpu_exec_micros() < opts.min_cpu_micros ||
      node->proto().total_parameters() < opts.min_params ||
      node->proto().total_float_ops() < opts.min_float_ops ||
      depth > opts.max_depth || !ShouldShowIfExtra(node, opts, depth)) {
    return false;
  }

  bool show = false;
  if (opts.show_name_regexes.size() == 1 && opts.show_name_regexes[0] == ".*") {
    show = true;
  } else {
    for (const string& regex : opts.show_name_regexes) {
      if (RE2::FullMatch(node->name(), regex)) {
        show = true;
        break;
      }
    }
  }
  // Don't show if show_name_regexes don't cover it.
  if (!show) return false;
  // Don't show if hide_name_regexes cover it.
  for (const string& regex : opts.hide_name_regexes) {
    if (RE2::FullMatch(node->name(), regex)) return false;
  }
  return true;
}

bool TFMultiShow::ShouldTrim(const ShowMultiNode* node,
                             const std::vector<string>& regexes) const {
  for (const string& regex : regexes) {
    if (RE2::FullMatch(node->name(), regex)) {
      return true;
    }
  }
  return false;
}

bool TFMultiShow::ReAccount(ShowMultiNode* node, const Options& opts) {
  return node->ReInit(opts.step, opts.account_type_regexes);
}

string TFMultiShow::FormatLegend(const Options& opts) const {
  std::vector<string> legends;
  if (opts.select.find(kShown[0]) != opts.select.end()) {
    legends.push_back("requested bytes");
  }
  if (opts.select.find(kShown[11]) != opts.select.end()) {
    legends.push_back("peak bytes");
  }
  if (opts.select.find(kShown[12]) != opts.select.end()) {
    legends.push_back("residual bytes");
  }
  if (opts.select.find(kShown[13]) != opts.select.end()) {
    legends.push_back("output bytes");
  }
  if (opts.select.find(kShown[1]) != opts.select.end()) {
    legends.push_back("total execution time");
    legends.push_back("accelerator execution time");
    legends.push_back("cpu execution time");
  }
  if (opts.select.find(kShown[9]) != opts.select.end() &&
      opts.select.find(kShown[1]) == opts.select.end()) {
    legends.push_back("accelerator execution time");
  }
  if (opts.select.find(kShown[10]) != opts.select.end() &&
      opts.select.find(kShown[1]) == opts.select.end()) {
    legends.push_back("cpu execution time");
  }
  if (opts.select.find(kShown[2]) != opts.select.end()) {
    legends.push_back("# parameters");
  }
  if (opts.select.find(kShown[3]) != opts.select.end()) {
    legends.push_back("# float_ops");
  }
  if (opts.select.find(kShown[5]) != opts.select.end()) {
    legends.push_back("assigned devices");
  }
  if (opts.select.find(kShown[6]) != opts.select.end()) {
    legends.push_back("op types");
  }
  if (opts.select.find(kShown[7]) != opts.select.end()) {
    legends.push_back("op occurrence (run|defined)");
  }
  if (opts.select.find(kShown[8]) != opts.select.end()) {
    legends.push_back("input shapes");
  }
  return absl::StrFormat("node name | %s\n", absl::StrJoin(legends, " | "));
}

string TFMultiShow::FormatInputShapes(const MultiGraphNodeProto& proto) const {
  // input_shape string -> (static defined count, run count, run_micros)
  std::map<string, std::tuple<int64_t, int64_t, int64_t>> input_shapes_attr;
  for (int i = 0; i < proto.graph_nodes_size(); ++i) {
    const GraphNodeProto& gnode = proto.graph_nodes(i);
    // Convert and sort by input_idx.
    std::map<int, std::vector<int64_t>> input_shapes;
    for (const auto& inp : gnode.input_shapes()) {
      input_shapes[inp.first] = ShapeProtoToVec(inp.second);
    }

    std::vector<string> input_vec;
    for (const auto& s : input_shapes) {
      if (s.second.empty()) {
        input_vec.push_back(absl::StrFormat("%d:unknown", s.first));
      } else {
        input_vec.push_back(
            absl::StrFormat("%d:%s", s.first, absl::StrJoin(s.second, "x")));
      }
    }
    string shape_type_str =
        absl::StrFormat("input_type: %s", absl::StrJoin(input_vec, ",\t"));
    auto t = input_shapes_attr.find(shape_type_str);
    if (t == input_shapes_attr.end()) {
      input_shapes_attr.insert(
          std::make_pair(shape_type_str, std::make_tuple(0, 0, 0)));
      t = input_shapes_attr.find(shape_type_str);
    }
    input_shapes_attr[shape_type_str] = std::make_tuple(
        std::get<0>(t->second) + 1, std::get<1>(t->second) + gnode.run_count(),
        std::get<2>(t->second) + gnode.exec_micros());
  }
  if (input_shapes_attr.empty()) {
    return "";
  }

  std::vector<std::pair<string, std::tuple<int64_t, int64_t, int64_t>>>
      shape_count_vec(input_shapes_attr.begin(), input_shapes_attr.end());
  std::stable_sort(
      shape_count_vec.begin(), shape_count_vec.end(),
      [](const std::pair<const string, std::tuple<int64, int64, int64>>& a,
         const std::pair<const string, std::tuple<int64, int64, int64>>& b) {
        return std::get<1>(a.second) > std::get<1>(b.second);
      });

  std::vector<string> input_types;
  input_types.reserve(shape_count_vec.size());
  for (const auto& s : shape_count_vec) {
    std::tuple<int64_t, int64_t, int64_t> t = s.second;
    input_types.push_back(absl::StrFormat(
        "%s\t(run*%d|defined*%d)\texec_time: %s", s.first, std::get<1>(t),
        std::get<0>(t), FormatTime(std::get<2>(t))));
  }
  return absl::StrJoin(input_types, "\n");
}

std::vector<string> TFMultiShow::FormatTimes(const ShowMultiNode* node,
                                             const Options& opts) const {
  std::vector<string> attrs;
  if (opts.select.find(kShown[1]) != opts.select.end()) {
    attrs.push_back(FormatTotalExecTime(node, opts));
    attrs.push_back(FormatAcceleratorExecTime(node, opts));
    attrs.push_back(FormatCPUExecTime(node, opts));
  }
  if (opts.select.find(kShown[9]) != opts.select.end() &&
      opts.select.find(kShown[1]) == opts.select.end()) {
    attrs.push_back(FormatAcceleratorExecTime(node, opts));
  }
  if (opts.select.find(kShown[10]) != opts.select.end() &&
      opts.select.find(kShown[1]) == opts.select.end()) {
    attrs.push_back(FormatCPUExecTime(node, opts));
  }
  return attrs;
}

}  // namespace tfprof
}  // namespace tensorflow


text:
Run the current file in iTerm

![Example](http://g.recordit.co/EQPVMJXdQt.gif)

## Support

- [x] RSpec

## Command

**cmd-shift-r** Run the current file in iTerm


text:
package com.ettrema.httpclient;

import java.io.IOException;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.List;
import org.apache.commons.httpclient.Header;
import org.apache.commons.httpclient.methods.EntityEnclosingMethod;
import org.jdom.Document;
import org.jdom.Element;
import org.jdom.JDOMException;
import org.jdom.Namespace;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 *
 * @author mcevoyb
 */
public class PropFindMethod extends EntityEnclosingMethod {

	private static final Logger log = LoggerFactory.getLogger(PropFindMethod.class);
	private static final Namespace NS_CLYDE = Namespace.getNamespace("ns1", "clyde");

	public PropFindMethod(String uri) {
		super(uri);
	}

	@Override
	public String getName() {
		return "PROPFIND";
	}

	public Document getResponseAsDocument() throws IOException {
		InputStream in = getResponseBodyAsStream();
//        IOUtils.copy( in, out );
//        String xml = out.toString();
		try {
			Document document = RespUtils.getJDomDocument(in);
			return document;
		} catch (JDOMException ex) {
			throw new RuntimeException(ex);
		}
	}

	/**
	 *
	 * @return - child responses only, not the requested url
	 */
	public List<Response> getResponses() {
		List<Response> responses = new ArrayList<PropFindMethod.Response>();
		try {
			Header serverDateHeader = this.getResponseHeader("Date");
			String serverDate = null;
			if (serverDateHeader != null) {
				serverDate = serverDateHeader.getValue();
			}
			Document document = getResponseAsDocument();
			if (document == null) {
				return responses;
			}
			Element root = document.getRootElement();
			List<Element> responseEls = RespUtils.getElements(root, "response");
			for (Element el : responseEls) {
				Response resp = new Response(serverDate, el);

				// Dont add if href is the requested url
				if (!this.getURI().getEscapedPath().equals(resp.href)) {
					responses.add(resp);
				}
			}
			return responses;
		} catch (IOException ex) {
			throw new RuntimeException(ex);
		}
	}

	public static class Response {

		final String name;
		final String parentHref;
		final String displayName;
		final String href;
		final String modifiedDate;
		final String createdDate;
		final String serverDate;
		final String contentType;
		final Long contentLength;
		final Long quotaAvailableBytes;
		final Long quotaUsedBytes;
		final Long crc;
		final boolean isCollection;
		final String lockOwner;
		final String lockToken;

		public Response(String serverDate, Element elResponse) {
			this.serverDate = serverDate;
			href = RespUtils.asString(elResponse, "href").trim();
			int pos = href.lastIndexOf("/", 8);
			if (pos > 0) {
				parentHref = href.substring(0, pos - 1);
			} else {
				parentHref = null;
			}

			Element el = elResponse.getChild("propstat", RespUtils.NS_DAV).getChild("prop", RespUtils.NS_DAV);
			if (href.contains("/")) {
				String[] arr = href.split("[/]");
				if (arr.length > 0) {
					name = arr[arr.length - 1];
				} else {
					name = "";
				}
			} else {
				name = href;
			}
			String dn = RespUtils.asString(el, "displayname");
			displayName = (dn == null) ? name : dn;
			createdDate = RespUtils.asString(el, "creationdate");
			modifiedDate = RespUtils.asString(el, "getlastmodified");

			contentType = RespUtils.asString(el, "getcontenttype");
			contentLength = RespUtils.asLong(el, "getcontentlength");
			quotaAvailableBytes = RespUtils.asLong(el, "quota-available-bytes");
			quotaUsedBytes = RespUtils.asLong(el, "quota-used-bytes");
			crc = RespUtils.asLong(el, "crc", NS_CLYDE);
			isCollection = RespUtils.hasChild(el, "collection");

			Element elLockDisc = el.getChild("lockdiscovery", RespUtils.NS_DAV);
			if (elLockDisc != null) {
				Element elActiveLock = elLockDisc.getChild("activelock", RespUtils.NS_DAV);
				if (elActiveLock != null) {
					lockOwner = RespUtils.asString(elActiveLock, "owner");
					Element elToken = elActiveLock.getChild("locktoken", RespUtils.NS_DAV);
					if (elToken != null) {
						String t = RespUtils.asString(elToken, "href");
						if (t != null && t.contains(":")) {
							t = t.substring(t.indexOf(":"));
						}
						lockToken = t;
					} else {
						lockToken = null;
					}
				} else {
					lockOwner = null;
					lockToken = null;
				}
			} else {
				lockOwner = null;
				lockToken = null;
			}
		}
	}
}


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="vertical" >
	<LinearLayout
	    android:id="@+id/linearly1"
	    android:orientation="horizontal"
	    android:layout_width="wrap_content"
	    android:layout_height="wrap_content">
	    <ImageView
	        android:id="@+id/sensor_img_iv"
	        android:layout_width="wrap_content"
	        android:layout_height="wrap_content"/>
	    <TextView
	        android:id="@+id/sensor_name_tv"
	        android:layout_width="wrap_content"
	        android:layout_height="match_parent"
	        android:gravity="center_vertical"
	        android:layout_marginLeft="200dp"
	        android:textColor="@android:color/holo_green_light"
	        android:text=""/>
	    <TextView
	        android:id="@+id/sensor_data_tv"
	        android:layout_width="wrap_content"
	        android:layout_height="match_parent"
	        android:gravity="center_vertical"
	        android:layout_marginLeft="200dp"
	        android:textColor="@android:color/holo_green_light"
	        android:text=""/>
	</LinearLayout>
</LinearLayout>


text:
// Code generated by client-gen. DO NOT EDIT.

package fake

import (
	"context"

	eventsv1 "github.com/google/knative-gcp/pkg/apis/events/v1"
	v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
	labels "k8s.io/apimachinery/pkg/labels"
	schema "k8s.io/apimachinery/pkg/runtime/schema"
	types "k8s.io/apimachinery/pkg/types"
	watch "k8s.io/apimachinery/pkg/watch"
	testing "k8s.io/client-go/testing"
)

// FakeCloudBuildSources implements CloudBuildSourceInterface
type FakeCloudBuildSources struct {
	Fake *FakeEventsV1
	ns   string
}

var cloudbuildsourcesResource = schema.GroupVersionResource{Group: "events.cloud.google.com", Version: "v1", Resource: "cloudbuildsources"}

var cloudbuildsourcesKind = schema.GroupVersionKind{Group: "events.cloud.google.com", Version: "v1", Kind: "CloudBuildSource"}

// Get takes name of the cloudBuildSource, and returns the corresponding cloudBuildSource object, and an error if there is any.
func (c *FakeCloudBuildSources) Get(ctx context.Context, name string, options v1.GetOptions) (result *eventsv1.CloudBuildSource, err error) {
	obj, err := c.Fake.
		Invokes(testing.NewGetAction(cloudbuildsourcesResource, c.ns, name), &eventsv1.CloudBuildSource{})

	if obj == nil {
		return nil, err
	}
	return obj.(*eventsv1.CloudBuildSource), err
}

// List takes label and field selectors, and returns the list of CloudBuildSources that match those selectors.
func (c *FakeCloudBuildSources) List(ctx context.Context, opts v1.ListOptions) (result *eventsv1.CloudBuildSourceList, err error) {
	obj, err := c.Fake.
		Invokes(testing.NewListAction(cloudbuildsourcesResource, cloudbuildsourcesKind, c.ns, opts), &eventsv1.CloudBuildSourceList{})

	if obj == nil {
		return nil, err
	}

	label, _, _ := testing.ExtractFromListOptions(opts)
	if label == nil {
		label = labels.Everything()
	}
	list := &eventsv1.CloudBuildSourceList{ListMeta: obj.(*eventsv1.CloudBuildSourceList).ListMeta}
	for _, item := range obj.(*eventsv1.CloudBuildSourceList).Items {
		if label.Matches(labels.Set(item.Labels)) {
			list.Items = append(list.Items, item)
		}
	}
	return list, err
}

// Watch returns a watch.Interface that watches the requested cloudBuildSources.
func (c *FakeCloudBuildSources) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
	return c.Fake.
		InvokesWatch(testing.NewWatchAction(cloudbuildsourcesResource, c.ns, opts))

}

// Create takes the representation of a cloudBuildSource and creates it.  Returns the server's representation of the cloudBuildSource, and an error, if there is any.
func (c *FakeCloudBuildSources) Create(ctx context.Context, cloudBuildSource *eventsv1.CloudBuildSource, opts v1.CreateOptions) (result *eventsv1.CloudBuildSource, err error) {
	obj, err := c.Fake.
		Invokes(testing.NewCreateAction(cloudbuildsourcesResource, c.ns, cloudBuildSource), &eventsv1.CloudBuildSource{})

	if obj == nil {
		return nil, err
	}
	return obj.(*eventsv1.CloudBuildSource), err
}

// Update takes the representation of a cloudBuildSource and updates it. Returns the server's representation of the cloudBuildSource, and an error, if there is any.
func (c *FakeCloudBuildSources) Update(ctx context.Context, cloudBuildSource *eventsv1.CloudBuildSource, opts v1.UpdateOptions) (result *eventsv1.CloudBuildSource, err error) {
	obj, err := c.Fake.
		Invokes(testing.NewUpdateAction(cloudbuildsourcesResource, c.ns, cloudBuildSource), &eventsv1.CloudBuildSource{})

	if obj == nil {
		return nil, err
	}
	return obj.(*eventsv1.CloudBuildSource), err
}

// UpdateStatus was generated because the type contains a Status member.
// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
func (c *FakeCloudBuildSources) UpdateStatus(ctx context.Context, cloudBuildSource *eventsv1.CloudBuildSource, opts v1.UpdateOptions) (*eventsv1.CloudBuildSource, error) {
	obj, err := c.Fake.
		Invokes(testing.NewUpdateSubresourceAction(cloudbuildsourcesResource, "status", c.ns, cloudBuildSource), &eventsv1.CloudBuildSource{})

	if obj == nil {
		return nil, err
	}
	return obj.(*eventsv1.CloudBuildSource), err
}

// Delete takes name of the cloudBuildSource and deletes it. Returns an error if one occurs.
func (c *FakeCloudBuildSources) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
	_, err := c.Fake.
		Invokes(testing.NewDeleteAction(cloudbuildsourcesResource, c.ns, name), &eventsv1.CloudBuildSource{})

	return err
}

// DeleteCollection deletes a collection of objects.
func (c *FakeCloudBuildSources) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
	action := testing.NewDeleteCollectionAction(cloudbuildsourcesResource, c.ns, listOpts)

	_, err := c.Fake.Invokes(action, &eventsv1.CloudBuildSourceList{})
	return err
}

// Patch applies the patch and returns the patched cloudBuildSource.
func (c *FakeCloudBuildSources) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *eventsv1.CloudBuildSource, err error) {
	obj, err := c.Fake.
		Invokes(testing.NewPatchSubresourceAction(cloudbuildsourcesResource, c.ns, name, pt, data, subresources...), &eventsv1.CloudBuildSource{})

	if obj == nil {
		return nil, err
	}
	return obj.(*eventsv1.CloudBuildSource), err
}


text:
#import <IDEKit/IDEViewController.h>

@class DVTOutlineView, NSArray, NSMutableArray;

@interface IDESourceControlWorkspaceConfigNavigator : IDEViewController
{
    DVTOutlineView *_outlineView;
    NSArray *_selectedObjects;
    NSArray *_workingTrees;
    NSArray *_missingConfigurations;
    NSMutableArray *_currentItems;
    id _finishedUpgradingObserverToken;
}

@property(readonly) NSArray *selectedObjects; // @synthesize selectedObjects=_selectedObjects;
@property(readonly) DVTOutlineView *outlineView; // @synthesize outlineView=_outlineView;
- (void).cxx_destruct;
- (void)primitiveInvalidate;
- (void)outlineViewSelectionDidChange:(id)arg1;
- (id)outlineView:(id)arg1 viewForTableColumn:(id)arg2 item:(id)arg3;
- (BOOL)outlineView:(id)arg1 shouldSelectItem:(id)arg2;
- (BOOL)outlineView:(id)arg1 isGroupItem:(id)arg2;
- (BOOL)outlineView:(id)arg1 shouldShowOutlineCellForItem:(id)arg2;
- (BOOL)outlineView:(id)arg1 isItemExpandable:(id)arg2;
- (id)outlineView:(id)arg1 objectValueForTableColumn:(id)arg2 byItem:(id)arg3;
- (id)outlineView:(id)arg1 child:(long long)arg2 ofItem:(id)arg3;
- (long long)outlineView:(id)arg1 numberOfChildrenOfItem:(id)arg2;
- (void)doubleClickAction:(id)arg1;
@property NSArray *missingConfigurations;
@property NSArray *workingTrees;
- (void)viewDidInstall;

@end


text:
module Install
  module Ui
    def self.included(thor)
      thor.class_eval do

        desc 'generate_ui_controller', 'Generate the ui controller'
        def generate_ui_controller
          copy_file 'ui/ui_controller.rb', 'app/controllers/ui_controller.rb'
        end

        desc 'generate_index', 'Generate index view'
        def generate_index
          copy_file 'ui/index.html.haml', 'app/views/ui/index.html.haml'
        end

        desc 'setup_route', 'Add route code to routes config'
        def setup_route
          inject_into_file 'config/routes.rb', after: "Rails.application.routes.draw do\n" do <<-CODE
  root 'ui#index'

  # Requires an application restart everytime a new page is added.
  Dir.glob('app/views/ui/*.html.haml').sort.each do |file|
    action = File.basename(file,'.html.haml')
    get \"ui/\#{action}\", controller: 'ui', action: action
  end
CODE
          end
        end

        desc 'setup_ui', 'Generate UI route, controller and view setup'
        def setup_ui
          generate_ui_controller
          generate_index
          setup_route
        end

      end
    end
  end
end


text:
package cn.itganhuo.app.common;

import org.junit.Test;

public class TestAes {

	String key = "362C1E982014B30D73DFCEAE0A";

	@Test
	public void testEncrypt() {
		//生成MySQL驱动信息
		System.out.println(Aes.parseByte2HexStr(Aes.encrypt("com.mysql.jdbc.Driver", key)));

		//生成本地数据库连接信息
		System.out.println(Aes.parseByte2HexStr(Aes.encrypt("jdbc:mysql://10.162.103.166/itganhuo?useUnicode=true&characterEncoding=utf-8", key)));
		System.out.println(Aes.parseByte2HexStr(Aes.encrypt("root", key)));

		//生成公共测试库连接信息
		System.out.println(Aes.parseByte2HexStr(Aes.encrypt("jdbc:mysql://114.215.171.211:3306/test?useUnicode=true&characterEncoding=utf-8", key)));
		System.out.println(Aes.parseByte2HexStr(Aes.encrypt("test", key)));
	}
}


text:
namespace Azure.ResourceManager.Compute.Models
{
    /// <summary> The properties describe the recommended machine configuration for this Image Definition. These properties are updatable. </summary>
    public partial class RecommendedMachineConfiguration
    {
        /// <summary> Initializes a new instance of RecommendedMachineConfiguration. </summary>
        public RecommendedMachineConfiguration()
        {
        }

        /// <summary> Initializes a new instance of RecommendedMachineConfiguration. </summary>
        /// <param name="vCPUs"> Describes the resource range. </param>
        /// <param name="memory"> Describes the resource range. </param>
        internal RecommendedMachineConfiguration(ResourceRange vCPUs, ResourceRange memory)
        {
            VCPUs = vCPUs;
            Memory = memory;
        }

        /// <summary> Describes the resource range. </summary>
        public ResourceRange VCPUs { get; set; }
        /// <summary> Describes the resource range. </summary>
        public ResourceRange Memory { get; set; }
    }
}


text:
namespace gtx {

// Generates a unique identifier for `element`, represented as a string.
// `hierarchy` is the accessibility hierarchy containing `element`.
using ResourceIdGenerator =
    std::function<std::string(const UIElementProto &element,
                              const AccessibilityHierarchyProto &hierarchy)>;
}  // namespace gtx

#endif


text:
namespace staple {

CompilerContext::CompilerContext()
  : outputFile("-"), rootNode(NULL), generateDebugSymobols(false) {

}

void CompilerContext::setInputFile(const File& file) {
  inputFile = file;
}

void CompilerContext::setOutputFile(const std::string& str) {
  outputFile = str;
}

void CompilerContext::addIncludeDir(const File& file) {
  includeDirs.push_back(file);
}

bool CompilerContext::parse() {
  bool retval = parserContext.parse(inputFile);
  if(retval) {
    rootNode = parserContext.rootNode;
    rootNode->mFile = inputFile;
  }
  return retval;
}

void CompilerContext::addError(const std::string& message, uint32_t line, uint32_t column) {
  FileLocation location(inputFile, line, column);
  CompilerMessage msg(CompilerMessage::Type::ERROR, message, location);
  mMessages.push_back(msg);
}

void CompilerContext::addError(const std::string& message, const FileLocation& location) {
  CompilerMessage msg(CompilerMessage::Type::ERROR, message, location);
  mMessages.push_back(msg);
}

bool CompilerContext::hasErrors() const {
  for(const CompilerMessage& msg : mMessages) {
    if(msg.mType == CompilerMessage::Type::ERROR) {
      return true;
    }
  }
  return false;
}

} // namespace staple


text:
#ifndef _MKDIO_D
#define _MKDIO_D

#include <stdio.h>

typedef void MMIOT;

/* line builder for markdown()
 */
MMIOT *mkd_in(FILE*,int);		/* assemble input from a file */
MMIOT *mkd_string(char*,int,int);	/* assemble input from a buffer */

void mkd_basename(MMIOT*,char*);

/* compilation, debugging, cleanup
 */
int mkd_compile(MMIOT*, int);
int mkd_cleanup(MMIOT*);

/* markup functions
 */
int mkd_dump(MMIOT*, FILE*, int, char*);
int markdown(MMIOT*, FILE*, int);
int mkd_line(char *, int, char **, int);
void mkd_string_to_anchor(char *, int, int (*)(int,void*), void*);
int mkd_xhtmlpage(MMIOT*,int,FILE*);

/* header block access
 */
char* mkd_doc_title(MMIOT*);
char* mkd_doc_author(MMIOT*);
char* mkd_doc_date(MMIOT*);

/* compiled data access
 */
int mkd_document(MMIOT*, char**);
int mkd_toc(MMIOT*, char**);
int mkd_css(MMIOT*, char **);
int mkd_xml(char *, int, char **);

/* write-to-file functions
 */
int mkd_generatehtml(MMIOT*,FILE*);
int mkd_generatetoc(MMIOT*,FILE*);
int mkd_generatexml(char *, int,FILE*);
int mkd_generatecss(MMIOT*,FILE*);
#define mkd_style mkd_generatecss
int mkd_generateline(char *, int, FILE*, int);
#define mkd_text mkd_generateline

/* url generator callbacks
 */
typedef char * (*mkd_callback_t)(const char*, const int, void*);
typedef void   (*mkd_free_t)(char*, void*);

void mkd_e_url(void *, mkd_callback_t);
void mkd_e_flags(void *, mkd_callback_t);
void mkd_e_free(void *, mkd_free_t );
void mkd_e_data(void *, void *);

/* version#.
 */
extern char markdown_version[];

/* special flags for markdown() and mkd_text()
 */
#define MKD_NOLINKS	0x0001	/* don't do link processing, block <a> tags  */
#define MKD_NOIMAGE	0x0002	/* don't do image processing, block <img> */
#define MKD_NOPANTS	0x0004	/* don't run smartypants() */
#define MKD_NOHTML	0x0008	/* don't allow raw html through AT ALL */
#define MKD_STRICT	0x0010	/* disable SUPERSCRIPT, RELAXED_EMPHASIS */
#define MKD_TAGTEXT	0x0020	/* process text inside an html tag; no
				 * <em>, no <bold>, no html or [] expansion */
#define MKD_NO_EXT	0x0040	/* don't allow pseudo-protocols */
#define MKD_CDATA	0x0080	/* generate code for xml ![CDATA[...]] */
#define MKD_NOTABLES	0x0400	/* disallow tables */
#define MKD_TOC		0x1000	/* do table-of-contents processing */
#define MKD_1_COMPAT	0x2000	/* compatability with MarkdownTest_1.0 */
#define MKD_AUTOLINK	0x4000	/* make http://foo.com link even without <>s */
#define MKD_SAFELINK	0x8000	/* paranoid check for link protocol */
#define MKD_EMBED	MKD_NOLINKS|MKD_NOIMAGE|MKD_TAGTEXT

/* special flags for mkd_in() and mkd_string()
 */
#define MKD_NOHEADER	0x0100	/* don't process header blocks */
#define MKD_TABSTOP	0x0200	/* expand tabs to 4 spaces */

#endif/*_MKDIO_D*/


text:
layout: post
title: "Buttler for Trello"
posturl: https://butlerfortrello.com/
tags:
- Product
- Trello
- Assistant
- Productivity
---

{% include post_info_header.md %}

Personal productivity is ripe for innovation with AI tech. This Trello automation tool seems promising - while most features are just a some cool automation that the user can define the best feature seems to be the smart generation of automation options. Most often it's not obvious what actions could be done faster to most people, so this one seems hugely useful. (I use Trello all the time).

<!--more-->
{% include post_info_footer.md %}


text:
{% if object.vernacular_name %}

  {{ object.vernacular_name }}

{% endif %}

{% if object.vernacular_names and object.vernacular_names != object.vernacular_name %}

  {{ object.vernacular_names }}

{% endif %}


text:
import pytest

import openpathsampling as paths
import numpy as np

from openpathsampling.engines.external_snapshots.snapshot import (
    ExternalMDSnapshot, InternalizedMDSnapshot
)
from openpathsampling.engines.snapshot import SnapshotDescriptor

from openpathsampling.engines.external_engine import \
        _InternalizedEngineProxy

class MockEngine(object):
    SnapshotClass = ExternalMDSnapshot
    InternalizedSnapshotClass = InternalizedMDSnapshot
    def __init__(self, sequences, sleep_ms=0):
        self.sequences = sequences
        self.sleep_ms = sleep_ms
        self.descriptor = SnapshotDescriptor.construct(
            snapshot_class=ExternalMDSnapshot,
            snapshot_dimensions={'n_spatial': 2, 'n_atoms': 1}
        )
        self.internalized_engine = _InternalizedEngineProxy(self)

    def read_frame_data(self, filename, position):
        return self.sequences[filename][position]

class ErrorMockEngine(MockEngine):
    """Mock engine used to create the IndexError in load_details"""
    def __init__(self, sequences, sleep_ms=0):
        super(ErrorMockEngine, self).__init__(sequences, sleep_ms)
        self._sequences = self.sequences
        self.sequences = {k: [] for k in self.sequences}
        self.accessed = False

    def read_frame_data(self, filename, position):
        if self.accessed:
            self.sequences = self._sequences

        self.accessed = True
        return super(ErrorMockEngine, self).read_frame_data(filename,
                                                            position)

class TestExternalMDSnapshot(object):
    def setup(self):
        self.box = np.array([[1.0, 0.0], [0.0, 1.0]])
        self.vel = np.array([[1.0, 0.0]])

        self.engine = MockEngine(
            sequences={
                'foo': [(np.array([[0.0, 0.0]]), self.vel, self.box),
                        (np.array([[0.1, 0.0]]), self.vel, self.box),
                        (np.array([[0.2, 0.0]]), self.vel, self.box)]
            },
            sleep_ms=0.0
        )
        self.snapshots = [
            ExternalMDSnapshot(file_name='foo',
                               file_position=i,
                               engine=self.engine)
            for i in range(3)
        ]

    def test_init(self):
        for (i, snap) in enumerate(self.snapshots):
            assert snap._reversed is None
            assert snap.file_name == "foo"
            assert snap.file_position == i
            assert snap.engine == self.engine
            assert snap.velocity_direction == 1

    def test_load_details(self):
        for (i, snap) in enumerate(self.snapshots):
            snap.load_details()
            expected_xyz = np.array([[0.1 * i, 0.0]])
            expected_vel = np.array([[1.0, 0.0]])
            np.testing.assert_array_equal(snap._xyz, expected_xyz)
            np.testing.assert_array_equal(snap._velocities, expected_vel)
            np.testing.assert_array_equal(snap._box_vectors, self.box)

    def test_load_details_indexerror(self):
        engine = ErrorMockEngine(self.engine.sequences)
        snap = ExternalMDSnapshot(file_name='foo',
                                  file_position=0,
                                  engine=engine)
        snap.load_details()
        np.testing.assert_array_equal(snap._xyz, np.array([[0.0, 0.0]]))
        np.testing.assert_array_equal(snap._velocities, self.vel)
        np.testing.assert_array_equal(snap._box_vectors, self.box)

    def test_load_details_recursionerror(self):
        bad_snap = ExternalMDSnapshot(file_name='foo',
                                      file_position=3,
                                      engine=self.engine)
        with pytest.raises(RuntimeError):
            bad_snap.load_details()

    def test_set_details(self):
        xyz = np.array([[1.0, 1.0]])
        vel = np.array([[2.0, 2.0]])
        snap = ExternalMDSnapshot(file_name='bar', file_position=0)
        snap.set_details(xyz=xyz, velocities=vel, box_vectors=self.box)
        np.testing.assert_array_equal(snap._xyz, xyz)
        np.testing.assert_array_equal(snap._velocities, vel)
        np.testing.assert_array_equal(snap._box_vectors, self.box)

    def test_set_details_exists(self):
        snap = self.snapshots[0]
        with pytest.raises(RuntimeError):
            snap.set_details(xyz=np.array([[1.0, 1.0]]),
                             velocities=self.vel,
                             box_vectors=self.box)

    def test_clear_cache(self):
        snap = self.snapshots[0]
        snap.load_details()
        assert snap._xyz is not None
        assert snap._velocities is not None
        assert snap._box_vectors is not None
        snap.clear_cache()
        assert snap._xyz is None
        assert snap._velocities is None
        assert snap._box_vectors is None

    def test_reversed(self):
        traj = paths.Trajectory(self.snapshots)
        traj_rev = traj.reversed
        for idx in range(len(traj)):
            snap = traj[idx]
            snap_rev = traj_rev[-idx-1]
            np.testing.assert_array_equal(snap.xyz, snap_rev.xyz)
            np.testing.assert_array_equal(snap.box_vectors,
                                          snap_rev.box_vectors)
            assert snap.velocity_direction == 1
            assert snap_rev.velocity_direction == -1
            np.testing.assert_array_equal(snap.velocities,
                                          -snap_rev.velocities)

            assert snap._reversed == snap_rev
            assert snap_rev._reversed == snap

    def test_internalize(self):
        snap = self.snapshots[0]
        internal = snap.internalize()
        np.testing.assert_array_equal(snap.xyz, internal.xyz)
        np.testing.assert_array_equal(snap.velocities, internal.velocities)
        np.testing.assert_array_equal(snap.box_vectors, internal.box_vectors)

        # the way to do it for a trajectory
        traj_i = paths.Trajectory([s.internalize() for s in self.snapshots])
        traj_e = paths.Trajectory(self.snapshots)
        np.testing.assert_array_equal(traj_i.xyz, traj_e.xyz)


text:
package org.apache.hadoop.ha;

import java.io.File;
import java.io.IOException;
import java.util.List;

import org.apache.hadoop.classification.InterfaceAudience;
import org.apache.hadoop.HadoopIllegalArgumentException;
import org.apache.zookeeper.ZooDefs;
import org.apache.zookeeper.data.ACL;
import org.apache.zookeeper.data.Id;

import com.google.common.base.Charsets;
import com.google.common.base.Splitter;
import com.google.common.collect.Lists;
import com.google.common.io.Files;

/**
 * Utilities for working with ZooKeeper.
 */
@InterfaceAudience.Private
public class HAZKUtil {

  /**
   * Parse ACL permission string, partially borrowed from
   * ZooKeeperMain private method
   */
  private static int getPermFromString(String permString) {
    int perm = 0;
    for (int i = 0; i < permString.length(); i++) {
      char c = permString.charAt(i);
      switch (c) {
      case 'r':
        perm |= ZooDefs.Perms.READ;
        break;
      case 'w':
        perm |= ZooDefs.Perms.WRITE;
        break;
      case 'c':
        perm |= ZooDefs.Perms.CREATE;
        break;
      case 'd':
        perm |= ZooDefs.Perms.DELETE;
        break;
      case 'a':
        perm |= ZooDefs.Perms.ADMIN;
        break;
      default:
        throw new BadAclFormatException(
            "Invalid permission '" + c + "' in permission string '" +
            permString + "'");
      }
    }
    return perm;
  }

  /**
   * Parse comma separated list of ACL entries to secure generated nodes, e.g.
   * sasl:hdfs/host1@MY.DOMAIN:cdrwa,sasl:hdfs/host2@MY.DOMAIN:cdrwa
   *
   * @return ACL list
   * @throws HadoopIllegalArgumentException if an ACL is invalid
   */
  public static List<ACL> parseACLs(String aclString) {
    List<ACL> acl = Lists.newArrayList();
    if (aclString == null) {
      return acl;
    }

    List<String> aclComps = Lists.newArrayList(
        Splitter.on(',').omitEmptyStrings().trimResults()
        .split(aclString));
    for (String a : aclComps) {
      // from ZooKeeperMain private method
      int firstColon = a.indexOf(':');
      int lastColon = a.lastIndexOf(':');
      if (firstColon == -1 || lastColon == -1 || firstColon == lastColon) {
        throw new BadAclFormatException(
            "ACL '" + a + "' not of expected form scheme:id:perm");
      }

      ACL newAcl = new ACL();
      newAcl.setId(new Id(a.substring(0, firstColon), a.substring(
          firstColon + 1, lastColon)));
      newAcl.setPerms(getPermFromString(a.substring(lastColon + 1)));
      acl.add(newAcl);
    }

    return acl;
  }

  /**
   * Parse a comma-separated list of authentication mechanisms. Each
   * such mechanism should be of the form 'scheme:auth' -- the same
   * syntax used for the 'addAuth' command in the ZK CLI.
   *
   * @param authString the comma-separated auth mechanisms
   * @return a list of parsed authentications
   */
  public static List<ZKAuthInfo> parseAuth(String authString) {
    List<ZKAuthInfo> ret = Lists.newArrayList();
    if (authString == null) {
      return ret;
    }

    List<String> authComps = Lists.newArrayList(
        Splitter.on(',').omitEmptyStrings().trimResults()
        .split(authString));

    for (String comp : authComps) {
      String parts[] = comp.split(":", 2);
      if (parts.length != 2) {
        throw new BadAuthFormatException(
            "Auth '" + comp + "' not of expected form scheme:auth");
      }
      ret.add(new ZKAuthInfo(parts[0],
          parts[1].getBytes(Charsets.UTF_8)));
    }
    return ret;
  }

  /**
   * Because ZK ACLs and authentication information may be secret,
   * allow the configuration values to be indirected through a file
   * by specifying the configuration as "@/path/to/file". If this
   * syntax is used, this function will return the contents of the file
   * as a String.
   *
   * @param valInConf the value from the Configuration
   * @return either the same value, or the contents of the referenced
   * file if the configured value starts with "@"
   * @throws IOException if the file cannot be read
   */
  public static String resolveConfIndirection(String valInConf)
      throws IOException {
    if (valInConf == null) return null;
    if (!valInConf.startsWith("@")) {
      return valInConf;
    }
    String path = valInConf.substring(1).trim();
    return Files.toString(new File(path), Charsets.UTF_8).trim();
  }

  /**
   * An authentication token passed to ZooKeeper.addAuthInfo
   */
  static class ZKAuthInfo {
    private final String scheme;
    private final byte[] auth;

    public ZKAuthInfo(String scheme, byte[] auth) {
      super();
      this.scheme = scheme;
      this.auth = auth;
    }

    String getScheme() {
      return scheme;
    }

    byte[] getAuth() {
      return auth;
    }
  }

  static class BadAclFormatException extends HadoopIllegalArgumentException {
    private static final long serialVersionUID = 1L;

    public BadAclFormatException(String message) {
      super(message);
    }
  }

  static class BadAuthFormatException extends HadoopIllegalArgumentException {
    private static final long serialVersionUID = 1L;

    public BadAuthFormatException(String message) {
      super(message);
    }
  }

}


text:
import _ from "lodash";
import {
  RECEIVE_OBSERVATIONS,
  UPDATE_OBSERVATION_IN_COLLECTION,
  UPDATE_ALL_LOCAL,
  SET_REVIEWING,
  SET_PLACES_BY_ID,
  SET_LAST_REQUEST_AT
} from "../actions";

const observationsReducer = ( state = {
  results: [],
  reviewing: false,
  placesByID: {},
  lastRequestAt: null
}, action ) => {
  if ( action.type === RECEIVE_OBSERVATIONS ) {
    return Object.assign( {}, state, {
      totalResults: action.totalResults,
      page: action.page,
      totalPages: action.totalPages,
      results: action.results
    } );
  }
  if ( action.type === UPDATE_OBSERVATION_IN_COLLECTION ) {
    const newState = Object.assign( {}, state, {
      results: _.cloneDeep( state.results ).map( obs => {
        if ( obs.id !== action.observation.id ) {
          return obs;
        }
        const newObs = _.cloneDeep( obs );
        _.forOwn( action.changes, ( v, k ) => {
          newObs[k] = v;
        } );
        return newObs;
      } )
    } );
    return newState;
  }
  if ( action.type === UPDATE_ALL_LOCAL ) {
    const newState = Object.assign( {}, state, {
      results: _.cloneDeep( state.results ).map( obs => {
        const newObs = _.cloneDeep( obs );
        _.forOwn( action.changes, ( v, k ) => {
          newObs[k] = v;
        } );
        return newObs;
      } )
    } );
    return newState;
  }
  if ( action.type === SET_REVIEWING ) {
    const newState = Object.assign( {}, state, {
      reviewing: action.reviewing
    } );
    return newState;
  }
  if ( action.type === SET_PLACES_BY_ID ) {
    const newState = Object.assign( {}, state, {
      placesByID: Object.assign( state.placesByID, action.placesByID )
    } );
    return newState;
  }
  if ( action.type === SET_LAST_REQUEST_AT ) {
    return Object.assign( {}, state, {
      lastRequestAt: action.lastRequestAt
    } );
  }
  return state;
};

export default observationsReducer;


text:
package com.lee.main.view.container;

import android.os.Bundle;

import com.lee.base.activity.BaseActivity;
import com.lee.main.R;
import com.lee.utils.screen.ScreenUtil;

/**
 * Drawer Container Activity
 * </p>
 * Created by LiYang on 2017/3/6.
 */

public class DrawerContainerActivity extends BaseActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_drawer_container);

        int screenWidth = ScreenUtil.getScreenWidth(this);
        int screenHeight = ScreenUtil.getScreenHeight(this);

        DrawerContainerView homeContainer = (DrawerContainerView)findViewById(R.id.drawer_container_view);
        homeContainer.setViewSize(screenWidth, screenHeight);
//        homeContainer.setContainerStateListener(containerStateListener);
        homeContainer.initPullDownLayout(screenHeight);
        homeContainer.initPullUpLayout(screenHeight);
        homeContainer.initSlideLeftLayout(screenWidth);
        homeContainer.initMask();
    }
}


text:
package org.springframework.cloud.netflix.ribbon;

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

import org.springframework.beans.factory.annotation.Value;

/**
 * Annotation at the field or method/constructor parameter level that injects the Ribbon
 * Client Name that got allocated at runtime. Provides a convenient alternative for
 * <code>@Value("${ribbon.client.name}")</code>.
 *
 * @author Spencer Gibb
 * @since 2.0.0
 */
@Target({ ElementType.FIELD, ElementType.METHOD, ElementType.PARAMETER,
		ElementType.ANNOTATION_TYPE })
@Retention(RetentionPolicy.RUNTIME)
@Documented
@Value("${ribbon.client.name}")
public @interface RibbonClientName {

}


text:
package clusterresourcequota

import (
	"fmt"

	"k8s.io/apimachinery/pkg/fields"
	"k8s.io/apimachinery/pkg/labels"
	"k8s.io/apimachinery/pkg/runtime"
	"k8s.io/apimachinery/pkg/util/validation/field"
	apirequest "k8s.io/apiserver/pkg/endpoints/request"
	"k8s.io/apiserver/pkg/storage"
	kapi "k8s.io/kubernetes/pkg/api"

	"github.com/openshift/origin/pkg/quota/api"
	"github.com/openshift/origin/pkg/quota/api/validation"
)

type strategy struct {
	runtime.ObjectTyper
}

var Strategy = strategy{kapi.Scheme}

func (strategy) NamespaceScoped() bool {
	return false
}

func (strategy) AllowCreateOnUpdate() bool {
	return false
}

func (strategy) AllowUnconditionalUpdate() bool {
	return false
}

func (strategy) GenerateName(base string) string {
	return base
}

func (strategy) PrepareForCreate(ctx apirequest.Context, obj runtime.Object) {
	quota := obj.(*api.ClusterResourceQuota)
	quota.Status = api.ClusterResourceQuotaStatus{}
}

// PrepareForUpdate clears fields that are not allowed to be set by end users on update.
func (strategy) PrepareForUpdate(ctx apirequest.Context, obj, old runtime.Object) {
	curr := obj.(*api.ClusterResourceQuota)
	prev := old.(*api.ClusterResourceQuota)

	curr.Status = prev.Status
}

// Canonicalize normalizes the object after validation.
func (strategy) Canonicalize(obj runtime.Object) {
}

func (strategy) Validate(ctx apirequest.Context, obj runtime.Object) field.ErrorList {
	return validation.ValidateClusterResourceQuota(obj.(*api.ClusterResourceQuota))
}

func (strategy) ValidateUpdate(ctx apirequest.Context, obj, old runtime.Object) field.ErrorList {
	return validation.ValidateClusterResourceQuotaUpdate(obj.(*api.ClusterResourceQuota), old.(*api.ClusterResourceQuota))
}

// GetAttrs returns labels and fields of a given object for filtering purposes
func GetAttrs(obj runtime.Object) (labels.Set, fields.Set, error) {
	quota, ok := obj.(*api.ClusterResourceQuota)
	if !ok {
		return nil, nil, fmt.Errorf("not a ClusterResourceQuota")
	}
	return labels.Set(quota.ObjectMeta.Labels), api.ClusterResourceQuotaToSelectableFields(quota), nil
}

// Matcher returns a generic matcher for a given label and field selector.
func Matcher(label labels.Selector, field fields.Selector) storage.SelectionPredicate {
	return storage.SelectionPredicate{
		Label:    label,
		Field:    field,
		GetAttrs: GetAttrs,
	}
}

type statusStrategy struct {
	runtime.ObjectTyper
}

var StatusStrategy = statusStrategy{kapi.Scheme}

func (statusStrategy) NamespaceScoped() bool {
	return false
}

func (statusStrategy) AllowCreateOnUpdate() bool {
	return false
}

func (statusStrategy) AllowUnconditionalUpdate() bool {
	return false
}

func (statusStrategy) GenerateName(base string) string {
	return base
}

func (statusStrategy) PrepareForCreate(ctx apirequest.Context, obj runtime.Object) {
}

func (statusStrategy) PrepareForUpdate(ctx apirequest.Context, obj, old runtime.Object) {
	curr := obj.(*api.ClusterResourceQuota)
	prev := old.(*api.ClusterResourceQuota)

	curr.Spec = prev.Spec
}

func (statusStrategy) Canonicalize(obj runtime.Object) {
}

func (statusStrategy) Validate(ctx apirequest.Context, obj runtime.Object) field.ErrorList {
	return validation.ValidateClusterResourceQuota(obj.(*api.ClusterResourceQuota))
}

func (statusStrategy) ValidateUpdate(ctx apirequest.Context, obj, old runtime.Object) field.ErrorList {
	return validation.ValidateClusterResourceQuotaUpdate(obj.(*api.ClusterResourceQuota), old.(*api.ClusterResourceQuota))
}


text:
dir=$(dirname ${0})
cd ${dir}/../..

if [ -z "$version" ]
then
    echo 'version not set'
    version=`mvn org.apache.maven.plugins:maven-help-plugin:2.1.1:evaluate -Dexpression=project.version |  grep -E '^[0-9]+\.[0-9]+\.[0-9]+' `
fi
echo "version ${version}"
export version

sh build/script/prepare-libs.sh || { exit 1; }

cp server/target/kylin-server-${version}.war build/tomcat/webapps/kylin.war
chmod 644 build/tomcat/webapps/kylin.war

echo "add js css to war"
if [ ! -d "webapp/dist" ]
then
    echo "error generate js files"
    exit 1
fi

cd webapp/dist
for f in * .[!.]*
do
    echo "Adding $f to war"
    jar -uf ../../build/tomcat/webapps/kylin.war $f
done


text:
import collections
import itertools

import mock

from sahara.service.validations.edp import job as j
from sahara.service.validations.edp import job_execution_schema as j_e_schema
from sahara.service.validations.edp import job_interface as j_i
from sahara.service.validations.edp import job_schema as j_schema
from sahara.tests.unit.service.validation import utils as u
from sahara.utils import edp

def _configs(**kwargs):
    arg = {
        "name": "Reducer Count",
        "mapping_type": "configs",
        "location": "mapred.reduce.tasks",
        "value_type": "number",
        "required": True,
        "default": "1"
    }
    arg.update(kwargs)
    return arg

def _params(**kwargs):
    arg = {
        "name": "Input Path",
        "mapping_type": "params",
        "location": "INPUT",
        "value_type": "data_source",
        "required": False,
        "default": "hdfs://path"
    }
    arg.update(kwargs)
    return arg

def _args(**kwargs):
    arg = {
        "name": "Positional Argument",
        "mapping_type": "args",
        "location": "0",
        "value_type": "string",
        "required": False,
        "default": "arg_value"
    }
    arg.update(kwargs)
    return arg

_mapping_types = {"configs", "args", "params"}

def _job(job_type, interface):
    return {"name": "job", "type": job_type, "interface": interface}

_job_types = [
    _job(edp.JOB_TYPE_HIVE, [_configs(), _params()]),
    _job(edp.JOB_TYPE_PIG, [_configs(), _params(), _args()]),
    _job(edp.JOB_TYPE_MAPREDUCE, [_configs()]),
    _job(edp.JOB_TYPE_MAPREDUCE_STREAMING, [_configs()]),
    _job(edp.JOB_TYPE_JAVA, [_configs(), _args()]),
    _job(edp.JOB_TYPE_SHELL, [_configs(), _params(), _args()]),
    _job(edp.JOB_TYPE_SPARK, [_configs(), _args()]),
    _job(edp.JOB_TYPE_STORM, [_args()])
]

class TestJobInterfaceValidation(u.ValidationTestCase):

    def setUp(self):
        super(TestJobInterfaceValidation, self).setUp()
        self._create_object_fun = j.check_interface
        self.scheme = j_schema.JOB_SCHEMA

    def test_interface(self):
        for job in _job_types:
            self._assert_create_object_validation(data=job)

    def test_no_interface(self):
        job = _job(edp.JOB_TYPE_PIG, None)
        self._assert_create_object_validation(data=job)

    def test_overlapping_names(self):
        job = _job(edp.JOB_TYPE_PIG,
                   [_configs(), _configs(location="mapred.map.tasks")])
        self._assert_create_object_validation(
            data=job, bad_req_i=(
                1, "INVALID_DATA",
                "Name must be unique within the interface for any job."))

    def test_unacceptable_types(self):
        for job in _job_types:
            acceptable_types = [arg['mapping_type']
                                for arg in job['interface']]
            unacceptable_types = _mapping_types - set(acceptable_types)
            unacceptable_args = (globals()["_" + m_type]()
                                 for m_type in unacceptable_types)
            bad_job = job.copy()
            for arg in unacceptable_args:
                bad_job['interface'] = [arg]
                permutations = itertools.permutations(acceptable_types)
                msgs = ["Only mapping types %s are allowed for job type %s." %
                        (list(permutation), bad_job['type'])
                        for permutation in permutations]
                self._assert_create_object_validation(
                    data=bad_job, bad_req_i=(1, "INVALID_DATA", msgs))

    def test_bad_positional_arg_locations(self):
        job = _job(edp.JOB_TYPE_PIG, [_args(location="1")])
        self._assert_create_object_validation(
            data=job, bad_req_i=(
                1, "INVALID_DATA",
                "Locations of positional arguments must be an unbroken "
                "integer sequence ascending from 0."))

        job = _job(edp.JOB_TYPE_PIG, [_args(location="fish")])
        self._assert_create_object_validation(
            data=job, bad_req_i=(
                1, "INVALID_DATA",
                "Locations of positional arguments must be an unbroken "
                "integer sequence ascending from 0."))

        job = _job(edp.JOB_TYPE_PIG,
                   [_args(), _args(location="2", name="Argument 2")])
        self._assert_create_object_validation(
            data=job, bad_req_i=(
                1, "INVALID_DATA",
                "Locations of positional arguments must be an unbroken "
                "integer sequence ascending from 0."))

    def test_required_positional_arg_without_default(self):
        arg = _args(required=False)
        del arg['default']
        job = _job(edp.JOB_TYPE_PIG, [arg])
        self._assert_create_object_validation(
            data=job, bad_req_i=(
                1, "INVALID_DATA",
                "Positional arguments must be given default values if they "
                "are not required."))

    def test_overlapping_locations(self):
        job = _job(edp.JOB_TYPE_PIG,
                   [_configs(), _configs(name="Mapper Count")])
        self._assert_create_object_validation(
            data=job, bad_req_i=(
                1, "INVALID_DATA",
                "The combination of mapping type and location must be unique "
                "within the interface for any job."))

    def test_number_values(self):
        job = _job(edp.JOB_TYPE_PIG, [_configs(default="fish")])
        self._assert_create_object_validation(
            data=job, bad_req_i=(
                1, "INVALID_DATA",
                "Value 'fish' is not a valid number."))

    @mock.patch('sahara.conductor.API.data_source_get')
    def test_data_source_values(self, data_source):
        data_source.return_value = True
        job = _job(edp.JOB_TYPE_PIG,
                   [_params(default="DEADBEEF-DEAD-BEEF-DEAD-BEEFDEADBEEF")])
        self._assert_create_object_validation(data=job)

        data_source.return_value = False
        self._assert_create_object_validation(
            data=job, bad_req_i=(
                1, "INVALID_REFERENCE",
                "DataSource with id 'DEADBEEF-DEAD-BEEF-DEAD-BEEFDEADBEEF' "
                "doesn't exist"))

        job = _job(edp.JOB_TYPE_PIG, [_params(default="Filial Piety")])
        self._assert_create_object_validation(
            data=job, bad_req_i=(
                1, "INVALID_DATA",
                "Data source value 'Filial Piety' is neither a valid data "
                "source ID nor a valid URL."))

    def test_default_data_type(self):
        param = _params()
        del param['value_type']
        job = _job(edp.JOB_TYPE_PIG, [param])
        self._assert_create_object_validation(data=job)
        assert param['value_type'] == j_i.DEFAULT_DATA_TYPE

int_arg = collections.namedtuple("int_arg",
                                 ["name", "mapping_type", "location",
                                  "value_type", "required", "default"])

def j_e_i_wrapper(data):
    job = mock.Mock(
        interface=[int_arg(**_configs()),
                   int_arg(**_args()),
                   int_arg(**_params())]
    )
    j_i.check_execution_interface(data, job)

class TestJobExecutionInterfaceValidation(u.ValidationTestCase):

    def setUp(self):
        super(TestJobExecutionInterfaceValidation, self).setUp()
        self._create_object_fun = j_e_i_wrapper
        self.scheme = j_e_schema.JOB_EXEC_SCHEMA

    def test_valid_execution(self):
        data = {"cluster_id": "DEADBEEF-DEAD-BEEF-DEAD-BEEFDEADBEEF",
                "interface": {"Reducer Count": "2",
                              "Input Path": "swift://path",
                              "Positional Argument": "value"}}
        self._assert_create_object_validation(data=data)

    def test_no_execution_interface(self):
        data = {"cluster_id": "DEADBEEF-DEAD-BEEF-DEAD-BEEFDEADBEEF"}
        self._assert_create_object_validation(data=data, bad_req_i=(
            1, "INVALID_DATA",
            "An interface was specified with the template for this job. "
            "Please pass an interface map with this job (even if empty)."))

    def test_bad_argument_name(self):
        data = {"cluster_id": "DEADBEEF-DEAD-BEEF-DEAD-BEEFDEADBEEF",
                "interface": {"Fish": "Rainbow Trout",
                              "Reducer Count": "2",
                              "Input Path": "swift://path"}}
        self._assert_create_object_validation(data=data, bad_req_i=(
            1, "INVALID_DATA", "Argument names: ['Fish'] were not found in "
                               "the interface for this job."))

    def test_required_argument_missing(self):
        data = {"cluster_id": "DEADBEEF-DEAD-BEEF-DEAD-BEEFDEADBEEF",
                "interface": {"Positional Argument": "Value"}}
        self._assert_create_object_validation(data=data, bad_req_i=(
            1, "INVALID_DATA", "Argument names: ['Reducer Count'] are "
                               "required for this job."))

    @mock.patch('sahara.conductor.API.data_source_get')
    def test_bad_values(self, data_source):
        data = {"cluster_id": "DEADBEEF-DEAD-BEEF-DEAD-BEEFDEADBEEF",
                "interface": {"Reducer Count": "Two"}}
        self._assert_create_object_validation(data=data, bad_req_i=(
            1, "INVALID_DATA", "Value 'Two' is not a valid number."))

        data = {"cluster_id": "DEADBEEF-DEAD-BEEF-DEAD-BEEFDEADBEEF",
                "interface": {"Reducer Count": "2",
                              "Input Path": "not_a_url"}}
        self._assert_create_object_validation(data=data, bad_req_i=(
            1, "INVALID_DATA", "Data source value 'not_a_url' is neither a "
                               "valid data source ID nor a valid URL."))

        data = {"cluster_id": "DEADBEEF-DEAD-BEEF-DEAD-BEEFDEADBEEF",
                "interface": {"Reducer Count": "2",
                              "Positional Argument": 2}}
        self._assert_create_object_validation(data=data, bad_req_i=(
            1, "INVALID_DATA", "Value '2' is not a valid string."))

        data_source.return_value = False
        data = {"cluster_id": "DEADBEEF-DEAD-BEEF-DEAD-BEEFDEADBEEF",
                "interface":
                    {"Reducer Count": "2",
                     "Input Path": "DEADBEEF-DEAD-BEEF-DEAD-BEEFDEADBEEF"}}
        self._assert_create_object_validation(
            data=data, bad_req_i=(
                1, "INVALID_REFERENCE",
                "DataSource with id 'DEADBEEF-DEAD-BEEF-DEAD-BEEFDEADBEEF' "
                "doesn't exist"))

    def test_overlapping_data(self):
        data = {"cluster_id": "DEADBEEF-DEAD-BEEF-DEAD-BEEFDEADBEEF",
                "interface": {"Reducer Count": "2"},
                "job_configs": {"configs": {"mapred.reduce.tasks": "2"}}}
        self._assert_create_object_validation(data=data)

        data = {"cluster_id": "DEADBEEF-DEAD-BEEF-DEAD-BEEFDEADBEEF",
                "interface": {"Reducer Count": "2"},
                "job_configs": {"configs": {"mapred.reduce.tasks": "3"}}}
        self._assert_create_object_validation(data=data, bad_req_i=(
            1, "INVALID_DATA",
            "Argument 'Reducer Count' was passed both through the interface "
            "and in location 'configs'.'mapred.reduce.tasks'. Please pass "
            "this through either the interface or the configuration maps, "
            "not both."))


text:
<?xml version="1.0" encoding="utf-8"?>

<!--
  ~ Copyright 2021 Red Hat, Inc. and/or its affiliates.
  ~
  ~ Licensed under the Apache License, Version 2.0 (the "License");
  ~ you may not use this file except in compliance with the License.
  ~ You may obtain a copy of the License at
  ~
  ~       http://www.apache.org/licenses/LICENSE-2.0
  ~
  ~ Unless required by applicable law or agreed to in writing, software
  ~ distributed under the License is distributed on an "AS IS" BASIS,
  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  ~ See the License for the specific language governing permissions and
  ~ limitations under the License.
  -->

<!DOCTYPE module PUBLIC "-//Google Inc.//DTD Google Web Toolkit 2.4.0//EN"
    "http://google-web-toolkit.googlecode.com/svn/tags/2.5.0/distro-source/core/src/gwt-module.dtd">
<module>
  <source path="api"/>
  <source path="client"/>

  <generate-with class="org.kie.dmn.feel.gwt.functions.rebind.FunctionProviderGenerator">
    <when-type-assignable class="org.kie.dmn.feel.gwt.functions.client.FEELFunctionProvider"/>
  </generate-with>
</module>


text:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">

	<modelVersion>4.0.0</modelVersion>
	<parent>
		<groupId>com.github.ggiamarchi.i18n.generator</groupId>
		<artifactId>i18n-generator-parent</artifactId>
		<version>0.1-SNAPSHOT</version>
		<relativePath>../pom.xml</relativePath>
	</parent>
	<artifactId>i18n-generator-ant</artifactId>
	<packaging>jar</packaging>
	<name>I18N Generator Ant Task</name>
	<description>Ant task for I18N Genrator</description>

	<dependencies>
		<dependency>
			<groupId>com.github.ggiamarchi.i18n.generator</groupId>
			<artifactId>i18n-generator</artifactId>
			<version>0.1-SNAPSHOT</version>
		</dependency>
		<dependency>
			<groupId>org.apache.ant</groupId>
			<artifactId>ant</artifactId>
			<version>1.8.4</version>
		</dependency>
	</dependencies>

	<build>

	</build>

</project>