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

    <parent>
        <groupId>io.dropwizard</groupId>
        <artifactId>dropwizard-parent</artifactId>
        <version>1.0.0-SNAPSHOT</version>
    </parent>

    <artifactId>dropwizard-bom</artifactId>
    <packaging>pom</packaging>
    <name>Dropwizard BOM</name>
    <description>
        Bill of materials to make sure a consistent set of versions is used for Dropwizard modules.
    </description>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
        <dropwizard.version>${project.version}</dropwizard.version>
        <guava.version>18.0</guava.version>
        <jersey.version>2.22.1</jersey.version>
        <jackson.api.version>2.6.0</jackson.api.version>
        <jackson.version>2.6.3</jackson.version>
        <jetty.version>9.2.13.v20150730</jetty.version>
        <servlet.version>3.0.0.v201112011016</servlet.version>
        <metrics3.version>3.1.2</metrics3.version>
        <slf4j.version>1.7.12</slf4j.version>
        <logback.version>1.1.3</logback.version>
        <h2.version>1.4.190</h2.version>
    </properties>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>org.objenesis</groupId>
                <artifactId>objenesis</artifactId>
                <version>2.2</version>
            </dependency>
            <dependency>
                <groupId>org.apache.commons</groupId>
                <artifactId>commons-lang3</artifactId>
                <version>3.4</version>
            </dependency>
            <dependency>
                <groupId>com.google.guava</groupId>
                <artifactId>guava</artifactId>
                <version>${guava.version}</version>
            </dependency>
            <dependency>
                <groupId>net.sourceforge.argparse4j</groupId>
                <artifactId>argparse4j</artifactId>
                <version>0.6.0</version>
            </dependency>
            <dependency>
                <groupId>com.google.code.findbugs</groupId>
                <artifactId>jsr305</artifactId>
                <version>3.0.1</version>
            </dependency>
            <dependency>
                <groupId>joda-time</groupId>
                <artifactId>joda-time</artifactId>
                <version>2.9</version>
            </dependency>
            <dependency>
                <groupId>org.hibernate</groupId>
                <artifactId>hibernate-validator</artifactId>
                <version>5.2.2.Final</version>
            </dependency>
            <dependency>
                <groupId>org.glassfish</groupId>
                <artifactId>javax.el</artifactId>
                <version>3.0.0</version>
            </dependency>
            <dependency>
                <groupId>javax.servlet</groupId>
                <artifactId>javax.servlet-api</artifactId>
                <version>3.1.0</version>
            </dependency>
            <dependency>
                <groupId>org.apache.httpcomponents</groupId>
                <artifactId>httpclient</artifactId>
                <version>4.5.1</version>
                <exclusions>
                    <exclusion>
                        <groupId>commons-logging</groupId>
                        <artifactId>commons-logging</artifactId>
                    </exclusion>
                </exclusions>
            </dependency>
            <dependency>
                <groupId>org.apache.tomcat</groupId>
                <artifactId>tomcat-jdbc</artifactId>
                <version>8.0.28</version>
            </dependency>
            <dependency>
                <groupId>com.h2database</groupId>
                <artifactId>h2</artifactId>
                <version>${h2.version}</version>
            </dependency>
            <dependency>
                <groupId>org.jadira.usertype</groupId>
                <artifactId>usertype.core</artifactId>
                <version>4.0.0.GA</version>
                <exclusions>
                    <exclusion>
                        <groupId>org.hibernate</groupId>
                        <artifactId>hibernate-entitymanager</artifactId>
                    </exclusion>
                    <exclusion>
                        <groupId>org.slf4j</groupId>
                        <artifactId>slf4j-api</artifactId>
                    </exclusion>
                    <exclusion>
                        <groupId>org.joda</groupId>
                        <artifactId>joda-money</artifactId>
                    </exclusion>
                </exclusions>
            </dependency>
            <dependency>
                <groupId>org.hibernate</groupId>
                <artifactId>hibernate-core</artifactId>
                <version>4.3.11.Final</version>
                <exclusions>
                    <exclusion>
                        <groupId>org.jboss.logging</groupId>
                        <artifactId>jboss-logging</artifactId>
                    </exclusion>
                </exclusions>
            </dependency>
            <dependency>
                <groupId>org.hsqldb</groupId>
                <artifactId>hsqldb</artifactId>
                <version>2.3.3</version>
            </dependency>
            <dependency>
                <groupId>org.liquibase</groupId>
                <artifactId>liquibase-core</artifactId>
                <version>3.4.1</version>
            </dependency>
            <dependency>
                <groupId>com.mattbertolini</groupId>
                <artifactId>liquibase-slf4j</artifactId>
                <version>1.2.1</version>
                <exclusions>
                    <exclusion>
                        <groupId>org.slf4j</groupId>
                        <artifactId>slf4j-api</artifactId>
                    </exclusion>
                    <exclusion>
                        <groupId>org.liquibase</groupId>
                        <artifactId>liquibase-core</artifactId>
                    </exclusion>
                </exclusions>
            </dependency>
            <dependency>
                <groupId>net.jcip</groupId>
                <artifactId>jcip-annotations</artifactId>
                <version>1.0</version>
            </dependency>
            <dependency>
                <groupId>com.github.spullara.mustache.java</groupId>
                <artifactId>compiler</artifactId>
                <version>0.8.17</version>
                <exclusions>
                    <exclusion>
                        <groupId>com.google.guava</groupId>
                        <artifactId>guava</artifactId>
                    </exclusion>
                </exclusions>
            </dependency>
            <dependency>
                <groupId>org.freemarker</groupId>
                <artifactId>freemarker</artifactId>
                <version>2.3.23</version>
            </dependency>
            <dependency>
                <groupId>org.jdbi</groupId>
                <artifactId>jdbi</artifactId>
                <version>2.63.1</version>
            </dependency>

            <!-- Jetty -->
            <dependency>
                <groupId>org.eclipse.jetty</groupId>
                <artifactId>jetty-server</artifactId>
                <version>${jetty.version}</version>
            </dependency>
            <dependency>
                <groupId>org.eclipse.jetty</groupId>
                <artifactId>jetty-util</artifactId>
                <version>${jetty.version}</version>
            </dependency>
            <dependency>
                <groupId>org.eclipse.jetty</groupId>
                <artifactId>jetty-webapp</artifactId>
                <version>${jetty.version}</version>
            </dependency>
            <dependency>
                <groupId>org.eclipse.jetty</groupId>
                <artifactId>jetty-continuation</artifactId>
                <version>${jetty.version}</version>
            </dependency>
            <dependency>
                <groupId>org.eclipse.jetty</groupId>
                <artifactId>jetty-servlet</artifactId>
                <version>${jetty.version}</version>
            </dependency>
            <dependency>
                <groupId>org.eclipse.jetty</groupId>
                <artifactId>jetty-servlets</artifactId>
                <version>${jetty.version}</version>
            </dependency>
            <dependency>
                <groupId>org.eclipse.jetty</groupId>
                <artifactId>jetty-http</artifactId>
                <version>${jetty.version}</version>
            </dependency>
            <dependency>
                <groupId>org.eclipse.jetty.spdy</groupId>
                <artifactId>spdy-http-server</artifactId>
                <version>${jetty.version}</version>
            </dependency>
            <dependency>
                <groupId>org.eclipse.jetty</groupId>
                <artifactId>jetty-alpn-server</artifactId>
                <version>${jetty.version}</version>
            </dependency>
            <dependency>
                <groupId>org.eclipse.jetty.toolchain.setuid</groupId>
                <artifactId>jetty-setuid-java</artifactId>
                <version>1.0.3</version>
                <exclusions>
                    <exclusion>
                        <groupId>org.eclipse.jetty</groupId>
                        <artifactId>jetty-util</artifactId>
                    </exclusion>
                    <exclusion>
                        <groupId>org.eclipse.jetty</groupId>
                        <artifactId>jetty-server</artifactId>
                    </exclusion>
                </exclusions>
            </dependency>

            <!-- Jackson -->
            <dependency>
                <groupId>com.fasterxml.jackson.core</groupId>
                <artifactId>jackson-annotations</artifactId>
                <version>${jackson.api.version}</version>
            </dependency>
            <dependency>
                <groupId>com.fasterxml.jackson.core</groupId>
                <artifactId>jackson-core</artifactId>
                <version>${jackson.version}</version>
            </dependency>
            <dependency>
                <groupId>com.fasterxml.jackson.core</groupId>
                <artifactId>jackson-databind</artifactId>
                <version>${jackson.version}</version>
            </dependency>
            <dependency>
                <groupId>com.fasterxml.jackson.datatype</groupId>
                <artifactId>jackson-datatype-jdk7</artifactId>
                <version>${jackson.version}</version>
            </dependency>
            <dependency>
                <groupId>com.fasterxml.jackson.datatype</groupId>
                <artifactId>jackson-datatype-guava</artifactId>
                <version>${jackson.version}</version>
                <exclusions>
                    <exclusion>
                        <groupId>com.google.guava</groupId>
                        <artifactId>guava</artifactId>
                    </exclusion>
                </exclusions>
            </dependency>
            <dependency>
                <groupId>com.fasterxml.jackson.datatype</groupId>
                <artifactId>jackson-datatype-hibernate4</artifactId>
                <version>${jackson.version}</version>
                <exclusions>
                    <exclusion>
                        <groupId>com.fasterxml.jackson.core</groupId>
                        <artifactId>jackson-databind</artifactId>
                    </exclusion>
                </exclusions>
            </dependency>
            <dependency>
                <groupId>com.fasterxml.jackson.module</groupId>
                <artifactId>jackson-module-afterburner</artifactId>
                <version>${jackson.version}</version>
            </dependency>
            <dependency>
                <groupId>com.fasterxml.jackson.datatype</groupId>
                <artifactId>jackson-datatype-joda</artifactId>
                <version>${jackson.version}</version>
                <exclusions>
                    <exclusion>
                        <groupId>joda-time</groupId>
                        <artifactId>joda-time</artifactId>
                    </exclusion>
                </exclusions>
            </dependency>
            <dependency>
                <groupId>com.fasterxml.jackson.dataformat</groupId>
                <artifactId>jackson-dataformat-yaml</artifactId>
                <version>${jackson.version}</version>
            </dependency>
            <dependency>
                <groupId>com.fasterxml.jackson.jaxrs</groupId>
                <artifactId>jackson-jaxrs-json-provider</artifactId>
                <version>${jackson.version}</version>
                <exclusions>
                    <exclusion>
                        <groupId>com.fasterxml.jackson.core</groupId>
                        <artifactId>jackson-core</artifactId>
                    </exclusion>
                    <exclusion>
                        <groupId>com.fasterxml.jackson.core</groupId>
                        <artifactId>jackson-databind</artifactId>
                    </exclusion>
                </exclusions>
            </dependency>

            <!-- Jersey -->
            <dependency>
                <groupId>org.glassfish.jersey</groupId>
                <artifactId>jersey-bom</artifactId>
                <version>${jersey.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
            <dependency>
                <groupId>org.glassfish.jersey.core</groupId>
                <artifactId>jersey-server</artifactId>
                <version>${jersey.version}</version>
                <exclusions>
                    <exclusion>
                        <groupId>com.google.guava</groupId>
                        <artifactId>guava</artifactId>
                    </exclusion>
                    <exclusion>
                        <groupId>org.slf4j</groupId>
                        <artifactId>slf4j-api</artifactId>
                    </exclusion>
                </exclusions>
            </dependency>
            <dependency>
                <groupId>org.glassfish.jersey.connectors</groupId>
                <artifactId>jersey-apache-connector</artifactId>
                <version>${jersey.version}</version>
                <exclusions>
                    <exclusion>
                        <groupId>org.apache.httpcomponents</groupId>
                        <artifactId>httpclient</artifactId>
                    </exclusion>
                    <exclusion>
                        <groupId>org.slf4j</groupId>
                        <artifactId>slf4j-api</artifactId>
                    </exclusion>
                </exclusions>
            </dependency>
            <dependency>
                <groupId>org.glassfish.jersey.ext</groupId>
                <artifactId>jersey-bean-validation</artifactId>
                <version>${jersey.version}</version>
                <exclusions>
                    <exclusion>
                        <groupId>org.hibernate</groupId>
                        <artifactId>hibernate-validator</artifactId>
                    </exclusion>
                    <exclusion>
                        <groupId>javax.el</groupId>
                        <artifactId>javax.el-api</artifactId>
                    </exclusion>
                    <exclusion>
                        <groupId>org.glassfish.web</groupId>
                        <artifactId>javax.el</artifactId>
                    </exclusion>
                </exclusions>
            </dependency>

            <!-- Metrics -->
            <dependency>
                <groupId>io.dropwizard.metrics</groupId>
                <artifactId>metrics-annotation</artifactId>
                <version>${metrics3.version}</version>
            </dependency>
            <dependency>
                <groupId>io.dropwizard.metrics</groupId>
                <artifactId>metrics-core</artifactId>
                <version>${metrics3.version}</version>
                <exclusions>
                    <exclusion>
                        <groupId>org.slf4j</groupId>
                        <artifactId>slf4j-api</artifactId>
                    </exclusion>
                </exclusions>
            </dependency>
            <dependency>
                <groupId>io.dropwizard.metrics</groupId>
                <artifactId>metrics-jvm</artifactId>
                <version>${metrics3.version}</version>
                <exclusions>
                    <exclusion>
                        <groupId>org.slf4j</groupId>
                        <artifactId>slf4j-api</artifactId>
                    </exclusion>
                </exclusions>
            </dependency>
            <dependency>
                <groupId>io.dropwizard.metrics</groupId>
                <artifactId>metrics-servlets</artifactId>
                <version>${metrics3.version}</version>
                <exclusions>
                    <exclusion>
                        <groupId>com.fasterxml.jackson.core</groupId>
                        <artifactId>jackson-databind</artifactId>
                    </exclusion>
                    <exclusion>
                        <groupId>org.slf4j</groupId>
                        <artifactId>slf4j-api</artifactId>
                    </exclusion>
                </exclusions>
            </dependency>
            <dependency>
                <groupId>io.dropwizard.metrics</groupId>
                <artifactId>metrics-healthchecks</artifactId>
                <version>${metrics3.version}</version>
                <exclusions>
                    <exclusion>
                        <groupId>org.slf4j</groupId>
                        <artifactId>slf4j-api</artifactId>
                    </exclusion>
                </exclusions>
            </dependency>
            <dependency>
                <groupId>io.dropwizard.metrics</groupId>
                <artifactId>metrics-logback</artifactId>
                <version>${metrics3.version}</version>
                <exclusions>
                    <exclusion>
                        <groupId>ch.qos.logback</groupId>
                        <artifactId>logback-classic</artifactId>
                    </exclusion>
                    <exclusion>
                        <groupId>org.slf4j</groupId>
                        <artifactId>slf4j-api</artifactId>
                    </exclusion>
                </exclusions>
            </dependency>
            <dependency>
                <groupId>io.dropwizard.metrics</groupId>
                <artifactId>metrics-jersey2</artifactId>
                <version>${metrics3.version}</version>
                <exclusions>
                    <exclusion>
                        <groupId>org.glassfish.jersey.core</groupId>
                        <artifactId>jersey-server</artifactId>
                    </exclusion>
                    <exclusion>
                        <groupId>org.slf4j</groupId>
                        <artifactId>slf4j-api</artifactId>
                    </exclusion>
                </exclusions>
            </dependency>
            <dependency>
                <groupId>io.dropwizard.metrics</groupId>
                <artifactId>metrics-jetty9</artifactId>
                <version>${metrics3.version}</version>
                <exclusions>
                    <exclusion>
                        <groupId>org.eclipse.jetty</groupId>
                        <artifactId>jetty-server</artifactId>
                    </exclusion>
                    <exclusion>
                        <groupId>org.slf4j</groupId>
                        <artifactId>slf4j-api</artifactId>
                    </exclusion>
                </exclusions>
            </dependency>
            <dependency>
                <groupId>io.dropwizard.metrics</groupId>
                <artifactId>metrics-httpclient</artifactId>
                <version>${metrics3.version}</version>
                <exclusions>
                    <exclusion>
                        <groupId>commons-logging</groupId>
                        <artifactId>commons-logging</artifactId>
                    </exclusion>
                    <exclusion>
                        <groupId>org.slf4j</groupId>
                        <artifactId>slf4j-api</artifactId>
                    </exclusion>
                    <exclusion>
                        <groupId>org.apache.httpcomponents</groupId>
                        <artifactId>httpclient</artifactId>
                    </exclusion>
                </exclusions>
            </dependency>
            <dependency>
                <groupId>io.dropwizard.metrics</groupId>
                <artifactId>metrics-jdbi</artifactId>
                <version>${metrics3.version}</version>
                <exclusions>
                    <exclusion>
                        <groupId>org.jdbi</groupId>
                        <artifactId>jdbi</artifactId>
                    </exclusion>
                    <exclusion>
                        <groupId>org.slf4j</groupId>
                        <artifactId>slf4j-api</artifactId>
                    </exclusion>
                </exclusions>
            </dependency>
            <dependency>
                <groupId>io.dropwizard.metrics</groupId>
                <artifactId>metrics-ganglia</artifactId>
                <version>${metrics3.version}</version>
                <exclusions>
                    <exclusion>
                        <groupId>org.slf4j</groupId>
                        <artifactId>slf4j-api</artifactId>
                    </exclusion>
                </exclusions>
            </dependency>
            <dependency>
                <groupId>io.dropwizard.metrics</groupId>
                <artifactId>metrics-graphite</artifactId>
                <version>${metrics3.version}</version>
                <exclusions>
                    <exclusion>
                        <groupId>org.slf4j</groupId>
                        <artifactId>slf4j-api</artifactId>
                    </exclusion>
                </exclusions>
            </dependency>

            <!-- Logging dependencies -->
            <dependency>
                <groupId>org.slf4j</groupId>
                <artifactId>slf4j-api</artifactId>
                <version>${slf4j.version}</version>
            </dependency>
            <dependency>
                <groupId>org.slf4j</groupId>
                <artifactId>jul-to-slf4j</artifactId>
                <version>${slf4j.version}</version>
            </dependency>
            <dependency>
                <groupId>org.slf4j</groupId>
                <artifactId>log4j-over-slf4j</artifactId>
                <version>${slf4j.version}</version>
            </dependency>
            <dependency>
                <groupId>org.slf4j</groupId>
                <artifactId>jcl-over-slf4j</artifactId>
                <version>${slf4j.version}</version>
            </dependency>
            <dependency>
                <groupId>ch.qos.logback</groupId>
                <artifactId>logback-core</artifactId>
                <version>${logback.version}</version>
            </dependency>
            <dependency>
                <groupId>ch.qos.logback</groupId>
                <artifactId>logback-classic</artifactId>
                <version>${logback.version}</version>
                <exclusions>
                    <exclusion>
                        <groupId>org.slf4j</groupId>
                        <artifactId>slf4j-api</artifactId>
                    </exclusion>
                </exclusions>
            </dependency>

            <!-- Test dependencies -->
            <dependency>
                <groupId>junit</groupId>
                <artifactId>junit</artifactId>
                <version>4.12</version>
            </dependency>
            <dependency>
                <groupId>org.hamcrest</groupId>
                <artifactId>hamcrest-core</artifactId>
                <version>1.3</version>
            </dependency>
            <dependency>
                <groupId>org.mockito</groupId>
                <artifactId>mockito-core</artifactId>
                <version>${mockito.version}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.assertj</groupId>
                <artifactId>assertj-core</artifactId>
                <version>${assertj.version}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.glassfish.jersey.test-framework</groupId>
                <artifactId>jersey-test-framework-core</artifactId>
                <version>${jersey.version}</version>
                <exclusions>
                    <exclusion>
                        <groupId>javax.servlet</groupId>
                        <artifactId>javax.servlet-api</artifactId>
                    </exclusion>
                </exclusions>
            </dependency>
            <dependency>
                <groupId>org.glassfish.jersey.test-framework.providers</groupId>
                <artifactId>jersey-test-framework-provider-grizzly2</artifactId>
                <version>${jersey.version}</version>
                <exclusions>
                    <exclusion>
                        <groupId>javax.servlet</groupId>
                        <artifactId>javax.servlet-api</artifactId>
                    </exclusion>
                </exclusions>
            </dependency>
            <dependency>
                <groupId>org.glassfish.jersey.test-framework.providers</groupId>
                <artifactId>jersey-test-framework-provider-inmemory</artifactId>
                <version>${jersey.version}</version>
                <exclusions>
                    <exclusion>
                        <groupId>javax.servlet</groupId>
                        <artifactId>javax.servlet-api</artifactId>
                    </exclusion>
                </exclusions>
            </dependency>

            <!-- Dropwizard modules -->
            <dependency>
                <groupId>io.dropwizard</groupId>
                <artifactId>dropwizard-assets</artifactId>
                <version>${dropwizard.version}</version>
            </dependency>
            <dependency>
                <groupId>io.dropwizard</groupId>
                <artifactId>dropwizard-auth</artifactId>
                <version>${dropwizard.version}</version>
            </dependency>
            <dependency>
                <groupId>io.dropwizard</groupId>
                <artifactId>dropwizard-client</artifactId>
                <version>${dropwizard.version}</version>
            </dependency>
            <dependency>
                <groupId>io.dropwizard</groupId>
                <artifactId>dropwizard-configuration</artifactId>
                <version>${dropwizard.version}</version>
            </dependency>
            <dependency>
                <groupId>io.dropwizard</groupId>
                <artifactId>dropwizard-core</artifactId>
                <version>${dropwizard.version}</version>
            </dependency>
            <dependency>
                <groupId>io.dropwizard</groupId>
                <artifactId>dropwizard-db</artifactId>
                <version>${dropwizard.version}</version>
            </dependency>
            <dependency>
                <groupId>io.dropwizard</groupId>
                <artifactId>dropwizard-forms</artifactId>
                <version>${dropwizard.version}</version>
            </dependency>
            <dependency>
                <groupId>io.dropwizard</groupId>
                <artifactId>dropwizard-hibernate</artifactId>
                <version>${dropwizard.version}</version>
            </dependency>
            <dependency>
                <groupId>io.dropwizard</groupId>
                <artifactId>dropwizard-jackson</artifactId>
                <version>${dropwizard.version}</version>
            </dependency>
            <dependency>
                <groupId>io.dropwizard</groupId>
                <artifactId>dropwizard-jdbi</artifactId>
                <version>${dropwizard.version}</version>
            </dependency>
            <dependency>
                <groupId>io.dropwizard</groupId>
                <artifactId>dropwizard-jersey</artifactId>
                <version>${dropwizard.version}</version>
            </dependency>
            <dependency>
                <groupId>io.dropwizard</groupId>
                <artifactId>dropwizard-jetty</artifactId>
                <version>${dropwizard.version}</version>
            </dependency>
            <dependency>
                <groupId>io.dropwizard</groupId>
                <artifactId>dropwizard-lifecycle</artifactId>
                <version>${dropwizard.version}</version>
            </dependency>
            <dependency>
                <groupId>io.dropwizard</groupId>
                <artifactId>dropwizard-logging</artifactId>
                <version>${dropwizard.version}</version>
            </dependency>
            <dependency>
                <groupId>io.dropwizard</groupId>
                <artifactId>dropwizard-metrics</artifactId>
                <version>${dropwizard.version}</version>
            </dependency>
            <dependency>
                <groupId>io.dropwizard</groupId>
                <artifactId>dropwizard-metrics-ganglia</artifactId>
                <version>${dropwizard.version}</version>
            </dependency>
            <dependency>
                <groupId>io.dropwizard</groupId>
                <artifactId>dropwizard-metrics-graphite</artifactId>
                <version>${dropwizard.version}</version>
            </dependency>
            <dependency>
                <groupId>io.dropwizard</groupId>
                <artifactId>dropwizard-migrations</artifactId>
                <version>${dropwizard.version}</version>
            </dependency>
            <dependency>
                <groupId>io.dropwizard</groupId>
                <artifactId>dropwizard-servlets</artifactId>
                <version>${dropwizard.version}</version>
            </dependency>
            <dependency>
                <groupId>io.dropwizard</groupId>
                <artifactId>dropwizard-spdy</artifactId>
                <version>${dropwizard.version}</version>
            </dependency>
            <dependency>
                <groupId>io.dropwizard</groupId>
                <artifactId>dropwizard-testing</artifactId>
                <version>${dropwizard.version}</version>
            </dependency>
            <dependency>
                <groupId>io.dropwizard</groupId>
                <artifactId>dropwizard-util</artifactId>
                <version>${dropwizard.version}</version>
            </dependency>
            <dependency>
                <groupId>io.dropwizard</groupId>
                <artifactId>dropwizard-validation</artifactId>
                <version>${dropwizard.version}</version>
            </dependency>
            <dependency>
                <groupId>io.dropwizard</groupId>
                <artifactId>dropwizard-views</artifactId>
                <version>${dropwizard.version}</version>
            </dependency>
            <dependency>
                <groupId>io.dropwizard</groupId>
                <artifactId>dropwizard-views-freemarker</artifactId>
                <version>${dropwizard.version}</version>
            </dependency>
            <dependency>
                <groupId>io.dropwizard</groupId>
                <artifactId>dropwizard-views-mustache</artifactId>
                <version>${dropwizard.version}</version>
            </dependency>
        </dependencies>
    </dependencyManagement>
</project>


text:
from typing import List

import astroid

from pylint import checkers, interfaces
from pylint.checkers import utils

class LenChecker(checkers.BaseChecker):
    """Checks for incorrect usage of len() inside conditions.
    Pep8 states:
    For sequences, (strings, lists, tuples), use the fact that empty sequences are false.

        Yes: if not seq:
             if seq:

        No: if len(seq):
            if not len(seq):

    Problems detected:
    * if len(sequence):
    * if not len(sequence):
    * elif len(sequence):
    * elif not len(sequence):
    * while len(sequence):
    * while not len(sequence):
    * assert len(sequence):
    * assert not len(sequence):
    * bool(len(sequence))
    """

    __implements__ = (interfaces.IAstroidChecker,)

    # configuration section name
    name = "refactoring"
    msgs = {
        "C1801": (
            "Do not use `len(SEQUENCE)` without comparison to determine if a sequence is empty",
            "len-as-condition",
            "Used when Pylint detects that len(sequence) is being used "
            "without explicit comparison inside a condition to determine if a sequence is empty. "
            "Instead of coercing the length to a boolean, either "
            "rely on the fact that empty sequences are false or "
            "compare the length against a scalar.",
        )
    }

    priority = -2
    options = ()

    @utils.check_messages("len-as-condition")
    def visit_call(self, node):
        # a len(S) call is used inside a test condition
        # could be if, while, assert or if expression statement
        # e.g. `if len(S):`
        if not utils.is_call_of_name(node, "len"):
            return
        # the len() call could also be nested together with other
        # boolean operations, e.g. `if z or len(x):`
        parent = node.parent
        while isinstance(parent, astroid.BoolOp):
            parent = parent.parent
        # we're finally out of any nested boolean operations so check if
        # this len() call is part of a test condition
        if not utils.is_test_condition(node, parent):
            return
        len_arg = node.args[0]
        generator_or_comprehension = (
            astroid.ListComp,
            astroid.SetComp,
            astroid.DictComp,
            astroid.GeneratorExp,
        )
        if isinstance(len_arg, generator_or_comprehension):
            # The node is a generator or comprehension as in len([x for x in ...])
            self.add_message("len-as-condition", node=node)
            return
        try:
            instance = next(len_arg.infer())
        except astroid.InferenceError:
            # Probably undefined-varible, abort check
            return
        mother_classes = self.base_classes_of_node(instance)
        affected_by_pep8 = any(
            t in mother_classes for t in ["str", "tuple", "list", "set"]
        )
        if "range" in mother_classes or (
            affected_by_pep8 and not self.instance_has_bool(instance)
        ):
            self.add_message("len-as-condition", node=node)

    @staticmethod
    def instance_has_bool(class_def: astroid.ClassDef) -> bool:
        try:
            class_def.getattr("__bool__")
            return True
        except astroid.AttributeInferenceError:
            ...
        return False

    @utils.check_messages("len-as-condition")
    def visit_unaryop(self, node):
        """`not len(S)` must become `not S` regardless if the parent block
        is a test condition or something else (boolean expression)
        e.g. `if not len(S):`"""
        if (
            isinstance(node, astroid.UnaryOp)
            and node.op == "not"
            and utils.is_call_of_name(node.operand, "len")
        ):
            self.add_message("len-as-condition", node=node)

    @staticmethod
    def base_classes_of_node(instance: astroid.nodes.ClassDef) -> List[astroid.Name]:
        """Return all the classes names that a ClassDef inherit from including 'object'."""
        try:
            return [instance.name] + [x.name for x in instance.ancestors()]
        except TypeError:
            return [instance.name]

redpajama_set_name: RedPajamaGithub


text:
import zgui.guilocal as local
import pygame
import os
from .surface import *

class ResourceManager:
	"""resource Manager to save mamory"""

	def __init__(self,path = os.path.dirname(local.__file__)):
		self.res = {}
		self.folder = path

	def LoadImage(self,name):
		"""load image"""
		if ":" in name: path = name
		else: path = self.folder+'/'+name
		if not path in self.res:
			try:
				self.res[path] = ExSurface(pygame.image.load(path))
			except:
				raise "Can't load Image"
		return self.res[path]

	def LoadFont(self,name,size):
		if not (name,size) in self.res:
			if name.endswith('.ttf'):
				path = self.folder+'/'+ name
				self.res[(name,size)] = pygame.font.Font(path,size)
			else:
				self.res[(name,size)] = pygame.font.SysFont(name,size)
		return self.res[(name,size)]


text:
import urlparse
import httplib
import isbntool

def check(url):
    _, host, path, _, _ = urlparse.urlsplit(url)
    connection = httplib.HTTPConnection(host)
    connection.request('HEAD', path)
    response = connection.getresponse()
    if response.status == httplib.NOT_FOUND:
        return False
    return True

def cover(isbn):
    isbn10 = isbntool.convert_to_10(isbn)
    prefix = 'http://image.aladdin.co.kr/cover/cover/'
    url1 = prefix + isbn10 + '_1.gif'
    url2 = prefix + isbn10 + '_1.jpg'
    if check(url1):
        return url1
    if check(url2):
        return url2
    isbn13 = isbntool.convert_to_13(isbn10)
    url = prefix + isbn13 + '.gif'
    if check(url):
        return url


text:
/**
 * An OSC (Open Sound Control) library for processing.
 *
 * (c) 2004-2011
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General
 * Public License along with this library; if not, write to the
 * Free Software Foundation, Inc., 59 Temple Place, Suite 330,
 * Boston, MA  02111-1307  USA
 *
 * @author		Andreas Schlegel http://www.sojamo.de/libraries/oscP5
 * @modified	12/19/2011
 * @version		0.9.8
 */

package oscP5;

import java.net.DatagramPacket;

import java.net.InetAddress;
import netP5.Bytes;
import netP5.Logger;
import netP5.TcpClient;
import netP5.TcpPacket;

/**
 * An OSC message consists of an OSC Address Pattern, an OSC Type Tag String
 * and the OSC arguments.
 *
 * @related OscBundle
 * @example oscP5sendReceive
 */
public class OscMessage extends OscPacket {

	protected final OscArgument _myOscArgument = new OscArgument();

    protected boolean isPlugged = false;

    protected OscMessage(final DatagramPacket theDatagramPacket) {
        inetAddress = theDatagramPacket.getAddress();
        port = theDatagramPacket.getPort();
        hostAddress = inetAddress.toString();
        parseMessage(theDatagramPacket.getData());
        _myType = MESSAGE;
    }

    protected OscMessage(final TcpPacket thePacket) {
        _myTcpClient = thePacket.getTcpConnection();
        inetAddress = _myTcpClient.netAddress().inetaddress();
        port = _myTcpClient.netAddress().port();
        hostAddress = inetAddress.toString();
        parseMessage(thePacket.getData());
        _myType = MESSAGE;
    }

    /**
     *
     * @param theOscMessage OscMessage
     * @invisible
     */

    public OscMessage(final OscMessage theOscMessage) {
        inetAddress = theOscMessage.inetAddress;
        port = theOscMessage.port;
        hostAddress = theOscMessage.hostAddress;
        _myTcpClient = theOscMessage.tcpConnection();
        _myAddrPattern = theOscMessage._myAddrPattern;
        _myTypetag = theOscMessage._myTypetag;
        _myData = theOscMessage._myData;
        _myArguments = theOscMessage._myArguments;
        isValid = true;
    }

    /**
     *
     * @param theAddrPattern
     * String
     */
    public OscMessage(final String theAddrPattern) {
        this(theAddrPattern, new Object[0]);
    }

    /**
     *
     * @param theAddrInt
     * int
     */
    public OscMessage(final int theAddrInt) {
        this(theAddrInt, new Object[0]);
    }

    /**
     *
     * @param theAddrPattern String
     * @param theArguments
     * Object[]
     */
    public OscMessage(final String theAddrPattern,
                      final Object[] theArguments) {
        init();
        setAddrPattern(theAddrPattern);
        setArguments(theArguments);
    }

    /**
     *
     * @param theAddrPattern int
     * @param theArguments Object[]
     */
    public OscMessage(final int theAddrPattern,
                      final Object[] theArguments) {
        init();
        setAddrPattern(theAddrPattern);
        setArguments(theArguments);
    }

    protected OscMessage(final byte[] theBytes,
                         final InetAddress theInetAddress,
                         final int thePort,
                         final TcpClient theClient
            ) {
        _myTcpClient = theClient;
        inetAddress = theInetAddress;
        port = thePort;
        hostAddress = inetAddress.toString();
        parseMessage(theBytes);
    }

    protected OscMessage(final byte[] theBytes,
                         final InetAddress theInetAddress,
                         final int thePort,
                         final long theTimetag,
                         final TcpClient theClient
            ) {
        this(theBytes,theInetAddress,thePort,theClient);
        timetag = theTimetag;
    }

    protected void init() {
        _myTypetag = new byte[0];
        _myData = new byte[0];
    }

    /**
     * clear and reset an OscMessage for reuse.
     */
    public void clear() {
        init();
        setAddrPattern("");
        setArguments(new Object[0]);
    }

    /**
     * clears the arguments in a message,
     * but keeps the address the address pattern.
     *
     */
    public void clearArguments() {
    	_myTypetag = new byte[0];
        _myData = new byte[0];
        _myArguments = new Object[0];
    }

    /**
     * TODO
     * set should enable the programmer to set values
     * of an existing osc message.
     */
    public void set(final int theIndex, final Object theObject) {
//    	byte[] myPreTypetag = new byte[theIndex];
//    	byte[] myPostTypetag = new byte[_myTypetag.length - theIndex];
    	System.out.println("Typetag:\t" + _myTypetag.length);
    	System.out.println("Arguments:\t");
    	Bytes.printBytes(_myData);
    	System.out.println(_myArguments.length);
    	for(int i=0;i<_myArguments.length;i++) {
    		System.out.println(_myArguments[i]);
    	}
    }

    /**
     *
     * @param theTypeTag
     * String
     * @return boolean
     * @example oscP5parsing
     */
    public boolean checkTypetag(final String theTypeTag) {
        return theTypeTag.equals(typetag());
    }

    /**
     * check if an address pattern equals a specific address pattern
     * you are looking for. this is usually used when parsing an osc message.
     * e.g. if(theOscMessage.checkAddrPattern("/test")==true) {...}
     * @param theAddrPattern
     * String
     * @return boolean
     * @example oscP5parsing
     */
    public boolean checkAddrPattern(final String theAddrPattern) {
        return theAddrPattern.equals(addrPattern());
    }

    /**
     * set the address pattern of an osc message. you can set
     * a string or an int as address pattern.tnt might be useful for
     * supercollider users. oscP5 does support ints and strings as
     * address patterns when sending and receiving messages.
     * @param theAddrPattern
     * String
     */
    public void setAddrPattern(final String theAddrPattern) {
        _myAddrPattern = theAddrPattern.getBytes();
    }

    /**
     *
     * @param theAddrPattern
     * int
     */
    public void setAddrPattern(final int theAddrPattern) {
        _myAddrPattern = Bytes.toBytes(theAddrPattern);
    }

    /**
     * set the arguments of the osc message using an object array.
     * with version 0.9.4 the existing arguments are overwritten,
     * to add the arguments to the argument list, use addArguments(Object[])
     * @param theArguments
     * Object[]
     */
    public void setArguments(final Object[] theArguments) {
    	clearArguments();
    	addArguments(theArguments);
    }

    /**
     * add a list of arguments to an exisiting set of arguments.
     * to overwrite the existing argument list, use setArguments(Object[])
     *
     * @param theArguments
     */
    public OscMessage addArguments(final Object[] theArguments) {
        return add(theArguments);
    }

    public String addrPattern() {
        return Bytes.getAsString(_myAddrPattern);
    }

    /**
     * returns the address pattern of the osc message as int.
     * @return int
     */
    public int addrInt() {
        return _myAddrInt;
    }

    /**
     * returns the typetag of the osc message. e.g. the message contains
     * 3 floats then the typetag would be "fff"
     * @return String
     */
    public String typetag() {
        return Bytes.getAsString(_myTypetag);
    }

    /**
     * get the timetag of an osc message. timetags are only sent by
     * osc bundles.
     * @return long
     */
    public long timetag() {
      return timetag;
    }

    /**
     *
     * @return Object[]
     */
    public Object[] arguments() {
        return _myArguments;
    }

    /**
     * supported arrays see OscPlug.getArgs
     * @return Object[]
     */
    protected Object[] argsAsArray() {
        switch (_myTypetag[0]) {
        case (0X66): // float f
            final float[] myFloatArray = new float[_myArguments.length];
            for (int i = 0; i < myFloatArray.length; i++) {
                myFloatArray[i] = ((Float) _myArguments[i]).floatValue();
            }
            return new Object[] {myFloatArray};
        case (0x69): // int i
            final int[] myIntArray = new int[_myArguments.length];
            for (int i = 0; i < myIntArray.length; i++) {
                myIntArray[i] = ((Integer) _myArguments[i]).intValue();
            }
            return new Object[] {myIntArray};
        case (0x53): // Symbol S
        case (0x73): // String s
            final String[] myStringArray = new String[_myArguments.length];
            for (int i = 0; i < myStringArray.length; i++) {
                myStringArray[i] = ((String) _myArguments[i]);
            }
            return new Object[] {myStringArray};
        default:
            break;
        }
        return new Object[] {};
    }

    /**
     *
     * @return byte[]
     * @invisible
     */
    public byte[] getAddrPatternAsBytes() {
        return Bytes.append(_myAddrPattern,
                            new byte[align(_myAddrPattern.length)]);
    }

    /**
     *
     * @return byte[]
     * @invisible
     */
    public byte[] getTypetagAsBytes() {
        return _myTypetag;
    }

    /**
     *
     * @return byte[]
     * @invisible
     */
    public byte[] getBytes() {
        byte[] myBytes = new byte[0];
        byte[] myTypeTag = Bytes.copy(_myTypetag, 0);
        myBytes = Bytes.append(myBytes, _myAddrPattern,
                               new byte[align(_myAddrPattern.length)]);
        if (myTypeTag.length == 0) {
            myTypeTag = new byte[] {KOMMA};
        } else if (myTypeTag[0] != KOMMA) {
            myTypeTag = Bytes.append(new byte[] {KOMMA}, myTypeTag);
        }
        myBytes = Bytes.append(myBytes, myTypeTag,
                               new byte[align(myTypeTag.length)]);
        myBytes = Bytes.append(myBytes, _myData,
                               new byte[align(_myData.length) % 4]);
        return myBytes;
    }

    protected Object[]  increase(int theAmount) {
    	if(_myArguments.length<1 || _myArguments == null) {
    		return new Object[1];
    	}
    	Object[] myArguments = new Object[_myArguments.length + theAmount];
        System.arraycopy(_myArguments, 0, myArguments, 0, _myArguments.length);
        return myArguments;
    }
    /**
     * add values to an osc message. please check the
     * add documentation for specific information.
     * @example oscP5message
     */
    public OscMessage add() {
        _myTypetag = Bytes.append(_myTypetag, new byte[] {0x4e});
        return this;
    }

    /**
     * @param theValue int
     */
    public OscMessage add(final int theValue) {
        _myTypetag = Bytes.append(_myTypetag, new byte[] {0x69});
        _myData = Bytes.append(_myData, Bytes.toBytes(theValue));
        _myArguments = increase(1);
        _myArguments[_myArguments.length-1] = new Integer(theValue);
        return this;
    }

    /**
     *
     * @param theValue String
     */
    public OscMessage add(final String theValue) {
        _myTypetag = Bytes.append(_myTypetag, new byte[] {0x73});
        final byte[] myString = theValue.getBytes();
        _myData = Bytes.append(_myData, myString,
                               new byte[align(myString.length)]);
        _myArguments = increase(1);
        _myArguments[_myArguments.length-1] = theValue;
        return this;
    }

    /**
     *
     * @param theValue float
     */
    public OscMessage add(final float theValue) {
        _myTypetag = Bytes.append(_myTypetag, new byte[] {0x66});
        _myData = Bytes.append(_myData, Bytes.toBytes(Float
                .floatToIntBits(theValue)));
        _myArguments = increase(1);
        _myArguments[_myArguments.length-1] = new Float(theValue);
        return this;
    }

    /**
     *
     * @param theValue double
     */
    public OscMessage add(final double theValue) {
        _myTypetag = Bytes.append(_myTypetag, new byte[] {0x64});
        _myData = Bytes.append(_myData, Bytes.toBytes(Double
                .doubleToLongBits(theValue)));
        _myArguments = increase(1);
        _myArguments[_myArguments.length-1] = new Double(theValue);
        return this;
    }

    /**
     *
     * @param theValue boolean
     */
    public OscMessage add(final boolean theValue) {
        if (theValue) {
            _myTypetag = Bytes.append(_myTypetag, new byte[] {0x54});
        } else {
            _myTypetag = Bytes.append(_myTypetag, new byte[] {0x46});
        }
        return this;
    }

    /**
     *
     * @param theValue Boolean
     */
    public OscMessage add(final Boolean theValue) {
        add((theValue).booleanValue());
        return this;
    }

    /**
     *
     * @param theValue Integer
     */
    public OscMessage add(final Integer theValue) {
        add(theValue.intValue());
        return this;
    }

    /**
     *
     * @param theValue
     * Float
     */
    public OscMessage add(final Float theValue) {
        add(theValue.floatValue());
        return this;
    }

    /**
     *
     * @param theValue
     * Double
     */
    public OscMessage add(final Double theValue) {
        add(theValue.doubleValue());
        return this;
    }

    /**
     *
     * @param theValue
     * Character
     */
    public OscMessage add(final Character theValue) {
        add(theValue.charValue());
        return this;
    }

    /**
     *
     * @param theValue
     * char
     */
    public OscMessage add(final char theValue) {
        _myTypetag = Bytes.append(_myTypetag, new byte[] {0x63});
        _myData = Bytes.append(_myData, Bytes.toBytes(theValue));
        _myArguments = increase(1);
        _myArguments[_myArguments.length-1] = new Character(theValue);
        return this;
    }

    /**
     *
     * @param channel int
     * @param status int
     * @param value1 int
     * @param value2 int
     */

    public OscMessage add(final int channel,
                    final int status,
                    final int value1,
                    final int value2) {
        _myTypetag = Bytes.append(_myTypetag, new byte[] {0x6d}); // m
        final byte[] theBytes = new byte[4];
        theBytes[0] = (byte) channel;
        theBytes[1] = (byte) status;
        theBytes[2] = (byte) value1;
        theBytes[3] = (byte) value2;
        _myData = Bytes.append(_myData, theBytes);
        _myArguments = increase(1);
        _myArguments[_myArguments.length-1] = theBytes;
        return this;
    }

    /**
     *
     * @param theArray
     * int[]
     */
    public OscMessage add(final int[] theArray) {
        for (int i = 0; i < theArray.length; i++) {
            add(theArray[i]);
        }
        return this;
    }

    /**
     *
     * @param theArray
     * char[]
     */
    public OscMessage add(final char[] theArray) {
        for (int i = 0; i < theArray.length; i++) {
            add(theArray[i]);
        }
        return this;
    }

    /**
     *
     * @param theArray
     * float[]
     */
    public OscMessage add(final float[] theArray) {
        for (int i = 0; i < theArray.length; i++) {
            add(theArray[i]);
        }
        return this;
    }

    /**
     *
     * @param theArray
     * String[]
     */
    public OscMessage add(final String[] theArray) {
        for (int i = 0; i < theArray.length; i++) {
            add(theArray[i]);
        }
        return this;
    }

    /**
     *
     * @param theArray
     * byte[]
     */
    public OscMessage add(final byte[] theArray) {
        _myTypetag = Bytes.append(_myTypetag, new byte[] {0x62});
        _myData = Bytes.append(_myData, makeBlob(theArray));
        _myArguments = increase(1);
        _myArguments[_myArguments.length-1] = theArray;
        return this;
    }

    /**
     *
     * @param theArray
     * Object[]
     */
    public OscMessage add(final Object[] theArray) {
        for (int i = 0; i < theArray.length; i++) {
            if (!add(theArray[i])) {
                System.out.println("type of Argument not defined in osc specs.");
            }
        }
        return this;
    }

    private boolean add(final Object theObject) {
        if (theObject instanceof Number) {
            if (theObject instanceof Integer) {
                add((Integer) theObject);
            } else if (theObject instanceof Float) {
                add((Float) theObject);
            } else if (theObject instanceof Double) {
                add((Double) theObject);
            } else if (theObject instanceof Long) {
                add((Long) theObject);
            }
        } else if (theObject instanceof String) {
            add((String) theObject);
        } else if (theObject instanceof Boolean) {
            add((Boolean) theObject);
        } else if (theObject instanceof Character) {
            add((Character) theObject);
        }

        else {
            if (theObject instanceof int[]) {
                add((int[]) theObject);
                return true;
            } else if (theObject instanceof float[]) {
                add((float[]) theObject);
                return true;
            } else if (theObject instanceof byte[]) {
                add((byte[]) theObject);
                return true;
            }

            else if (theObject instanceof String[]) {
                add((String[]) theObject);
                return true;
            } else if (theObject instanceof char[]) {
                add((char[]) theObject);
                return true;
            } else if (theObject instanceof double[]) {
                add((float[]) theObject);
                return true;
            }
            return false;
        }
        return true;
    }

    /**
     *
     * @param b byte[]
     * @return byte[]
     * @invisible
     */
    public static byte[] makeBlob(final byte[] b) {
        final int tLength = b.length;
        byte[] b1 = Bytes.toBytes(tLength);
        b1 = Bytes.append(b1, b);
        final int t = tLength % 4;
        if (t != 0) {
            b1 = Bytes.append(b1, new byte[4 - t]);
        }
        return b1;
    }

    /**
     * get a value at a specific position in the osc message. the get method
     * returns an OscArgument from which the value can be parsed into the right
     * format. e.g. to parse an int from the first argument in the osc message,
     * use theOscMessage.get(0).intValue();
     * @param theIndex int
     * @return OscArgument
     */
    public OscArgument get(final int theIndex) {
        if (theIndex < arguments().length) {
            _myOscArgument.value = arguments()[theIndex];
            return _myOscArgument;
        }
        return null;
    }

    /**
     *
     * @return String
     * @invisible
     */
    public final String toString() {
        return hostAddress + ":" + port + " | " +
                addrPattern() + " " + typetag();
    }

    public boolean isPlugged() {
        return isPlugged;
    }

    public void print() {
        Logger.println("-OscMessage----------");
        Logger.println("received from\t" + hostAddress + ":" + port);
        Logger.println("addrpattern\t" + Bytes.getAsString(_myAddrPattern));
        Logger.println("typetag\t" + Bytes.getAsString(_myTypetag));
        Logger.println(Bytes.getAsString(_myArguments));
        Logger.println("---------------------");
    }

    public void printData() {
    	Bytes.printBytes(_myData);
    }
}


text:
var express = require('express')
var app = express()
app.use(express.static('./index.html'))
app.listen(process.env.PORT || 8000)
console.log("Server is running...")


text:
using System.Collections.Generic;
using BusinessLogic.DtoObjects;

namespace Web.Models
{
    public class CreateScheduleViewModel
    {
        public IEnumerable<DtoCourse> CoursesToChoose { get; set; }

        public IEnumerable<DtoCourse> CoursesChosen { get; set; }

        public string ErrorText { get; set; }
    }
}


text:
namespace MiniCraft.Entities.Particles
{
    public class Particle : Entity
    {
        public Particle()
        {
        }

    }
}


text:
<?php
/*
 * Apolbox - ComposerScript
 *
 * (c) Ayus irfang filaras <ayus.sahabat@gmail.com>
 */
namespace PHPCenter\Command;

use Composer\Script\Event;

final class ComposerScript
{
    /**
     *
     * @param Event
     */
    final public static function postInstall(Event $event)
    {
        $vendorDir = $event->getComposer()->getConfig()->get('vendor-dir');
        require $vendorDir . '/autoload.php';

        static::clearCompiled();
    }

    /**
     *
     * @param Event
     */
    final public static function postUpdate(Event $event)
    {
        require $event->getComposer();
        static::clearCompiled();
    }

    final private static function clearCompiled()
    {
        if (file_exists($services = 'cache/services.php')) @unlink($services);
    }
}


text:
import random
import torch
import torch.nn as nn
import torch.nn.functional as F

from tqdm.auto import tqdm
from torch.nn.utils.rnn import pad_sequence

from moses.interfaces import MosesTrainer
from moses.utils import CharVocab, Logger

class PolicyGradientLoss(nn.Module):
    def forward(self, outputs, targets, rewards, lengths):
        log_probs = F.log_softmax(outputs, dim=2)
        items = torch.gather(
            log_probs, 2, targets.unsqueeze(2)
        ) * rewards.unsqueeze(2)
        loss = -sum(
            [t[:l].sum() for t, l in zip(items, lengths)]
        ) / lengths.sum().float()
        return loss

class ORGANTrainer(MosesTrainer):
    def __init__(self, config):
        self.config = config

    def generator_collate_fn(self, model):
        device = self.get_collate_device(model)

        def collate(data):
            data.sort(key=len, reverse=True)
            tensors = [model.string2tensor(string, device=device)
                       for string in data]

            pad = model.vocabulary.pad
            prevs = pad_sequence(
                [t[:-1] for t in tensors],
                batch_first=True, padding_value=pad
            )
            nexts = pad_sequence(
                [t[1:] for t in tensors],
                batch_first=True, padding_value=pad
            )
            lens = torch.tensor(
                [len(t) - 1 for t in tensors],
                dtype=torch.long, device=device
            )
            return prevs, nexts, lens

        return collate

    def get_vocabulary(self, data):
        return CharVocab.from_data(data)

    def _pretrain_generator_epoch(self, model, tqdm_data,
                                  criterion, optimizer=None):
        model.discriminator.eval()
        if optimizer is None:
            model.generator.eval()
        else:
            model.generator.train()

        postfix = {'loss': 0,
                   'running_loss': 0}

        for i, batch in enumerate(tqdm_data):
            (prevs, nexts, lens) = (data.to(model.device) for data in batch)
            outputs, _, _ = model.generator_forward(prevs, lens)

            loss = criterion(outputs.view(-1, outputs.shape[-1]),
                             nexts.view(-1))

            if optimizer is not None:
                optimizer.zero_grad()
                loss.backward()
                optimizer.step()

            postfix['loss'] = loss.item()
            postfix['running_loss'] += (
                loss.item() - postfix['running_loss']
            ) / (i + 1)
            tqdm_data.set_postfix(postfix)

        postfix['mode'] = ('Pretrain: eval generator'
                           if optimizer is None
                           else 'Pretrain: train generator')
        return postfix

    def _pretrain_generator(self, model, train_loader,
                            val_loader=None, logger=None):
        device = model.device
        generator = model.generator
        criterion = nn.CrossEntropyLoss(ignore_index=model.vocabulary.pad)
        optimizer = torch.optim.Adam(generator.parameters(), lr=self.config.lr)

        generator.zero_grad()
        for epoch in range(self.config.generator_pretrain_epochs):
            tqdm_data = tqdm(
                train_loader,
                desc='Generator training (epoch #{})'.format(epoch))
            postfix = self._pretrain_generator_epoch(model, tqdm_data,
                                                     criterion, optimizer)
            if logger is not None:
                logger.append(postfix)
                logger.save(self.config.log_file)

            if val_loader is not None:
                tqdm_data = tqdm(
                    val_loader,
                    desc='Generator validation (epoch #{})'.format(epoch))
                postfix = self._pretrain_generator_epoch(
                    model, tqdm_data, criterion
                )
                if logger is not None:
                    logger.append(postfix)
                    logger.save(self.config.log_file)

            if epoch % self.config.save_frequency == 0:
                generator = generator.to('cpu')
                torch.save(generator.state_dict(),
                           self.config.model_save[:-3] +
                           '_generator_{0:03d}.pt'.format(epoch))
                generator = generator.to(device)

    def _pretrain_discriminator_epoch(self, model, tqdm_data,
                                      criterion, optimizer=None):
        model.generator.eval()
        if optimizer is None:
            model.discriminator.eval()
        else:
            model.discriminator.train()

        postfix = {'loss': 0,
                   'running_loss': 0}

        for i, inputs_from_data in enumerate(tqdm_data):
            inputs_from_data = inputs_from_data.to(model.device)
            inputs_from_model, _ = model.sample_tensor(self.config.n_batch,
                                                       self.config.max_length)

            targets = torch.zeros(self.config.n_batch, 1, device=model.device)
            outputs = model.discriminator_forward(inputs_from_model)
            loss = criterion(outputs, targets) / 2

            targets = torch.ones(
                inputs_from_data.shape[0], 1, device=model.device
            )
            outputs = model.discriminator_forward(inputs_from_data)
            loss += criterion(outputs, targets) / 2

            if optimizer is not None:
                optimizer.zero_grad()
                loss.backward()
                optimizer.step()

            postfix['loss'] = loss.item()
            postfix['running_loss'] += (loss.item() -
                                        postfix['running_loss']) / (i + 1)
            tqdm_data.set_postfix(postfix)

        postfix['mode'] = ('Pretrain: eval discriminator'
                           if optimizer is None
                           else 'Pretrain: train discriminator')
        return postfix

    def discriminator_collate_fn(self, model):
        device = self.get_collate_device(model)

        def collate(data):
            data.sort(key=len, reverse=True)
            tensors = [model.string2tensor(string, device=device)
                       for string in data]
            inputs = pad_sequence(tensors, batch_first=True,
                                  padding_value=model.vocabulary.pad)
            return inputs

        return collate

    def _pretrain_discriminator(self, model, train_loader,
                                val_loader=None, logger=None):
        device = model.device
        discriminator = model.discriminator
        criterion = nn.BCEWithLogitsLoss()
        optimizer = torch.optim.Adam(discriminator.parameters(),
                                     lr=self.config.lr)

        discriminator.zero_grad()
        for epoch in range(self.config.discriminator_pretrain_epochs):
            tqdm_data = tqdm(
                train_loader,
                desc='Discriminator training (epoch #{})'.format(epoch)
            )
            postfix = self._pretrain_discriminator_epoch(
                model, tqdm_data, criterion, optimizer
            )
            if logger is not None:
                logger.append(postfix)
                logger.save(self.config.log_file)

            if val_loader is not None:
                tqdm_data = tqdm(
                    val_loader,
                    desc='Discriminator validation (epoch #{})'.format(epoch)
                )
                postfix = self._pretrain_discriminator_epoch(
                    model, tqdm_data, criterion
                )
                if logger is not None:
                    logger.append(postfix)
                    logger.save(self.config.log_file)

            if epoch % self.config.save_frequency == 0:
                discriminator = discriminator.to('cpu')
                torch.save(
                    discriminator.state_dict(),
                    self.config.model_save[:-3] +
                    '_discriminator_{0:03d}.pt'.format(epoch)
                )
                discriminator = discriminator.to(device)

    def _policy_gradient_iter(self, model, train_loader,
                              criterion, optimizer, iter_):
        smooth = self.config.pg_smooth_const if iter_ > 0 else 1

        # Generator
        gen_postfix = {'generator_loss': 0,
                       'smoothed_reward': 0}

        gen_tqdm = tqdm(range(self.config.generator_updates),
                        desc='PG generator training (iter #{})'.format(iter_))
        for _ in gen_tqdm:
            model.eval()
            sequences, rewards, lengths = model.rollout(
                self.config.n_batch, self.config.rollouts,
                self.ref_smiles, self.ref_mols, self.config.max_length
            )
            model.train()

            lengths, indices = torch.sort(lengths, descending=True)
            sequences = sequences[indices, ...]
            rewards = rewards[indices, ...]

            generator_outputs, lengths, _ = model.generator_forward(
                sequences[:, :-1], lengths - 1
            )
            generator_loss = criterion['generator'](
                generator_outputs, sequences[:, 1:], rewards, lengths
            )

            optimizer['generator'].zero_grad()
            generator_loss.backward()
            nn.utils.clip_grad_value_(model.generator.parameters(),
                                      self.config.clip_grad)
            optimizer['generator'].step()

            gen_postfix['generator_loss'] += (
                generator_loss.item() -
                gen_postfix['generator_loss']
            ) * smooth
            mean_episode_reward = torch.cat(
                [t[:l] for t, l in zip(rewards, lengths)]
            ).mean().item()
            gen_postfix['smoothed_reward'] += (
                mean_episode_reward - gen_postfix['smoothed_reward']
            ) * smooth
            gen_tqdm.set_postfix(gen_postfix)

        # Discriminator
        discrim_postfix = {'discrim-r_loss': 0}
        discrim_tqdm = tqdm(
            range(self.config.discriminator_updates),
            desc='PG discrim-r training (iter #{})'.format(iter_)
        )
        for _ in discrim_tqdm:
            model.generator.eval()
            n_batches = (
                len(train_loader) + self.config.n_batch - 1
            ) // self.config.n_batch
            sampled_batches = [
                model.sample_tensor(self.config.n_batch,
                                    self.config.max_length)[0]
                for _ in range(n_batches)
            ]

            for _ in range(self.config.discriminator_epochs):
                random.shuffle(sampled_batches)

                for inputs_from_model, inputs_from_data in zip(
                        sampled_batches, train_loader
                ):
                    inputs_from_data = inputs_from_data.to(model.device)

                    discrim_outputs = model.discriminator_forward(
                        inputs_from_model
                    )
                    discrim_targets = torch.zeros(len(discrim_outputs),
                                                  1, device=model.device)
                    discrim_loss = criterion['discriminator'](
                        discrim_outputs, discrim_targets
                    ) / 2

                    discrim_outputs = model.discriminator_forward(
                        inputs_from_data
                    )
                    discrim_targets = torch.ones(
                        len(discrim_outputs), 1, device=model.device
                    )
                    discrim_loss += criterion['discriminator'](
                        discrim_outputs, discrim_targets
                    ) / 2
                    optimizer['discriminator'].zero_grad()
                    discrim_loss.backward()
                    optimizer['discriminator'].step()

                    discrim_postfix['discrim-r_loss'] += (
                        discrim_loss.item() -
                        discrim_postfix['discrim-r_loss']
                    ) * smooth

            discrim_tqdm.set_postfix(discrim_postfix)

        postfix = {**gen_postfix, **discrim_postfix}
        postfix['mode'] = 'Policy Gradient (iter #{})'.format(iter_)
        return postfix

    def _train_policy_gradient(self, model, train_loader, logger=None):
        device = model.device

        criterion = {
            'generator': PolicyGradientLoss(),
            'discriminator': nn.BCEWithLogitsLoss(),
        }

        optimizer = {
            'generator': torch.optim.Adam(model.generator.parameters(),
                                          lr=self.config.lr),
            'discriminator': torch.optim.Adam(
                model.discriminator.parameters(), lr=self.config.lr
            )
        }

        model.zero_grad()
        for iter_ in range(self.config.pg_iters):
            postfix = self._policy_gradient_iter(model, train_loader,
                                                 criterion, optimizer, iter_)
            if logger is not None:
                logger.append(postfix)
                logger.save(self.config.log_file)

            if iter_ % self.config.save_frequency == 0:
                model = model.to('cpu')
                torch.save(model.state_dict(),
                           self.config.model_save[:-3] +
                           '_{0:03d}.pt'.format(iter_))
                model = model.to(device)

    def fit(self, model, train_data, val_data=None):
        logger = Logger() if self.config.log_file is not None else None

        # Generator
        gen_collate_fn = self.generator_collate_fn(model)
        gen_train_loader = self.get_dataloader(model, train_data,
                                               gen_collate_fn, shuffle=True)
        gen_val_loader = None if val_data is None else self.get_dataloader(
            model, val_data, gen_collate_fn, shuffle=False
        )
        self._pretrain_generator(model, gen_train_loader,
                                 gen_val_loader, logger)

        # Discriminator
        dsc_collate_fn = self.discriminator_collate_fn(model)
        dsc_train_loader = self.get_dataloader(model, train_data,
                                               dsc_collate_fn, shuffle=True)
        dsc_val_loader = None if val_data is None else self.get_dataloader(
            model, val_data, dsc_collate_fn, shuffle=False)
        self._pretrain_discriminator(model, dsc_train_loader,
                                     dsc_val_loader, logger)

        # Policy gradient
        self.ref_smiles, self.ref_mols = None, None
        if model.metrics_reward is not None:
            (
             self.ref_smiles,
             self.ref_mols
            ) = model.metrics_reward.get_reference_data(train_data)

        pg_train_loader = dsc_train_loader
        self._train_policy_gradient(model, pg_train_loader, logger)

        del self.ref_smiles
        del self.ref_mols

        return model


text:
/* Auto-generated by genfincode.sh - DO NOT EDIT! */
#include <stdio.h>
#include <stdint.h>
#include <stdlib.h>
#define RTPP_FINCODE
#include "rtpp_types.h"
#include "rtpp_debug.h"
#include "rtpp_record.h"
#include "rtpp_record_fin.h"
#if defined(RTPP_DEBUG)
static void rtpp_record_write_fin(void *pub) {
    fprintf(stderr, "Method rtpp_record@%p::pktwrite (rtpp_record_write) is invoked after destruction\x0a", pub);
    RTPP_AUTOTRAP();
}
void rtpp_record_fin(struct rtpp_record *pub) {
    RTPP_DBG_ASSERT(pub->pktwrite != (rtpp_record_write_t)NULL);
    RTPP_DBG_ASSERT(pub->pktwrite != (rtpp_record_write_t)&rtpp_record_write_fin);
    pub->pktwrite = (rtpp_record_write_t)&rtpp_record_write_fin;
}
#endif /* RTPP_DEBUG */
#if defined(RTPP_FINTEST)
#include <assert.h>
#include <stddef.h>
#include "rtpp_mallocs.h"
#include "rtpp_refcnt.h"
#include "rtpp_linker_set.h"
#define CALL_TFIN(pub, fn) ((void (*)(typeof(pub)))((pub)->fn))(pub)

void
rtpp_record_fintest()
{
    int naborts_s;

    struct {
        struct rtpp_record pub;
    } *tp;

    naborts_s = _naborts;
    tp = rtpp_rzmalloc(sizeof(*tp), offsetof(typeof(*tp), pub.rcnt));
    assert(tp != NULL);
    assert(tp->pub.rcnt != NULL);
    tp->pub.pktwrite = (rtpp_record_write_t)((void *)0x1);
    CALL_SMETHOD(tp->pub.rcnt, attach, (rtpp_refcnt_dtor_t)&rtpp_record_fin,
      &tp->pub);
    RTPP_OBJ_DECREF(&(tp->pub));
    CALL_TFIN(&tp->pub, pktwrite);
    assert((_naborts - naborts_s) == 1);
    free(tp);
}
const static void *_rtpp_record_ftp = (void *)&rtpp_record_fintest;
DATA_SET(rtpp_fintests, _rtpp_record_ftp);
#endif /* RTPP_FINTEST */