text:
from __future__ import absolute_import, division, print_function

import logging

logger = logging.getLogger(__name__)

def _get_package(package, version_query, media_type, package_class):
    """
      Fetch the package data from the datastore
      and instantiate a :obj:`appr.models.package_base.PackageModelBase`

    Args:
      package (:obj:`str`): package name in the format "namespace/name" or "domain.com/name"
      version_query (:obj:`str`): a version query, eg: ">=1.5,<2.0"
      package_class (:obj:`appr.models.package_base:PackageBase`): the implemented Package class to use

    Returns:
      :obj:`appr.kub_jsonnet.KubJsonnet`: :obj:`appr.models.package_base.PackageModelBase`

    See Also:
       * :obj:`appr.api.models.package_base.PackageModelBase`
       * :obj:`appr.api.models.etcd.package.Package`

    Raises:
      :obj:`appr.exception.PackageNotFound`: package not found
      :obj:`appr.exception.InvalidVersion`: version-query malformated
      :obj:`appr.exception.PackageVersionNotFound`: version-query didn't match any release

    """

    if version_query is None:
        version_query = 'default'
    p = package_class.get(package, version_query, media_type)
    return p

def pull_blob(package, digest, blob_class):
    blob = blob_class.get(package, digest)
    resp = {
        "package": package,
        "blob": blob.b64blob,
        "release": digest,
        "filename": "%s_%s.tar.gz" % (package.replace("/", "_"), digest[0:8])}
    return resp

def pull(package, version_query, media_type, package_class, blob_class):
    """
    Retrives the package blob from the datastore

    Args:
      package (:obj:`str`): package name in the format "namespace/name" or "domain.com/name"
      version_query (:obj:`str`): a version query, eg: ">=1.5,<2.0"
      package_class (:obj:`appr.models.package_base:PackageBase`): the implemented Package class to use

    Returns:
      :obj:`dict`: package data
        * package: package name
        * version: version that matched the version query
        * filename: suggested filename to create the tarball
        * blob: a `tar.gz` encoded in base64.

    Example:
      >>> appr.api.impl.registry.pull("coreos/etcd", version=">=3")
        {
         'blob': 'H4sICHDFvlcC/3RpdF9yb2NrZXRjaGF0XzEuMTAuMGt1Yi50YXIA7ZdRb5swEM',
         'filename': u'coreos_etcd_3.0.1.tar.gz',
         'package': 'coreos_etcd',
         'version': u'3.0.1'
        }

    Raises:
      :obj:`appr.exception.PackageNotFound`: package not found
      :obj:`appr.exception.InvalidVersion`: version-query malformated
      :obj:`appr.exception.PackageVersionNotFound`: version-query didn't match any release

    See Also:
       * :obj:`appr.api.registry.pull`

    """
    packagemodel = _get_package(package, version_query, media_type, package_class=package_class)
    blob = blob_class.get(package, packagemodel.digest)
    resp = {
        "package": package,
        "blob": blob.b64blob,
        "release": packagemodel.release,
        "media_type": packagemodel.media_type,
        "filename": "%s_%s.tar.gz" % (packagemodel.package.replace("/", "_"),
                                      packagemodel.release)}
    return resp

def push(package, release, media_type, blob, force, package_class, **kwargs):
    """
    Push a new package release in the the datastore

    Args:
      package (:obj:`str`): package name in the format "namespace/name" or "domain.com/name"
      release (:obj:`str`): the 'exact' package release (this is not a release_query)
      blob (:obj:`str`): the package directory in `tar.gz` and encoded in base64
      force (:obj:`boolean`): if the package exists already, overwrite it
      package_class (:obj:`appr.models.package_base:PackageBase`): the implemented Package class to use

    Returns:
      :obj:`dict`: push status

    Example:
      >>> appr.api.impl.registry.push("coreos/etcd", "3.0.1",
            "H4sICHDFvlcC/3RpdF9yb2NrZXRjaGF0XzEuMTAuMGt1Yi50YXIA7ZdRb5swEM")
        {
         'status': u'ok'
        }

    Raises:
      PackageAlreadyExists: if package already exists and `force` is False

    See Also:
       * :obj:`appr.api.registry.push`

    """
    p = package_class(package, release, media_type, blob, kwargs.get('metadata', None))
    p.save(force=force, **kwargs)
    return {"status": "ok"}

def search(query, package_class, **kwargs):
    """
    Search packages

    Args:
      package (:obj:`str`): package name in the format "namespace/name" or "domain.com/name"
      package_class (:obj:`appr.models.package_base:PackageBase`): the implemented Package class to use

    Returns:
      :obj:`list`: list of package names

    Example:
      >>> appr.api.impl.registry.search("etcd")
        [
         'coreos/etcd',
         'ant31/etcd',
         'my-etcd/stable'
        ]

    See Also:
       * :obj:`appr.api.registry.search`

    """
    return package_class.search(query, **kwargs)

def list_packages(namespace, package_class, **kwargs):
    """
    List all packages, filters can be applied
    Must have at least a release to be visible

    Todos:
       - sort_by: name, created_at, downloads, number of stars
       - filter_by: users

    Args:
      namespace (:obj:`str`): returns packages from the `namespace` only
      package_class (:obj:`appr.models.package_base:PackageBase`): the implemented Package class to use

    Returns:
      :obj:`list of dict`: list packages
        * name: package name
        * available_releases (list of str):  All releases
        * created_at (datetime, optional): package creation date
        * downloads (int, optional): number of downloads
        * release: release name

    Example:
      >>> appr.api.impl.registry.list_packages()
      [
       {
        'available_releases': ['0.1.0'],
        'name': u'quentinm/rados-gateway',
        'release': '0.1.0',
        'created_at": "2016-04-22T11:58:34.103Z",
        'downloads': 41
       },
       {
        'available_releases': ['0.1.0'],
        'name': u'quentinm/nova',
        'release': '0.1.0'
       },
      ]

    See Also:
       * :obj:`appr.api.registry.list_packages`
    """
    resp = package_class.all(namespace, **kwargs)
    return resp

def show_package(package, release, media_type, channel_class, package_class):
    """
    Returns package details

    Args:
      package (:obj:`str`): package name in the format "namespace/name" or "domain.com/name"
      release (:obj:`str`): the 'exact' package release (this is not a release_query)
      channel_class (:obj:`appr.models.channel_base:ChannelBase`): the implemented Channel class to use
      package_class (:obj:`appr.models.package_base:PackageBase`): the implemented Package class to use

    Returns:
      :obj:`dict`: package data
        * release (str)
        * name (str)
        * created_at (str)
        * digest (str)
        * channels (list)
        * available_releases (list)
        * dependencies (list)
        * variables (dict)
        * manifest (str)

    Example:
      >>> appr.api.impl.registry.show_package("ns/mypackage")
      {
      "release": "3.2.0-rc",
      "name": "ns/mypackage",
      "created_at": "2016-08-25T10:16:16.366758",
      "digest": "93de60f59238f9aebce5b9f8bc708e02a0d740364fcd4b185c6da7fc1cdfe1ba",
      "channels": ['stable', 'beta'],
      "available_releases": [
        "3.2.0-rc"
        "3.1.0",
        "3.0.1"
      ],
      "dependencies": [
        "ns/dep1",
        "ns/dep2",
        "ns/dep3"
       ],
       "variables": {
         "replicas": 1,
         "image": "ns/mypackage:latest",
         "namespace": "default",
         "cluster": "cluster.local",
         "mail_url": "smtp://"
       },
      "manifest": "---...."
       }

    Raises:
      :obj:`appr.exception.PackageNotFound`: package not found
      :obj:`appr.exception.InvalidRelease`: release-query malformated
      :obj:`appr.exception.PackageReleaseNotFound`: release-query didn't match any release

    See Also:
       * :obj:`appr.api.registry.show_package`
    """
    packagemodel = _get_package(package, release, media_type, package_class)
    # manifest = packagemodel.manifest()
    # optional = {"manifest": packagemodel.packager.manifest,
    # "variables": manifest.variables,
    # "dependencies": manifest.dependencies}

    response = {"channels": packagemodel.channels(channel_class)}
    response.update(packagemodel.data)
    return response

def show_package_releases(package, media_type, package_class):
    return package_class.view_releases(package, media_type)

def show_package_manifests(package, release, package_class):
    return package_class.view_manifests(package, release)

# CHANNELS
def list_channels(package, channel_class):
    """
    List all channels for a given package

    Args:
      package (:obj:`str`): package name in the format "namespace/name" or "domain.com/name"
      channel_class (:obj:`appr.models.channel_base:ChannelBase`): the implemented Channel class to use

    Returns:
      :obj:`list of dict`: list channels:
        * channel (str): channel name
        * current (str): latest/default release associated to the channel
        * releases (list): list channel's releases

    Example:
      >>> appr.api.impl.registry.list_channels("myns/package")
      [{'channel': u'stable', 'current': '1.10.2', 'releases': [u'1.10.2']},
       {'channel': u'dev', 'current': 2.0.0-beta, 'releases': [1.10.2, 2.0.0-beta]}]

    See Also:
       * :obj:`appr.api.registry.list_channels`
    """
    channels = [c.to_dict() for c in channel_class.all(package)]
    return channels

def show_channel(package, name, channel_class):
    """
    Show channel info
    Args:
      package (:obj:`str`): package name in the format "namespace/name" or "domain.com/name"
      name (:obj:`str`): channel name to inspect
      channel_class (:obj:`appr.models.channel_base:ChannelBase`): the implemented Channel class to use

    Returns:
      :obj:`dict`: channel info
        * channel (str): channel name
        * current (str): latest/default release associated to the channel
        * releases (list): list channel's releases

    Example:
      >>> appr.api.impl.registry.list_channels("tit/rocketchat", 'dev')
      {'channel': u'dev', 'current': '2.0.0-beta', 'releases': [u'1.10.2']}

    Raises:
      :obj:`appr.api.exception.ChannelNotFound`: channel not found

    See Also:
       * :obj:`appr.api.registry.show_channel`
    """
    c = channel_class.get(name, package)
    return c.to_dict()

def add_channel_release(package, name, release, channel_class, package_class):
    """
    Add a package-release to a channel
    Args:
      package (:obj:`str`): package name in the format "namespace/name" or "domain.com/name"
      name (:obj:`str`): channel name to inspect
      release (:obj:`str`): package release to add
      channel_class (:obj:`appr.models.channel_base:ChannelBase`): the implemented Channel class to use
      package_class (:obj:`appr.models.package_base:PackageBase`): the implemented Package class to use

    Returns:
      :obj:`dict`: channel info
        * channel (str): channel name
        * current (str): latest/default release associated to the channel
        * releases (list): list channel's releases

    Example:
      >>> appr.api.impl.registry.list_channels("tit/rocketchat", 'dev')
      {'channel': u'dev', 'current': '2.0.0-beta', 'releases': [u'1.10.2']}

    Raises:
      :obj:`appr.api.exception.ChannelNotFound`: channel not found

    See Also:
       * :obj:`appr.api.registry.add_channel_release`
    """
    channel = channel_class(name, package)
    channel.add_release(release, package_class)
    return channel.to_dict()

def delete_channel_release(package, name, release, channel_class, package_class):
    """
    Remove a release from a channel

    Args:
      package (:obj:`str`): package name in the format "namespace/name" or "domain.com/name"
      name (:obj:`str`): channel name to inspect
      release (:obj:`str`): package release to add
      channel_class (:obj:`appr.models.channel_base:ChannelBase`): the implemented Channel class to use
      package_class (:obj:`appr.models.package_base:PackageBase`): the implemented Package class to use

    Returns:
      :obj:`dict`: channel info
        * channel (str): channel name
        * current (str): latest/default release associated to the channel
        * releases (list): list channel's releases

    Example:
      >>> appr.api.impl.registry.delete_channel_release("tit/rocketchat", 'dev')
      {'channel': u'dev', 'current': '2.0.0-beta', 'releases': [u'1.10.2']}

    Raises:
      :obj:`appr.api.exception.ChannelNotFound`: channel not found

    See Also:
       * :obj:`appr.api.registry.delete_channel_release`
    """
    channel = channel_class.get(name, package)
    channel.remove_release(release)
    return {"status": "deleted", "package": package, "name": name, "release": release}

def delete_channel(package, name, channel_class):
    channel = channel_class.get(name, package)
    channel.delete()
    return {"channel": channel.name, "package": package, "action": 'delete'}

def delete_package(package, release, media_type, package_class):
    package_class.delete(package, release, media_type)
    return {"status": "deleted", "package": package, "release": release}


text:
    cursor: pointer;
    border: 1px solid #eaeaea;
    position: relative;
}

.colpick-popup {
    width: 256px;
    height: 256px;
    position: absolute;
    top: 0;
    left: 20px;
}

.colpick-select {
    position: absolute;
    top: -5px;
    left: -5px;
    background: url('../img/colorpicker_select.gif') no-repeat;
    width: 11px;
    height: 11px;
    overflow: hidden;
}

redpajama_set_name: RedPajamaGithub


text:
Documentation: [scholarly-citation-finder.readthedocs.io](http://scholarly-citation-finder.readthedocs.io)

License: SCF is licensed under the [MIT License](LICENSE.txt).

#### Code style

Style convention: [PEP 8](https://www.python.org/dev/peps/pep-0008/).

Tool: [pep8 ](https://pypi.python.org/pypi/pep8) with the parameters `--ignore=E265,E501,W293` (E265 _block comment should start with '# '_, E501 _line too long_, W293 _blank line contains whitespace_)


text:
using Sniper.Common;
using System.Collections.ObjectModel;

namespace Sniper.Contracts.Entities.Common
{
    public interface IHasBugs
    {
        Collection<Bug> Bugs { get; }
    }
}


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Farmacop
{
    //Representa un usuario en la aplicación
    public class User
    {
        private string _nombre;
        private string _fapellido;
        private string _sapellido;
        private string _account;
        private string _fechaN;
        private string _tipo;
        private bool _habilitado;
        private List<string> _alergias;
        private string _email;

        public string Nombre
        {
            get
            {
                return _nombre;
            }

            set
            {
                _nombre = value;
            }
        }

        public string Apellidos
        {
            get
            {
                return _fapellido + " " + _sapellido;
            }
        }

        public string Cuenta
        {
            get
            {
                return _account;
            }

            set
            {
                _account = value;
            }
        }

        public string Nacimiento
        {
            get
            {
                return _fechaN;
            }

            set
            {
                _fechaN = value;
            }
        }

        public string Tipo
        {
            get
            {
                return _tipo;
            }

            set
            {
                _tipo = value;
            }
        }

        private bool Habilitado
        {
            get
            {
                return _habilitado;
            }

            set
            {
                _habilitado = value;
            }
        }

        public List<string> Alergias
        {
            get
            {
                return _alergias;
            }

            set
            {
                _alergias = value;
            }
        }

        public User() { }

        public User(string name, string surname,string ssurname, string account, string birthDate, string type, bool enabled,string email)
        {
            this.Nombre = name;
            this._fapellido = surname;
            this._sapellido = ssurname;
            this.Cuenta = account;
            this.Nacimiento = birthDate;
            this.Tipo = type;
            this.Habilitado = enabled;
            this._email = email;
        }

        public bool IsEnabled()
        {
            return Habilitado;
        }

        public string GetFApl()
        {
            return _fapellido;
        }

        public string GetSApl()
        {
            return _sapellido;
        }

        public List<Alergia> GetAlgList()
        {
            List<Alergia> AlgList = new List<Alergia>();
            foreach (string alg in Alergias)
                AlgList.Add(new Alergia(alg));
            return AlgList;
        }

        public string GetEmail()
        {
            return _email;
        }
    }
}


text:
package com.space.invaders.actores;

import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.graphics.Texture;
import com.badlogic.gdx.graphics.g2d.Sprite;
import com.badlogic.gdx.graphics.g2d.SpriteBatch;
import com.badlogic.gdx.math.MathUtils;
import com.badlogic.gdx.scenes.scene2d.ui.Image;
import com.badlogic.gdx.scenes.scene2d.utils.SpriteDrawable;
import com.space.invaders.actores.direccion.DireccionX;
import com.space.invaders.actores.direccion.DireccionY;
import com.space.invaders.actores.naves.Nave;
import com.space.invaders.interfaces.actores.IElementoJuego;

/**
 * Representa un elemento que se pinta en el juego, utilizando una imagen.
 */
public abstract class ElementoImagen implements IElementoJuego {

	protected ActorImagen actor;
	protected DireccionX direccionX;
	protected float velocidadX = 1;
	protected DireccionY direccionY;
	protected float velocidadY = 1;
	protected boolean visible = true;

	/**
	 * Crea una nueva instancia de elemento de juego.
	 */
	public ElementoImagen() {
		actor = new ActorImagen();
	}

	/**
	 * Crea una nueva instancia de elemento de juego.
	 */
	public ElementoImagen(Texture texture) {
		actor = new ActorImagen(texture);

	}

	/**
	 * Actualiza el elemento de juego de acuerdo al cambio de tiempo.
	 * @param deltaTiempo Cambio de tiempo.
	 */
	public abstract void actualizar(float deltaTiempo);

	/**
	 * Renderiza el elemento.
	 * @param batch Sprite batch a utilizar.
	 */
	public void renderizar(SpriteBatch batch) {
		if(!visible) {
			return;
		}

		this.getActor().draw(batch, 1);
	}

	/**
	 * Dispone del elemento.
	 */
	public abstract void disponer();

	/**
	 * Obtiene la direccion en X.
	 * @return Direccion en X.
	 */
	public DireccionX getDireccionX() {
		return direccionX;
	}

	/**
	 * Obtiene la direccion en Y.
	 * @return Direccion en Y.
	 */
	public DireccionY getDireccionY() {
		return direccionY;
	}

	/**
	 * Obtiene la velocidad en X del elemento.
	 * @return Velocidad en X.
	 */
	public float getVelocidadX() {
		return velocidadX;
	}

	/**
	 * Obtiene la velocidad del elemento en Y.
	 * @return Velocidad en Y.
	 */
	public float getVelocidadY() {
		return velocidadY;
	}

	/**
	 * Asigna la direccion en X del elemento.
	 * @param direccionX Direccion en X.
	 */
	public void setDireccionX(DireccionX direccionX) {
		this.direccionX = direccionX;
	}

	/**
	 * Asigna la direccion en Y.
	 * @param direccionY Direccion en Y.
	 */
	public void setDireccionY(DireccionY direccionY) {
		this.direccionY = direccionY;
	}

	/**
	 * Asigna la nueva textura al elemento de juego.
	 * @param textura Nueva textura para el elemento de juego.
	 */
	public void setTextura(Texture textura)
	{
		setTextura(this.getActor(), textura);
	}

	/**
	 * Assigns the texture to the actor.
	 * @param actor Actor.
	 * @param textura Texture.
	 */
	protected void setTextura(ActorImagen actor, Texture textura)
	{
		Sprite sprite = new Sprite(textura);
		SpriteDrawable spriteDrawable = new SpriteDrawable(sprite);
		actor.setDrawable(spriteDrawable);
		actor.setSize(textura.getWidth(), textura.getHeight());
	}

	/**
	 * Asigna la velocidad en X del elemento.
	 * @param velocidadX Velocidad en X.
	 */
	public void setVelocidadX(float velocidadX) {
		this.velocidadX = velocidadX;
	}

	/**
	 * Asigna la velocidad en Y del elemento.
	 * @param velocidadY Velocidad en Y.
	 */
	public void setVelocidadY(float velocidadY) {
		this.velocidadY = velocidadY;
	}

	/**
	 * Indica si el elemento es visible.
	 * @return Retorna true si el elemento es visible; de lo contrario retorna false.
	 */
	public boolean isVisible() {
		return visible;
	}

	/**
	 * Cambia la visibilidad del elemento.
	 * @param visible Es visible.
	 */
	public void setVisible(boolean visible) {
		this.visible = visible;
	}

	/**
	 * Mueve el elemento de acuerdo a la configuración de dirección y velocidad.
	 */
	public void mover() {
		moverX();
		moverY();
	}

	/**
	 * Mueve el elemento en X de acuerdo a la configuración de dirección y velocidad.
	 */
	public boolean moverX() {
		return moverX(getDireccionX(), getVelocidadX());
	}

	/**
	 * Mueve el elemento en X de acuerdo a la configuración de dirección y velocidad.
	 * @param direccion Direccion en X.
	 * @param velocidad Velocidad de moviemiento.
	 */
	public boolean moverX(DireccionX direccion, float velocidad) {

		if(alcanzoUbicacionLimiteX(direccion))
			return false;

		float x = getActor().getX() + (velocidad * direccion.getMultiplicadorX());
		this.getActor().setX(x);
		return true;
	}

	/**
	 * Mueve el elemento en Y de acuerdo a la configuración de dirección y velocidad.
	 */
	public boolean moverY() {
		return moverY(getDireccionY(), getVelocidadY());
	}

	/**
	 * Mueve el elemento en Y de acuerdo a la configuración de dirección y velocidad.
	 * @param direccion Direccion en Y.
	 * @param velocidad Velocidad de moviemiento.
	 */
	public boolean moverY(DireccionY direccion, float velocidad) {

		if(alcanzoUbicacionLimiteY(direccion))
			return false;

		float y = getActor().getY() + (velocidad * direccion.getMultiplicadorY());
		this.getActor().setY(y);
		return true;
	}

	/**
	 * Mueve el elemento hacia la derecha.
	 */
	public void moverDerecha() {
		moverX(DireccionX.Derecha, velocidadX);
	}

	/**
	 * Mover elemento hacia la izquierda.
	 */
	public void moverIzquierda() {
		moverX(DireccionX.Izquierda, velocidadX);
	}

	/**
	 * Valida si el elemento alcanzó la ubicación limite en X.
	 * @return Retorna true si el elemento alcanzo la ubicacion limite en X.
	 */
	public boolean alcanzoUbicacionLimiteX() {
		return alcanzoUbicacionLimiteX(this.direccionX);
	}

	/**
	 * Valida si el elemento alcanzó la ubicación limite en X.
	 * @return Retorna true si el elemento alcanzo la ubicacion limite en X.
	 */
	public boolean alcanzoUbicacionLimiteX(DireccionX direccionX) {
		float x = getActor().getX();
		float width = getActor().getWidth();
		float graphicsWidth = Gdx.graphics.getWidth();

		boolean alcanzoLimiteX = (direccionX == DireccionX.Izquierda && x < 0) || (direccionX == DireccionX.Derecha && x > graphicsWidth-width);
		return alcanzoLimiteX;
	}

	/**
	 * Valida si el elemento alcanzó la ubicación limite en X.
	 * @return Retorna true si el elemento alcanzo la ubicacion limite en X.
	 */
	public boolean alcanzoUbicacionLimiteY() {
		return alcanzoUbicacionLimiteY(this.direccionY);
	}

	/**
	 * Valida si el elemento alcanzó la ubicación limite en Y.
	 * @return Retorna true si el elemento alcanzo la ubicacion limite en Y.
	 */
	public boolean alcanzoUbicacionLimiteY(DireccionY direccionY) {
		float y = getActor().getY();
		float graphicsHeight = Gdx.graphics.getHeight();
		boolean alcanzoLimiteY =(direccionY == DireccionY.Abajo && y < 0) || (direccionY == DireccionY.Arriba && y > graphicsHeight);
		return alcanzoLimiteY;
	}

	/**
	 * Obtiene el actor de tipo imagen del elemento.
	 * @return Actor imagen.
	 */
	public ActorImagen getActor() {
		return actor;
	}

	@Override
	public float getX() {
		return actor.getX();
	}

	@Override
	public void setX(float x) {
		actor.setX(x);
	}

	@Override
	public float getY() {
		return actor.getY();
	}

	@Override
	public void setY(float y) {
		actor.setY(y);
	}

	@Override
	public float getWidth() {
		return actor.getWidth();
	}

	@Override
	public float getHeight() {
		return actor.getHeight();
	}

	@Override
	public void setWidth(float width) {
		actor.setWidth(width);
	}

	@Override
	public void setHeight(float height) {
		actor.setHeight(height);
	}

	/*
	 * Implementación metodo para clonar elemento juego.
	 */
	@Override
	public ElementoImagen clone() {
		ElementoImagen copiaElemento = null;
		try {
			copiaElemento = (ElementoImagen) super.clone();
			if(this.actor!=null) {
			copiaElemento.actor = this.getActor().clone();
			}

		} catch (CloneNotSupportedException e) {
			e.printStackTrace();
		}

		return copiaElemento;
	}

}


text:
angular
  .module('mage')
  .controller('SetupController', SetupController);

SetupController.$inject = ['$scope', '$http', '$location', 'UserService', 'api'];

function SetupController($scope, $http, $location, UserService, api) {
  $scope.account = {};

  var pages = ['account', 'device'];
  $scope.page = pages[0];

  $scope.passwordRequirements = {}

  var localAuthenticationStrategy = api.authenticationStrategies.local;
  if (localAuthenticationStrategy) {
    $scope.passwordRequirements.minLength = localAuthenticationStrategy.passwordMinLength;
  }

  $scope.form = {};

  $scope.next = function() {
    if ($scope.form[$scope.page].$invalid) {
      return;
    }

    var index = pages.indexOf($scope.page);
    $scope.page = pages[index + 1];
  }

  $scope.finish = function() {
    $http.post('/api/setup', $scope.account, {headers: { 'Content-Type': 'application/json' }}).success(function() {
      // login the user
      UserService.login({username: $scope.account.username, password: $scope.account.password, uid: $scope.account.uid});
    })
    .error(function() {
      console.log('error creating intial account');
    });
  }
}


text:
package com.brainy.util;

import java.io.InputStream;

/**
 * Created by eossth on 9/21/2017 AD.
 */

public abstract class Stream {
    public abstract String read();
    public abstract void write(String text);
    public abstract void write(InputStream inputStream) throws Exception;
}


text:
var $             = require("jquery-browserify")
  , GLOW          = require("./GLOW.js").GLOW
  , utils         = require("./utils.js")
  , normals       = require("normals");

var vertexNormals = normals.vertexNormals;
var faceNormals = normals.faceNormals;

exports.makeViewer = function(params) {

  if(!params) {
    params = {};
  }
  var shell = require("./shell.js").makeShell(params);

  shell.params = params;

  if(!params.lightPosition) {
    params.lightPosition = [100,100,100];
  }

  var shaderInfo = {
    vertexShader: [
      "uniform     mat4     transform;",
      "uniform     mat4     cameraInverse;",
      "uniform     mat4     cameraProjection;",

      "attribute  vec3      position;",
      "attribute  vec3      color;",
      "attribute  vec3      normal;",

      "varying    vec3      eyeDir;",
      "varying    vec3      f_color;",
      "varying    vec3      f_normal;",
      "varying    vec3      f_position;",

      "void main(void) {",
        "vec4 t_position = transform * vec4( position, 1.0 );",
        "gl_Position = cameraProjection * cameraInverse * t_position;",
        "eyeDir = normalize(t_position.xyz);",
        "f_color = color;",
        "f_normal = normal;",
        "f_position = position;",
      "}"
    ].join("\n"),
    fragmentShader: [
      "#ifdef GL_ES",
        "precision highp float;",
      "#endif",

      "uniform    vec3  lightPosition;",
      "uniform    float     ambientPower;",
      "uniform    float     diffusePower;",
      "uniform    float     specularPower;",

      "varying    vec3      eyeDir;",
      "varying    vec3      f_color;",
      "varying    vec3      f_normal;",
      "varying    vec3      f_position;",

      "void main() {",

        "vec3 lightDir = normalize(lightPosition - f_position);",

        "float diffuse = clamp(dot(lightDir, f_normal), 0.0, 1.0);",
        "float specular = clamp(dot(f_normal, normalize(lightDir + eyeDir)), 0.0, 1.0);",
        "specular = pow(specular, 32.0);",
        "float intensity = ambientPower + diffusePower * diffuse + specularPower * specular;",

        "gl_FragColor = vec4(intensity * f_color, 1.0);",
      "}"
    ].join("\n"),
    data: {
      transform:        new GLOW.Matrix4(),
      cameraInverse:    GLOW.defaultCamera.inverse,
      cameraProjection: GLOW.defaultCamera.projection,
      position:         new Float32Array([0,0,0,1,0,0,0,1,0]),
      color:            new Float32Array([0,0,1,1,0,0,0,1,0]),
      normal:           new Float32Array([0,0,1,0,0,1,0,0,1]),
      lightPosition:    new GLOW.Vector3(params.lightPosition[0], params.lightPosition[1], params.lightPosition[2]),
      ambientPower:     new GLOW.Float(0.4),
      diffusePower:     new GLOW.Float(0.6),
      specularPower:    new GLOW.Float(0.5)
    },
    interleave: {
      position: false,
      normal:   false,
      color:    false
    },
    primitives: GL.TRIANGLES,
    usage:     GL.DYNAMIC_DRAW
  };

  var wireInfo = {
    vertexShader: [
      "uniform     mat4     transform;",
      "uniform     mat4     cameraInverse;",
      "uniform     mat4     cameraProjection;",

      "attribute  vec3      position;",

      "void main(void) {",
        "vec4 t_position = transform * vec4( position, 1.0 );",
        "gl_Position = cameraProjection * cameraInverse * t_position;",
      "}"
    ].join("\n"),
    fragmentShader: [
      "#ifdef GL_ES",
        "precision highp float;",
      "#endif",

      "void main() {",
        "gl_FragColor = vec4(0, 0, 0, 1);",
      "}"
    ].join("\n"),
    data: {
      transform:        new GLOW.Matrix4(),
      cameraInverse:    GLOW.defaultCamera.inverse,
      cameraProjection: GLOW.defaultCamera.projection,
      position:         new Float32Array([0,0,0,1,0,0]),
    },
    interleave: {
      position: false,
    },
    primitives: GL.LINES,
    usage:     GL.DYNAMIC_DRAW
  };

  shell.shader = new GLOW.Shader(shaderInfo);
  shell.wireShader = new GLOW.Shader(wireInfo);

  //Update mesh
  shell.updateMesh = function(params) {

    if(params.packed) {
      shell.shader.normal.bufferData(params.normals)
      shell.shader.color.bufferData(params.colors)
      shell.shader.position.bufferData(params.positions)
      shell.shader.elements.length = (params.positions.length / 3)|0
      return
    }

    var faces = params.faces || params.cells

    //Update normals
    if(shell.params.flatShaded) {
      var normals = params.faceNormals || faceNormals(faces, params.positions);
      shell.shader.normal.bufferData(new Float32Array(utils.flattenPerFace(faces, normals)));
    } else {
      var normals = params.vertexNormals || vertexNormals(faces, params.positions);
      shell.shader.normal.bufferData(new Float32Array(utils.flattenFaces(faces, normals)));
    }

    //Update colors
    if(params.colors) {
      shell.shader.color.bufferData(new Float32Array(utils.flattenFaces(faces, params.colors)));
    } else if(params.faceColors) {
      shell.shader.color.bufferData(new Float32Array(utils.flattenPerFace(faces, params.faceColors)));
    } else {
      for(var i=0; i<normals.length; ++i) {
        for(var j=0; j<3; ++j) {
          normals[i][j] = 0.5 * normals[i][j] + 0.5;
        }
      }
      if(shell.params.flatShaded) {
        shell.shader.color.bufferData(new Float32Array(utils.flattenPerFace(faces, normals)));
      } else {
        shell.shader.color.bufferData(new Float32Array(utils.flattenFaces(faces, normals)));
      }
    }

    //Update buffer data
    shell.shader.position.bufferData(new Float32Array(utils.flattenFaces(faces, params.positions)), GL.DYNAMIC_DRAW);

    shell.shader.elements.length = 3*utils.elementLen(faces);

    if(shell.params.wireframe) {
      var wire_pos = [];
      for(var i=0; i<faces.length; ++i) {
        var f = faces[i];
        for(var j=0; j<f.length; ++j) {
          wire_pos.push(params.positions[f[j]]);
          wire_pos.push(params.positions[f[(j+1)%f.length]]);
        }
      }
      shell.wireShader.position.bufferData(new Float32Array(utils.flatten(wire_pos)));
      shell.wireShader.elements.length = wire_pos.length;
    }
  }

  //Draw mesh
  shell.events.on('render', function() {
    var matrix = shell.camera.matrix()
      , xform0  = shell.shader.transform
      , xform1  = shell.wireShader.transform;
    for(var i=0; i<4; ++i) {
      for(var j=0; j<4; ++j) {
        var ptr = i+4*j;
        xform0.value[ptr] = xform1.value[ptr] = matrix[i][j];
      }
    }
    shell.shader.draw();
    if(shell.params.wireframe) {
      GL.lineWidth(2.0);
      shell.wireShader.draw();
    }
  });

  return shell;
}


text:
import Controller from '@ember/controller';
import EditController from 'fakturama/mixins/edit-controller';

export default Controller.extend(EditController, {
  transitionTo() {
    const model = this.get('content.model');
    if (model.get('isDeleted')) {
      this.transitionToRoute('invoices');
    } else {
      this.transitionToRoute('invoice.show', model);
    }
  },
  settings: null,
  currencies: null,
  taxRates: null,
  languages: null,
  units: null,
  clients: null,
  accounts: null,

  isRemoveItemDisabled: function() {
    return this.get('items.length') <= 1;
  }.property('items.@each'),

  actions: {
    addItem() {
      this.get('content').addItem();
    },

    removeItem(item) {
      this.get('items').removeObject(item);
    },

    chooseClient(client) {
      this.get('model').setProperties({
        buyer: client.get('buyer'),
        buyerSignature: client.get('contactName')
      });
    },

    chooseAccount(account) {
      this.get('model').setProperties({
        accountBankName: account.get('bankName'),
        accountSwift: account.get('swift'),
        accountNumber: account.get('number')
      });
    }
  }
});


text:
package resourceapply

import (
	"context"
	"fmt"

	"k8s.io/klog/v2"

	rbacv1 "k8s.io/api/rbac/v1"
	"k8s.io/apimachinery/pkg/api/equality"
	apierrors "k8s.io/apimachinery/pkg/api/errors"
	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
	rbacclientv1 "k8s.io/client-go/kubernetes/typed/rbac/v1"

	"github.com/openshift/library-go/pkg/operator/events"
	"github.com/openshift/library-go/pkg/operator/resource/resourcemerge"
)

// ApplyClusterRole merges objectmeta, requires rules, aggregation rules are not allowed for now.
func ApplyClusterRole(client rbacclientv1.ClusterRolesGetter, recorder events.Recorder, required *rbacv1.ClusterRole) (*rbacv1.ClusterRole, bool, error) {
	if required.AggregationRule != nil && len(required.AggregationRule.ClusterRoleSelectors) != 0 {
		return nil, false, fmt.Errorf("cannot create an aggregated cluster role")
	}

	existing, err := client.ClusterRoles().Get(context.TODO(), required.Name, metav1.GetOptions{})
	if apierrors.IsNotFound(err) {
		actual, err := client.ClusterRoles().Create(context.TODO(), required, metav1.CreateOptions{})
		reportCreateEvent(recorder, required, err)
		return actual, true, err
	}
	if err != nil {
		return nil, false, err
	}

	modified := resourcemerge.BoolPtr(false)
	existingCopy := existing.DeepCopy()

	resourcemerge.EnsureObjectMeta(modified, &existingCopy.ObjectMeta, required.ObjectMeta)
	contentSame := equality.Semantic.DeepEqual(existingCopy.Rules, required.Rules)
	if contentSame && !*modified {
		return existingCopy, false, nil
	}

	existingCopy.Rules = required.Rules
	existingCopy.AggregationRule = nil

	if klog.V(4).Enabled() {
		klog.Infof("ClusterRole %q changes: %v", required.Name, JSONPatchNoError(existing, existingCopy))
	}

	actual, err := client.ClusterRoles().Update(context.TODO(), existingCopy, metav1.UpdateOptions{})
	reportUpdateEvent(recorder, required, err)
	return actual, true, err
}

// ApplyClusterRoleBinding merges objectmeta, requires subjects and role refs
// TODO on non-matching roleref, delete and recreate
func ApplyClusterRoleBinding(client rbacclientv1.ClusterRoleBindingsGetter, recorder events.Recorder, required *rbacv1.ClusterRoleBinding) (*rbacv1.ClusterRoleBinding, bool, error) {
	existing, err := client.ClusterRoleBindings().Get(context.TODO(), required.Name, metav1.GetOptions{})
	if apierrors.IsNotFound(err) {
		actual, err := client.ClusterRoleBindings().Create(context.TODO(), required, metav1.CreateOptions{})
		reportCreateEvent(recorder, required, err)
		return actual, true, err
	}
	if err != nil {
		return nil, false, err
	}

	modified := resourcemerge.BoolPtr(false)
	existingCopy := existing.DeepCopy()
	requiredCopy := required.DeepCopy()

	// Enforce apiGroup fields in roleRefs
	existingCopy.RoleRef.APIGroup = rbacv1.GroupName
	for i := range existingCopy.Subjects {
		if existingCopy.Subjects[i].Kind == "User" {
			existingCopy.Subjects[i].APIGroup = rbacv1.GroupName
		}
	}

	requiredCopy.RoleRef.APIGroup = rbacv1.GroupName
	for i := range requiredCopy.Subjects {
		if existingCopy.Subjects[i].Kind == "User" {
			requiredCopy.Subjects[i].APIGroup = rbacv1.GroupName
		}
	}

	resourcemerge.EnsureObjectMeta(modified, &existingCopy.ObjectMeta, requiredCopy.ObjectMeta)

	subjectsAreSame := equality.Semantic.DeepEqual(existingCopy.Subjects, requiredCopy.Subjects)
	roleRefIsSame := equality.Semantic.DeepEqual(existingCopy.RoleRef, requiredCopy.RoleRef)

	if subjectsAreSame && roleRefIsSame && !*modified {
		return existingCopy, false, nil
	}

	existingCopy.Subjects = requiredCopy.Subjects
	existingCopy.RoleRef = requiredCopy.RoleRef

	if klog.V(4).Enabled() {
		klog.Infof("ClusterRoleBinding %q changes: %v", requiredCopy.Name, JSONPatchNoError(existing, existingCopy))
	}

	actual, err := client.ClusterRoleBindings().Update(context.TODO(), existingCopy, metav1.UpdateOptions{})
	reportUpdateEvent(recorder, requiredCopy, err)
	return actual, true, err
}

// ApplyRole merges objectmeta, requires rules
func ApplyRole(client rbacclientv1.RolesGetter, recorder events.Recorder, required *rbacv1.Role) (*rbacv1.Role, bool, error) {
	existing, err := client.Roles(required.Namespace).Get(context.TODO(), required.Name, metav1.GetOptions{})
	if apierrors.IsNotFound(err) {
		actual, err := client.Roles(required.Namespace).Create(context.TODO(), required, metav1.CreateOptions{})
		reportCreateEvent(recorder, required, err)
		return actual, true, err
	}
	if err != nil {
		return nil, false, err
	}

	modified := resourcemerge.BoolPtr(false)
	existingCopy := existing.DeepCopy()

	resourcemerge.EnsureObjectMeta(modified, &existingCopy.ObjectMeta, required.ObjectMeta)
	contentSame := equality.Semantic.DeepEqual(existingCopy.Rules, required.Rules)
	if contentSame && !*modified {
		return existingCopy, false, nil
	}

	existingCopy.Rules = required.Rules

	if klog.V(4).Enabled() {
		klog.Infof("Role %q changes: %v", required.Namespace+"/"+required.Name, JSONPatchNoError(existing, existingCopy))
	}
	actual, err := client.Roles(required.Namespace).Update(context.TODO(), existingCopy, metav1.UpdateOptions{})
	reportUpdateEvent(recorder, required, err)
	return actual, true, err
}

// ApplyRoleBinding merges objectmeta, requires subjects and role refs
// TODO on non-matching roleref, delete and recreate
func ApplyRoleBinding(client rbacclientv1.RoleBindingsGetter, recorder events.Recorder, required *rbacv1.RoleBinding) (*rbacv1.RoleBinding, bool, error) {
	existing, err := client.RoleBindings(required.Namespace).Get(context.TODO(), required.Name, metav1.GetOptions{})
	if apierrors.IsNotFound(err) {
		actual, err := client.RoleBindings(required.Namespace).Create(context.TODO(), required, metav1.CreateOptions{})
		reportCreateEvent(recorder, required, err)
		return actual, true, err
	}
	if err != nil {
		return nil, false, err
	}

	modified := resourcemerge.BoolPtr(false)
	existingCopy := existing.DeepCopy()
	requiredCopy := required.DeepCopy()

	// Enforce apiGroup fields in roleRefs and subjects
	existingCopy.RoleRef.APIGroup = rbacv1.GroupName
	for i := range existingCopy.Subjects {
		if existingCopy.Subjects[i].Kind == "User" {
			existingCopy.Subjects[i].APIGroup = rbacv1.GroupName
		}
	}

	requiredCopy.RoleRef.APIGroup = rbacv1.GroupName
	for i := range requiredCopy.Subjects {
		if existingCopy.Subjects[i].Kind == "User" {
			requiredCopy.Subjects[i].APIGroup = rbacv1.GroupName
		}
	}

	resourcemerge.EnsureObjectMeta(modified, &existingCopy.ObjectMeta, requiredCopy.ObjectMeta)

	subjectsAreSame := equality.Semantic.DeepEqual(existingCopy.Subjects, requiredCopy.Subjects)
	roleRefIsSame := equality.Semantic.DeepEqual(existingCopy.RoleRef, requiredCopy.RoleRef)

	if subjectsAreSame && roleRefIsSame && !*modified {
		return existingCopy, false, nil
	}

	existingCopy.Subjects = requiredCopy.Subjects
	existingCopy.RoleRef = requiredCopy.RoleRef

	if klog.V(4).Enabled() {
		klog.Infof("RoleBinding %q changes: %v", requiredCopy.Namespace+"/"+requiredCopy.Name, JSONPatchNoError(existing, existingCopy))
	}

	actual, err := client.RoleBindings(requiredCopy.Namespace).Update(context.TODO(), existingCopy, metav1.UpdateOptions{})
	reportUpdateEvent(recorder, requiredCopy, err)
	return actual, true, err
}


text:
package com.alibaba.nacos.core.utils;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletRequestWrapper;
import java.util.HashMap;
import java.util.Map;

/**
 * A request wrapper to override the parameters.
 *
 * <p>Referenced article is https://blog.csdn.net/xieyuooo/article/details/8447301
 *
 * @author nkorange
 * @since 0.8.0
 */
public class OverrideParameterRequestWrapper extends HttpServletRequestWrapper {

    private Map<String, String[]> params = new HashMap<>();

    /**
     * Constructs a request object wrapping the given request.
     *
     * @param request The request to wrap
     * @throws IllegalArgumentException if the request is null
     */
    public OverrideParameterRequestWrapper(HttpServletRequest request) {
        super(request);
        this.params.putAll(request.getParameterMap());
    }

    public static OverrideParameterRequestWrapper buildRequest(HttpServletRequest request) {
        return new OverrideParameterRequestWrapper(request);
    }

    /**
     * build OverrideParameterRequestWrapper and addParameter.
     *
     * @param request origin HttpServletRequest
     * @param name    name
     * @param value   value
     * @return {@link OverrideParameterRequestWrapper}
     */
    public static OverrideParameterRequestWrapper buildRequest(HttpServletRequest request, String name, String value) {
        OverrideParameterRequestWrapper requestWrapper = new OverrideParameterRequestWrapper(request);
        requestWrapper.addParameter(name, value);
        return requestWrapper;
    }

    /**
     * build OverrideParameterRequestWrapper and addParameter.
     *
     * @param request          origin HttpServletRequest
     * @param appendParameters need to append to request
     * @return {@link OverrideParameterRequestWrapper}
     */
    public static OverrideParameterRequestWrapper buildRequest(HttpServletRequest request,
            Map<String, String[]> appendParameters) {
        OverrideParameterRequestWrapper requestWrapper = new OverrideParameterRequestWrapper(request);
        requestWrapper.params.putAll(appendParameters);
        return requestWrapper;
    }

    @Override
    public String getParameter(String name) {
        String[] values = params.get(name);
        if (values == null || values.length == 0) {
            return null;
        }
        return values[0];
    }

    @Override
    public Map<String, String[]> getParameterMap() {
        return params;
    }

    @Override
    public String[] getParameterValues(String name) {
        return params.get(name);
    }

    /**
     * addParameter.
     *
     * @param name  name
     * @param value value
     */
    public void addParameter(String name, String value) {
        if (value != null) {
            params.put(name, new String[] {value});
        }
    }

}


text:
package org.jetbrains.plugins.scala.lang.resolve2

import _root_.org.jetbrains.plugins.scala.lang.resolve.ScalaResolveTestCase
import com.intellij.psi.impl.source.resolve.reference.impl.PsiMultiReference
import com.intellij.psi.{PsiElement, PsiReference}
import junit.framework._
import org.jetbrains.plugins.scala.extensions._
import org.jetbrains.plugins.scala.lang.psi.api.base.ScReferenceElement
import org.jetbrains.plugins.scala.lang.psi.api.toplevel.typedef.ScTypeDefinition
import org.jetbrains.plugins.scala.util.TestUtils
import org.jetbrains.plugins.scala.util.TestUtils.ScalaSdkVersion

/**
 * Pavel.Fatin, 02.02.2010
 */

abstract class ResolveTestBase extends ScalaResolveTestCase {
  val pattern = """/\*\s*(.*?)\s*\*/\s*""".r
  type Parameters = Map[String, String]

  val Resolved = "resolved" // default: true
  val Name = "name" // default: reference name
  val File = "file" // default: this (if line or offset provided)
  val Line = "line"
  val Offset = "offset"
  val Length = "length"
  val Type = "type"
  val Path = "path"
  val Applicable = "applicable" // default: true
  val Accessible = "accessible" // default: true

  val Parameters = List(Resolved, Name, File, Line, Offset, Length, Type, Path, Applicable, Accessible)

  var options: List[Parameters] = List()
  var references: List[PsiReference] = List()

  override def setUp() {
    setUp(TestUtils.DEFAULT_SCALA_SDK_VERSION)
  }

  override def setUp(version: ScalaSdkVersion) {
    super.setUp(version)
    configureReferences()
  }

  override def folderPath: String = {
    super.folderPath() + "resolve2/"
  }

  def configureReferences(): PsiReference = {
    options = List()
    references = List()

    val matches = pattern.findAllIn(getFileAdapter.getText).matchData

    for (m <- matches) {
      val parameters = parseParameters(m.group(1))
      val reference = getFileAdapter.findReferenceAt(m.end)

      assertKnown(parameters)
      Assert.assertNotNull("No reference found at offset " + m.end, references)

      options = parameters :: options
      references = reference :: references
    }

    options = options.reverse
    references = references.reverse

    Assert.assertFalse("At least one expectation must be specified", references.isEmpty)
    Assert.assertEquals("Options number", references.size, options.size)

    null
  }

  def assertKnown(parameters: Parameters) {
    for ((key, value) <- parameters) {
      Assert.assertTrue("Unknown parameter: " + key + "\nAllowed: " + Parameters.mkString(", "),
        Parameters.contains(key))
    }
  }

  def parseParameters(s: String): Parameters = {
    if (s.isEmpty) Map() else Map(s.split("""\s*,\s*""").map(_.trim).map {
      it: String =>
        val parts = it.split("""\s*:\s*""")
        (parts(0), parts(1))
    }: _*)
  }

  def doTest() {
    doTest(getTestName(false) + ".scala")
  }

  def doTest(file: String) {
    references.zip(options).foreach(it => {
      it._1 match {
        case ref: ScReferenceElement =>
          doEachTest(it._1.asInstanceOf[ScReferenceElement], it._2)
        case ref: PsiMultiReference =>
          val hostReferences = ref.getReferences
          if (hostReferences.length == 2) {
            hostReferences.find(_.isInstanceOf[ScReferenceElement]) match {
              case Some(r: ScReferenceElement) =>
                doEachTest(r, it._2)
              case _ => assert(assertion = false, message = "Multihost references are not supported")
            }
          } else {
            assert(assertion = false, message = "Multihost references are not supported")
          }
      }
    })
  }

  def doEachTest(reference: ScReferenceElement, options: Parameters) {
    val referenceName = reference.refName
    val result = reference.advancedResolve
    val (target, accessible, applicable) = if(result.isDefined) (
            result.get.element,
            result.get.isAccessible,
            result.get.isApplicable()) else (null, true, true)

    def message = format(getFileAdapter.getText, _: String, lineOf(reference))

    def assertEquals(name: String, v1: Any, v2: Any) {
      if(v1 != v2) Assert.fail(message(name + " - expected: " + v1 + ", actual: " + v2))
    }

    if (options.contains(Resolved) && options(Resolved) == "false") {
      Assert.assertNull(message(referenceName + " must NOT be resolved!"), target)
    } else {
      Assert.assertNotNull(message(referenceName + " must BE resolved!"), target)

      if (options.contains(Accessible) && options(Accessible) == "false") {
        Assert.assertFalse(message(referenceName + " must NOT be accessible!"), accessible)
      } else {
        Assert.assertTrue(message(referenceName + " must BE accessible!"), accessible)
      }

      if (options.contains(Applicable) && options(Applicable) == "false") {
        Assert.assertFalse(message(referenceName + " must NOT be applicable!"), applicable)
      } else {
        Assert.assertTrue(message(referenceName + " must BE applicable! " +
          result.get.problems.mkString("(", ",", ")")), applicable)
      }

      if (options.contains(Path)) {
        assertEquals(Path, options(Path), target.asInstanceOf[ScTypeDefinition].qualifiedName)
      }

      if (options.contains(File) || options.contains(Offset) || options.contains(Line)) {
        val actual = target.getContainingFile.getVirtualFile.getNameWithoutExtension
        val expected = if (!options.contains(File) || options(File) == "this") {
          reference.getElement.getContainingFile.getVirtualFile.getNameWithoutExtension
        } else options(File)
        assertEquals(File, expected, actual)
      }

      val expectedName = if (options.contains(Name)) options(Name) else referenceName
      assertEquals(Name, expectedName, target.name)

      if (options.contains(Line)) {
        assertEquals(Line, options(Line).toInt, lineOf(target))
      }

      if (options.contains(Offset)) {
        assertEquals(Offset, options(Offset).toInt, target.getTextOffset)
      }

      if (options.contains(Length)) {
        assertEquals(Length, options(Length).toInt, target.getTextLength)
      }

      if (options.contains(Type)) {
        val expectedClass = Class.forName(options(Type))
        val targetClass = target.getClass
        val text = Type + " - expected: " + expectedClass.getSimpleName + ", actual: " + targetClass.getSimpleName
        Assert.assertTrue(message(text), expectedClass.isAssignableFrom(targetClass))
      }
    }
  }

  def lineOf(element: PsiElement) = {
    element.getContainingFile.getText.substring(0, element.getTextOffset).count(_ == '\n') + 1
  }

  def format(text: String, message: String, line: Int) = {
    val lines = text.lines.zipWithIndex.map(p => if (p._2 + 1 == line) p._1 + " // " + message else p._1)
    "\n\n" + lines.mkString("\n") + "\n"
  }
}


text:
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE QuasiQuotes #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE QuasiQuotes #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE TypeOperators #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE PostfixOperators #-}

{-# OPTIONS_GHC -fno-warn-orphans #-}

--------------------------------------------------------------------------------
-- Single call from an active to a passive thread.
--
-- (c) 2015 Galois, Inc.
--
--------------------------------------------------------------------------------

module Main where

import Ivory.Tower
import Ivory.Language
import Tower.AADL

-- test1 :: Tower e ()
-- test1 = do
--   towerModule  towerDepModule
--   towerDepends towerDepModule

--   (c1in, c1out) <- channel

--   -- per0 <- period (100`ms`)
--   -- per1 <- period (1`ms`)

--   -- monitor "sender0" $ do
--   --   handler per0 "tick0" $ do
--   --     e <- emitter c1in 1
--   --     callback $ \msg -> do
--   --       m <- deref msg
--   --       call_ printf "Sender ping received %d. Writing to receiver.\n" m
--   --       emitV e (m+1)

--   -- monitor "sender1" $ do
--   --   handler per1 "tick1" $ do
--   --     e <- emitter c1in 1
--   --     callback $ \msg -> do
--   --       m <- deref msg
--   --       call_ printf "Sender ping received %d. Writing to receiver.\n" m
--   --       emitV e (m+1)

--   -- monitor "rx_monitor" $ do
--   --   handler c1out "receiver1" $ do
--   --     callback $ \msg -> do
--   --       m <- deref msg
--   --       call_ printf "receiver1 msg received %d.\n" m

test1 :: Tower e ()
test1 = do
  towerModule  towerDepModule
  towerDepends towerDepModule

  (c1in, c1out) <- channel
  per <- period (100`ms`)

  monitor "sender" $ do
    handler per "tick" $ do
      e <- emitter c1in 1
      callback $ \msg -> do
        m <- deref msg
        call_ printf "Sender ping received %d. Writing to receiver.\n" m
        emitV e (m+1)

  monitor "rx_monitor" $ do
    handler c1out "receiver1" $ do
      callback $ \msg -> do
        m <- deref msg
        call_ printf "receiver1 msg received %d.\n" m

    handler c1out "receiver2" $ do
      callback $ \msg -> do
        m <- deref msg
        call_ printf "receiver2 msg received %d.\n" m

--------------------------------------------------------------------------------
-- Compiler

main :: IO ()
main =
  runCompileAADL
    initialOpts { genDirOpts = Just "test1" }
    test1

--------------------------------------------------------------------------------
-- Helpers

printf :: Def('[IString, ITime] :-> ())
printf = importProc "printf" "stdio.h"

towerDepModule :: Module
towerDepModule = package "towerDeps" (incl printf)


text:
using System;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Windows.Forms;
using System.ComponentModel;

namespace WeifenLuo.WinFormsUI.Docking
{
    using WeifenLuo.WinFormsUI.ThemeVS2003;

    [ToolboxItem(false)]
    internal class VS2003DockPaneStrip : DockPaneStripBase
    {
        private class TabVS2003 : Tab
        {
            internal TabVS2003(IDockContent content)
                : base(content)
            {
            }

            private int m_tabX;
            protected internal int TabX
            {
                get { return m_tabX; }
                set { m_tabX = value; }
            }

            private int m_tabWidth;
            protected internal int TabWidth
            {
                get { return m_tabWidth; }
                set { m_tabWidth = value; }
            }

            private int m_maxWidth;
            protected internal int MaxWidth
            {
                get { return m_maxWidth; }
                set { m_maxWidth = value; }
            }

            private bool m_flag;
            protected internal bool Flag
            {
                get { return m_flag; }
                set { m_flag = value; }
            }
        }

        protected override DockPaneStripBase.Tab CreateTab(IDockContent content)
        {
            return new TabVS2003(content);
        }

        private class DocumentButton : Label
        {
            public DocumentButton(Image image)
            {
                Image = image;
            }

        }

        #region consts
        private const int _ToolWindowStripGapLeft = 4;
        private const int _ToolWindowStripGapRight = 3;
        private const int _ToolWindowImageHeight = 16;
        private const int _ToolWindowImageWidth = 16;
        private const int _ToolWindowImageGapTop = 3;
        private const int _ToolWindowImageGapBottom = 1;
        private const int _ToolWindowImageGapLeft = 3;
        private const int _ToolWindowImageGapRight = 2;
        private const int _ToolWindowTextGapRight = 1;
        private const int _ToolWindowTabSeperatorGapTop = 3;
        private const int _ToolWindowTabSeperatorGapBottom = 3;

        private const int _DocumentTabMaxWidth = 200;
        private const int _DocumentButtonGapTop = 5;
        private const int _DocumentButtonGapBottom = 5;
        private const int _DocumentButtonGapBetween = 0;
        private const int _DocumentButtonGapRight = 3;
        private const int _DocumentTabGapTop = 3;
        private const int _DocumentTabGapLeft = 3;
        private const int _DocumentTabGapRight = 3;
        private const int _DocumentIconGapLeft = 6;
        private const int _DocumentIconHeight = 16;
        private const int _DocumentIconWidth = 16;
        #endregion

        private InertButton m_buttonClose, m_buttonScrollLeft, m_buttonScrollRight;
        private IContainer m_components;
        private ToolTip m_toolTip;

        /// <exclude/>
        protected IContainer Components
        {
            get	{	return m_components;	}
        }

        private int m_offsetX = 0;
        private int OffsetX
        {
            get	{	return m_offsetX;	}
            set
            {
                m_offsetX = value;
                #if DEBUG
                if (m_offsetX > 0)
                    throw new InvalidOperationException();
                #endif
            }
        }

        #region Customizable Properties
        /// <include file='CodeDoc/DockPaneStripVS2003.xml' path='//CodeDoc/Class[@name="DockPaneStripVS2003"]/Property[@name="ToolWindowStripGapLeft"]/*'/>
        protected virtual int ToolWindowStripGapLeft
        {
            get	{	return _ToolWindowStripGapLeft;	}
        }

        /// <include file='CodeDoc/DockPaneStripVS2003.xml' path='//CodeDoc/Class[@name="DockPaneStripVS2003"]/Property[@name="ToolWindowStripGapRight"]/*'/>
        protected virtual int ToolWindowStripGapRight
        {
            get	{	return _ToolWindowStripGapRight;	}
        }

        /// <include file='CodeDoc/DockPaneStripVS2003.xml' path='//CodeDoc/Class[@name="DockPaneStripVS2003"]/Property[@name="ToolWindowImageHeight"]/*'/>
        protected virtual int ToolWindowImageHeight
        {
            get	{	return _ToolWindowImageHeight;	}
        }

        /// <include file='CodeDoc/DockPaneStripVS2003.xml' path='//CodeDoc/Class[@name="DockPaneStripVS2003"]/Property[@name="ToolWindowImageWidth"]/*'/>
        protected virtual int ToolWindowImageWidth
        {
            get	{	return _ToolWindowImageWidth;	}
        }

        /// <include file='CodeDoc/DockPaneStripVS2003.xml' path='//CodeDoc/Class[@name="DockPaneStripVS2003"]/Property[@name="ToolWindowImageGapTop"]/*'/>
        protected virtual int ToolWindowImageGapTop
        {
            get	{	return _ToolWindowImageGapTop;	}
        }

        /// <include file='CodeDoc/DockPaneStripVS2003.xml' path='//CodeDoc/Class[@name="DockPaneStripVS2003"]/Property[@name="ToolWindowImageGapBottom"]/*'/>
        protected virtual int ToolWindowImageGapBottom
        {
            get	{	return _ToolWindowImageGapBottom;	}
        }

        /// <include file='CodeDoc/DockPaneStripVS2003.xml' path='//CodeDoc/Class[@name="DockPaneStripVS2003"]/Property[@name="ToolWindowImageGapLeft"]/*'/>
        protected virtual int ToolWindowImageGapLeft
        {
            get	{	return _ToolWindowImageGapLeft;	}
        }

        /// <include file='CodeDoc/DockPaneStripVS2003.xml' path='//CodeDoc/Class[@name="DockPaneStripVS2003"]/Property[@name="ToolWindowImageGapRight"]/*'/>
        protected virtual int ToolWindowImageGapRight
        {
            get	{	return _ToolWindowImageGapRight;	}
        }

        /// <include file='CodeDoc/DockPaneStripVS2003.xml' path='//CodeDoc/Class[@name="DockPaneStripVS2003"]/Property[@name="ToolWindowTextGapRight"]/*'/>
        protected virtual int ToolWindowTextGapRight
        {
            get	{	return _ToolWindowTextGapRight;	}
        }

        /// <include file='CodeDoc/DockPaneStripVS2003.xml' path='//CodeDoc/Class[@name="DockPaneStripVS2003"]/Property[@name="ToolWindowSeperatorGaptop"]/*'/>
        protected virtual int ToolWindowTabSeperatorGapTop
        {
            get	{	return _ToolWindowTabSeperatorGapTop;	}
        }

        /// <include file='CodeDoc/DockPaneStripVS2003.xml' path='//CodeDoc/Class[@name="DockPaneStripVS2003"]/Property[@name="ToolWindowSeperatorGapBottom"]/*'/>
        protected virtual int ToolWindowTabSeperatorGapBottom
        {
            get	{	return _ToolWindowTabSeperatorGapBottom;	}
        }

        private static Image _imageCloseEnabled = null;
        /// <include file='CodeDoc/DockPaneStripVS2003.xml' path='//CodeDoc/Class[@name="DockPaneStripVS2003"]/Property[@name="ImageCloseEnabled"]/*'/>
        protected virtual Image ImageCloseEnabled
        {
            get
            {
                if (_imageCloseEnabled == null)
                    _imageCloseEnabled = Resources.DockPaneStrip_CloseEnabled;
                return _imageCloseEnabled;
            }
        }

        private static Image _imageCloseDisabled = null;
        /// <include file='CodeDoc/DockPaneStripVS2003.xml' path='//CodeDoc/Class[@name="DockPaneStripVS2003"]/Property[@name="ImageCloseDisabled"]/*'/>
        protected virtual Image ImageCloseDisabled
        {
            get
            {
                if (_imageCloseDisabled == null)
                    _imageCloseDisabled = Resources.DockPaneStrip_CloseDisabled;
                return _imageCloseDisabled;
            }
        }

        private static Image _imageScrollLeftEnabled = null;
        /// <include file='CodeDoc/DockPaneStripVS2003.xml' path='//CodeDoc/Class[@name="DockPaneStripVS2003"]/Property[@name="ImageScrollLeftEnabled"]/*'/>
        protected virtual Image ImageScrollLeftEnabled
        {
            get
            {
                if (_imageScrollLeftEnabled == null)
                    _imageScrollLeftEnabled = Resources.DockPaneStrip_ScrollLeftEnabled;
                return _imageScrollLeftEnabled;
            }
        }

        private static Image _imageScrollLeftDisabled = null;
        /// <include file='CodeDoc/DockPaneStripVS2003.xml' path='//CodeDoc/Class[@name="DockPaneStripVS2003"]/Property[@name="ImageScrollLeftDisabled"]/*'/>
        protected virtual Image ImageScrollLeftDisabled
        {
            get
            {
                if (_imageScrollLeftDisabled == null)
                    _imageScrollLeftDisabled = Resources.DockPaneStrip_ScrollLeftDisabled;
                return _imageScrollLeftDisabled;
            }
        }

        private static Image _imageScrollRightEnabled = null;
        /// <include file='CodeDoc/DockPaneStripVS2003.xml' path='//CodeDoc/Class[@name="DockPaneStripVS2003"]/Property[@name="ImageScrollRightEnabled"]/*'/>
        protected virtual Image ImageScrollRightEnabled
        {
            get
            {
                if (_imageScrollRightEnabled == null)
                    _imageScrollRightEnabled = Resources.DockPaneStrip_ScrollRightEnabled;
                return _imageScrollRightEnabled;
            }
        }

        private static Image _imageScrollRightDisabled = null;
        /// <include file='CodeDoc/DockPaneStripVS2003.xml' path='//CodeDoc/Class[@name="DockPaneStripVS2003"]/Property[@name="ImageScrollRightDisabled"]/*'/>
        protected virtual Image ImageScrollRightDisabled
        {
            get
            {
                if (_imageScrollRightDisabled == null)
                    _imageScrollRightDisabled = Resources.DockPaneStrip_ScrollRightDisabled;
                return _imageScrollRightDisabled;
            }
        }

        private static string _toolTipClose = null;
        /// <include file='CodeDoc/DockPaneStripVS2003.xml' path='//CodeDoc/Class[@name="DockPaneStripVS2003"]/Property[@name="ToolTipClose"]/*'/>
        protected virtual string ToolTipClose
        {
            get
            {
                if (_toolTipClose == null)
                    _toolTipClose = Strings.DockPaneStrip_ToolTipClose;
                return _toolTipClose;
            }
        }

        private static string _toolTipScrollLeft = null;
        /// <include file='CodeDoc/DockPaneStripVS2003.xml' path='//CodeDoc/Class[@name="DockPaneStripVS2003"]/Property[@name="ToolTipScrollLeft"]/*'/>
        protected virtual string ToolTipScrollLeft
        {
            get
            {
                if (_toolTipScrollLeft == null)
                    _toolTipScrollLeft = Strings.DockPaneStrip_ToolTipScrollLeft;
                return _toolTipScrollLeft;
            }
        }

        private static string _toolTipScrollRight = null;
        /// <include file='CodeDoc/DockPaneStripVS2003.xml' path='//CodeDoc/Class[@name="DockPaneStripVS2003"]/Property[@name="ToolTipScrollRight"]/*'/>
        protected virtual string ToolTipScrollRight
        {
            get
            {
                if (_toolTipScrollRight == null)
                    _toolTipScrollRight = Strings.DockPaneStrip_ToolTipScrollRight;
                return _toolTipScrollRight;
            }
        }

        private static TextFormatFlags _toolWindowTextFormat =
            TextFormatFlags.EndEllipsis |
            TextFormatFlags.HorizontalCenter |
            TextFormatFlags.SingleLine |
            TextFormatFlags.VerticalCenter;
        /// <include file='CodeDoc/DockPaneStripVS2003.xml' path='//CodeDoc/Class[@name="DockPaneStripVS2003"]/Property[@name="ToolWindowTextStringFormat"]/*'/>
        protected virtual TextFormatFlags ToolWindowTextFormat
        {
            get	{	return _toolWindowTextFormat;	}
        }

        private static TextFormatFlags _documentTextFormat =
            TextFormatFlags.PathEllipsis |
            TextFormatFlags.SingleLine |
            TextFormatFlags.VerticalCenter;
        /// <include file='CodeDoc/DockPaneStripVS2003.xml' path='//CodeDoc/Class[@name="DockPaneStripVS2003"]/Property[@name="DocumentTextStringFormat"]/*'/>
        public static TextFormatFlags DocumentTextFormat
        {
            get	{	return _documentTextFormat;	}
        }

        /// <include file='CodeDoc/DockPaneStripVS2003.xml' path='//CodeDoc/Class[@name="DockPaneStripVS2003"]/Property[@name="DocumentTabMaxWidth"]/*'/>
        protected virtual int DocumentTabMaxWidth
        {
            get	{	return _DocumentTabMaxWidth;	}
        }

        /// <include file='CodeDoc/DockPaneStripVS2003.xml' path='//CodeDoc/Class[@name="DockPaneStripVS2003"]/Property[@name="DocumentButtonGapTop"]/*'/>
        protected virtual int DocumentButtonGapTop
        {
            get	{	return _DocumentButtonGapTop;	}
        }

        /// <include file='CodeDoc/DockPaneStripVS2003.xml' path='//CodeDoc/Class[@name="DockPaneStripVS2003"]/Property[@name="DocumentButtonGapBottom"]/*'/>
        protected virtual int DocumentButtonGapBottom
        {
            get	{	return _DocumentButtonGapBottom;	}
        }

        /// <include file='CodeDoc/DockPaneStripVS2003.xml' path='//CodeDoc/Class[@name="DockPaneStripVS2003"]/Property[@name="DocumentButtonGapBetween"]/*'/>
        protected virtual int DocumentButtonGapBetween
        {
            get	{	return _DocumentButtonGapBetween;	}
        }

        /// <include file='CodeDoc/DockPaneStripVS2003.xml' path='//CodeDoc/Class[@name="DockPaneStripVS2003"]/Property[@name="DocumentButtonGapRight"]/*'/>
        protected virtual int DocumentButtonGapRight
        {
            get	{	return _DocumentButtonGapRight;	}
        }

        /// <include file='CodeDoc/DockPaneStripVS2003.xml' path='//CodeDoc/Class[@name="DockPaneStripVS2003"]/Property[@name="DocumentTabGapTop"]/*'/>
        protected virtual int DocumentTabGapTop
        {
            get	{	return _DocumentTabGapTop;	}
        }

        /// <include file='CodeDoc/DockPaneStripVS2003.xml' path='//CodeDoc/Class[@name="DockPaneStripVS2003"]/Property[@name="DocumentTabGapLeft"]/*'/>
        protected virtual int DocumentTabGapLeft
        {
            get	{	return _DocumentTabGapLeft;	}
        }

        /// <include file='CodeDoc/DockPaneStripVS2003.xml' path='//CodeDoc/Class[@name="DockPaneStripVS2003"]/Property[@name="DocumentTabGapRight"]/*'/>
        protected virtual int DocumentTabGapRight
        {
            get	{	return _DocumentTabGapRight;	}
        }

        /// <include file='CodeDoc/DockPaneStripVS2003.xml' path='//CodeDoc/Class[@name="DockPaneStripVS2003"]/Property[@name="DocumentIconGapLeft"]/*'/>
        protected virtual int DocumentIconGapLeft
        {
            get	{	return _DocumentIconGapLeft;	}
        }

        /// <include file='CodeDoc/DockPaneStripVS2003.xml' path='//CodeDoc/Class[@name="DockPaneStripVS2003"]/Property[@name="DocumentIconWidth"]/*'/>
        protected virtual int DocumentIconWidth
        {
            get	{	return _DocumentIconWidth;	}
        }

        /// <include file='CodeDoc/DockPaneStripVS2003.xml' path='//CodeDoc/Class[@name="DockPaneStripVS2003"]/Property[@name="DocumentIconHeight"]/*'/>
        protected virtual int DocumentIconHeight
        {
            get	{	return _DocumentIconHeight;	}
        }

        /// <include file='CodeDoc/DockPaneStripVS2003.xml' path='//CodeDoc/Class[@name="DockPaneStripVS2003"]/Property[@name="OutlineInnerPen"]/*'/>
        protected virtual Pen OutlineInnerPen
        {
            get	{	return SystemPens.ControlText;	}
        }

        /// <include file='CodeDoc/DockPaneStripVS2003.xml' path='//CodeDoc/Class[@name="DockPaneStripVS2003"]/Property[@name="OutlineOuterPen"]/*'/>
        protected virtual Pen OutlineOuterPen
        {
            get	{	return SystemPens.ActiveCaptionText;	}
        }

        /// <include file='CodeDoc/DockPaneStripVS2003.xml' path='//CodeDoc/Class[@name="DockPaneStripVS2003"]/Property[@name="ActiveBackBrush"]/*'/>
        protected virtual Brush ActiveBackBrush
        {
            get	{	return SystemBrushes.Control;	}
        }

        /// <include file='CodeDoc/DockPaneStripVS2003.xml' path='//CodeDoc/Class[@name="DockPaneStripVS2003"]/Property[@name="ActiveTextBrush"]/*'/>
        protected virtual Color ActiveTextColor
        {
            get	{	return SystemColors.ControlText;	}
        }

        /// <include file='CodeDoc/DockPaneStripVS2003.xml' path='//CodeDoc/Class[@name="DockPaneStripVS2003"]/Property[@name="TabSeperatorPen"]/*'/>
        protected virtual Pen TabSeperatorPen
        {
            get	{	return SystemPens.GrayText;	}
        }

        /// <include file='CodeDoc/DockPaneStripVS2003.xml' path='//CodeDoc/Class[@name="DockPaneStripVS2003"]/Property[@name="InactiveTextBrush"]/*'/>
        protected virtual Color InactiveTextColor
        {
            get	{	return SystemColors.ControlDarkDark;	}
        }
        #endregion

        public VS2003DockPaneStrip(DockPane pane) : base(pane)
        {
            SetStyle(ControlStyles.ResizeRedraw, true);
            SetStyle(ControlStyles.UserPaint, true);
            SetStyle(ControlStyles.AllPaintingInWmPaint, true);

            SuspendLayout();

            Font = SystemInformation.MenuFont;
            BackColor = Color.WhiteSmoke;

            m_components = new Container();
            m_toolTip = new ToolTip(Components);

            m_buttonClose = new InertButton(ImageCloseEnabled, ImageCloseDisabled);
            m_buttonScrollLeft = new InertButton(ImageScrollLeftEnabled, ImageScrollLeftDisabled);
            m_buttonScrollRight = new InertButton(ImageScrollRightEnabled, ImageScrollRightDisabled);

            m_buttonClose.ToolTipText = ToolTipClose;
            m_buttonClose.Anchor = AnchorStyles.Top | AnchorStyles.Right;
            m_buttonClose.Click += new EventHandler(Close_Click);

            m_buttonScrollLeft.Enabled = false;
            m_buttonScrollLeft.RepeatClick = true;
            m_buttonScrollLeft.ToolTipText = ToolTipScrollLeft;
            m_buttonScrollLeft.Anchor = AnchorStyles.Top | AnchorStyles.Right;
            m_buttonScrollLeft.Click += new EventHandler(ScrollLeft_Click);

            m_buttonScrollRight.Enabled = false;
            m_buttonScrollRight.RepeatClick = true;
            m_buttonScrollRight.ToolTipText = ToolTipScrollRight;
            m_buttonScrollRight.Anchor = AnchorStyles.Top | AnchorStyles.Right;
            m_buttonScrollRight.Click += new EventHandler(ScrollRight_Click);

            Controls.AddRange(new Control[] {	m_buttonClose,
                                                m_buttonScrollLeft,
                                                m_buttonScrollRight	});

            ResumeLayout();
        }

        protected override void Dispose(bool disposing)
        {
            if (disposing)
            {
                Components.Dispose();
            }
            base.Dispose (disposing);
        }

        protected override int MeasureHeight()
        {
            if (Appearance == DockPane.AppearanceStyle.ToolWindow)
                return MeasureHeight_ToolWindow();
            else
                return MeasureHeight_Document();
        }

        private int MeasureHeight_ToolWindow()
        {
            if (DockPane.IsAutoHide || Tabs.Count <= 1)
                return 0;

            int height = Math.Max(Font.Height, ToolWindowImageHeight)
                + ToolWindowImageGapTop + ToolWindowImageGapBottom;

            return height;
        }

        private int MeasureHeight_Document()
        {
            int height = Math.Max(Font.Height + DocumentTabGapTop,
                ImageCloseEnabled.Height + DocumentButtonGapTop + DocumentButtonGapBottom);

            return height;
        }

        protected override void OnPaint(PaintEventArgs e)
        {
            base.OnPaint (e);
            CalculateTabs();
            DrawTabStrip(e.Graphics);
        }

        protected override void OnRefreshChanges()
        {
            CalculateTabs();
            SetInertButtons();
            Invalidate();
        }

        public override GraphicsPath GetOutline(int index)
        {
            Point[] pts = new Point[8];

            if (Appearance == DockPane.AppearanceStyle.Document)
            {
                Rectangle rectTab = Tabs[index].Rectangle.Value;
                rectTab.Intersect(TabsRectangle);
                int y = DockPane.PointToClient(PointToScreen(new Point(0, rectTab.Bottom))).Y;
                Rectangle rectPaneClient = DockPane.ClientRectangle;
                pts[0] = DockPane.PointToScreen(new Point(rectPaneClient.Left, y));
                pts[1] = PointToScreen(new Point(rectTab.Left, rectTab.Bottom));
                pts[2] = PointToScreen(new Point(rectTab.Left, rectTab.Top));
                pts[3] = PointToScreen(new Point(rectTab.Right, rectTab.Top));
                pts[4] = PointToScreen(new Point(rectTab.Right, rectTab.Bottom));
                pts[5] = DockPane.PointToScreen(new Point(rectPaneClient.Right, y));
                pts[6] = DockPane.PointToScreen(new Point(rectPaneClient.Right, rectPaneClient.Bottom));
                pts[7] = DockPane.PointToScreen(new Point(rectPaneClient.Left, rectPaneClient.Bottom));
            }
            else
            {
                Rectangle rectTab = Tabs[index].Rectangle.Value;
                rectTab.Intersect(TabsRectangle);
                int y = DockPane.PointToClient(PointToScreen(new Point(0, rectTab.Top))).Y;
                Rectangle rectPaneClient = DockPane.ClientRectangle;
                pts[0] = DockPane.PointToScreen(new Point(rectPaneClient.Left, rectPaneClient.Top));
                pts[1] = DockPane.PointToScreen(new Point(rectPaneClient.Right, rectPaneClient.Top));
                pts[2] = DockPane.PointToScreen(new Point(rectPaneClient.Right, y));
                pts[3] = PointToScreen(new Point(rectTab.Right, rectTab.Top));
                pts[4] = PointToScreen(new Point(rectTab.Right, rectTab.Bottom));
                pts[5] = PointToScreen(new Point(rectTab.Left, rectTab.Bottom));
                pts[6] = PointToScreen(new Point(rectTab.Left, rectTab.Top));
                pts[7] = DockPane.PointToScreen(new Point(rectPaneClient.Left, y));
            }

            GraphicsPath path = new GraphicsPath();
            path.AddLines(pts);
            return path;
        }

        private void CalculateTabs()
        {
            if (Appearance == DockPane.AppearanceStyle.ToolWindow)
                CalculateTabs_ToolWindow();
            else
                CalculateTabs_Document();
        }

        private void CalculateTabs_ToolWindow()
        {
            if (Tabs.Count <= 1 || DockPane.IsAutoHide)
                return;

            Rectangle rectTabStrip = ClientRectangle;

            // Calculate tab widths
            int countTabs = Tabs.Count;
            foreach (TabVS2003 tab in Tabs)
            {
                tab.MaxWidth = GetTabOriginalWidth(Tabs.IndexOf(tab));
                tab.Flag = false;
            }

            // Set tab whose max width less than average width
            bool anyWidthWithinAverage = true;
            int totalWidth = rectTabStrip.Width - ToolWindowStripGapLeft - ToolWindowStripGapRight;
            int totalAllocatedWidth = 0;
            int averageWidth = totalWidth / countTabs;
            int remainedTabs = countTabs;
            for (anyWidthWithinAverage=true; anyWidthWithinAverage && remainedTabs>0;)
            {
                anyWidthWithinAverage = false;
                foreach (TabVS2003 tab in Tabs)
                {
                    if (tab.Flag)
                        continue;

                    if (tab.MaxWidth <= averageWidth)
                    {
                        tab.Flag = true;
                        tab.TabWidth = tab.MaxWidth;
                        totalAllocatedWidth += tab.TabWidth;
                        anyWidthWithinAverage = true;
                        remainedTabs--;
                    }
                }
                if (remainedTabs != 0)
                    averageWidth = (totalWidth - totalAllocatedWidth) / remainedTabs;
            }

            // If any tab width not set yet, set it to the average width
            if (remainedTabs > 0)
            {
                int roundUpWidth = (totalWidth - totalAllocatedWidth) - (averageWidth * remainedTabs);
                foreach (TabVS2003 tab in Tabs)
                {
                    if (tab.Flag)
                        continue;

                    tab.Flag = true;
                    if (roundUpWidth > 0)
                    {
                        tab.TabWidth = averageWidth + 1;
                        roundUpWidth --;
                    }
                    else
                        tab.TabWidth = averageWidth;
                }
            }

            // Set the X position of the tabs
            int x = rectTabStrip.X + ToolWindowStripGapLeft;
            foreach (TabVS2003 tab in Tabs)
            {
                tab.TabX = x;
                x += tab.TabWidth;
            }
        }

        private void CalculateTabs_Document()
        {
            Rectangle rectTabStrip = TabsRectangle;

            int totalWidth = 0;
            foreach (TabVS2003 tab in Tabs)
            {
                tab.TabWidth = Math.Min(GetTabOriginalWidth(Tabs.IndexOf(tab)), DocumentTabMaxWidth);
                totalWidth += tab.TabWidth;
            }

            if (totalWidth + OffsetX < rectTabStrip.Width && OffsetX < 0)
                OffsetX = Math.Min(0, rectTabStrip.Width - totalWidth);

            int x = rectTabStrip.X + OffsetX;
            foreach (TabVS2003 tab in Tabs)
            {
                tab.TabX = x;
                x += tab.TabWidth;
            }
        }

        protected override void EnsureTabVisible(IDockContent content)
        {
            if (Appearance != DockPane.AppearanceStyle.Document || !Tabs.Contains(content))
                return;

            Rectangle rectTabStrip = TabsRectangle;
            Rectangle rectTab = GetTabRectangle(Tabs.IndexOf(content));

            if (rectTab.Right > rectTabStrip.Right)
            {
                OffsetX -= rectTab.Right - rectTabStrip.Right;
                rectTab.X -= rectTab.Right - rectTabStrip.Right;
            }

            if (rectTab.Left < rectTabStrip.Left)
                OffsetX += rectTabStrip.Left - rectTab.Left;

            OnRefreshChanges();
        }

        private int GetTabOriginalWidth(int index)
        {
            if (Appearance == DockPane.AppearanceStyle.ToolWindow)
                return GetTabOriginalWidth_ToolWindow(index);
            else
                return GetTabOriginalWidth_Document(index);
        }

        private int GetTabOriginalWidth_ToolWindow(int index)
        {
            IDockContent content = Tabs[index].Content;
            using (Graphics g = CreateGraphics())
            {
                Size sizeString = TextRenderer.MeasureText(g, content.DockHandler.TabText, Font);
                return ToolWindowImageWidth + sizeString.Width + ToolWindowImageGapLeft
                    + ToolWindowImageGapRight + ToolWindowTextGapRight;
            }
        }

        private int GetTabOriginalWidth_Document(int index)
        {
            IDockContent content = Tabs[index].Content;

            int height = GetTabRectangle_Document(index).Height;

            using (Graphics g = CreateGraphics())
            {
                Size sizeText;
                if (content == DockPane.ActiveContent && DockPane.IsActiveDocumentPane)
                {
                    using (Font boldFont = new Font(this.Font, FontStyle.Bold))
                    {
                        sizeText = TextRenderer.MeasureText(g, content.DockHandler.TabText, boldFont, new Size(DocumentTabMaxWidth, height), DocumentTextFormat);
                    }
                }
                else
                    sizeText = TextRenderer.MeasureText(content.DockHandler.TabText, Font, new Size(DocumentTabMaxWidth, height), DocumentTextFormat);

                if (DockPane.DockPanel.ShowDocumentIcon)
                    return sizeText.Width + DocumentIconWidth + DocumentIconGapLeft;
                else
                    return sizeText.Width;
            }
        }

        private void DrawTabStrip(Graphics g)
        {
            OnBeginDrawTabStrip();

            if (Appearance == DockPane.AppearanceStyle.Document)
                DrawTabStrip_Document(g);
            else
                DrawTabStrip_ToolWindow(g);

            OnEndDrawTabStrip();
        }

        private void DrawTabStrip_Document(Graphics g)
        {
            int count = Tabs.Count;
            if (count == 0)
                return;

            Rectangle rectTabStrip = ClientRectangle;
            g.DrawLine(OutlineOuterPen, rectTabStrip.Left, rectTabStrip.Bottom - 1,
                rectTabStrip.Right, rectTabStrip.Bottom - 1);

            // Draw the tabs
            Rectangle rectTabOnly = TabsRectangle;
            Rectangle rectTab = Rectangle.Empty;
            g.SetClip(rectTabOnly);
            for (int i=0; i<count; i++)
            {
                rectTab = GetTabRectangle(i);
                if (rectTab.IntersectsWith(rectTabOnly))
                {
                    rectTab.Intersect(rectTabOnly);
                    var tab = Tabs[i] as TabVS2003;
                    tab.Rectangle = rectTab;
                    DrawTab(g, tab);
                }
            }
        }

        private void DrawTabStrip_ToolWindow(Graphics g)
        {
            Rectangle rectTabStrip = ClientRectangle;

            g.DrawLine(OutlineInnerPen, rectTabStrip.Left, rectTabStrip.Top,
                rectTabStrip.Right, rectTabStrip.Top);

            for (int i = 0; i < Tabs.Count; i++)
            {
                var tab = Tabs[i] as TabVS2003;
                tab.Rectangle = GetTabRectangle(i);
                DrawTab(g, tab);
            }
        }

        private Rectangle GetTabRectangle(int index)
        {
            if (Appearance == DockPane.AppearanceStyle.ToolWindow)
                return GetTabRectangle_ToolWindow(index);
            else
                return GetTabRectangle_Document(index);
        }

        private Rectangle GetTabRectangle_ToolWindow(int index)
        {
            Rectangle rectTabStrip = ClientRectangle;

            TabVS2003 tab = (TabVS2003)(Tabs[index]);
            return new Rectangle(tab.TabX, rectTabStrip.Y, tab.TabWidth, rectTabStrip.Height);
        }

        private Rectangle GetTabRectangle_Document(int index)
        {
            Rectangle rectTabStrip = ClientRectangle;
            TabVS2003 tab = (TabVS2003)Tabs[index];

            return new Rectangle(tab.TabX, rectTabStrip.Y + DocumentTabGapTop, tab.TabWidth, rectTabStrip.Height - DocumentTabGapTop);
        }

        private void DrawTab(Graphics g, TabVS2003 tab)
        {
            OnBeginDrawTab(tab);

            if (Appearance == DockPane.AppearanceStyle.ToolWindow)
                DrawTab_ToolWindow(g, tab);
            else
                DrawTab_Document(g, tab);

            OnEndDrawTab(tab);
        }

        private void DrawTab_ToolWindow(Graphics g, TabVS2003 tab)
        {
            var rect = tab.Rectangle.Value;
            Rectangle rectIcon = new Rectangle(
                rect.X + ToolWindowImageGapLeft,
                rect.Y + rect.Height - 1 - ToolWindowImageGapBottom - ToolWindowImageHeight,
                ToolWindowImageWidth, ToolWindowImageHeight);
            Rectangle rectText = rectIcon;
            rectText.X += rectIcon.Width + ToolWindowImageGapRight;
            rectText.Width = rect.Width - rectIcon.Width - ToolWindowImageGapLeft -
                ToolWindowImageGapRight - ToolWindowTextGapRight;

            if (DockPane.ActiveContent == tab.Content)
            {
                g.FillRectangle(ActiveBackBrush, rect);
                g.DrawLine(OutlineOuterPen,
                    rect.X, rect.Y, rect.X, rect.Y + rect.Height - 1);
                g.DrawLine(OutlineInnerPen,
                    rect.X, rect.Y + rect.Height - 1, rect.X + rect.Width - 1, rect.Y + rect.Height - 1);
                g.DrawLine(OutlineInnerPen,
                    rect.X + rect.Width - 1, rect.Y, rect.X + rect.Width - 1, rect.Y + rect.Height - 1);
                TextRenderer.DrawText(g, tab.Content.DockHandler.TabText, Font, rectText, ActiveTextColor, ToolWindowTextFormat);
            }
            else
            {
                if (Tabs.IndexOf(DockPane.ActiveContent) != Tabs.IndexOf(tab) + 1)
                    g.DrawLine(TabSeperatorPen,
                        rect.X + rect.Width - 1,
                        rect.Y + ToolWindowTabSeperatorGapTop,
                        rect.X + rect.Width - 1,
                        rect.Y + rect.Height - 1 - ToolWindowTabSeperatorGapBottom);
                TextRenderer.DrawText(g, tab.Content.DockHandler.TabText, Font, rectText, InactiveTextColor, ToolWindowTextFormat);
            }

            if (rect.Contains(rectIcon))
                g.DrawIcon(tab.Content.DockHandler.Icon, rectIcon);
        }

        private void DrawTab_Document(Graphics g, TabVS2003 tab)
        {
            var rect = tab.Rectangle.Value;
            Rectangle rectText = rect;
            if (DockPane.DockPanel.ShowDocumentIcon)
            {
                rectText.X += DocumentIconWidth + DocumentIconGapLeft;
                rectText.Width -= DocumentIconWidth + DocumentIconGapLeft;
            }

            if (DockPane.ActiveContent == tab.Content)
            {
                g.FillRectangle(ActiveBackBrush, rect);
                g.DrawLine(OutlineOuterPen, rect.X, rect.Y, rect.X, rect.Y + rect.Height);
                g.DrawLine(OutlineOuterPen, rect.X, rect.Y, rect.X + rect.Width - 1, rect.Y);
                g.DrawLine(OutlineInnerPen,
                    rect.X + rect.Width - 1, rect.Y,
                    rect.X + rect.Width - 1, rect.Y + rect.Height - 1);

                if (DockPane.DockPanel.ShowDocumentIcon)
                {
                    Icon icon = (tab.Content as Form).Icon;
                    Rectangle rectIcon = new Rectangle(
                        rect.X + DocumentIconGapLeft,
                        rect.Y + (rect.Height - DocumentIconHeight) / 2,
                        DocumentIconWidth, DocumentIconHeight);

                    g.DrawIcon(tab.ContentForm.Icon, rectIcon);
                }

                if (DockPane.IsActiveDocumentPane)
                {
                    using (Font boldFont = new Font(this.Font, FontStyle.Bold))
                    {
                        TextRenderer.DrawText(g, tab.Content.DockHandler.TabText, boldFont, rectText, ActiveTextColor, DocumentTextFormat);
                    }
                }
                else
                    TextRenderer.DrawText(g, tab.Content.DockHandler.TabText, Font, rectText, InactiveTextColor, DocumentTextFormat);
            }
            else
            {
                if (Tabs.IndexOf(DockPane.ActiveContent) != Tabs.IndexOf(tab) + 1)
                    g.DrawLine(TabSeperatorPen,
                        rect.X + rect.Width - 1, rect.Y,
                        rect.X + rect.Width - 1, rect.Y + rect.Height - 1 - DocumentTabGapTop);

                if (DockPane.DockPanel.ShowDocumentIcon)
                {
                    Icon icon = tab.ContentForm.Icon;
                    Rectangle rectIcon = new Rectangle(
                        rect.X + DocumentIconGapLeft,
                        rect.Y + (rect.Height - DocumentIconHeight) / 2,
                        DocumentIconWidth, DocumentIconHeight);

                    g.DrawIcon(tab.ContentForm.Icon, rectIcon);
                }

                TextRenderer.DrawText(g, tab.Content.DockHandler.TabText, Font, rectText, InactiveTextColor, DocumentTextFormat);
            }
        }

        private Rectangle TabsRectangle
        {
            get
            {
                if (Appearance == DockPane.AppearanceStyle.ToolWindow)
                    return ClientRectangle;

                Rectangle rectWindow = ClientRectangle;
                int x = rectWindow.X;
                int y = rectWindow.Y;
                int width = rectWindow.Width;
                int height = rectWindow.Height;

                x += DocumentTabGapLeft;
                width -= DocumentTabGapLeft +
                        DocumentTabGapRight +
                        DocumentButtonGapRight +
                        m_buttonClose.Width +
                        m_buttonScrollRight.Width +
                        m_buttonScrollLeft.Width +
                        2 * DocumentButtonGapBetween;

                return new Rectangle(x, y, width, height);
            }
        }

        private void ScrollLeft_Click(object sender, EventArgs e)
        {
            Rectangle rectTabStrip = TabsRectangle;

            int index;
            for (index=0; index<Tabs.Count; index++)
                if (Tabs[index].Rectangle.Value.IntersectsWith(rectTabStrip))
                    break;

            Rectangle rectTab = Tabs[index].Rectangle.Value;
            if (rectTab.Left < rectTabStrip.Left)
                OffsetX += rectTabStrip.Left - rectTab.Left;
            else if (index == 0)
                OffsetX = 0;
            else
                OffsetX += rectTabStrip.Left - Tabs[index - 1].Rectangle.Value.Left;

            OnRefreshChanges();
        }

        private void ScrollRight_Click(object sender, EventArgs e)
        {
            Rectangle rectTabStrip = TabsRectangle;

            int index;
            int count = Tabs.Count;
            for (index=0; index<count; index++)
                if (Tabs[index].Rectangle.Value.IntersectsWith(rectTabStrip))
                    break;

            if (index + 1 < count)
            {
                OffsetX -= Tabs[index + 1].Rectangle.Value.Left - rectTabStrip.Left;
                CalculateTabs();
            }

            Rectangle rectLastTab = Tabs[count - 1].Rectangle.Value;
            if (rectLastTab.Right < rectTabStrip.Right)
                OffsetX += rectTabStrip.Right - rectLastTab.Right;

            OnRefreshChanges();
        }

        private void SetInertButtons()
        {
            // Set the visibility of the inert buttons
            m_buttonScrollLeft.Visible = m_buttonScrollRight.Visible = m_buttonClose.Visible = (DockPane.DockState == DockState.Document);

            m_buttonClose.ForeColor = m_buttonScrollRight.ForeColor	= m_buttonScrollLeft.ForeColor = SystemColors.ControlDarkDark;
            m_buttonClose.BorderColor = m_buttonScrollRight.BorderColor	= m_buttonScrollLeft.BorderColor = SystemColors.ControlDarkDark;

            // Enable/disable scroll buttons
            int count = Tabs.Count;

            Rectangle rectTabOnly = TabsRectangle;
            Rectangle rectTab = (count == 0) ? Rectangle.Empty : GetTabRectangle(count - 1);
            m_buttonScrollLeft.Enabled = (OffsetX < 0);
            m_buttonScrollRight.Enabled = rectTab.Right > rectTabOnly.Right;

            // show/hide close button
            if (Appearance == DockPane.AppearanceStyle.ToolWindow)
                m_buttonClose.Visible = false;
            else
            {
                bool showCloseButton = DockPane.ActiveContent == null ? true : DockPane.ActiveContent.DockHandler.CloseButton;
                if (m_buttonClose.Visible != showCloseButton)
                {
                    m_buttonClose.Visible = showCloseButton;
                    PerformLayout();
                }
            }
        }

        /// <exclude/>
        protected override void OnLayout(LayoutEventArgs levent)
        {
            Rectangle rectTabStrip = ClientRectangle;

            // Set position and size of the buttons
            int buttonWidth = ImageCloseEnabled.Width;
            int buttonHeight = ImageCloseEnabled.Height;
            int height = rectTabStrip.Height - DocumentButtonGapTop - DocumentButtonGapBottom;
            if (buttonHeight < height)
            {
                buttonWidth = buttonWidth * height / buttonHeight;
                buttonHeight = height;
            }
            Size buttonSize = new Size(buttonWidth, buttonHeight);
            m_buttonClose.Size = m_buttonScrollLeft.Size = m_buttonScrollRight.Size = buttonSize;
            int x = rectTabStrip.X + rectTabStrip.Width - DocumentTabGapLeft
                - DocumentButtonGapRight - buttonWidth;
            int y = rectTabStrip.Y + DocumentButtonGapTop;
            m_buttonClose.Location = new Point(x, y);
            Point point = m_buttonClose.Location;
            bool showCloseButton = DockPane.ActiveContent == null ? true : DockPane.ActiveContent.DockHandler.CloseButton;
            if (showCloseButton)
                point.Offset(-(DocumentButtonGapBetween + buttonWidth), 0);
            m_buttonScrollRight.Location = point;
            point.Offset(-(DocumentButtonGapBetween + buttonWidth), 0);
            m_buttonScrollLeft.Location = point;

            OnRefreshChanges();

            base.OnLayout (levent);
        }

        private void Close_Click(object sender, EventArgs e)
        {
            DockPane.CloseActiveContent();
            if (PatchController.EnableMemoryLeakFix == true)
            {
                ContentClosed();
            }
        }

        /// <exclude/>
        protected override int HitTest(Point point)
        {
            Rectangle rectTabStrip = TabsRectangle;

            for (int i=0; i<Tabs.Count; i++)
            {
                Rectangle rectTab = Tabs[i].Rectangle.Value;
                rectTab.Intersect(rectTabStrip);
                if (rectTab.Contains(point))
                    return i;
            }
            return -1;
        }

        protected override Rectangle GetTabBounds(Tab tab)
        {
            return tab.Rectangle.Value;
        }

        /// <exclude/>
        protected override void OnMouseMove(MouseEventArgs e)
        {
            int index = HitTest(PointToClient(Control.MousePosition));
            string toolTip = string.Empty;

            base.OnMouseMove(e);

            if (index != -1)
            {
                Rectangle rectTab = Tabs[index].Rectangle.Value;
                if (Tabs[index].Content.DockHandler.ToolTipText != null)
                    toolTip = Tabs[index].Content.DockHandler.ToolTipText;
                else if (rectTab.Width < GetTabOriginalWidth(index))
                    toolTip = Tabs[index].Content.DockHandler.TabText;
            }

            if (m_toolTip.GetToolTip(this) != toolTip)
            {
                m_toolTip.Active = false;
                m_toolTip.SetToolTip(this, toolTip);
                m_toolTip.Active = true;
            }
        }

        /// <include file='CodeDoc/DockPaneStripVS2003.xml' path='//CodeDoc/Class[@name="DockPaneStripVS2003"]/Method[@name="OnBeginDrawTabStrip()"]/*'/>
        protected virtual void OnBeginDrawTabStrip()
        {
        }

        /// <include file='CodeDoc/DockPaneStripVS2003.xml' path='//CodeDoc/Class[@name="DockPaneStripVS2003"]/Method[@name="OnEndDrawTabStrip()"]/*'/>
        protected virtual void OnEndDrawTabStrip()
        {
        }

        /// <include file='CodeDoc/DockPaneStripVS2003.xml' path='//CodeDoc/Class[@name="DockPaneStripVS2003"]/Method[@name="OnBeginDrawTab(DockPaneTab)"]/*'/>
        protected virtual void OnBeginDrawTab(Tab tab)
        {
        }

        /// <include file='CodeDoc/DockPaneStripVS2003.xml' path='//CodeDoc/Class[@name="DockPaneStripVS2003"]/Method[@name="OnEndDrawTab(DockPaneTab)"]/*'/>
        protected virtual void OnEndDrawTab(Tab tab)
        {
        }
    }
}


text:
<?php
/**
 * Created by PhpStorm.
 * User: rgladson
 * Date: 6/1/2016
 * Time: 5:06 PM
 */

namespace PHPixme\exception;

use PHPixme\ClosedTrait;
use PHPixme\ImmutableConstructorTrait;
use PHPixme\Pot;

/**
 * Class InvalidContentException
 * Represents the error of the contents (or lack there of) of a container being inappropriate for
 * the action taken.
 * @package PHPixme\exception
 */
class InvalidContentException extends \Exception implements CollectibleExceptionInterface
{
  use ImmutableConstructorTrait, ClosedTrait;
  private $content;

  /**
   * InvalidContentsException constructor.
   * @param mixed $content
   * @param string $message
   * @param int $code
   * @param \Exception $previous
   */
  public function __construct($content, $message = '', $code = 0, \Exception $previous = null)
  {
    $this->assertOnce();
    parent::__construct($message, $code, $previous);
    $this->content = $content;
  }

  /**
   * Returns the inappropriate content
   * @return mixed
   */
  public function get() {
    return $this->content;
  }

  /**
   * @inheritdoc
   */
  public function toPot()
  {
   return new Pot($this->content, $this->message, $this->code, $this);
  }
}