text:
package org.elasticsearch.discovery;

import org.elasticsearch.Version;
import org.elasticsearch.common.Nullable;
import org.elasticsearch.common.io.stream.StreamInput;
import org.elasticsearch.common.io.stream.StreamOutput;
import org.elasticsearch.common.io.stream.Writeable;
import org.elasticsearch.common.xcontent.ToXContentFragment;
import org.elasticsearch.common.xcontent.XContentBuilder;
import org.elasticsearch.discovery.zen.PendingClusterStateStats;
import org.elasticsearch.discovery.zen.PublishClusterStateStats;

import java.io.IOException;

public class DiscoveryStats implements Writeable, ToXContentFragment {

    private final PendingClusterStateStats queueStats;
    private final PublishClusterStateStats publishStats;

    public DiscoveryStats(PendingClusterStateStats queueStats, PublishClusterStateStats publishStats) {
        this.queueStats = queueStats;
        this.publishStats = publishStats;
    }

    public DiscoveryStats(StreamInput in) throws IOException {
        queueStats = in.readOptionalWriteable(PendingClusterStateStats::new);

        if (in.getVersion().onOrAfter(Version.V_6_1_0)) {
            publishStats = in.readOptionalWriteable(PublishClusterStateStats::new);
        } else {
            publishStats = null;
        }
    }

    @Override
    public void writeTo(StreamOutput out) throws IOException {
        out.writeOptionalWriteable(queueStats);

        if (out.getVersion().onOrAfter(Version.V_6_1_0)) {
            out.writeOptionalWriteable(publishStats);
        }
    }

    @Override
    public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException {
        builder.startObject(Fields.DISCOVERY);
        if (queueStats != null) {
            queueStats.toXContent(builder, params);
        }
        if (publishStats != null) {
            publishStats.toXContent(builder, params);
        }
        builder.endObject();
        return builder;
    }

    static final class Fields {
        static final String DISCOVERY = "discovery";
    }

    public PendingClusterStateStats getQueueStats() {
        return queueStats;
    }

    public PublishClusterStateStats getPublishStats() {
        return publishStats;
    }
}


text:
import { Vector3 } from "./vector3";

export class Box {
   constructor(public min: Vector3, public max: Vector3) {
   }
}

redpajama_set_name: RedPajamaGithub


text:
<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>

  <parent>
    <groupId>org.sonatype.oss</groupId>
    <artifactId>oss-parent</artifactId>
    <version>7</version>
  </parent>

  <groupId>com.signalfx.public</groupId>
  <artifactId>clients-parent</artifactId>
  <name>SignalFx parent</name>
  <version>0.0.22-SNAPSHOT</version>
  <packaging>pom</packaging>

  <description>
    SignalFx client language integrations
  </description>

  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
  </properties>

  <url>http://www.signalfx.com</url>

  <licenses>
    <license>
      <name>Apache License 2.0</name>
      <url>http://www.apache.org/licenses/LICENSE-2.0.html</url>
      <distribution>repo</distribution>
    </license>
  </licenses>

  <scm>
    <connection>scm:git:git@github.com:signalfx/signalfx-clients.git</connection>
    <developerConnection>scm:git:git@github.com:signalfx/signalfx-clients.git
    </developerConnection>
    <url>git@github.com:signalfx/signalfx-clients.git</url>
  </scm>

  <developers>
    <developer>
      <id>jack</id>
      <name>Jack Lindamood</name>
      <email>jack@signalfx.com</email>
      <organization>SignalFx</organization>
      <organizationUrl>http://www.signalfx.com</organizationUrl>
    </developer>
  </developers>

  <profiles>
    <profile>
      <id>release-sign-artifacts</id>
      <activation>
        <property>
          <name>performRelease</name>
          <value>true</value>
        </property>
      </activation>
      <build>
        <plugins>
          <plugin>
            <groupId>org.sonatype.plugins</groupId>
            <artifactId>nexus-staging-maven-plugin</artifactId>
            <version>1.6.2</version>
            <extensions>true</extensions>
            <configuration>
              <serverId>ossrh</serverId>
              <nexusUrl>https://oss.sonatype.org/</nexusUrl>
              <autoReleaseAfterClose>true</autoReleaseAfterClose>
            </configuration>
          </plugin>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-gpg-plugin</artifactId>
            <version>1.5</version>
            <executions>
              <execution>
                <id>sign-artifacts</id>
                <phase>verify</phase>
                <goals>
                  <goal>sign</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>

  <dependencyManagement>
    <dependencies>
      <!-- ***** -->
      <!-- These -->
      <!-- ***** -->
      <dependency>
        <groupId>com.signalfx.public</groupId>
        <artifactId>signalfx-protoc</artifactId>
        <version>0.0.22-SNAPSHOT</version>
      </dependency>
      <dependency>
        <groupId>com.signalfx.public</groupId>
        <artifactId>signalfx-codahale</artifactId>
        <version>0.0.22-SNAPSHOT</version>
      </dependency>
      <dependency>
        <groupId>com.signalfx.public</groupId>
        <artifactId>signalfx-commons-protoc-java</artifactId>
        <version>0.0.22-SNAPSHOT</version>
      </dependency>
      <dependency>
        <groupId>com.signalfx.public</groupId>
        <artifactId>signalfx-java</artifactId>
        <version>0.0.22-SNAPSHOT</version>
      </dependency>

      <!-- ********************** -->
      <!-- 3rd Party dependencies -->
      <!-- ********************** -->
      <dependency>
        <groupId>junit</groupId>
        <artifactId>junit</artifactId>
        <version>4.11</version>
        <scope>test</scope>
      </dependency>
      <dependency>
        <groupId>junit</groupId>
        <artifactId>junit-dep</artifactId>
        <version>4.11</version>
      </dependency>
      <dependency>
        <groupId>org.eclipse.jetty</groupId>
        <artifactId>jetty-server</artifactId>
        <version>8.1.15.v20140411</version>
        <scope>test</scope>
      </dependency>
      <dependency>
        <groupId>org.eclipse.jetty.orbit</groupId>
        <artifactId>javax.servlet</artifactId>
        <version>3.0.0.v201112011016</version>
        <scope>test</scope>
      </dependency>
      <dependency>
        <groupId>com.google.guava</groupId>
        <artifactId>guava</artifactId>
        <version>18.0</version>
      </dependency>
      <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>slf4j-api</artifactId>
        <version>1.7.5</version>
      </dependency>
      <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>slf4j-simple</artifactId>
        <version>1.7.5</version>
      </dependency>
      <dependency>
        <groupId>org.hamcrest</groupId>
        <artifactId>hamcrest-core</artifactId>
        <version>1.1</version>
        <scope>test</scope>
      </dependency>
      <dependency>
        <groupId>org.apache.commons</groupId>
        <artifactId>commons-lang3</artifactId>
        <version>3.1</version>
      </dependency>
      <dependency>
        <groupId>com.fasterxml.jackson.core</groupId>
        <artifactId>jackson-databind</artifactId>
        <version>2.2.2</version>
      </dependency>
      <dependency>
        <groupId>com.codahale.metrics</groupId>
        <artifactId>metrics-core</artifactId>
        <version>3.0.2</version>
      </dependency>
      <dependency>
        <groupId>com.fasterxml.jackson.core</groupId>
        <artifactId>jackson-core</artifactId>
        <version>2.2.2</version>
      </dependency>
      <dependency>
        <groupId>com.fasterxml.jackson.core</groupId>
        <artifactId>jackson-annotations</artifactId>
        <version>2.2.2</version>
      </dependency>
      <dependency>
        <groupId>javax.validation</groupId>
        <artifactId>validation-api</artifactId>
        <version>1.1.0.Final</version>
      </dependency>
      <dependency>
        <groupId>com.google.protobuf</groupId>
        <artifactId>protobuf-java</artifactId>
        <version>2.5.0</version>
      </dependency>
      <dependency>
        <groupId>org.apache.httpcomponents</groupId>
        <artifactId>httpclient</artifactId>
        <version>4.3</version>
      </dependency>
      <dependency>
        <groupId>org.apache.httpcomponents</groupId>
        <artifactId>httpcore</artifactId>
        <version>4.3</version>
      </dependency>
      <dependency>
        <groupId>commons-io</groupId>
        <artifactId>commons-io</artifactId>
        <version>2.4</version>
      </dependency>
    </dependencies>
  </dependencyManagement>

  <build>
    <pluginManagement>
      <plugins>
        <plugin>
          <!--
            Bugs in older versions prevent altReleaseDeploymentRepository
            and altSnapshotDeploymentRepository from working correctly
            https://maven.apache.org/plugins/maven-deploy-plugin/deploy-mojo.html
           -->
          <artifactId>maven-deploy-plugin</artifactId>
          <version>2.8.1</version>
        </plugin>
      </plugins>
    </pluginManagement>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>3.1</version>
        <configuration>
          <source>1.6</source>
          <target>1.6</target>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-javadoc-plugin</artifactId>
        <version>2.9.1</version>
        <executions>
          <execution>
            <id>attach-javadocs</id>
            <goals>
              <goal>jar</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-source-plugin</artifactId>
        <version>2.2.1</version>
        <executions>
          <execution>
            <id>attach-sources</id>
            <goals>
              <goal>jar</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-dependency-plugin</artifactId>
        <version>2.8</version>
        <executions>
          <execution>
            <id>analyze</id>
            <goals>
              <goal>analyze</goal>
              <goal>analyze-only</goal>
            </goals>
            <configuration>
              <failOnWarning>true</failOnWarning>
              <ignoreNonCompile>true</ignoreNonCompile>
            </configuration>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>

  <modules>
    <module>signalfx-protoc</module>
    <module>signalfx-java</module>
    <module>signalfx-commons-protoc-java</module>
    <module>signalfx-codahale</module>
  </modules>
</project>


text:
console.log( "=== simpread focus load ===" );

var util     = require( "util" ),
    fcontrol = require( "controlbar" ),
    tooltip  = require( "tooltip" ),
    waves    = require( "waves" ),
    focus    = ( function () {

    var $parent,
        tag,
        focuscls   = "simpread-focus-highlight",
        focusstyle = "z-index: 2147483646; overflow: visible; position: relative;",
        maskcls    = "simpread-focus-mask",
        maskstyle  = "z-index: auto; opacity: 1; overflow: visible; transform: none; animation: none; position: relative;",
        bgcls      = "simpread-focus-root",
        bgtmpl     = "

",
        bgclsjq    = "." + bgcls;

    function Focus() { this.$target = null; }

    /**
     * Add focus mode
     *
     * @param {jquery} jquery object
     * @param {array}  exclude html array
     * @param {string} background color style
     */
    Focus.prototype.Render = function( $target, exclude, bgcolor ) {
        console.log( "=== simpread focus add ===" );
        this.$target = $target;

        // set include style
        includeStyle( $target, focusstyle, focuscls, "add" );

        // set exclude style
        excludeStyle( $target, exclude, "delete" );

        // add simpread-focus-mask
        $parent = $target.parent();
        tag     = $parent[0].tagName;
        while ( tag.toLowerCase() != "body" ) {
            includeStyle( $parent, maskstyle, maskcls, "add" );
            $parent = $parent.parent();
            tag     = $parent[0].tagName;
        }

        // add background
        $( "body" ).append( bgtmpl );

        // add background color
        $( bgclsjq )
            .css({ "background-color" : bgcolor })
            .velocity({ opacity: 1 });

        // add control bar
        fcontrol.Render( bgclsjq );

        // add tooltip and waves
        tooltip.Render( bgclsjq );
        waves.Render({ root: bgclsjq });

        // click mask remove it
        $( bgclsjq ).on( "click", function( event ) {
            if ( $( event.target ).attr("class") != bgcls ) return;
             $( bgclsjq ).velocity({ opacity: 0 }, {
                 complete: ()=> {
                    includeStyle( $target, focusstyle, focuscls, "delete" );
                    excludeStyle( $target, exclude, "add" );
                    tooltip.Exit( bgclsjq );
                    $( bgclsjq ).remove();
                    $( bgclsjq ).off( "click" );
                 }
             });

            // remove simpread-focus-mask style
            $parent = $target.parent();
            tag     = $parent[0].tagName;
            while ( tag && tag.toLowerCase() != "body" ) {
                includeStyle( $parent, maskstyle, maskcls, "delete" );
                $parent = $parent.parent();
                tag     = $parent[0].tagName;
            }

            console.log( "=== simpread focus remove ===" );
        });

    }

    /**
     * Verify exit
     *
     * @param  {boolean} when true, call fcontrol.Click()
     * @return {boolen} true: exist; false: not exist
     */
    Focus.prototype.Exist = function( action ) {
        if ( $( "body" ).find( "." + focuscls ).length > 0 ) {
            if (action) fcontrol.elem.onAction( undefined, "setting" );
            return true;
        } else {
            return false;
        }
    }

    /**
     * Get focus
     *
     * @param {string} storage.current.site.include
     * @return {jquery} focus jquery object or undefined
     */
    Focus.prototype.GetFocus = function( include ) {
        var $focus = [],
            sel, range, node, tag,
            target;
        target = util.selector( include );
        if ( util.specTest( target) ) {
            var value = util.specAction( include )[0];
            $focus = $( "body" ).find( value );
        } else if ( target ) {
            $focus = $( "body" ).find( target );
        }
        while ( $focus.length == 0 ) {
            if ( $( "body" ).find( "article" ).length > 0 ) {
                $focus = $( "body" ).find( "article" );
            }
            else {
                try {
                    sel    = window.getSelection();
                    range  = sel.getRangeAt( sel.rangeCount - 1 );
                    node   = range.startContainer.nodeName;
                if ( node.toLowerCase() === "body" ) throw( "selection area is body tag." );
                    $focus = $( range.startContainer.parentNode );
                } catch ( error ) {
                    console.log( sel, range, node )
                    console.error( error )
                    return undefined;
                }
            }
        }
        return fixFocus( $focus );
    }

    return new Focus();

})();

/**
 *  Set include style
 *
 *  @param {jquery} jquery object
 *  @param {string} set style string
 *  @param {string} set class string
 *  @param {string} include 'add' and 'delete'
*/
function includeStyle( $target, style, cls, type ) {
    var bakstyle;
    if ( type === "add" ) {
        bakstyle = $target.attr( "style" ) == undefined ? "" : $target.attr( "style" );
        $target.attr( "style", bakstyle + style ).addClass( cls );
    } else if (  type === "delete" ) {
        bakstyle = $target.attr( "style" );
        bakstyle = bakstyle.replace( style, "" );
        $target.attr( "style", bakstyle ).removeClass( cls );
    }
}

/**
 * Set exclude style
 *
 * @param {jquery} jquery object
 * @param {array}  hidden html
 * @param {string} include: 'add' 'delete'
 */
function excludeStyle( $target, exclude, type ) {
    const tags = util.exclude( $target, exclude );
    if ( type == "delete" )   $target.find( tags ).hide();
    else if ( type == "add" ) $target.find( tags ).show();
}

/**
 * Fix $focus get bad tag, get good tag and return
 * Good tag include: div, article
 *
 * @param  {jquery} jquery object
 * @return {jquery} jquery object
 */
function fixFocus( $focus ) {
    var tag = $focus[0].tagName.toLowerCase();
    while ( [ "p", "span", "strong", "ul", "li", "code", "pre", "pre" ].includes( tag )) {
            $focus = $focus.parent();
            tag    = $focus[0].tagName.toLowerCase();
    }
    return $focus;
}

exports.focus       = focus;


text:
using System;
using System.Data;
using System.Data.Common;
using System.Data.SQLite;
using System.Globalization;
using System.Transactions;
using Blade;
using Maui.Logging;
using Maui;
using System.IO;
using Blade.Logging;

namespace Maui.Data.SQL.SQLite
{
    // TODO: we need a possiblity to insert a bulk of data
    //       - use transaction and commit in the end
    //       - use SQLiteParameter
    public class SQLiteDatabaseSC : ManagedObject, IDatabaseSC
    {
        private static readonly ILogger myLogger = LoggerFactory.GetLogger( typeof( SQLiteDatabaseSC ) );

        private string myDBFile = null;
        private SQLiteConnection myConnection = null;
        private Transaction myTransaction = null;
        private SQLiteCommand myLastRowIdCmd = null;
        private SQLiteCommand myTableExistsCmd = null;
        private SQLiteCommand myViewExistsCmd = null;
        private SQLiteCommand myListTablesCmd = null;
        private SQLiteCommand myListTablesAndViewsCmd = null;

        public SQLiteDatabaseSC( string file )
        {
            myDBFile = file;

            myLastRowIdCmd = new SQLiteCommand( "SELECT last_insert_rowid() AS Id;" );
            myTableExistsCmd = new SQLiteCommand( "SELECT name FROM sqlite_master WHERE type = 'table' AND name = ?;" );
            myViewExistsCmd = new SQLiteCommand( "SELECT name FROM sqlite_master WHERE type = 'view' AND name = ?;" );
            myListTablesCmd = new SQLiteCommand( "SELECT name FROM sqlite_master WHERE type = 'table';" );
            myListTablesAndViewsCmd = new SQLiteCommand( "SELECT name FROM sqlite_master WHERE type = 'table' OR type = 'view';" );
        }

        protected override void Dispose( bool disposing )
        {
            try
            {
                if ( IsDisposed )
                {
                    return;
                }

                if ( disposing )
                {
                    myLastRowIdCmd.Dispose();
                    myTableExistsCmd.Dispose();
                    myListTablesCmd.Dispose();
                    myListTablesAndViewsCmd.Dispose();

                    Close();
                }

                myDBFile = null;
                myConnection = null;
                myTransaction = null;
                myLastRowIdCmd = null;
                myTableExistsCmd = null;
                myListTablesCmd = null;
                myListTablesAndViewsCmd = null;
            }
            finally
            {
                base.Dispose( disposing );
            }
        }

        public void Init( ServiceProvider serviceProvider )
        {
        }

        public string GetDBType( Type type )
        {
            if ( type == typeof( int ) || type == typeof( long ) )
            {
                return "INTEGER";
            }
            else if ( type == typeof( float ) )
            {
                return "REAL";
            }
            else if ( type == typeof( double ) )
            {
                return "DOUBLE";
            }
            else if ( type == typeof( string ) || type == typeof( DateTime ) )
            {
                return "TEXT";
            }
            else if ( type == typeof( bool ) )
            {
                return "BOOL";
            }
            else
            {
                return null;
            }
        }

        public bool ExistsDatabase()
        {
            return System.IO.File.Exists( myDBFile ) && ExistsTable( "db_metadata" );
        }

        public string ConnectionUri
        {
            get { return myDBFile; }
        }

        [System.Diagnostics.CodeAnalysis.SuppressMessage( "Microsoft.Performance", "CA1822:MarkMembersAsStatic" )]
        public DbCommand CreateCommand()
        {
            return new SQLiteCommand();
        }

        [System.Diagnostics.CodeAnalysis.SuppressMessage( "Microsoft.Performance", "CA1822:MarkMembersAsStatic" )]
        public DbCommand CreateCommand( string sql )
        {
            return new SQLiteCommand( sql );
        }

        /// <summary>
        /// Call this outside of any transaction.
        /// </summary>
        public void CreateDatabase()
        {
            myLogger.Info( "Creating database at {0}", myDBFile );

            Open( true );

            Execute( "CREATE TABLE db_metadata (" +
                    "key TEXT NOT NULL," +
                    "value TEXT NULL" +
                ");" );

            Close();
        }

        public void Execute( string sql )
        {
            if ( string.IsNullOrEmpty( sql ) )
            {
                throw new ArgumentException( "parameter must not be null or empty", "sql" );
            }

            Open( false );

            using ( SQLiteCommand cmd = new SQLiteCommand( myConnection ) )
            {
                cmd.CommandText = sql;
                cmd.ExecuteNonQuery();
            }
        }

        public void Execute( DbCommand cmd )
        {
            if ( cmd == null )
            {
                throw new ArgumentNullException( "cmd" );
            }

            Open( false );

            if ( cmd.Connection != myConnection )
            {
                cmd.Connection = myConnection;
            }

            cmd.ExecuteNonQuery();
        }

        public void Execute( DbCommand cmd, params object[] values )
        {
            if ( cmd == null )
            {
                throw new ArgumentNullException( "cmd" );
            }

            if ( values == null )
            {
                throw new ArgumentNullException( "values" );
            }

            for ( int i = 0; i < values.Length; ++i )
            {
                if ( cmd.Parameters.Count == i )
                {
                    cmd.Parameters.Add( cmd.CreateParameter() );
                }

                cmd.Parameters[ i ].Value = values[ i ];
            }

            Execute( cmd );
        }

        /// <summary>
        /// Returns the id of the inserted record
        /// </summary>
        public long Insert( string sql )
        {
            if ( string.IsNullOrEmpty( sql ) )
            {
                throw new ArgumentException( "parameter must not be null or empty", "sql" );
            }

            Open( false );

            if ( myLastRowIdCmd.Connection != myConnection )
            {
                myLastRowIdCmd.Connection = myConnection;
            }

            using ( SQLiteCommand cmd = new SQLiteCommand( myConnection ) )
            {
                cmd.CommandText = sql;
                cmd.ExecuteNonQuery();

                return Convert.ToInt64( myLastRowIdCmd.ExecuteScalar(), CultureInfo.InvariantCulture );
            }
        }

        /// <summary>
        /// Returns the id of the inserted record
        /// </summary>
        public long Insert( DbCommand cmd )
        {
            if ( cmd == null )
            {
                throw new ArgumentNullException( "cmd" );
            }

            Open( false );

            if ( myLastRowIdCmd.Connection != myConnection )
            {
                myLastRowIdCmd.Connection = myConnection;
            }

            if ( cmd.Connection != myConnection )
            {
                cmd.Connection = myConnection;
            }

            cmd.ExecuteNonQuery();

            return Convert.ToInt64( myLastRowIdCmd.ExecuteScalar(), CultureInfo.InvariantCulture );
        }

        public long Insert( DbCommand cmd, params object[] values )
        {
            if ( cmd == null )
            {
                throw new ArgumentNullException( "cmd" );
            }

            if ( values == null )
            {
                throw new ArgumentNullException( "values" );
            }

            for ( int i = 0; i < values.Length; ++i )
            {
                if ( cmd.Parameters.Count == i )
                {
                    cmd.Parameters.Add( cmd.CreateParameter() );
                }

                cmd.Parameters[ i ].Value = values[ i ];
            }

            return Insert( cmd );
        }

        public object QueryScalar( string sql )
        {
            if ( string.IsNullOrEmpty( sql ) )
            {
                throw new ArgumentException( "parameter must not be null or empty", "sql" );
            }

            Open( false );

            using ( SQLiteCommand cmd = new SQLiteCommand( myConnection ) )
            {
                cmd.CommandText = sql;

                return cmd.ExecuteScalar();
            }
        }

        public object QueryScalar( DbCommand cmd )
        {
            if ( cmd == null )
            {
                throw new ArgumentNullException( "cmd" );
            }

            Open( false );

            if ( cmd.Connection != myConnection )
            {
                cmd.Connection = myConnection;
            }

            return cmd.ExecuteScalar();
        }

        public object QueryScalar( DbCommand cmd, params object[] values )
        {
            if ( cmd == null )
            {
                throw new ArgumentNullException( "cmd" );
            }

            if ( values == null )
            {
                throw new ArgumentNullException( "values" );
            }

            for ( int i = 0; i < values.Length; ++i )
            {
                if ( cmd.Parameters.Count == i )
                {
                    cmd.Parameters.Add( cmd.CreateParameter() );
                }

                cmd.Parameters[ i ].Value = values[ i ];
            }

            return QueryScalar( cmd );
        }

        public DataTable Query( string sql )
        {
            if ( string.IsNullOrEmpty( sql ) )
            {
                throw new ArgumentException( "parameter must not be null or empty", "sql" );
            }

            Open( false );

            // TODO: use:
            // DbDataReader reader = cmd.ExecuteReader();
            // table.Load( reader );

            SQLiteDataAdapter dataAdapter = new SQLiteDataAdapter( sql, myConnection );

            DataTable table = new DataTable();
            table.Locale = CultureInfo.InvariantCulture;
            dataAdapter.Fill( table );

            return table;
        }

        public DataTable Query( DbCommand cmd )
        {
            if ( cmd == null )
            {
                throw new ArgumentNullException( "cmd" );
            }

            SQLiteCommand sqliteCmd = cmd as SQLiteCommand;
            if ( cmd == null )
            {
                throw new ArgumentException( "command has invalid type: " + cmd.GetType() );
            }

            Open( false );

            if ( sqliteCmd.Connection != myConnection )
            {
                sqliteCmd.Connection = myConnection;
            }

            // TODO: use:
            // DbDataReader reader = cmd.ExecuteReader();
            // table.Load( reader );

            SQLiteDataAdapter dataAdapter = new SQLiteDataAdapter( sqliteCmd );

            DataTable table = new DataTable();
            table.Locale = CultureInfo.InvariantCulture;
            dataAdapter.Fill( table );

            return table;
        }

        public DataTable Query( DbCommand cmd, params object[] values )
        {
            if ( cmd == null )
            {
                throw new ArgumentNullException( "cmd" );
            }

            if ( values == null )
            {
                throw new ArgumentNullException( "values" );
            }

            for ( int i = 0; i < values.Length; ++i )
            {
                if ( cmd.Parameters.Count == i )
                {
                    cmd.Parameters.Add( cmd.CreateParameter() );
                }

                cmd.Parameters[ i ].Value = values[ i ];
            }

            return Query( cmd );
        }

        public bool ExistsTable( string name )
        {
            object obj = QueryScalar( myTableExistsCmd, name );
            return obj != null;
        }

        public bool ExistsView( string name )
        {
            object obj = QueryScalar( myViewExistsCmd, name );
            return obj != null;
        }

        public string[] GetTables( bool includeViews )
        {
            DbCommand cmd = ( includeViews ? myListTablesAndViewsCmd : myListTablesCmd );
            DataTable table = Query( cmd );

            string[] tables = new string[ table.Rows.Count ];
            for ( int i = 0; i < table.Rows.Count; ++i )
            {
                tables[ i ] = (string)table.Rows[ i ][ 0 ];
            }

            table.Dispose();

            return tables;
        }

        #region Protected/private members

        protected void Open( bool createNew )
        {
            if ( !IsOpen() )
            {
                string connStr = String.Format( CultureInfo.InvariantCulture, "Data Source={0};New={1};Enlist=False;Version=3", myDBFile, createNew );
                myConnection = new SQLiteConnection( connStr );

                myConnection.Open();
            }

            // enlist connection into transaction if any available
            Transaction trans = Transaction.Current;
            if ( trans != null && trans != myTransaction )
            {
                myTransaction = trans;
                myConnection.EnlistTransaction( myTransaction );
            }
        }

        protected void Close()
        {
            if ( myTransaction != null )
            {
                myTransaction.Dispose();
                myTransaction = null;
            }

            if ( myConnection != null )
            {
                myConnection.Dispose();
                myConnection = null;
            }
        }

        protected bool IsOpen()
        {
            return ( myConnection != null && myConnection.State == ConnectionState.Open );
        }

        #endregion
    }
}


text:
import com.github.retronym.SbtOneJar
import sbt._
import Keys._

object build extends Build {
  def standardSettings = Seq(
    exportJars := true
  ) ++ Defaults.defaultSettings

  lazy val multi  = Project("multi", file("."), aggregate = Seq(alpha, beta))
  lazy val alpha = Project("alpha", file("alpha"), settings = standardSettings)
  lazy val beta = Project("beta",
    file("beta"),
    dependencies = Seq(alpha),
    settings = standardSettings ++ SbtOneJar.oneJarSettings
  )
}


text:
from django.shortcuts import render_to_response, get_object_or_404
from django.http import HttpResponseRedirect
from django.contrib.auth.decorators import login_required
from django.template import RequestContext
from django.core.paginator import Paginator, InvalidPage, EmptyPage, PageNotAnInteger
from django.db.models import Q
from django.core.urlresolvers import reverse
from django import forms
from django.forms import ModelForm
from django.utils.translation import ugettext_lazy as _

from proftpd.ftpadmin.lib.view_common import show_items, view_multiple_done, del_model_items, display_confirm_msg
from proftpd.ftpadmin.settings import SITE_INTERFACE
from proftpd.ftpadmin.forms.ftpusers import UserForm
from proftpd.ftpadmin.models.ftpusers import Ftpuser
from proftpd.ftpadmin.models.ftpgroups import  Ftpgroup
from proftpd.ftpadmin.lib.common import initlog

logger2 = initlog()

#class UserForm(ModelForm):
#    #det_notes=forms.CharField(label=u'NOTES', widget=forms.TextInput(attrs={'size':'40'}))
#    #passwd=forms.CharField(label=u'PASSWORD', widget=forms.PasswordInput())
#    class Meta:
#        model = Ftpuser
#        #fields = ('username', 'passwd', 'group')
#        widgets = {
#
#        }
#
#class EditUserForm(ModelForm):
#    #det_notes=forms.CharField(label=u'NOTES', widget=forms.TextInput(attrs={'size':'40'}))
#    #passwd=forms.CharField(label=u'PASSWORD', widget=forms.PasswordInput())
#    class Meta:
#        model = Ftpuser
#        #fields = ('username', 'passwd', 'group')
#        widgets = {
#
#        }

#
#@login_required(redirect_field_name='')
#def user_list(request):
#    return render_to_response('ftpadmin/user_list.html',
#                               { 'user_list': Ftpuser.objects.all()} ,context_instance=RequestContext(request) )

@login_required(redirect_field_name='')
def add_user(request):
    if request.method == 'POST':
        form = UserForm(model=Ftpuser, data=request.POST)
        logger2.info(request)
        if form.is_valid():
            new_user = form.save()
            return HttpResponseRedirect(reverse('ftpuser_list_user'))
    else:
        form = UserForm(model=Ftpuser
        )

    return render_to_response('ftpadmin/add_user.html', {'form': form} ,context_instance=RequestContext(request))

@login_required(redirect_field_name='')
def edit_user(request, user_id):
    user = get_object_or_404(Ftpuser, pk=user_id)
    if request.method == 'POST':
        form = UserForm(model=Ftpuser, instance=user, data=request.POST)
        if form.is_valid():
           new_user = form.save()
           return HttpResponseRedirect(reverse('ftpuser_list_user'))
    else:
        form = UserForm(model=Ftpuser, instance=user)
    return render_to_response('ftpadmin/edit_user.html',
                                  { 'form': form} ,context_instance=RequestContext(request))

@login_required(redirect_field_name='')
def multiple_done(request):
    invalid_fields = []
    return view_multiple_done(request=request, d_model=Ftpuser, default_url=HttpResponseRedirect(reverse('ftpuser_list_user')), invalid_fields=invalid_fields )

@login_required(redirect_field_name='')
def user_list(request):
    model_object = Ftpuser
    each_page_items = int( SITE_INTERFACE.get('show_ftpuser_items_each_page', 3))
    filter_field = 'username'
    page_nav_base_url = reverse('ftpuser_list_user')
    show_error_url =  reverse('ftpuser_list_user')
    show_list_uri = [{'name':'detail', 'url':'/user/detail', 'title':'detail', 'target':'_self'}, {'name':'edit', 'url':'/user/edit', 'title':'edit', 'target':'_self'}, {'name':'del', 'url':'/user/del', 'title':'del', 'target':'_self'}]
    nav_uri = [{'name':_('Add New User'), 'url':reverse('ftpuser_add_user'), 'title':'add', 'target':'_self'}]
    template_file = 'ftpadmin/user_list.html'
    show_field_list = ['username', 'homedir', 'group', 'count', 'lastlogin', 'expiration', 'disabled']
    render_context = show_items(request=request, mult_action_url=reverse('ftpuser_multiple_done'), show_list_uri = show_list_uri, nav_uri = nav_uri, show_error_url = show_error_url, page_nav_base_url=page_nav_base_url,  model_object=model_object, each_page_items = each_page_items, filter_field = filter_field, template_file = template_file, show_field_list = show_field_list)
    return render_context

@login_required(redirect_field_name='')
def user_detail(request, user_id):
    model_object = Ftpuser
    ftpuser = get_object_or_404(model_object, pk=int(user_id))
    return render_to_response('ftpadmin/user_detail.html',
                                  { 'ftpuser': ftpuser} ,context_instance=RequestContext(request))

@login_required(redirect_field_name='')
def del_user(request, user_id):

    if request.method == "GET":

        confirm_result = request.GET.get('confirm_result', None)
        jump_url = request.GET.get('s_url', reverse('ftpuser_list_user'))
        http_referer = request.META.get('HTTP_REFERER', None)
        if confirm_result != "yes":
            return_result = display_confirm_msg(request=request, http_referer=http_referer, confirm_back_url=http_referer or reverse('ftpuser_list_user'), confirm_msg="You are trying to delete a user , Are you sure to delete it ?", confirm_title='Delete User' )
            return return_result
        elif confirm_result == "yes" :
            del_model_items(del_model=Ftpuser, del_items=user_id)

        return HttpResponseRedirect(jump_url)

@login_required(redirect_field_name='')
def jqplot(request):
    return render_to_response('ftpadmin/jqplot.html')


text:
import yaml
import json
import crypt
from functools import partial
from config import WHEEL_CONFIG
import pytest
from saltcontainers.factories import ContainerFactory

def pytest_generate_tests(metafunc):
    functions = [
        'test_master_shipped_with_sha256',
        'test_minion_shipped_with_sha256',
    ]
    if metafunc.function.func_name in functions:
        images = [metafunc.config.getini('IMAGE')]
        minion_image = metafunc.config.getini('MINION_IMAGE')
        if minion_image:
            images.append(minion_image)
        metafunc.parametrize('container', images, indirect=['container'])

@pytest.fixture(scope="module")
def container(request, docker_client):
    obj = ContainerFactory(
        config__docker_client=docker_client,
        config__image=request.param,
        config__salt_config=None,
        config__volumes=None,
        config__host_config=None
    )
    request.addfinalizer(obj.remove)
    return obj

@pytest.fixture(scope="module")
def salt_master_config(file_root, pillar_root):
    return {
        'base_config': {
            'hash_type': 'sha384',
            'pillar_roots': {
                'base': [pillar_root]
            },
            'file_roots': {
                'base': [file_root]
            },
            'external_auth': {
                'pam': {
                    WHEEL_CONFIG['user']: ['@wheel']
                }
            }
        }
    }

@pytest.fixture(scope="module")
def master_container_extras():
    return dict(config__environment=dict(PYTHONPATH='/salt-toaster'))

@pytest.mark.skiptags('devel', 'leap')
def test_master_shipped_with_sha256(container):
    """
    Test the Master is *shipped* with hash type set to SHA256.
    """
    master_config = container.run('cat /etc/salt/master')
    content = yaml.load(master_config)
    assert content['hash_type'] == 'sha256'

@pytest.mark.skiptags('devel', 'leap')
def test_minion_shipped_with_sha256(container):
    """
    Test the Minion is *shipped* with hash type set to SHA256.
    """
    minion_config = container.run('cat /etc/salt/minion')
    content = yaml.load(minion_config)
    assert content['hash_type'] == 'sha256'

def test_hash_type_is_used(request, master, salt_master_config):
    user = WHEEL_CONFIG['user']
    password_salt = '00'
    password = crypt.crypt(WHEEL_CONFIG['password'], password_salt)
    request.addfinalizer(
        partial(master['container'].run, "userdel {0}".format(user)))
    master['container'].run("useradd {0} -p '{1}'".format(user, password))
    raw_output = master['container'].run(
        "python tests/scripts/wheel_config_values.py"
    )
    output = json.loads(raw_output)
    expected = salt_master_config['base_config']['hash_type']
    assert output['data']['return']['hash_type'] == expected


text:
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Amin Ghadersohi | Gregor von Laszewski</title>
    <link>/author/amin-ghadersohi/</link>
      <atom:link href="/author/amin-ghadersohi/index.xml" rel="self" type="application/rss+xml" />
    <description>Amin Ghadersohi</description>
    <generator>Source Themes Academic (https://sourcethemes.com/academic/)</generator><language>en-us</language><lastBuildDate>Wed, 01 Jan 2014 00:00:00 +0000</lastBuildDate>
    <image>
      <url>/images/icon_hufdd866d90d76849587aac6fbf27da1ac_464_512x512_fill_lanczos_center_3.png</url>
      <title>Amin Ghadersohi</title>
      <link>/author/amin-ghadersohi/</link>
    </image>

    <item>
      <title>Comprehensive, open-source resource usage measurement and analysis for HPC systems</title>
      <link>/publication/las-2014-xdmod/</link>
      <pubDate>Wed, 01 Jan 2014 00:00:00 +0000</pubDate>
      <guid>/publication/las-2014-xdmod/</guid>
      <description></description>
    </item>

    <item>
      <title>Performance Metrics and Auditing Framework using Application Kernels for High-performance Computer Systems</title>
      <link>/publication/las-2012-xdmod-kernel/</link>
      <pubDate>Mon, 01 Jul 2013 00:00:00 +0000</pubDate>
      <guid>/publication/las-2012-xdmod-kernel/</guid>
      <description></description>
    </item>

    <item>
      <title>Using XDMoD to Facilitate XSEDE Operations, Planning and Analysis</title>
      <link>/publication/las-2013-xdmod/</link>
      <pubDate>Tue, 01 Jan 2013 00:00:00 +0000</pubDate>
      <guid>/publication/las-2013-xdmod/</guid>
      <description></description>
    </item>

    <item>
      <title>Data analytics driven cyberinfrastructure operations, planning and analysis using XDMoD</title>
      <link>/publication/las-2012-xdmod-data/</link>
      <pubDate>Sun, 01 Jan 2012 00:00:00 +0000</pubDate>
      <guid>/publication/las-2012-xdmod-data/</guid>
      <description></description>
    </item>

  </channel>
</rss>


text:
Test.Summary = '''
Execute plugin with cppapi tests.
'''

ts = Test.MakeATSProcess("ts")

Test.PreparePlugin(Test.Variables.AtsTestToolsDir + '/plugins/test_cppapi.cc', ts, extra_build_args='-l tscppapi')

tr = Test.AddTestRun()
tr.Processes.Default.StartBefore(Test.Processes.ts)
tr.Processes.Default.Command = "echo run test_cppapi plugin"
tr.Processes.Default.ReturnCode = 0
tr.Processes.StillRunningAfter = ts


text:
package com.amazonaws.services.cloudwatch.model;
import com.amazonaws.AmazonWebServiceRequest;

/**
 * Container for the parameters to the {@link com.amazonaws.services.cloudwatch.AmazonCloudWatch#describeAlarmsForMetric(DescribeAlarmsForMetricRequest) DescribeAlarmsForMetric operation}.
 *

 * Retrieves all alarms for a single metric. Specify a statistic, period, or unit to filter the set of alarms further.
 *

 *
 * @see com.amazonaws.services.cloudwatch.AmazonCloudWatch#describeAlarmsForMetric(DescribeAlarmsForMetricRequest)
 */
public class DescribeAlarmsForMetricRequest extends AmazonWebServiceRequest {

    /**
     * The name of the metric.
     *

     * Constraints:

     * Length: 1 - 255

     */
    private String metricName;

    /**
     * The namespace of the metric.
     *

     * Constraints:

     * Length: 1 - 255

     * Pattern: [^:].*

     */
    private String namespace;

    /**
     * The statistic for the metric.
     *

     * Constraints:

     * Allowed Values: SampleCount, Average, Sum, Minimum, Maximum
     */
    private String statistic;

    /**
     * The list of dimensions associated with the metric.
     *

     * Constraints:

     * Length: 0 - 10

     */
    private java.util.List<Dimension> dimensions;

    /**
     * The period in seconds over which the statistic is applied.
     *

     * Constraints:

     * Range: 60 -

     */
    private Integer period;

    /**
     * The unit for the metric.
     *

     * Constraints:

     * Allowed Values: Seconds, Microseconds, Milliseconds, Bytes, Kilobytes, Megabytes, Gigabytes, Terabytes, Bits, Kilobits, Megabits, Gigabits, Terabits, Percent, Count, Bytes/Second, Kilobytes/Second, Megabytes/Second, Gigabytes/Second, Terabytes/Second, Bits/Second, Kilobits/Second, Megabits/Second, Gigabits/Second, Terabits/Second, Count/Second, None
     */
    private String unit;

    /**
     * The name of the metric.
     *

     * Constraints:

     * Length: 1 - 255

     *
     * @return The name of the metric.
     */
    public String getMetricName() {
        return metricName;
    }

    /**
     * The name of the metric.
     *

     * Constraints:

     * Length: 1 - 255

     *
     * @param metricName The name of the metric.
     */
    public void setMetricName(String metricName) {
        this.metricName = metricName;
    }

    /**
     * The name of the metric.
     *

     * Returns a reference to this object so that method calls can be chained together.
     *

     * Constraints:

     * Length: 1 - 255

     *
     * @param metricName The name of the metric.
     *
     * @return A reference to this updated object so that method calls can be chained
     *         together.
     */
    public DescribeAlarmsForMetricRequest withMetricName(String metricName) {
        this.metricName = metricName;
        return this;
    }

    /**
     * The namespace of the metric.
     *

     * Constraints:

     * Length: 1 - 255

     * Pattern: [^:].*

     *
     * @return The namespace of the metric.
     */
    public String getNamespace() {
        return namespace;
    }

    /**
     * The namespace of the metric.
     *

     * Constraints:

     * Length: 1 - 255

     * Pattern: [^:].*

     *
     * @param namespace The namespace of the metric.
     */
    public void setNamespace(String namespace) {
        this.namespace = namespace;
    }

    /**
     * The namespace of the metric.
     *

     * Returns a reference to this object so that method calls can be chained together.
     *

     * Constraints:

     * Length: 1 - 255

     * Pattern: [^:].*

     *
     * @param namespace The namespace of the metric.
     *
     * @return A reference to this updated object so that method calls can be chained
     *         together.
     */
    public DescribeAlarmsForMetricRequest withNamespace(String namespace) {
        this.namespace = namespace;
        return this;
    }

    /**
     * The statistic for the metric.
     *

     * Constraints:

     * Allowed Values: SampleCount, Average, Sum, Minimum, Maximum
     *
     * @return The statistic for the metric.
     *
     * @see Statistic
     */
    public String getStatistic() {
        return statistic;
    }

    /**
     * The statistic for the metric.
     *

     * Constraints:

     * Allowed Values: SampleCount, Average, Sum, Minimum, Maximum
     *
     * @param statistic The statistic for the metric.
     *
     * @see Statistic
     */
    public void setStatistic(String statistic) {
        this.statistic = statistic;
    }

    /**
     * The statistic for the metric.
     *

     * Returns a reference to this object so that method calls can be chained together.
     *

     * Constraints:

     * Allowed Values: SampleCount, Average, Sum, Minimum, Maximum
     *
     * @param statistic The statistic for the metric.
     *
     * @return A reference to this updated object so that method calls can be chained
     *         together.
     *
     * @see Statistic
     */
    public DescribeAlarmsForMetricRequest withStatistic(String statistic) {
        this.statistic = statistic;
        return this;
    }

    /**
     * The statistic for the metric.
     *

     * Constraints:

     * Allowed Values: SampleCount, Average, Sum, Minimum, Maximum
     *
     * @param statistic The statistic for the metric.
     *
     * @see Statistic
     */
    public void setStatistic(Statistic statistic) {
        this.statistic = statistic.toString();
    }

    /**
     * The statistic for the metric.
     *

     * Returns a reference to this object so that method calls can be chained together.
     *

     * Constraints:

     * Allowed Values: SampleCount, Average, Sum, Minimum, Maximum
     *
     * @param statistic The statistic for the metric.
     *
     * @return A reference to this updated object so that method calls can be chained
     *         together.
     *
     * @see Statistic
     */
    public DescribeAlarmsForMetricRequest withStatistic(Statistic statistic) {
        this.statistic = statistic.toString();
        return this;
    }

    /**
     * The list of dimensions associated with the metric.
     *

     * Constraints:

     * Length: 0 - 10

     *
     * @return The list of dimensions associated with the metric.
     */
    public java.util.List<Dimension> getDimensions() {

        if (dimensions == null) {
            dimensions = new java.util.ArrayList<Dimension>();
        }
        return dimensions;
    }

    /**
     * The list of dimensions associated with the metric.
     *

     * Constraints:

     * Length: 0 - 10

     *
     * @param dimensions The list of dimensions associated with the metric.
     */
    public void setDimensions(java.util.Collection<Dimension> dimensions) {
        if (dimensions == null) {
            this.dimensions = null;
            return;
        }

        java.util.List<Dimension> dimensionsCopy = new java.util.ArrayList<Dimension>(dimensions.size());
        dimensionsCopy.addAll(dimensions);
        this.dimensions = dimensionsCopy;
    }

    /**
     * The list of dimensions associated with the metric.
     *

     * Returns a reference to this object so that method calls can be chained together.
     *

     * Constraints:

     * Length: 0 - 10

     *
     * @param dimensions The list of dimensions associated with the metric.
     *
     * @return A reference to this updated object so that method calls can be chained
     *         together.
     */
    public DescribeAlarmsForMetricRequest withDimensions(Dimension... dimensions) {
        if (getDimensions() == null) setDimensions(new java.util.ArrayList<Dimension>(dimensions.length));
        for (Dimension value : dimensions) {
            getDimensions().add(value);
        }
        return this;
    }

    /**
     * The list of dimensions associated with the metric.
     *

     * Returns a reference to this object so that method calls can be chained together.
     *

     * Constraints:

     * Length: 0 - 10

     *
     * @param dimensions The list of dimensions associated with the metric.
     *
     * @return A reference to this updated object so that method calls can be chained
     *         together.
     */
    public DescribeAlarmsForMetricRequest withDimensions(java.util.Collection<Dimension> dimensions) {
        if (dimensions == null) {
            this.dimensions = null;
        } else {
            java.util.List<Dimension> dimensionsCopy = new java.util.ArrayList<Dimension>(dimensions.size());
            dimensionsCopy.addAll(dimensions);
            this.dimensions = dimensionsCopy;
        }

        return this;
    }

    /**
     * The period in seconds over which the statistic is applied.
     *

     * Constraints:

     * Range: 60 -

     *
     * @return The period in seconds over which the statistic is applied.
     */
    public Integer getPeriod() {
        return period;
    }

    /**
     * The period in seconds over which the statistic is applied.
     *

     * Constraints:

     * Range: 60 -

     *
     * @param period The period in seconds over which the statistic is applied.
     */
    public void setPeriod(Integer period) {
        this.period = period;
    }

    /**
     * The period in seconds over which the statistic is applied.
     *

     * Returns a reference to this object so that method calls can be chained together.
     *

     * Constraints:

     * Range: 60 -

     *
     * @param period The period in seconds over which the statistic is applied.
     *
     * @return A reference to this updated object so that method calls can be chained
     *         together.
     */
    public DescribeAlarmsForMetricRequest withPeriod(Integer period) {
        this.period = period;
        return this;
    }

    /**
     * The unit for the metric.
     *

     * Constraints:

     * Allowed Values: Seconds, Microseconds, Milliseconds, Bytes, Kilobytes, Megabytes, Gigabytes, Terabytes, Bits, Kilobits, Megabits, Gigabits, Terabits, Percent, Count, Bytes/Second, Kilobytes/Second, Megabytes/Second, Gigabytes/Second, Terabytes/Second, Bits/Second, Kilobits/Second, Megabits/Second, Gigabits/Second, Terabits/Second, Count/Second, None
     *
     * @return The unit for the metric.
     *
     * @see StandardUnit
     */
    public String getUnit() {
        return unit;
    }

    /**
     * The unit for the metric.
     *

     * Constraints:

     * Allowed Values: Seconds, Microseconds, Milliseconds, Bytes, Kilobytes, Megabytes, Gigabytes, Terabytes, Bits, Kilobits, Megabits, Gigabits, Terabits, Percent, Count, Bytes/Second, Kilobytes/Second, Megabytes/Second, Gigabytes/Second, Terabytes/Second, Bits/Second, Kilobits/Second, Megabits/Second, Gigabits/Second, Terabits/Second, Count/Second, None
     *
     * @param unit The unit for the metric.
     *
     * @see StandardUnit
     */
    public void setUnit(String unit) {
        this.unit = unit;
    }

    /**
     * The unit for the metric.
     *

     * Returns a reference to this object so that method calls can be chained together.
     *

     * Constraints:

     * Allowed Values: Seconds, Microseconds, Milliseconds, Bytes, Kilobytes, Megabytes, Gigabytes, Terabytes, Bits, Kilobits, Megabits, Gigabits, Terabits, Percent, Count, Bytes/Second, Kilobytes/Second, Megabytes/Second, Gigabytes/Second, Terabytes/Second, Bits/Second, Kilobits/Second, Megabits/Second, Gigabits/Second, Terabits/Second, Count/Second, None
     *
     * @param unit The unit for the metric.
     *
     * @return A reference to this updated object so that method calls can be chained
     *         together.
     *
     * @see StandardUnit
     */
    public DescribeAlarmsForMetricRequest withUnit(String unit) {
        this.unit = unit;
        return this;
    }

    /**
     * The unit for the metric.
     *

     * Constraints:

     * Allowed Values: Seconds, Microseconds, Milliseconds, Bytes, Kilobytes, Megabytes, Gigabytes, Terabytes, Bits, Kilobits, Megabits, Gigabits, Terabits, Percent, Count, Bytes/Second, Kilobytes/Second, Megabytes/Second, Gigabytes/Second, Terabytes/Second, Bits/Second, Kilobits/Second, Megabits/Second, Gigabits/Second, Terabits/Second, Count/Second, None
     *
     * @param unit The unit for the metric.
     *
     * @see StandardUnit
     */
    public void setUnit(StandardUnit unit) {
        this.unit = unit.toString();
    }

    /**
     * The unit for the metric.
     *

     * Returns a reference to this object so that method calls can be chained together.
     *

     * Constraints:

     * Allowed Values: Seconds, Microseconds, Milliseconds, Bytes, Kilobytes, Megabytes, Gigabytes, Terabytes, Bits, Kilobits, Megabits, Gigabits, Terabits, Percent, Count, Bytes/Second, Kilobytes/Second, Megabytes/Second, Gigabytes/Second, Terabytes/Second, Bits/Second, Kilobits/Second, Megabits/Second, Gigabits/Second, Terabits/Second, Count/Second, None
     *
     * @param unit The unit for the metric.
     *
     * @return A reference to this updated object so that method calls can be chained
     *         together.
     *
     * @see StandardUnit
     */
    public DescribeAlarmsForMetricRequest withUnit(StandardUnit unit) {
        this.unit = unit.toString();
        return this;
    }

    /**
     * Returns a string representation of this object; useful for testing and
     * debugging.
     *
     * @return A string representation of this object.
     *
     * @see java.lang.Object#toString()
     */
    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append("{");
        if (metricName != null) sb.append("MetricName: " + metricName + ", ");
        if (namespace != null) sb.append("Namespace: " + namespace + ", ");
        if (statistic != null) sb.append("Statistic: " + statistic + ", ");
        if (dimensions != null) sb.append("Dimensions: " + dimensions + ", ");
        if (period != null) sb.append("Period: " + period + ", ");
        if (unit != null) sb.append("Unit: " + unit + ", ");
        sb.append("}");
        return sb.toString();
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int hashCode = 1;

        hashCode = prime * hashCode + ((getMetricName() == null) ? 0 : getMetricName().hashCode());
        hashCode = prime * hashCode + ((getNamespace() == null) ? 0 : getNamespace().hashCode());
        hashCode = prime * hashCode + ((getStatistic() == null) ? 0 : getStatistic().hashCode());
        hashCode = prime * hashCode + ((getDimensions() == null) ? 0 : getDimensions().hashCode());
        hashCode = prime * hashCode + ((getPeriod() == null) ? 0 : getPeriod().hashCode());
        hashCode = prime * hashCode + ((getUnit() == null) ? 0 : getUnit().hashCode());
        return hashCode;
    }

    @Override
    public boolean equals(Object obj) {
        if (this == obj) return true;
        if (obj == null) return false;

        if (obj instanceof DescribeAlarmsForMetricRequest == false) return false;
        DescribeAlarmsForMetricRequest other = (DescribeAlarmsForMetricRequest)obj;

        if (other.getMetricName() == null ^ this.getMetricName() == null) return false;
        if (other.getMetricName() != null && other.getMetricName().equals(this.getMetricName()) == false) return false;
        if (other.getNamespace() == null ^ this.getNamespace() == null) return false;
        if (other.getNamespace() != null && other.getNamespace().equals(this.getNamespace()) == false) return false;
        if (other.getStatistic() == null ^ this.getStatistic() == null) return false;
        if (other.getStatistic() != null && other.getStatistic().equals(this.getStatistic()) == false) return false;
        if (other.getDimensions() == null ^ this.getDimensions() == null) return false;
        if (other.getDimensions() != null && other.getDimensions().equals(this.getDimensions()) == false) return false;
        if (other.getPeriod() == null ^ this.getPeriod() == null) return false;
        if (other.getPeriod() != null && other.getPeriod().equals(this.getPeriod()) == false) return false;
        if (other.getUnit() == null ^ this.getUnit() == null) return false;
        if (other.getUnit() != null && other.getUnit().equals(this.getUnit()) == false) return false;
        return true;
    }

}


text:
body .content .midcol > .arrow,
body .content .midcol > .arrow:hover,
body .content .midcol > .arrow:active,
body .commentarea .midcol {
  display: block !important;
  visibility: visible !important;
  text-indent: 0 !important;
  clip: initial !important;
  position: relative !important;
  top: 0 !important;
  left: 0 !important;
  min-width: 15px !important;
  min-height: 14px !important;
  overflow: initial !important;
  pointer-events: initial !important;
  /* http://webaim.org/techniques/css/invisiblecontent/ */
}

/* Hides hover effect when not subscribed to /r/politics */
body .content .midcol:before {
  display: none !important;
}


text:
SYNONYM

#### According to
The Catalogue of Life, 3rd January 2011

#### Published in
null

#### Original name
Sphaerella mappiae Petch, 1922

### Remarks
null