text:
package metadata

import (
	"bytes"
	"context"
	"io"
	"reflect"

	"github.com/apache/arrow/go/v10/arrow/memory"
	"github.com/apache/arrow/go/v10/parquet"
	"github.com/apache/arrow/go/v10/parquet/compress"
	"github.com/apache/arrow/go/v10/parquet/internal/encryption"
	format "github.com/apache/arrow/go/v10/parquet/internal/gen-go/parquet"
	"github.com/apache/arrow/go/v10/parquet/internal/thrift"
	"github.com/apache/arrow/go/v10/parquet/schema"
	"golang.org/x/xerrors"
)

// PageEncodingStats is used for counting the number of pages of specific
// types with the given internal encoding.
type PageEncodingStats struct {
	Encoding parquet.Encoding
	PageType format.PageType
}

type statvalues struct {
	*format.Statistics
}

func (s *statvalues) GetMin() []byte { return s.GetMinValue() }
func (s *statvalues) GetMax() []byte { return s.GetMaxValue() }
func (s *statvalues) IsSetMin() bool { return s.IsSetMinValue() }
func (s *statvalues) IsSetMax() bool { return s.IsSetMaxValue() }

func makeColumnStats(metadata *format.ColumnMetaData, descr *schema.Column, mem memory.Allocator) TypedStatistics {
	if descr.ColumnOrder() == parquet.ColumnOrders.TypeDefinedOrder {
		return NewStatisticsFromEncoded(descr, mem,
			metadata.NumValues-metadata.Statistics.GetNullCount(),
			&statvalues{metadata.Statistics})
	}
	return NewStatisticsFromEncoded(descr, mem,
		metadata.NumValues-metadata.Statistics.GetNullCount(),
		metadata.Statistics)
}

// ColumnChunkMetaData is a proxy around format.ColumnChunkMetaData
// containing all of the information and metadata for a given column chunk
// and it's associated Column
type ColumnChunkMetaData struct {
	column        *format.ColumnChunk
	columnMeta    *format.ColumnMetaData
	decryptedMeta format.ColumnMetaData
	descr         *schema.Column
	writerVersion *AppVersion
	encodings     []parquet.Encoding
	encodingStats []format.PageEncodingStats
	possibleStats TypedStatistics
	mem           memory.Allocator
}

// NewColumnChunkMetaData creates an instance of the metadata from a column chunk and descriptor
//
// this is primarily used internally or between the subpackages. ColumnChunkMetaDataBuilder should
// be used by consumers instead of using this directly.
func NewColumnChunkMetaData(column *format.ColumnChunk, descr *schema.Column, writerVersion *AppVersion, rowGroupOrdinal, columnOrdinal int16, fileDecryptor encryption.FileDecryptor) (*ColumnChunkMetaData, error) {
	c := &ColumnChunkMetaData{
		column:        column,
		columnMeta:    column.GetMetaData(),
		descr:         descr,
		writerVersion: writerVersion,
		mem:           memory.DefaultAllocator,
	}
	if column.IsSetCryptoMetadata() {
		ccmd := column.CryptoMetadata

		if ccmd.IsSetENCRYPTION_WITH_COLUMN_KEY() {
			if fileDecryptor != nil && fileDecryptor.Properties() != nil {
				// should decrypt metadata
				path := parquet.ColumnPath(ccmd.ENCRYPTION_WITH_COLUMN_KEY.GetPathInSchema())
				keyMetadata := ccmd.ENCRYPTION_WITH_COLUMN_KEY.GetKeyMetadata()
				aadColumnMetadata := encryption.CreateModuleAad(fileDecryptor.FileAad(), encryption.ColumnMetaModule, rowGroupOrdinal, columnOrdinal, -1)
				decryptor := fileDecryptor.GetColumnMetaDecryptor(path.String(), string(keyMetadata), aadColumnMetadata)
				thrift.DeserializeThrift(&c.decryptedMeta, decryptor.Decrypt(column.GetEncryptedColumnMetadata()))
				c.columnMeta = &c.decryptedMeta
			} else {
				return nil, xerrors.New("cannot decrypt column metadata. file decryption not setup correctly")
			}
		}
	}
	for _, enc := range c.columnMeta.Encodings {
		c.encodings = append(c.encodings, parquet.Encoding(enc))
	}
	for _, enc := range c.columnMeta.EncodingStats {
		c.encodingStats = append(c.encodingStats, *enc)
	}
	return c, nil
}

// CryptoMetadata returns the cryptographic metadata for how this column was
// encrypted and how to decrypt it.
func (c *ColumnChunkMetaData) CryptoMetadata() *format.ColumnCryptoMetaData {
	return c.column.GetCryptoMetadata()
}

// FileOffset is the location in the file where the column data begins
func (c *ColumnChunkMetaData) FileOffset() int64 { return c.column.FileOffset }

// FilePath gives the name of the parquet file if provided in the metadata
func (c *ColumnChunkMetaData) FilePath() string { return c.column.GetFilePath() }

// Type is the physical storage type used in the parquet file for this column chunk.
func (c *ColumnChunkMetaData) Type() parquet.Type { return parquet.Type(c.columnMeta.Type) }

// NumValues is the number of values stored in just this chunk including nulls.
func (c *ColumnChunkMetaData) NumValues() int64 { return c.columnMeta.NumValues }

// PathInSchema is the full path to this column from the root of the schema including
// any nested columns
func (c *ColumnChunkMetaData) PathInSchema() parquet.ColumnPath {
	return c.columnMeta.GetPathInSchema()
}

// Compression provides the type of compression used for this particular chunk.
func (c *ColumnChunkMetaData) Compression() compress.Compression {
	return compress.Compression(c.columnMeta.Codec)
}

// Encodings returns the list of different encodings used in this chunk
func (c *ColumnChunkMetaData) Encodings() []parquet.Encoding { return c.encodings }

// EncodingStats connects the order of encodings based on the list of pages and types
func (c *ColumnChunkMetaData) EncodingStats() []PageEncodingStats {
	ret := make([]PageEncodingStats, len(c.encodingStats))
	for idx := range ret {
		ret[idx].Encoding = parquet.Encoding(c.encodingStats[idx].Encoding)
		ret[idx].PageType = c.encodingStats[idx].PageType
	}
	return ret
}

// HasDictionaryPage returns true if there is a dictionary page offset set in
// this metadata.
func (c *ColumnChunkMetaData) HasDictionaryPage() bool {
	return c.columnMeta.IsSetDictionaryPageOffset()
}

// DictionaryPageOffset returns the location in the file where the dictionary page starts
func (c *ColumnChunkMetaData) DictionaryPageOffset() int64 {
	return c.columnMeta.GetDictionaryPageOffset()
}

// DataPageOffset returns the location in the file where the data pages begin for this column
func (c *ColumnChunkMetaData) DataPageOffset() int64 { return c.columnMeta.GetDataPageOffset() }

// HasIndexPage returns true if the offset for the index page is set in the metadata
func (c *ColumnChunkMetaData) HasIndexPage() bool { return c.columnMeta.IsSetIndexPageOffset() }

// IndexPageOffset is the location in the file where the index page starts.
func (c *ColumnChunkMetaData) IndexPageOffset() int64 { return c.columnMeta.GetIndexPageOffset() }

// TotalCompressedSize will be equal to TotalUncompressedSize if the data is not compressed.
// Otherwise this will be the size of the actual data in the file.
func (c *ColumnChunkMetaData) TotalCompressedSize() int64 {
	return c.columnMeta.GetTotalCompressedSize()
}

// TotalUncompressedSize is the total size of the raw data after uncompressing the chunk
func (c *ColumnChunkMetaData) TotalUncompressedSize() int64 {
	return c.columnMeta.GetTotalUncompressedSize()
}

// BloomFilterOffset is the byte offset from the beginning of the file to the bloom
// filter data.
func (c *ColumnChunkMetaData) BloomFilterOffset() int64 {
	return c.columnMeta.GetBloomFilterOffset()
}

// StatsSet returns true only if there are statistics set in the metadata and the column
// descriptor has a sort order that is not SortUnknown
//
// It also checks the writer version to ensure that it was not written by a version
// of parquet which is known to have incorrect stat computations.
func (c *ColumnChunkMetaData) StatsSet() (bool, error) {
	if !c.columnMeta.IsSetStatistics() || c.descr.SortOrder() == schema.SortUNKNOWN {
		return false, nil
	}

	if c.possibleStats == nil {
		c.possibleStats = makeColumnStats(c.columnMeta, c.descr, c.mem)
	}

	encoded, err := c.possibleStats.Encode()
	if err != nil {
		return false, err
	}

	return c.writerVersion.HasCorrectStatistics(c.Type(), c.descr.LogicalType(), encoded, c.descr.SortOrder()), nil
}

func (c *ColumnChunkMetaData) Equals(other *ColumnChunkMetaData) bool {
	return reflect.DeepEqual(c.columnMeta, other.columnMeta)
}

// Statistics can return nil if there are no stats in this metadata
func (c *ColumnChunkMetaData) Statistics() (TypedStatistics, error) {
	ok, err := c.StatsSet()
	if err != nil {
		return nil, err
	}

	if ok {
		return c.possibleStats, nil
	}
	return nil, nil
}

// ColumnChunkMetaDataBuilder is used during writing to construct metadata
// for a given column chunk while writing, providing a proxy around constructing
// the actual thrift object.
type ColumnChunkMetaDataBuilder struct {
	chunk  *format.ColumnChunk
	props  *parquet.WriterProperties
	column *schema.Column

	compressedSize int64
}

func NewColumnChunkMetaDataBuilder(props *parquet.WriterProperties, column *schema.Column) *ColumnChunkMetaDataBuilder {
	return NewColumnChunkMetaDataBuilderWithContents(props, column, format.NewColumnChunk())
}

// NewColumnChunkMetaDataBuilderWithContents will construct a builder and start it with the provided
// column chunk information rather than with an empty column chunk.
func NewColumnChunkMetaDataBuilderWithContents(props *parquet.WriterProperties, column *schema.Column, chunk *format.ColumnChunk) *ColumnChunkMetaDataBuilder {
	b := &ColumnChunkMetaDataBuilder{
		props:  props,
		column: column,
		chunk:  chunk,
	}
	b.init(chunk)
	return b
}

// Contents returns the underlying thrift ColumnChunk object so that it can be used
// for constructing or duplicating column metadata
func (c *ColumnChunkMetaDataBuilder) Contents() *format.ColumnChunk { return c.chunk }

func (c *ColumnChunkMetaDataBuilder) init(chunk *format.ColumnChunk) {
	c.chunk = chunk
	if !c.chunk.IsSetMetaData() {
		c.chunk.MetaData = format.NewColumnMetaData()
	}
	c.chunk.MetaData.Type = format.Type(c.column.PhysicalType())
	c.chunk.MetaData.PathInSchema = schema.ColumnPathFromNode(c.column.SchemaNode())
	c.chunk.MetaData.Codec = format.CompressionCodec(c.props.CompressionFor(c.column.Path()))
}

func (c *ColumnChunkMetaDataBuilder) SetFilePath(val string) {
	c.chunk.FilePath = &val
}

// Descr returns the associated column descriptor for this column chunk
func (c *ColumnChunkMetaDataBuilder) Descr() *schema.Column { return c.column }

func (c *ColumnChunkMetaDataBuilder) TotalCompressedSize() int64 {
	// if this column is encrypted, after Finish is called, the MetaData
	// field is set to nil and we store the compressed size so return that
	if c.chunk.MetaData == nil {
		return c.compressedSize
	}
	return c.chunk.MetaData.GetTotalCompressedSize()
}

func (c *ColumnChunkMetaDataBuilder) SetStats(val EncodedStatistics) {
	c.chunk.MetaData.Statistics = val.ToThrift()
}

// ChunkMetaInfo is a helper struct for passing the offset and size information
// for finishing the building of column chunk metadata
type ChunkMetaInfo struct {
	NumValues        int64
	DictPageOffset   int64
	IndexPageOffset  int64
	DataPageOffset   int64
	CompressedSize   int64
	UncompressedSize int64
}

// EncodingStats is a helper struct for passing the encoding stat information
// for finishing up metadata for a column chunk.
type EncodingStats struct {
	DictEncodingStats map[parquet.Encoding]int32
	DataEncodingStats map[parquet.Encoding]int32
}

// Finish finalizes the metadata with the given offsets,
// flushes any compression that needs to be done, and performs
// any encryption if an encryptor is provided.
func (c *ColumnChunkMetaDataBuilder) Finish(info ChunkMetaInfo, hasDict, dictFallback bool, encStats EncodingStats, metaEncryptor encryption.Encryptor) error {
	if info.DictPageOffset > 0 {
		c.chunk.MetaData.DictionaryPageOffset = &info.DictPageOffset
		c.chunk.FileOffset = info.DictPageOffset + info.CompressedSize
	} else {
		c.chunk.FileOffset = info.DataPageOffset + info.CompressedSize
	}

	c.chunk.MetaData.NumValues = info.NumValues
	if info.IndexPageOffset >= 0 {
		c.chunk.MetaData.IndexPageOffset = &info.IndexPageOffset
	}

	c.chunk.MetaData.DataPageOffset = info.DataPageOffset
	c.chunk.MetaData.TotalUncompressedSize = info.UncompressedSize
	c.chunk.MetaData.TotalCompressedSize = info.CompressedSize

	// no matter the configuration, the maximum number of thrift encodings we'll
	// populate is going to be 3:
	// 	1. potential dictionary index encoding
	//	2. page encoding
	//	3. RLE for repetition and definition levels
	// so let's preallocate a capacity of 3 but initialize the slice at 0 len
	const maxEncodings = 3

	thriftEncodings := make([]format.Encoding, 0, maxEncodings)
	if hasDict {
		thriftEncodings = append(thriftEncodings, format.Encoding(c.props.DictionaryIndexEncoding()))
		if c.props.Version() == parquet.V1_0 {
			thriftEncodings = append(thriftEncodings, format.Encoding_PLAIN)
		} else {
			thriftEncodings = append(thriftEncodings, format.Encoding(c.props.DictionaryPageEncoding()))
		}
	} else { // no dictionary
		thriftEncodings = append(thriftEncodings, format.Encoding(c.props.EncodingFor(c.column.Path())))
	}

	thriftEncodings = append(thriftEncodings, format.Encoding(parquet.Encodings.RLE))
	// Only PLAIN encoding is supported for fallback in V1
	// TODO(zeroshade): Use user specified encoding for V2
	if dictFallback {
		thriftEncodings = append(thriftEncodings, format.Encoding_PLAIN)
	}
	c.chunk.MetaData.Encodings = thriftEncodings

	thriftEncodingStats := make([]*format.PageEncodingStats, 0, len(encStats.DictEncodingStats)+len(encStats.DataEncodingStats))
	for k, v := range encStats.DictEncodingStats {
		thriftEncodingStats = append(thriftEncodingStats, &format.PageEncodingStats{
			PageType: format.PageType_DICTIONARY_PAGE,
			Encoding: format.Encoding(k),
			Count:    v,
		})
	}
	for k, v := range encStats.DataEncodingStats {
		thriftEncodingStats = append(thriftEncodingStats, &format.PageEncodingStats{
			PageType: format.PageType_DATA_PAGE,
			Encoding: format.Encoding(k),
			Count:    v,
		})
	}
	c.chunk.MetaData.EncodingStats = thriftEncodingStats

	encryptProps := c.props.ColumnEncryptionProperties(c.column.Path())
	if encryptProps != nil && encryptProps.IsEncrypted() {
		ccmd := format.NewColumnCryptoMetaData()
		if encryptProps.IsEncryptedWithFooterKey() {
			ccmd.ENCRYPTION_WITH_FOOTER_KEY = format.NewEncryptionWithFooterKey()
		} else {
			ccmd.ENCRYPTION_WITH_COLUMN_KEY = &format.EncryptionWithColumnKey{
				KeyMetadata:  []byte(encryptProps.KeyMetadata()),
				PathInSchema: c.column.ColumnPath(),
			}
		}
		c.chunk.CryptoMetadata = ccmd

		encryptedFooter := c.props.FileEncryptionProperties().EncryptedFooter()
		encryptMetadata := !encryptedFooter || !encryptProps.IsEncryptedWithFooterKey()
		if encryptMetadata {
			// Serialize and encrypt ColumnMetadata separately
			// Thrift-serialize the ColumnMetaData structure,
			// encrypt it with the column key, and write to encrypted_column_metadata
			serializer := thrift.NewThriftSerializer()
			data, err := serializer.Write(context.Background(), c.chunk.MetaData)
			if err != nil {
				return err
			}
			var buf bytes.Buffer
			metaEncryptor.Encrypt(&buf, data)
			c.chunk.EncryptedColumnMetadata = buf.Bytes()

			if encryptedFooter {
				c.compressedSize = c.chunk.MetaData.GetTotalCompressedSize()
				c.chunk.MetaData = nil
			} else {
				// Keep redacted metadata version for old readers
				c.chunk.MetaData.Statistics = nil
				c.chunk.MetaData.EncodingStats = nil
			}
		}
	}
	return nil
}

// WriteTo will always return 0 as the int64 since the thrift writer library
// does not return the number of bytes written, we only use the signature
// of (int64, error) in order to match the standard WriteTo interfaces.
func (c *ColumnChunkMetaDataBuilder) WriteTo(w io.Writer) (int64, error) {
	return 0, thrift.SerializeThriftStream(c.chunk, w)
}


text:
package zztest;

import static com.icexxx.util.IceTestUtil.*;
import static com.icexxx.util.IceUtil.*;

import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;

import org.junit.Test;

public class IceUtilTest4 {
    // @Test
    public void notTest() {
        print(not(null, "yes", "no"));
        print(not("", "yes", "no"));
        print(not("yes", "yes", "no"));
        print(not("no", "yes", "no"));
    }

    // @Test
    public void negative2ZeroTest() {
        BigDecimal num1 = new BigDecimal("-1");
        print(negative2Zero(num1) + "");
        BigDecimal num2 = new BigDecimal("-1.2");
        print(negative2Zero(num2) + "");
        BigDecimal num3 = new BigDecimal("5");
        print(negative2Zero(num3) + "");
        BigDecimal num4 = new BigDecimal("1.3");
        print(negative2Zero(num4) + "");
        BigDecimal num5 = new BigDecimal("0");
        print(negative2Zero(num5) + "");
    }

    // @Test
    public void commaStr2ListTest() {
        print(commaStr2List(null) + "");
        print(commaStr2List("") + "");
        print(commaStr2List("123") + "");
        print(commaStr2List("123,456") + "");
        print(commaStr2List("123,,789") + "");
        print(commaStr2List("123 ,  ,  789  , 127") + "");
        print(commaStr2List("123 ,  ,  789  , 127").get(0) + 123);
    }

    // @Test
    public void addDefaultTest() {
        print(addDefault(null) + "");
        List<Integer> list = new ArrayList<Integer>();
        print(addDefault(list) + "");
        list.add(567);
        print(addDefault(list) + "");
        list.add(789);
        print(addDefault(list) + "");
    }

    // @Test
    public void trueFunctionTest() {
        System.out.println(trueFunction());
        System.out.println(falseFunction());
    }

    // @Test
    public void firstLetterTest() {
        print(firstLetter(null));
        print(firstLetter(""));
        print(firstLetter("abc"));
        print(firstLetter("abc_def_ghi"));
        print(firstLetter("abc_def__ghi"));
        print(firstLetter("_abc_d_ghi"));
    }

    // @Test
    public void createMapTest() {
        Map<String, String> map1 = createMap("name", "hello");
        System.out.println(map1);
        Map<String, String> map2 = createMap("name", "hello", "age", "23");
        System.out.println(map2);
    }

    // @Test
    public void isEmptyStrTest() {
        print(isEmptyStr(null));
        print(isEmptyStr(""));
        print(isEmptyStr(" "));
        print(isEmptyStr("abc"));
        print(isEmptyStr(new java.util.Date()));
    }

    // @Test
    public void toStringTest() {
        print(com.icexxx.util.IceUtil.toString(null));
        print(com.icexxx.util.IceUtil.toString(""));
        print(com.icexxx.util.IceUtil.toString(" "));
        print(com.icexxx.util.IceUtil.toString("abc"));
        print(com.icexxx.util.IceUtil.toString(new java.util.Date()));
        print("".equals(com.icexxx.util.IceUtil.toString(null)));
    }
}

redpajama_set_name: RedPajamaGithub


text:
html,body,div,span,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,abbr,address,cite,code,del,dfn,em,img,ins,kbd,q,samp,small,strong,sub,sup,var,b,i,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td,article,aside,canvas,details,figcaption,figure,footer,header,hgroup,menu,nav,section,summary,time,mark,audio,video{margin:0;padding:0;border:0;outline:0;font-size:100%;vertical-align:baseline;background:transparent}
body{line-height:1}
article,aside,details,figcaption,figure,footer,header,hgroup,menu,nav,section{display:block}
li,nav ul {list-style:none}
blockquote,q{quotes:none}
blockquote:before,blockquote:after,q:before,q:after{content:none}
a{margin:0;padding:0;font-size:100%;vertical-align:baseline;background:transparent}
ins{background-color:#ff9;color:#000;text-decoration:none}
mark{background-color:#ff9;color:#000;font-style:italic;font-weight:bold}
del{text-decoration:line-through}
abbr[title],dfn[title]{border-bottom:1px dotted;cursor:help}
table{border-collapse:collapse;border-spacing:0}
hr{display:block;height:1px;border:0;border-top:1px solid #ccc;margin:1em 0;padding:0}
input,select{vertical-align:middle}

@font-face { font-family: "osGallery"; src: url("osGallery/osGallery.eot"); src: url("osGallery/osGallery.eot#iefix") format("embedded-opentype"), url("osGallery/osGallery.woff") format("woff"), url("osGallery/osGallery.ttf") format("truetype"), url("osGallery/osGallery.svg") format("svg"); font-weight: normal; font-style: normal; }
[class^="osg-"]:before, [class*=" osg-"]:before,
[class^="osg-"]:after, [class*=" osg-"]:after { font-family: osGallery; font-size: 20px; font-style: normal; }
.osg-fullscreen:before { content: "\e001"; }
.osg-fullscreen_out:before { content: "\e003"; }
.osg-left:before { content: "\e002"; }
.osg-right:before { content: "\e004"; }
.osg-down:before { content: "\e005"; }
.osg-up:before { content: "\e006"; }
.osg-cross:before { content: "\e000"; }
.osGallery { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background-color: rgba(34, 34, 34, 0.80); z-index: 99; display:none; box-sizing: border-box; }
.osGallery.transition,
.osGallery .transition { -webkit-transition: all 600ms ease; -moz-transition: all 600ms ease; -ms-transition: all 600ms ease; -o-transition: all 600ms ease; transition: all 600ms ease; }
.osGallery.activeGallery { z-index: 99;display:block; }
.osGallery * { box-sizing: border-box; margin: 0; padding: 0; }
.osGallery .navigation { width: 100%; height: 50px; background-color: #ffe000; position: absolute; top: 0; left: 0; z-index: 9; }
.osGallery .navigation span.title { font-size: 18px; font-weight: 600; position: absolute; left: 20px; top: 0; height: 50px; line-height: 50px; }
.osGallery .navigation nav { height: 50px; line-height: 50px; position: absolute; right: 10px; top: 10px; }
.osGallery .navigation nav a { display: block; text-decoration: none; float: left; background-color: rgba(34, 34, 34, 0.80); height: 30px; width: 30px; line-height: 30px; font-size: 16px; text-align: center; -webkit-transition: all 400ms ease; -moz-transition: all 400ms ease; -ms-transition: all 400ms ease; -o-transition: all 400ms ease; transition: all 400ms ease; }
.osGallery .navigation nav a:before { font-size: 16px; color: #fff; }
.osGallery .navigation nav a:hover { background-color: #e9cd00; }
.osGallery .navigation nav a:hover:before { }
.osGallery .gallerThumbnails { width: 100%; height: 60px; border-top: 2px solid #ffe000; background-color: #343d41; position: absolute; bottom: 0; left: 0; z-index: 1; -webkit-transition: all 400ms ease; -moz-transition: all 400ms ease; -ms-transition: all 400ms ease; -o-transition: all 400ms ease; transition: all 400ms ease; }
.osGallery .gallerThumbnails:hover { border-color: #ffe000; }
.osGallery .gallerThumbnails nav { width: 100%; }
.osGallery .gallerThumbnails nav ul { display: table; margin: 0 auto; }
.osGallery .gallerThumbnails nav ul li { float: left; width: 60px; height: 60px; overflow: hidden; position: relative; cursor: pointer; }
.osGallery .gallerThumbnails nav ul li img { max-width: calc(100% - 20px); height: auto; position: absolute; left: 0; right: 0; top: 0; bottom: 0; margin: auto; border: 1px solid #ffe000; }
.osGallery .gallerThumbnails nav ul li.tactive { background-color: #ffe000; }
.osGallery .galleryContent .galleryBox { display: block; position: absolute; top: 50px; left: 0; width: 100%; height: calc(100% - 110px); }
.osGallery .galleryContent .galleryBox figure { height: 100%; width: 100%; }
.osGallery .galleryContent .galleryBox figure img { max-width: calc(100% - 40px); max-height: calc(100% - 40px); display: block; position: absolute; left: 0; right: 0; top: 0; bottom: 0; margin: auto; box-shadow: 0 0 10px #000; }
.osGallery .galleryContent .galleryBox figure.active { visibility: visible; opacity: 1; }
.osGallery .galleryContent .galleryBox figure.deactive { visibility: hidden; opacity: 0; }
.osGallery .galleryContent .galleryBox figure.active.zoom img { transform: scale(1, 1); -webkit-transform: scale(1, 1); -moz-transform: scale(1, 1); -o-transform: scale(1, 1); -ms-transform: scale(1, 1); }
.osGallery .galleryContent .galleryBox figure.deactive.zoom img { transform: scale(0.8, 0.8); -webkit-transform: scale(0.8, 0.8); -moz-transform: scale(0.8, 0.8); -o-transform: scale(0.8, 0.8); -ms-transform: scale(0.8, 0.8); }
@media only screen and (max-width: 640px) {
.osGallery .gallerThumbnails { height: 50px; }
.osGallery .gallerThumbnails nav ul li { width: 50px; height: 50px; }
.osGallery .galleryContent .galleryBox { height: calc(100% - 100px); }
}
@media only screen and (max-width: 320px) {
.osGallery .gallerThumbnails { height: 40px; }
.osGallery .gallerThumbnails nav ul li { width: 40px; height: 40px; }
.osGallery .galleryContent .galleryBox { height: calc(100% - 90px); }
}

.gallerystyle1 { border: 2px solid #808080; width: 600px; margin: 0 auto; margin-top: 20px; }
.gallerystyle1 * { list-style: none; }
.gallerystyle1 img { max-width: 100%; }
.gallerystyle1 .viewerBox { width: 100%; height: 380px; display: table; }
.gallerystyle1 .viewerBox .viewer { cursor: pointer; display: table-cell; vertical-align: middle; }
.gallerystyle1 .viewerBox .viewer img { display: block; }
.gallerystyle1 .thumbnails { border-top: 1px solid #808080; }
.gallerystyle1 .thumbnails:after { display: block; content: ""; clear: both; }
.gallerystyle1 .thumbnails li { float: left; height: 80px; width: 20%; box-sizing: border-box; display: table; border-right: 1px solid #808080; border-bottom: 1px solid #808080; }
.gallerystyle1 .thumbnails li figure { display: table-cell; vertical-align: middle; text-align: center; }
.gallerystyle1 .thumbnails li figure img { max-height: 80%; max-width: 80%; margin: 0 auto; }
.gallerystyle1 .thumbnails li:nth-of-type(5n+0) { border-right: 0; }

.gallerystyle2 { display: table; margin: 0 auto; max-width: 800px; padding-top: 20px; }
.gallerystyle2 h3 { display: inline-block; font-size: 22px; color: #222222; text-shadow: 1px 1px #fff; padding: 10px; padding-left: 0; padding-bottom: 20px; position: relative; }
.gallerystyle2 h3:after { content: ""; position: absolute; width: 40%; bottom: 14px; left: 0; background-color: #222222; height: 2px; }
.gallerystyle2:after { content: ""; display: block; clear: both; }
.gallerystyle2 div.item { display: table; border: 1px solid #808080; }
.gallerystyle2 div.item figure { float: left; height: 80px; width: 20%; box-sizing: border-box; display: table; border-right: 1px solid #808080; border-bottom: 1px solid #808080; }
.gallerystyle2 div.item figure span { display: table-cell; vertical-align: middle; text-align: center; }
.gallerystyle2 div.item figure span img { max-height: 79px; max-width: 100%; margin: 0 auto; }
.gallerystyle2 div.item figure:nth-of-type(5n+0) { border-right: 0; }


text:
/**
 * Support and FAQ: visit Atmel Support
 */

#ifndef __AVR32_NEWLIB_ADDONS_EXCEPTIONS_H__
#define __AVR32_NEWLIB_ADDONS_EXCEPTIONS_H__

#include <_ansi.h>

_BEGIN_STD_C

/*
 Exception vector offsets
*/
#define EVBA_UNRECOVERABLE    0x000
#define EVBA_TLB_MULTIPLE     0x004
#define EVBA_BUS_ERROR_DATA   0x008
#define EVBA_BUS_ERROR_INSTR  0x00C
#define EVBA_NMI              0x010
#define EVBA_INSTR_ADDR       0x014
#define EVBA_ITLB_MISS        0x050
#define EVBA_ITLB_PROT        0x018
#define EVBA_BREAKPOINT       0x01C
#define EVBA_ILLEGAL_OPCODE   0x020
#define EVBA_UNIMPLEMENTED    0x024
#define EVBA_PRIVILEGE_VIOL   0x028
#define EVBA_FLOATING_POINT   0x02C
#define EVBA_COP_ABSENT       0x030
#define EVBA_SCALL            0x100
#define EVBA_DATA_ADDR_R      0x034
#define EVBA_DATA_ADDR_W      0x038
#define EVBA_DTLB_MISS_R      0x060
#define EVBA_DTLB_MISS_W      0x070
#define EVBA_DTLB_PROT_R      0x03C
#define EVBA_DTLB_PROT_W      0x040
#define EVBA_DTLB_MODIFIED    0x044

/*
   Define the form of the function used when registering exceptions.
   The function should return the address which the exception should
   return to after the exception processing.
*/

typedef unsigned int (*__exception_handler)(int /*evba_offset*/, int /*return address*/);

/*
   Define the form of the function used when registering a scall handler.
*/

typedef void (*__scall_handler)(int /*code*/, int /*p1*/, int /*p2*/
                                         , int /*p3*/, int /*p4*/);

/*
   Function for registering an exception handler for the exception with
   offset given by evba_offset.
*/
void _register_exception_handler(__exception_handler handler, int evba_offset);

/*
   Function for registering a scall handler which can be a arbirary
   function which uses r8-r12 for parameters.
*/
void _register_scall_handler(__scall_handler handler);

/*
   Initialize exceptions. Must be called before registering exception handlers
   and needed to enable exceptions. 'evba' is the pointer to the exception
   vector. 'handler_table' is a pointer to an array where the pointers to
   the exception handlers are stored. This array must be at least 0x104 bytes
   and word aligned.
*/
void init_exceptions(void *evba, void *handler_table);

_END_STD_C

#endif


text:
namespace System.Runtime.Collections
{
    using System;
    using System.Collections;
    using System.Collections.Generic;
    using System.Collections.ObjectModel;
    using System.Runtime;

    class NullableKeyDictionary<TKey, TValue> : IDictionary<TKey, TValue>
    {
        bool isNullKeyPresent;
        TValue nullKeyValue;
        IDictionary<TKey, TValue> innerDictionary;

        public NullableKeyDictionary()
            : base()
        {
            this.innerDictionary = new Dictionary<TKey, TValue>();
        }

        public int Count
        {
            get { return this.innerDictionary.Count + (this.isNullKeyPresent ? 1 : 0); }
        }

        public bool IsReadOnly
        {
            get { return false; }
        }

        public ICollection<TKey> Keys
        {
            get
            {
                return new NullKeyDictionaryKeyCollection<TKey, TValue>(this);
            }
        }

        public ICollection<TValue> Values
        {
            get { return new NullKeyDictionaryValueCollection<TKey, TValue>(this); }
        }

        public TValue this[TKey key]
        {
            get
            {
                if (key == null)
                {
                    if (this.isNullKeyPresent)
                    {
                        return this.nullKeyValue;
                    }
                    else
                    {
                        throw Fx.Exception.AsError(new KeyNotFoundException());
                    }
                }
                else
                {
                    return this.innerDictionary[key];
                }
            }
            set
            {
                if (key == null)
                {
                    this.isNullKeyPresent = true;
                    this.nullKeyValue = value;
                }
                else
                {
                    this.innerDictionary[key] = value;
                }
            }
        }

        public void Add(TKey key, TValue value)
        {
            if (key == null)
            {
                if (this.isNullKeyPresent)
                {
                    throw Fx.Exception.Argument("key", InternalSR.NullKeyAlreadyPresent);
                }
                this.isNullKeyPresent = true;
                this.nullKeyValue = value;
            }
            else
            {
                this.innerDictionary.Add(key, value);
            }
        }

        public bool ContainsKey(TKey key)
        {
            return key == null ? this.isNullKeyPresent : this.innerDictionary.ContainsKey(key);
        }

        public bool Remove(TKey key)
        {
            if (key == null)
            {
                bool result = this.isNullKeyPresent;
                this.isNullKeyPresent = false;
                this.nullKeyValue = default(TValue);
                return result;
            }
            else
            {
                return this.innerDictionary.Remove(key);
            }
        }

        public bool TryGetValue(TKey key, out TValue value)
        {
            if (key == null)
            {
                if (this.isNullKeyPresent)
                {
                    value = this.nullKeyValue;
                    return true;
                }
                else
                {
                    value = default(TValue);
                    return false;
                }
            }
            else
            {
                return this.innerDictionary.TryGetValue(key, out value);
            }
        }

        public void Add(KeyValuePair<TKey, TValue> item)
        {
            Add(item.Key, item.Value);
        }

        public void Clear()
        {
            this.isNullKeyPresent = false;
            this.nullKeyValue = default(TValue);
            this.innerDictionary.Clear();
        }

        public bool Contains(KeyValuePair<TKey, TValue> item)
        {
            if (item.Key == null)
            {
                if (this.isNullKeyPresent)
                {
                    return item.Value == null ? this.nullKeyValue == null : item.Value.Equals(this.nullKeyValue);
                }
                else
                {
                    return false;
                }
            }
            else
            {
                return this.innerDictionary.Contains(item);
            }
        }

        public void CopyTo(KeyValuePair<TKey, TValue>[] array, int arrayIndex)
        {
            this.innerDictionary.CopyTo(array, arrayIndex);
            if (this.isNullKeyPresent)
            {
                array[arrayIndex + this.innerDictionary.Count] = new KeyValuePair<TKey, TValue>(default(TKey), this.nullKeyValue);
            }
        }

        public bool Remove(KeyValuePair<TKey, TValue> item)
        {
            if (item.Key == null)
            {
                if (this.Contains(item))
                {
                    this.isNullKeyPresent = false;
                    this.nullKeyValue = default(TValue);
                    return true;
                }
                else
                {
                    return false;
                }
            }
            else
            {
                return this.innerDictionary.Remove(item);
            }
        }

        public IEnumerator<KeyValuePair<TKey, TValue>> GetEnumerator()
        {
            IEnumerator<KeyValuePair<TKey, TValue>> innerEnumerator = this.innerDictionary.GetEnumerator() as IEnumerator<KeyValuePair<TKey, TValue>>;

            while (innerEnumerator.MoveNext())
            {
                yield return innerEnumerator.Current;
            }

            if (this.isNullKeyPresent)
            {
                yield return new KeyValuePair<TKey, TValue>(default(TKey), this.nullKeyValue);
            }
        }

        IEnumerator IEnumerable.GetEnumerator()
        {
            return ((IEnumerable<KeyValuePair<TKey, TValue>>)this).GetEnumerator();
        }

        class NullKeyDictionaryKeyCollection<TypeKey, TypeValue> : ICollection<TypeKey>
        {
            NullableKeyDictionary<TypeKey, TypeValue> nullKeyDictionary;

            public NullKeyDictionaryKeyCollection(NullableKeyDictionary<TypeKey, TypeValue> nullKeyDictionary)
            {
                this.nullKeyDictionary = nullKeyDictionary;
            }

            public int Count
            {
                get
                {
                    int count = this.nullKeyDictionary.innerDictionary.Keys.Count;
                    if (this.nullKeyDictionary.isNullKeyPresent)
                    {
                        count++;
                    }
                    return count;
                }
            }

            public bool IsReadOnly
            {
                get { return true; }
            }

            public void Add(TypeKey item)
            {
                throw Fx.Exception.AsError(new NotSupportedException(InternalSR.KeyCollectionUpdatesNotAllowed));
            }

            public void Clear()
            {
                throw Fx.Exception.AsError(new NotSupportedException(InternalSR.KeyCollectionUpdatesNotAllowed));
            }

            public bool Contains(TypeKey item)
            {
                return item == null ? this.nullKeyDictionary.isNullKeyPresent : this.nullKeyDictionary.innerDictionary.Keys.Contains(item);
            }

            public void CopyTo(TypeKey[] array, int arrayIndex)
            {
                this.nullKeyDictionary.innerDictionary.Keys.CopyTo(array, arrayIndex);
                if (this.nullKeyDictionary.isNullKeyPresent)
                {
                    array[arrayIndex + this.nullKeyDictionary.innerDictionary.Keys.Count] = default(TypeKey);
                }
            }

            public bool Remove(TypeKey item)
            {
                throw Fx.Exception.AsError(new NotSupportedException(InternalSR.KeyCollectionUpdatesNotAllowed));
            }

            public IEnumerator<TypeKey> GetEnumerator()
            {
                foreach (TypeKey item in this.nullKeyDictionary.innerDictionary.Keys)
                {
                    yield return item;
                }

                if (this.nullKeyDictionary.isNullKeyPresent)
                {
                    yield return default(TypeKey);
                }
            }

            IEnumerator IEnumerable.GetEnumerator()
            {
                return ((IEnumerable<TypeKey>)this).GetEnumerator();
            }
        }

        class NullKeyDictionaryValueCollection<TypeKey, TypeValue> : ICollection<TypeValue>
        {
            NullableKeyDictionary<TypeKey, TypeValue> nullKeyDictionary;

            public NullKeyDictionaryValueCollection(NullableKeyDictionary<TypeKey, TypeValue> nullKeyDictionary)
            {
                this.nullKeyDictionary = nullKeyDictionary;
            }

            public int Count
            {
                get
                {
                    int count = this.nullKeyDictionary.innerDictionary.Values.Count;
                    if (this.nullKeyDictionary.isNullKeyPresent)
                    {
                        count++;
                    }
                    return count;
                }
            }

            public bool IsReadOnly
            {
                get { return true; }
            }

            public void Add(TypeValue item)
            {
                throw Fx.Exception.AsError(new NotSupportedException(InternalSR.ValueCollectionUpdatesNotAllowed));
            }

            public void Clear()
            {
                throw Fx.Exception.AsError(new NotSupportedException(InternalSR.ValueCollectionUpdatesNotAllowed));
            }

            public bool Contains(TypeValue item)
            {
                return this.nullKeyDictionary.innerDictionary.Values.Contains(item) ||
                    (this.nullKeyDictionary.isNullKeyPresent && this.nullKeyDictionary.nullKeyValue.Equals(item));
            }

            public void CopyTo(TypeValue[] array, int arrayIndex)
            {
                this.nullKeyDictionary.innerDictionary.Values.CopyTo(array, arrayIndex);
                if (this.nullKeyDictionary.isNullKeyPresent)
                {
                    array[arrayIndex + this.nullKeyDictionary.innerDictionary.Values.Count] = this.nullKeyDictionary.nullKeyValue;
                }
            }

            public bool Remove(TypeValue item)
            {
                throw Fx.Exception.AsError(new NotSupportedException(InternalSR.ValueCollectionUpdatesNotAllowed));
            }

            public IEnumerator<TypeValue> GetEnumerator()
            {
                foreach (TypeValue item in this.nullKeyDictionary.innerDictionary.Values)
                {
                    yield return item;
                }

                if (this.nullKeyDictionary.isNullKeyPresent)
                {
                    yield return this.nullKeyDictionary.nullKeyValue;
                }
            }

            IEnumerator IEnumerable.GetEnumerator()
            {
                return ((IEnumerable<TypeValue>)this).GetEnumerator();
            }
        }
    }
}


text:
using System.Runtime.CompilerServices;

#if UNITY_EDITOR
[assembly: InternalsVisibleTo("Gametoolkit.Localization.Editor")]
#endif


text:
#include "Parallel.h"

using namespace shogun;

CParallel::CParallel() : refcount(0), num_threads(1)
{
}

CParallel::CParallel(const CParallel& orig) : refcount(0)
{
	num_threads=orig.get_num_threads();
}

CParallel::~CParallel()
{
}


text:
'use strict';

goog.provide('Blockly.Blocks.cwPictures');

goog.require('Blockly.Blocks');

var picsHUE = 160;
Blockly.Blocks['cwCombine'] = {
  init: function() {
    this.appendValueInput('PIC0');
    this.appendValueInput('PIC1')
        .appendField(new Blockly.FieldLabel("&","blocklyTextEmph") );
    this.setColour(picsHUE);
    this.setMutator(new Blockly.Mutator(['pics_combine_ele']));
    this.setTooltip('Combine multiple pictures');
    this.itemCount_ = 2;
    this.setOutput(true);

    Blockly.TypeInf.defineFunction("&", Type.fromList([Type.Lit("Picture"),Type.Lit("Picture"),Type.Lit("Picture")]));
    this.setAsFunction("&");
  },

  foldr1 : function(fn, xs) {
    var result = xs[xs.length - 1];
      for (var i = xs.length - 2; i > -1; i--) {
        result = fn(xs[i], result);
      }
    return result;
  },

  getExpr: function(){
    var exps = [];
    this.inputList.forEach(function(inp){
      if(inp.connection.isConnected())
        exps.push(inp.connection.targetBlock().getExpr());
      else
        exps.push(Exp.Var('undef'));
    });
    if(exps.length < 2){ // If the block has less than 2 inputs, warn the user
      exps = [];
      exps.push(Exp.Var('undef'));
      exps.push(Exp.Var('undef'));
    }
    var func = (a,b) => Exp.AppFunc([a,b],Exp.Var("&"));
    var e = this.foldr1(func,exps);
    return e;
  },

  decompose: function(workspace) {
    var containerBlock =
        workspace.newBlock('pics_combine_container');
    containerBlock.initSvg();
    var connection = containerBlock.getInput('STACK').connection;

    for (var x = 0; x < this.itemCount_; x++) {
      var itemBlock = workspace.newBlock('pics_combine_ele');
      itemBlock.initSvg();
      connection.connect(itemBlock.previousConnection);
      connection = itemBlock.nextConnection;
    }

    return containerBlock;
  },

  compose: function(containerBlock) {
    var tps = [];

    for (var x = 0; x < this.itemCount_; x++) {
      this.removeInput('PIC' + x);
    }

    this.itemCount_ = 0;
    // Rebuild the block's inputs.
    var itemBlock = containerBlock.getInputTargetBlock('STACK');
    while (itemBlock) {
      var input = this.appendValueInput('PIC' + this.itemCount_);
      tps.push(Type.Lit("Picture"));
      if (this.itemCount_ > 0) {
        input.appendField(new Blockly.FieldLabel("&","blocklyTextEmph") );
      }
      if (itemBlock.valueConnection_) {
        input.connection.connect(itemBlock.valueConnection_);
      }
      itemBlock = itemBlock.nextConnection &&
          itemBlock.nextConnection.targetBlock();
      this.itemCount_++;
    }
    tps.push(Type.Lit("Picture"));
    this.arrows = Type.fromList(tps);
    this.initArrows();
    this.renderMoveConnections_();

    if(this.itemCount_ < 2){
      this.setWarningText('This block requires at least 2 inputs');
    }
    else{
      this.setWarningText(null)
    }
  },

  mutationToDom: function() {
    var container = document.createElement('mutation');
    container.setAttribute('items', this.itemCount_);
    return container;
  },

  domToMutation: function(xmlElement) {
    this.itemCount_ = parseInt(xmlElement.getAttribute('items'), 10);
    var tps = [];
    this.inputList = [];
    for (var i = 0; i < this.itemCount_; i++){
      var input = this.appendValueInput('PIC' + i);
      tps.push(Type.Lit("Picture"));
      if (i > 0) {
        input.appendField(new Blockly.FieldLabel("&","blocklyTextEmph") );
      }
    };
    tps.push(Type.Lit("Picture"));
    this.arrows = Type.fromList(tps);
    this.initArrows();
  },
  saveConnections: function(containerBlock) {
    var itemBlock = containerBlock.getInputTargetBlock('STACK');
    var x = 0;
    while (itemBlock) {
      var input = this.getInput('PIC' + x);
      if(input && input.connection.targetConnection){
        if(input.connection.targetBlock().isShadow_){
          x++;
          itemBlock = itemBlock.nextConnection &&
          itemBlock.nextConnection.targetBlock();
          continue;
        }
      }
      itemBlock.valueConnection_ = input && input.connection.targetConnection;
      x++;
      itemBlock = itemBlock.nextConnection &&
          itemBlock.nextConnection.targetBlock();
    }
  }
};

Blockly.Blocks['pics_combine_ele'] = {
  /**
   * Mutator block for procedure argument.
   * @this Blockly.Block
   */
  init: function() {
    this.appendDummyInput()
        .appendField('picture');
    this.setPreviousStatement(true);
    this.setNextStatement(true);
    this.setColour(picsHUE);
    this.setTooltip('Adds a picture input');
    this.contextMenu = false;
  },
  getExpr: null
};

Blockly.Blocks['pics_combine_container'] = {
  init: function() {
    this.setColour(picsHUE);
    this.appendDummyInput()
        .appendField('Picture inputs');
    this.appendStatementInput('STACK');
    this.setTooltip('A list of inputs that the combine block should have');
    this.contextMenu = false;
  },
  getExpr: null
};

Blockly.Blocks['lists_pictures'] = {
  init: function() {
    this.setColour(160);
    this.appendValueInput('LST')
        .appendField(new Blockly.FieldLabel("pictures","blocklyTextEmph"))
        .appendField('(');
    this.appendDummyInput()
        .setAlign(Blockly.ALIGN_RIGHT)
        .appendField(')');
    this.setOutput(true);
    var pic = Type.Lit("Picture");
    Blockly.TypeInf.defineFunction("pictures", Type.fromList([Type.Lit("list", [pic]), pic]));
    this.setAsFunction("pictures");
  }
};

Blockly.Blocks['lists_path'] = {
  init: function() {
    this.setColour(160);
    this.appendValueInput('LST')
        .appendField(new Blockly.FieldLabel("path","blocklyTextEmph"))
        .appendField('(');
    this.appendDummyInput()
        .setAlign(Blockly.ALIGN_RIGHT)
        .appendField(')');
    this.setOutput(true);
    var pair = Type.Lit("pair", [Type.Lit("Number"), Type.Lit("Number")]);
    Blockly.TypeInf.defineFunction("path", Type.fromList([Type.Lit("list", [pair]), Type.Lit("Picture")]));
    this.setAsFunction("path");
  }
};

Blockly.Blocks['lists_thickPath'] = {
  init: function() {
    this.setColour(160);
    this.appendValueInput('LST')
        .appendField(new Blockly.FieldLabel("thickPath","blocklyTextEmph"))
        .appendField('(');
    this.appendValueInput('THICKNESS')
        .setAlign(Blockly.ALIGN_RIGHT)
        .appendField(',');
    this.appendDummyInput()
        .setAlign(Blockly.ALIGN_RIGHT)
        .appendField(')');
    this.setInputsInline(true);
    this.setOutput(true);

    var pair = Type.Lit("pair", [Type.Lit("Number"), Type.Lit("Number")]);
    var pts = Type.Lit("list", [pair]);
    var num = Type.Lit("Number");
    Blockly.TypeInf.defineFunction("thickPath", Type.fromList([pts, num, Type.Lit("Picture")]));
    this.setAsFunction("thickPath");
  }
};

Blockly.Blocks['lists_polygon'] = {
  init: function() {
    this.setColour(160);
    this.appendValueInput('LST')
        .appendField(new Blockly.FieldLabel("polygon","blocklyTextEmph"))
        .appendField('(');
    this.appendDummyInput()
        .setAlign(Blockly.ALIGN_RIGHT)
        .appendField(')');
    this.setOutput(true);
    var pair = Type.Lit("pair", [Type.Lit("Number"), Type.Lit("Number")]);
    Blockly.TypeInf.defineFunction("polygon", Type.fromList([Type.Lit("list", [pair]), Type.Lit("Picture")]));
    this.setAsFunction("polygon");
  }
};

Blockly.Blocks['lists_solidPolygon'] = {
  init: function() {
    this.setColour(160);
    this.appendValueInput('LST')
        .appendField(new Blockly.FieldLabel("solidPolygon","blocklyTextEmph"))
        .appendField('(');
    this.appendDummyInput()
        .setAlign(Blockly.ALIGN_RIGHT)
        .appendField(')');
    this.setOutput(true);
    var pair = Type.Lit("pair", [Type.Lit("Number"), Type.Lit("Number")]);
    Blockly.TypeInf.defineFunction("solidPolygon", Type.fromList([Type.Lit("list", [pair]), Type.Lit("Picture")]));
    this.setAsFunction("solidPolygon");
  }
};

Blockly.Blocks['lists_thickPolygon'] = {
  init: function() {
    this.setColour(160);
    this.appendValueInput('LST')
        .appendField(new Blockly.FieldLabel("thickPolygon","blocklyTextEmph"))
        .appendField('(');
    this.appendValueInput('THICKNESS')
        .setAlign(Blockly.ALIGN_RIGHT)
        .appendField(',');
    this.appendDummyInput()
        .setAlign(Blockly.ALIGN_RIGHT)
        .appendField(')');
    this.setInputsInline(true);
    this.setOutput(true);

    var pair = Type.Lit("pair", [Type.Lit("Number"), Type.Lit("Number")]);
    var pts = Type.Lit("list", [pair]);
    var num = Type.Lit("Number");
    Blockly.TypeInf.defineFunction("thickPolygon", Type.fromList([pts, num, Type.Lit("Picture")]));
    this.setAsFunction("thickPolygon");
  }
};

Blockly.Blocks['lists_curve'] = {
  init: function() {
    this.setColour(160);
    this.appendValueInput('LST')
        .appendField(new Blockly.FieldLabel("curve","blocklyTextEmph"))
        .appendField('(');
    this.appendDummyInput()
        .setAlign(Blockly.ALIGN_RIGHT)
        .appendField(')');
    this.setOutput(true);
    var pair = Type.Lit("pair", [Type.Lit("Number"), Type.Lit("Number")]);
    Blockly.TypeInf.defineFunction("curve", Type.fromList([Type.Lit("list", [pair]), Type.Lit("Picture")]));
    this.setAsFunction("curve");
  }
};

Blockly.Blocks['lists_thickCurve'] = {
  init: function() {
    this.setColour(160);
    this.appendValueInput('LST')
        .appendField(new Blockly.FieldLabel("thickCurve","blocklyTextEmph"))
        .appendField('(');
    this.appendValueInput('THICKNESS')
        .setAlign(Blockly.ALIGN_RIGHT)
        .appendField(',');
    this.appendDummyInput()
        .setAlign(Blockly.ALIGN_RIGHT)
        .appendField(')');
    this.setInputsInline(true);
    this.setOutput(true);

    var pair = Type.Lit("pair", [Type.Lit("Number"), Type.Lit("Number")]);
    var pts = Type.Lit("list", [pair]);
    var num = Type.Lit("Number");
    Blockly.TypeInf.defineFunction("thickCurve", Type.fromList([pts, num, Type.Lit("Picture")]));
    this.setAsFunction("thickCurve");
  }
};

Blockly.Blocks['lists_loop'] = {
  init: function() {
    this.setColour(160);
    this.appendValueInput('LST')
        .appendField(new Blockly.FieldLabel("loop","blocklyTextEmph"))
        .appendField('(');
    this.appendDummyInput()
        .setAlign(Blockly.ALIGN_RIGHT)
        .appendField(')');
    this.setOutput(true);
    var pair = Type.Lit("pair", [Type.Lit("Number"), Type.Lit("Number")]);
    Blockly.TypeInf.defineFunction("loop", Type.fromList([Type.Lit("list", [pair]), Type.Lit("Picture")]));
    this.setAsFunction("loop");
  }
};

Blockly.Blocks['lists_solidLoop'] = {
  init: function() {
    this.setColour(160);
    this.appendValueInput('LST')
        .appendField(new Blockly.FieldLabel("solidLoop","blocklyTextEmph"))
        .appendField('(');
    this.appendDummyInput()
        .setAlign(Blockly.ALIGN_RIGHT)
        .appendField(')');
    this.setOutput(true);
    var pair = Type.Lit("pair", [Type.Lit("Number"), Type.Lit("Number")]);
    Blockly.TypeInf.defineFunction("solidLoop", Type.fromList([Type.Lit("list", [pair]), Type.Lit("Picture")]));
    this.setAsFunction("solidLoop");
  }
};

Blockly.Blocks['lists_thickLoop'] = {
  init: function() {
    this.setColour(160);
    this.appendValueInput('LST')
        .appendField(new Blockly.FieldLabel("thickLoop","blocklyTextEmph"))
        .appendField('(');
    this.appendValueInput('THICKNESS')
        .setAlign(Blockly.ALIGN_RIGHT)
        .appendField(',');
    this.appendDummyInput()
        .setAlign(Blockly.ALIGN_RIGHT)
        .appendField(')');
    this.setInputsInline(true);
    this.setOutput(true);

    var pair = Type.Lit("pair", [Type.Lit("Number"), Type.Lit("Number")]);
    var pts = Type.Lit("list", [pair]);
    var num = Type.Lit("Number");
    Blockly.TypeInf.defineFunction("thickLoop", Type.fromList([pts, num, Type.Lit("Picture")]));
    this.setAsFunction("thickLoop");
  }
};


text:
package org.apache.sshd.client;

import java.util.Arrays;
import java.util.Collections;
import java.util.List;

import org.apache.sshd.client.kex.DHGClient;
import org.apache.sshd.client.kex.DHGEXClient;
import org.apache.sshd.client.keyverifier.AcceptAllServerKeyVerifier;
import org.apache.sshd.common.BaseBuilder;
import org.apache.sshd.common.NamedFactory;
import org.apache.sshd.common.channel.Channel;
import org.apache.sshd.common.kex.DHFactory;
import org.apache.sshd.common.kex.KeyExchange;
import org.apache.sshd.common.util.Transformer;
import org.apache.sshd.server.forward.ForwardedTcpipFactory;

/**
 * SshClient builder
 */
public class ClientBuilder extends BaseBuilder<SshClient, ClientBuilder> {
    public static final Transformer<DHFactory, NamedFactory<KeyExchange>> DH2KEX =
        new Transformer<DHFactory, NamedFactory<KeyExchange>>() {
            @Override
            public NamedFactory<KeyExchange> transform(DHFactory factory) {
                if (factory == null) {
                    return null;
                } else if (factory.isGroupExchange()) {
                    return DHGEXClient.newFactory(factory);
                } else {
                    return DHGClient.newFactory(factory);
                }
            }
        };

    public static final List<NamedFactory<Channel>> DEFAULT_CHANNEL_FACTORIES =
            Collections.unmodifiableList(Arrays.<NamedFactory<Channel>>asList(ForwardedTcpipFactory.INSTANCE));

    public static final ServerKeyVerifier DEFAULT_SERVER_KEY_VERIFIER = AcceptAllServerKeyVerifier.INSTANCE;

    protected ServerKeyVerifier serverKeyVerifier;

    public ClientBuilder() {
        super();
    }

    public ClientBuilder serverKeyVerifier(ServerKeyVerifier serverKeyVerifier) {
        this.serverKeyVerifier = serverKeyVerifier;
        return me();
    }

    @Override
    protected ClientBuilder fillWithDefaultValues() {
        super.fillWithDefaultValues();

        if (keyExchangeFactories == null) {
            keyExchangeFactories = setUpDefaultKeyExchanges(false);
        }

        if (channelFactories == null) {
            channelFactories = DEFAULT_CHANNEL_FACTORIES;
        }

        if (serverKeyVerifier == null) {
            serverKeyVerifier = DEFAULT_SERVER_KEY_VERIFIER;
        }

        if (factory == null) {
            factory = SshClient.DEFAULT_SSH_CLIENT_FACTORY;
        }

        return me();
    }

    @Override
    public SshClient build(boolean isFillWithDefaultValues) {
        SshClient client = super.build(isFillWithDefaultValues);
        client.setServerKeyVerifier(serverKeyVerifier);
        return client;
    }

    /**
     * @param ignoreUnsupported If {@code true} then all the default
     *                          key exchanges are included, regardless of whether they are currently
     *                          supported by the JCE. Otherwise, only the supported ones out of the
     *                          list are included
     * @return A {@link List} of the default {@link NamedFactory}
     * instances of the {@link KeyExchange}s according to the preference
     * order defined by {@link #DEFAULT_KEX_PREFERENCE}.
     * <B>Note:</B> the list may be filtered to exclude unsupported JCE
     * key exchanges according to the <tt>ignoreUnsupported</tt> parameter
     * @see org.apache.sshd.common.kex.BuiltinDHFactories#isSupported()
     */
    public static List<NamedFactory<KeyExchange>> setUpDefaultKeyExchanges(boolean ignoreUnsupported) {
        return NamedFactory.Utils.setUpTransformedFactories(ignoreUnsupported, DEFAULT_KEX_PREFERENCE, DH2KEX);
    }

    public static ClientBuilder builder() {
        return new ClientBuilder();
    }
}


text:
nSoundBag::nSoundBag(nSoundFormat format, quint64 frames, int freq, QObject * parent):
    QObject(parent)
{
    m_frames = frames;
    m_data_size = nSoundFormat_getFramesize(format)*frames;
    m_data = new unsigned char[m_data_size];
    m_frequency = freq;
    m_format = format;
}

nSoundBag::~nSoundBag()
{
    delete[] m_data;
}


text:
// Copyright © 2017, 2018 IBM Corp. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

/* global describe it */
'use strict';

const assert = require('assert');
const backup = require('../app.js').backup;
const fs = require('fs');
const nock = require('nock');

const goodUrl = 'http://localhost:5984/db';
// The real validateArgs function of app.js isn't
// exported - so we call the exported backup method
// instead. We don't get as far as a real backup when
// testing error cases. For success cases we nock the
// goodUrl and
const validateArgs = function(url, opts, callback) {
  const nullStream = fs.createWriteStream('/dev/null');
  let cb = callback;
  if (url === goodUrl) {
    // Nock the goodUrl
    nock(goodUrl).head('').reply(404, { error: 'not_found', reason: 'missing' });
    // replace the callback to handle the nock response
    // to avoid attempting a real backup
    cb = function(err) {
      nullStream.end();
      if (err.name === 'DatabaseNotFound') {
        // This is what we expect if we reached the backup
        // This is success for valid args cases.
        err = null;
      }
      callback(err);
    };
  }
  backup(url, nullStream, opts, cb);
  return true;
};

const stderrWriteFun = process.stderr.write;
let capturedStderr;

function captureStderr() {
  process.stderr.write = function(string, encoding, fd) {
    capturedStderr += string;
  };
}

function releaseStderr() {
  process.stderr.write = stderrWriteFun;
  capturedStderr = null;
}

function assertErrorMessage(msg, done) {
  return function(err, data) {
    try {
      assert(err.message, 'There should be an error message');
      assert(err.message.indexOf(msg) >= 0);
      assert(data === null || data === undefined, 'There should only be an error.');
      done();
    } catch (e) {
      done(e);
    }
  };
}

function assertNoError(done) {
  return function(err, data) {
    try {
      assert(err === null, 'There should be no error message.');
      done();
    } catch (e) {
      done(e);
    }
  };
}

describe('#unit Validate arguments', function() {
  it('returns error for invalid URL type', function(done) {
    validateArgs(true, {}, assertErrorMessage('Invalid URL, must be type string', done));
  });
  it('returns no error for valid URL type', function(done) {
    validateArgs(goodUrl, {}, assertNoError(done));
  });
  it('returns error for invalid (no host) URL', function(done) {
    validateArgs('http://', {}, assertErrorMessage('Invalid URL', done));
  });
  it('returns error for invalid (no protocol) URL', function(done) {
    validateArgs('invalid', {}, assertErrorMessage('Invalid URL', done));
  });
  it('returns error for invalid (wrong protocol) URL', function(done) {
    validateArgs('ftp://invalid.example.com', {}, assertErrorMessage('Invalid URL protocol.', done));
  });
  it('returns error for invalid (no path) URL', function(done) {
    validateArgs('https://invalid.example.com', {}, assertErrorMessage('Invalid URL, missing path element (no database).', done));
  });
  it('returns error for invalid (no protocol, no host) URL', function(done) {
    validateArgs('invalid', {}, assertErrorMessage('Invalid URL', done));
  });
  it('returns error for invalid buffer size type', function(done) {
    validateArgs(goodUrl, { bufferSize: '123' }, assertErrorMessage('Invalid buffer size option, must be a positive integer in the range (0, MAX_SAFE_INTEGER]', done));
  });
  it('returns error for zero buffer size', function(done) {
    validateArgs(goodUrl, { bufferSize: 0 }, assertErrorMessage('Invalid buffer size option, must be a positive integer in the range (0, MAX_SAFE_INTEGER]', done));
  });
  it('returns error for float buffer size', function(done) {
    validateArgs(goodUrl, { bufferSize: 1.23 }, assertErrorMessage('Invalid buffer size option, must be a positive integer in the range (0, MAX_SAFE_INTEGER]', done));
  });
  it('returns no error for valid buffer size type', function(done) {
    validateArgs(goodUrl, { bufferSize: 123 }, assertNoError(done));
  });
  it('returns error for invalid log type', function(done) {
    validateArgs(goodUrl, { log: true }, assertErrorMessage('Invalid log option, must be type string', done));
  });
  it('returns no error for valid log type', function(done) {
    validateArgs(goodUrl, { log: 'log.txt' }, assertNoError(done));
  });
  it('returns error for invalid mode type', function(done) {
    validateArgs(goodUrl, { mode: true }, assertErrorMessage('Invalid mode option, must be either "full" or "shallow"', done));
  });
  it('returns error for invalid mode string', function(done) {
    validateArgs(goodUrl, { mode: 'foobar' }, assertErrorMessage('Invalid mode option, must be either "full" or "shallow"', done));
  });
  it('returns no error for valid mode type', function(done) {
    validateArgs(goodUrl, { mode: 'full' }, assertNoError(done));
  });
  it('returns error for invalid output type', function(done) {
    validateArgs(goodUrl, { output: true }, assertErrorMessage('Invalid output option, must be type string', done));
  });
  it('returns no error for valid output type', function(done) {
    validateArgs(goodUrl, { output: 'output.txt' }, assertNoError(done));
  });
  it('returns error for invalid parallelism type', function(done) {
    validateArgs(goodUrl, { parallelism: '123' }, assertErrorMessage('Invalid parallelism option, must be a positive integer in the range (0, MAX_SAFE_INTEGER]', done));
  });
  it('returns error for zero parallelism', function(done) {
    validateArgs(goodUrl, { parallelism: 0 }, assertErrorMessage('Invalid parallelism option, must be a positive integer in the range (0, MAX_SAFE_INTEGER]', done));
  });
  it('returns error for float parallelism', function(done) {
    validateArgs(goodUrl, { parallelism: 1.23 }, assertErrorMessage('Invalid parallelism option, must be a positive integer in the range (0, MAX_SAFE_INTEGER]', done));
  });
  it('returns no error for valid parallelism type', function(done) {
    validateArgs(goodUrl, { parallelism: 123 }, assertNoError(done));
  });
  it('returns error for invalid request timeout type', function(done) {
    validateArgs(goodUrl, { requestTimeout: '123' }, assertErrorMessage('Invalid request timeout option, must be a positive integer in the range (0, MAX_SAFE_INTEGER]', done));
  });
  it('returns error for zero request timeout', function(done) {
    validateArgs(goodUrl, { requestTimeout: 0 }, assertErrorMessage('Invalid request timeout option, must be a positive integer in the range (0, MAX_SAFE_INTEGER]', done));
  });
  it('returns error for float request timout', function(done) {
    validateArgs(goodUrl, { requestTimeout: 1.23 }, assertErrorMessage('Invalid request timeout option, must be a positive integer in the range (0, MAX_SAFE_INTEGER]', done));
  });
  it('returns no error for valid request timeout type', function(done) {
    validateArgs(goodUrl, { requestTimeout: 123 }, assertNoError(done));
  });
  it('returns error for invalid resume type', function(done) {
    validateArgs(goodUrl, { resume: 'true' }, assertErrorMessage('Invalid resume option, must be type boolean', done));
  });
  it('returns no error for valid resume type', function(done) {
    validateArgs(goodUrl, { resume: false }, assertNoError(done));
  });
  it('returns error for invalid key type', function(done) {
    validateArgs(goodUrl, { iamApiKey: true }, assertErrorMessage('Invalid iamApiKey option, must be type string', done));
  });
  it('returns error for key and URL credentials supplied', function(done) {
    validateArgs('https://a:b@example.com/db', { iamApiKey: 'abc123' }, assertErrorMessage('URL user information must not be supplied when using IAM API key.', done));
  });
  it('warns for log arg in shallow mode', function(done) {
    captureStderr();
    try {
      validateArgs(goodUrl, { mode: 'shallow', log: 'test' }, function(err, data) {
        assert.ok(err);
        assert.ok(!data);
        assert(capturedStderr.indexOf('The options "log" and "resume" are invalid when using shallow mode.') > -1, 'Log warning message was not present');
      });
      done();
    } catch (e) {
      done(e);
    } finally {
      releaseStderr();
    }
  });
  it('warns for resume arg in shallow mode', function(done) {
    captureStderr();
    try {
      validateArgs(goodUrl, { mode: 'shallow', log: 'test', resume: true }, function(err, data) {
        assert.ok(err);
        assert.ok(!data);
        assert(capturedStderr.indexOf('The options "log" and "resume" are invalid when using shallow mode.') > -1, 'Log warning message was not present');
      });
      done();
    } catch (e) {
      done(e);
    } finally {
      releaseStderr();
    }
  });
  it('warns for parallism arg in shallow mode', function(done) {
    captureStderr();
    try {
      validateArgs(goodUrl, { mode: 'shallow', parallelsim: 10 }, function(err, data) {
        assert.ok(err);
        assert.ok(!data);
        assert(capturedStderr.indexOf('The option "parallelism" has no effect when using shallow mode.') > -1, 'Log warning message was not present');
      });
      done();
    } catch (e) {
      done(e);
    } finally {
      releaseStderr();
    }
  });
});


text:
CREATE PROCEDURE [dbo].[h3giCreditCheckAddPoisonOrder]
	@orderRef INT
AS
BEGIN
	-- SET NOCOUNT ON added to prevent extra result sets from
	-- interfering with SELECT statements.
	SET NOCOUNT ON;

	IF NOT EXISTS (SELECT orderref FROM h3giAutomatedCreditCheckQueuePoison WHERE orderref = @orderRef)
	BEGIN
		INSERT INTO h3giAutomatedCreditCheckQueuePoison
		VALUES (@orderRef)
	END

END

GRANT EXECUTE ON h3giCreditCheckAddPoisonOrder TO b4nuser
GO
GRANT EXECUTE ON h3giCreditCheckAddPoisonOrder TO experianQueueUser
GO


text:
pyexcel.Sheet.cell_value
========================

.. currentmodule:: pyexcel

.. automethod:: Sheet.cell_value


text:
"""
This package contains classes for representing semantic structure in
formulas of first-order logic and for evaluating such formulas in
set-theoretic models.

"""

from util import *
from evaluate import *
from logic import *
from relextract import *


text:
package br.com.makadu.makaduevento.UI;

import android.os.Bundle;
import android.os.PersistableBundle;
import android.support.v7.app.ActionBar;
import android.support.v7.app.ActionBarActivity;
import android.support.v7.app.AppCompatActivity;

import br.com.makadu.makaduevento.R;

/**
 * Created by lucasschwalbeferreira on 5/14/16.
 */
public class ActionBarmakadu extends AppCompatActivity {

    @Override
    protected void onStart() {
        super.onStart();
        getSupportActionBar().setDisplayShowHomeEnabled(true);
        getSupportActionBar().setDisplayOptions(ActionBar.DISPLAY_SHOW_CUSTOM);
        getSupportActionBar().setCustomView(R.layout.actionbar_makadu);
    }

}


text:
package org.xblackcat.sjpu.util.function;

import java.util.Objects;
import java.util.function.BiConsumer;
import java.util.function.BiFunction;
import java.util.function.Function;
import java.util.function.Supplier;

/**
 * Represents an operation that accepts two input arguments and returns no
 * result.  This is the two-arity specialization of {@link ConsumerEx}.
 * Unlike most other functional interfaces, {@code BiConsumer} is expected
 * to operate via side-effects.
 *

 *
This is a functional interface
 * whose functional method is {@link #accept(Object, Object)}.
 *
 * @param <T> the type of the first argument to the operation
 * @param  the type of the second argument to the operation
 * @param <E> the type of exception could be thrown while performing operation
 * @see ConsumerEx
 * @since 1.8
 */
@FunctionalInterface
public interface BiConsumerEx<T, U, E extends Throwable> {

    /**
     * Performs this operation on the given arguments.
     *
     * @param t the first input argument
     * @param u the second input argument
     */
    void accept(T t, U u) throws E;

    /**
     * Returns a composed {@code BiConsumer} that performs, in sequence, this
     * operation followed by the {@code after} operation. If performing either
     * operation throws an exception, it is relayed to the caller of the
     * composed operation.  If performing this operation throws an exception,
     * the {@code after} operation will not be performed.
     *
     * @param after the operation to perform after this operation
     * @return a composed {@code BiConsumer} that performs in sequence this
     * operation followed by the {@code after} operation
     * @throws NullPointerException if {@code after} is null
     */
    default BiConsumerEx<T, U, E> andThen(BiConsumerEx<? super T, ? super U, E> after) {
        Objects.requireNonNull(after);

        return (l, U) -> {
            accept(l, U);
            after.accept(l, U);
        };
    }

    default ConsumerEx<T, E> fixRight(U u) {
        return t -> accept(t, u);
    }

    default ConsumerEx fixLeft(T t) {
        return u -> accept(t, u);
    }

    default <C extends Throwable> BiConsumerEx<T, U, C> cover(String exceptionText, BiFunction<String, Throwable, C> cover) {
        return cover(() -> exceptionText, cover);
    }

    default <C extends Throwable> BiConsumerEx<T, U, C> cover(BiFunction<String, Throwable, C> cover) {
        return cover(Throwable::getMessage, cover);
    }

    default <C extends Throwable> BiConsumerEx<T, U, C> cover(Supplier<String> text, BiFunction<String, Throwable, C> cover) {
        return cover(e -> text.get(), cover);
    }

    default <C extends Throwable> BiConsumerEx<T, U, C> cover(Function<Throwable, String> text, BiFunction<String, Throwable, C> cover) {
        return (t, u) -> {
            try {
                accept(t, u);
            } catch (Throwable e) {
                throw cover.apply(text.apply(e), e);
            }
        };
    }

    default BiConsumer<T, U> unchecked(String exceptionText, BiFunction<String, Throwable, ? extends RuntimeException> cover) {
        return unchecked(() -> exceptionText, cover);
    }

    default BiConsumer<T, U> unchecked() {
        return unchecked(CoveringException::new);
    }

    default BiConsumer<T, U> unchecked(BiFunction<String, Throwable, ? extends RuntimeException> cover) {
        return unchecked(Throwable::getMessage, cover);
    }

    default BiConsumer<T, U> unchecked(Supplier<String> text, BiFunction<String, Throwable, ? extends RuntimeException> cover) {
        return unchecked(e -> text.get(), cover);
    }

    default BiConsumer<T, U> unchecked(
            Function<Throwable, String> text,
            BiFunction<String, Throwable, ? extends RuntimeException> cover
    ) {
        return (t, u) -> {
            try {
                accept(t, u);
            } catch (Throwable e) {
                throw cover.apply(text.apply(e), e);
            }
        };
    }

}


text:
import time
from typing import Optional, Tuple

from ..core.toolframe import ToolFrame
from ...core.utils.telemetry import TelemetryInfo

def split_time(time_seconds) -> Tuple[int, int, int, int]:
    days = time_seconds // (24 * 3600)
    hours = (time_seconds - days * (24 * 3600)) // 3600
    mins = (time_seconds - days * 24 * 3600 - hours * 3600) // 60
    secs = (time_seconds - days * 24 * 3600 - hours * 3600 - mins * 60)
    return int(days), int(hours), int(mins), int(secs)

class ResourceUsageFrame(ToolFrame):
    def __init__(self, *args, **kwargs):
        self._telemetry_connection = None
        super().__init__(*args, **kwargs)

    def init_gui(self, *args, **kwargs):
        self._telemetry_connection = self.instrument.services['telemetrymanager'].connect('telemetry',
                                                                                self.on_telemetry)

    def cleanup(self):
        if self._telemetry_connection is not None:
            self.instrument.services['telemetrymanager'].disconnect(self._telemetry_connection)
            self._telemetry_connection = None
        return super().cleanup()

    def on_telemetry(self, telemetrymanager, label: Optional[str], tm: TelemetryInfo):
        if label is not None:
            return False
        self.builder.get_object('uptime_label').set_text('{:d}d.{:d}:{:d}:{:d}'.format(*split_time(
            time.monotonic() - self.instrument.starttime)))
        self.builder.get_object('livetime_label').set_text('{:d}d.{:d}:{:d}:{:d}'.format(*split_time(
            tm.systemtime + tm.usertime)))
        self.builder.get_object('memory_label').set_text(
            '{:.2f} MB'.format(tm.memusage / 1024 / 1024))
        self.builder.get_object('freemem_label').set_text(
            '{:.2f} from {:.2f} GB ({:.2f} %)'.format(tm.freephysmem / 1073741824, tm.totalphysmem / 1073741824,
                                                      tm.freephysmem / tm.totalphysmem * 100))
        self.builder.get_object('freeswap_label').set_text(
            '{:.2f} from {:.2f} GB ({:.2f} %)'.format(tm.freeswap / 1073741824, tm.totalswap / 1073741824,
                                                      tm.freeswap / tm.totalswap * 100))
        self.builder.get_object('loadavg_label').set_text(tm.loadavg)
        return False


text:
class ThinkingSphinx::Middlewares::SphinxQL <
  ThinkingSphinx::Middlewares::Middleware

  SELECT_OPTIONS = [:agent_query_timeout, :boolean_simplify, :comment, :cutoff,
    :field_weights, :global_idf, :idf, :index_weights, :max_matches,
    :max_query_time, :max_predicted_time, :ranker, :retry_count, :retry_delay,
    :reverse_scan, :sort_method, :rand_seed]

  def call(contexts)
    contexts.each do |context|
      Inner.new(context).call
    end

    app.call contexts
  end

  private

  class Inner
    def initialize(context)
      @context = context
    end

    def call
      context[:indices]  = indices
      context[:sphinxql] = statement
    end

    private

    attr_reader :context

    delegate :search, :configuration, :to => :context
    delegate :options,                :to => :search
    delegate :settings,               :to => :configuration

    def classes
      options[:classes] || []
    end

    def classes_and_descendants
      classes + descendants
    end

    def classes_and_descendants_names
      classes_and_descendants.collect do |klass|
        name = klass.name
        name = %Q{"#{name}"} if name[/:/]
        name
      end
    end

    def classes_with_inheritance_column
      classes.select { |klass|
        klass.column_names.include?(klass.inheritance_column)
      }
    end

    def class_condition
      "(#{classes_and_descendants_names.join('|')})"
    end

    def class_condition_required?
      classes.any? && !indices_match_classes?
    end

    def constantize_inheritance_column(klass)
      values = klass.connection.select_values inheritance_column_select(klass)
      values.reject(&:blank?).each(&:constantize)
    end

    def descendants
      @descendants ||= options[:skip_sti] ? [] : descendants_from_tables
    end

    def descendants_from_tables
      classes_with_inheritance_column.collect do |klass|
        constantize_inheritance_column(klass)
        klass.descendants
      end.flatten
    end

    def exclusive_filters
      @exclusive_filters ||= (options[:without] || {}).tap do |without|
        without[:sphinx_internal_id] = options[:without_ids] if options[:without_ids].present?
      end
    end

    def extended_query
      conditions = options[:conditions] || {}
      if class_condition_required?
        conditions[:sphinx_internal_class_name] = class_condition
      end

      @extended_query ||= ThinkingSphinx::Search::Query.new(
        context.search.query, conditions, options[:star]
      ).to_s
    end

    def group_attribute
      options[:group_by].to_s if options[:group_by]
    end

    def group_order_clause
      group_by = options[:order_group_by]
      group_by = "#{group_by} ASC" if group_by.is_a? Symbol
      group_by
    end

    def inclusive_filters
      (options[:with] || {}).merge({:sphinx_deleted => false})
    end

    def index_names
      indices.collect(&:name)
    end

    def index_options
      indices.first.options
    end

    def indices
      @indices ||= begin
        set = configuration.index_set_class.new(
          options.slice(:classes, :indices)
        )
        raise ThinkingSphinx::NoIndicesError if set.empty?
        set
      end
    end

    def indices_match_classes?
      indices.collect(&:reference).uniq.sort == classes.collect { |klass|
        configuration.index_set_class.reference_name(klass)
      }.sort
    end

    def inheritance_column_select(klass)
      <<-SQL
SELECT DISTINCT #{klass.inheritance_column}
FROM #{klass.table_name}
SQL
    end

    def order_clause
      order_by = options[:order]
      order_by = "#{order_by} ASC" if order_by.is_a? Symbol
      order_by
    end

    def select_options
      @select_options ||= SELECT_OPTIONS.inject({}) do |hash, key|
        hash[key] = settings[key.to_s] if settings.key? key.to_s
        hash[key] = index_options[key] if index_options.key? key
        hash[key] = options[key]       if options.key? key
        hash
      end
    end

    def values
      options[:select] ||= ['*',
        "groupby() AS sphinx_internal_group",
        "id AS sphinx_document_id, count(DISTINCT sphinx_document_id) AS sphinx_internal_count"
      ].join(', ') if group_attribute.present?
      options[:select]
    end

    def statement
      Statement.new(self).to_riddle_query_select
    end

    class Statement
      def initialize(report)
        self.report = report
        self.query = Riddle::Query::Select.new
      end

      def to_riddle_query_select
        filter_by_scopes

        query
      end

      protected
      attr_accessor :report, :query
      def filter_by_scopes
        scope_by_from
        scope_by_values
        scope_by_extended_query
        scope_by_inclusive_filters
        scope_by_with_all
        scope_by_exclusive_filters
        scope_by_without_all

        scope_by_order
        scope_by_group
        scope_by_pagination
        scope_by_options
      end

      def scope_by_from
        query.from *(index_names.collect { |index| "`#{index}`" })
      end

      def scope_by_values
        query.values(values.present? ? values : '*')
      end

      def scope_by_extended_query
        query.matching extended_query if extended_query.present?
      end

      def scope_by_inclusive_filters
        query.where inclusive_filters if inclusive_filters.any?
      end

      def scope_by_with_all
        query.where_all options[:with_all] if options[:with_all]
      end

      def scope_by_exclusive_filters
        query.where_not exclusive_filters  if exclusive_filters.any?
      end

      def scope_by_without_all
        query.where_not_all options[:without_all] if options[:without_all]
      end

      def scope_by_order
        query.order_by order_clause if order_clause.present?
      end

      def scope_by_group
        query.group_by group_attribute        if group_attribute.present?
        query.group_best options[:group_best] if options[:group_best]
        query.order_within_group_by group_order_clause if group_order_clause.present?
        query.having options[:having]         if options[:having]
      end

      def scope_by_pagination
        query.offset context.search.offset
        query.limit  context.search.per_page
      end

      def scope_by_options
        query.with_options select_options if select_options.keys.any?
      end

      def method_missing(*args, &block)
        report.send *args, &block
      end
    end
  end
end


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

    var e, val;

    function ssvg () {
        var svg, ser;

        svg = document.getElementById('svgcontent_0');
        ser = new XMLSerializer();
        return '<?xml version="1.0" standalone="no"?>\n'
            + '<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">\n'
            + '\n'
            + ser.serializeToString(svg);
    }

    function pngdata () {
        var svgdata, img, canvas, context;

        svgdata = 'data:image/svg+xml;base64,' + btoa(ssvg());
        img = new Image();
        img.src = svgdata;
        canvas = document.createElement('canvas');
        canvas.width = img.width;
        canvas.height = img.height;
        context = canvas.getContext('2d');
        context.drawImage(img, 0, 0);
        return canvas.toDataURL('image/png');
    }

    // die if Enternet Explorer
    function killBill () {
        if (navigator.appName.indexOf('Explorer') >= 0) {
            var content;

            content = document.getElementById('content');
            content.parentNode.removeChild(e);
            document.write('
Sorry, Internet Explorer is not supported.
');
            document.body.style.backgroundColor = '#ffdddd';
            window.stop();
        }
    }

    function nodeWebkit () {
        // node-webkit detection
        val = localStorage.waveform;
        if (val === undefined || val === '' || val === null) {
            val = '{signal: [\n  {name: \'clk\', wave: \'p.....|...\'},\n  {name: \'dat\', wave: \'x.345x|=.x\', data: [\'head\', \'body\', \'tail\', \'data\']},\n  {name: \'req\', wave: \'0.1..0|1.0\'},\n  {},\n  {name: \'ack\', wave: \'1.....|01.\'}\n]}\n';
            localStorage.waveform = val;
        }

        if (typeof process !== 'object') {
            return;
        }

        var gui = require('nw.gui'),
            fs = require('fs'),
            path = require('path');

        var args = gui.App.argv,
            data,
            rawdata;

        if (args[0] && args[0] === 'source' && args[1]) {
            val = fs.readFileSync(
                path.resolve(process.env.PWD, args[1]),
                {encoding: 'utf8'}
            );
            localStorage.waveform = val;
        } else {
            return;
        }

        if (args[2] && args[3]) {
            e.value = val;
            WaveDrom.EditorRefresh();

            if (args[2] === 'svg') {
                data = ssvg();
            }
            if (args[2] === 'png') {
                rawdata = pngdata().replace(/^data:image\/\w+;base64,/, '');
                data = new Buffer(rawdata, 'base64');
            }

            fs.writeFileSync(
                path.resolve(process.env.PWD, args[3]),
                data,
                {encoding: 'utf8'}
            );
            gui.App.quit();
        }
    }

    killBill();

    e = document.getElementById('InputJSON_0');

    nodeWebkit();

    e.value = val;

    var cm = CodeMirror.fromTextArea(
        e,
        {
            lineNumbers: true,
            mode: {
                name: 'javascript',
                json: true
            },
            matchBrackets: true,
            autoCloseBrackets: true,
            highlightSelectionMatche: true,
            autofocus: true
        }
    );
    cm.on('change', function (cmm) {
        function c () {
            var v = cmm.getValue();
            e.value = v;
            localStorage.waveform = v;
            WaveDrom.EditorRefresh();
        }
        setTimeout(c, 750);
    });

WaveDrom.cm = cm;

})();

/* eslint-env browser */
/* global CodeMirror, WaveDrom */
/* eslint new-cap:0, no-underscore-dangle:1 */


text:
package net.sf.beanlib.spi;

import java.lang.reflect.Method;

import org.slf4j.Logger;

/**
 * Used to handle exception thrown during the population of a bean property.
 *
 * @author Joe D. Velopar
 */
public interface BeanPopulationExceptionHandler {

    /** Exception handler which aborts by throwing or re-throwing a RuntimeException or Error. */
    final BeanPopulationExceptionHandler ABORT = new BeanPopulationExceptionHandlerAdapter();

    /** Exception handler which always continue by logging and then igoring the exception or error. */
    final BeanPopulationExceptionHandler CONTINUE = new BeanPopulationExceptionHandlerAdapter() {
        @Override
        public void handleException(Throwable t, Logger log) {
            log.warn("\n" + "propertyName=" + propertyName + "\n" + "readerMethod=" + readerMethod + "\n" + "setterMethod=" + setterMethod + "\n"
                    + "fromBean=" + fromBean + "\n" + "toBean=" + toBean + "\n", t);
        }
    };

    /** Handles the exception thrown during the population of a bean property. */
    void handleException(Throwable t, Logger log);

    /** Sets the name of the property being populated. */
    BeanPopulationExceptionHandler initPropertyName(String propertyName);

    /** Sets the bean from which the property is populated from, ie the source bean. */
    BeanPopulationExceptionHandler initFromBean(Object fromBean);

    /** Sets the reader method used to retreive the value from the source bean. */
    BeanPopulationExceptionHandler initReaderMethod(Method readerMethod);

    /** Sets the bean to which the property is populated to, ie the target bean. */
    BeanPopulationExceptionHandler initToBean(Object toBean);

    /** Sets the setter method used to set the value to the target bean. */
    BeanPopulationExceptionHandler initSetterMethod(Method setterMethod);
}


text:
#include <aws/appstream/model/DescribeAppBlocksResult.h>
#include <aws/core/utils/json/JsonSerializer.h>
#include <aws/core/AmazonWebServiceResult.h>
#include <aws/core/utils/StringUtils.h>
#include <aws/core/utils/UnreferencedParam.h>

#include <utility>

using namespace Aws::AppStream::Model;
using namespace Aws::Utils::Json;
using namespace Aws::Utils;
using namespace Aws;

DescribeAppBlocksResult::DescribeAppBlocksResult()
{
}

DescribeAppBlocksResult::DescribeAppBlocksResult(const Aws::AmazonWebServiceResult<JsonValue>& result)
{
  *this = result;
}

DescribeAppBlocksResult& DescribeAppBlocksResult::operator =(const Aws::AmazonWebServiceResult<JsonValue>& result)
{
  JsonView jsonValue = result.GetPayload().View();
  if(jsonValue.ValueExists("AppBlocks"))
  {
    Array<JsonView> appBlocksJsonList = jsonValue.GetArray("AppBlocks");
    for(unsigned appBlocksIndex = 0; appBlocksIndex < appBlocksJsonList.GetLength(); ++appBlocksIndex)
    {
      m_appBlocks.push_back(appBlocksJsonList[appBlocksIndex].AsObject());
    }
  }

  if(jsonValue.ValueExists("NextToken"))
  {
    m_nextToken = jsonValue.GetString("NextToken");

  }

  return *this;
}


text:
Sequel.migration do
  change do
    create_table :users do
      primary_key :id

      String :name, null: false
      String :password, null: false
      String :email, null: false

      DateTime :created_at, null: false
      DateTime :updated_at, null: false
    end

    create_table :sessions do
      primary_key :id
      String :token, null: false, index: true, unique: true
      foreign_key :user_id, :users, null: false, index: true, on_delete: :cascade

      DateTime :created_at, null: false
      DateTime :updated_at, null: false
    end

    create_table :games do
      primary_key :id
      foreign_key :user_id, :users, null: false, index: true, on_delete: :cascade
      column :users, 'integer[]', null: false
      json :settings, null: false, default: '{}'
      jsonb :state, null: false, default: '{}'

      DateTime :created_at, null: false
      DateTime :updated_at, null: false

      index :users, type: 'gin'
      index :state, type: 'gin'
    end

    create_table :actions do
      primary_key :id
      foreign_key :game_id, :games, null: false, index: true, on_delete: :cascade
      Integer :round, null: false
      Integer :phase, null: false
      json :turns, null: false, default: '[]'

      DateTime :created_at, null: false
      DateTime :updated_at, null: false
      index [:game_id, :round, :phase], unique: true
    end
  end
end


text:
<?php

namespace Rentgen;

use Symfony\Component\DependencyInjection\ContainerBuilder;

use Rentgen\DependencyInjection\RentgenExtension;
use Rentgen\Schema\Info;
use Rentgen\Schema\Manipulation;

class Rentgen
{
    private $container;

    /**
     * Constructor.
     */
    public function __construct()
    {
        $container = new ContainerBuilder();

        $extension = new RentgenExtension();
        $container->registerExtension($extension);
        $container->loadFromExtension($extension->getAlias());
        $container->compile();

        $this->container = $container;
    }

    /**
     * Get a service.
     *
     * @param string $service A service name.
     *
     * @return mixed
     */
    public function get($service)
    {
        return $this->container->get($service);
    }

    /**
     * Create the manipulation instance.
     *
     * @return Rentgen\Schema\Manipulation
     */
    public function createManipulationInstance()
    {
        return $this->container->get('rentgen.schema.manipulation');
    }

    /**
     * Create the info instance.
     *
     * @return Rentgen\Schema\Info
     */
    public function createInfoInstance()
    {
        return $this->container->get('rentgen.schema.info');
    }

    /**
     * Execute sql query.
     *
     * @param string $sql A sql query.
     *
     * @return integer
     */
    public function execute($sql)
    {
        $connection = $this->get('connection');

        return $connection->execute($sql);
    }

     /**
     * Execute sql query with select intention.
     *
     * @param string $sql A sql query.
     *
     * @return array
     */
    public function query($sql)
    {
        $connection = $this->get('connection');

        return $connection->query($sql);
    }
}


text:
using UnityEngine;
using System.Collections;

namespace SimpleSpritePackerEditor
{
	[System.Serializable]
	public struct SPSpriteImportData
	{
		public string name;
		public Vector4 border;
		public SpriteAlignment alignment;
		public Vector2 pivot;
	}
}


text:
<?php

namespace Tekkl\Bundle\UserBundle\Tests\Controller;

use Tekkl\Bundle\AppBundle\Tests\WebTestCase;

class PasswordControllerTest extends WebTestCase
{
    public static function setUpBeforeClass(){
        self::runCommand('doctrine:fixtures:load -n');
    }
    public function testMailIsSentAndContentIsOk()
    {
        $client = static::createClient();

        // Enable the profiler for the next request (it does nothing if the profiler is not available)
        $client->enableProfiler();

        $payload = $this->getPasswordResetPayload();
        $crawler = $client->request('POST', '/api/user/passwort/reset', [], [], [], json_encode($payload));
        $response = json_decode($client->getResponse()->getContent());

        $this->assertTrue($response->email_sent);

        $mailCollector = $client->getProfile()->getCollector('swiftmailer');
        $devDeliveryAddress = $client->getContainer()->getParameter('mailer_dev_delivery_address');

        // Check that an email was sent
        $this->assertEquals(1, $mailCollector->getMessageCount());

        $collectedMessages = $mailCollector->getMessages();
        $message = $collectedMessages[0];

        // Asserting email data
        $this->assertInstanceOf('Swift_Message', $message);
        // Depending on the environment we are in, the message receiver can either be the true receiver
        // or the development delivery address
        $this->assertTrue(($payload['email'] == key($message->getTo())) || ($devDeliveryAddress == key($message->getTo())));
        $this->assertRegExp(
            '/(.+\/user\/new-password\/([a-zA-Z0-9_-]+))/',
            $message->getBody()
        );
        preg_match('/(.+\/user\/new-password\/([a-zA-Z0-9_-]+))/', $message->getBody(), $matches);

        return $matches[2];
    }
    /**
     * @depends testMailIsSentAndContentIsOk
     */
    public function testNewPasswordForm($token){
    	$client = static::createClient();
    	$payload = $this->createPasswordResetPayload($token);
    	$crawler = $client->request('POST', '/api/user/password/new', [], [], [], json_encode($payload));
    	$response = json_decode($client->getResponse()->getContent());
    	$this->assertTrue(isset($response->user));
    }
    /**
     * @depends testNewPasswordForm
     */
    public function testNewPasswordLogin(){
        $client = static::createClient();
        $payload = $this->createNewPasswordLoginpayload();
        $crawler = $client->request('POST', '/api/login_check', [], [], [], json_encode($payload));
        $response = json_decode($client->getResponse()->getContent());
        $this->assertTrue(isset($response->user));
    }
    private function getPasswordResetPayload(){
    	// This user is created by executing bin/console doctrine:fixtures:load -n --env=test
    	$payload = [
    		'email'		=> 'password_reset@test.de'
    	];
    	return $payload;
    }
    private function createPasswordResetPayload($token){
    	$payload = [
    		'reset_form' => [
    			'plainPassword' => [
    				'first' => 'NewPassword1',
    				'second' => 'NewPassword1'
    			]
    		],
    		'confirmation_token' => $token
    	];
    	return $payload;
    }
    private function createNewPasswordLoginpayload(){
        return [
            '_username' => 'password_reset@test.de',
            '_password' => 'NewPassword1'
        ];
    }
}


text:
<?php

namespace OpenConext\Value;

/**
 * Simple interface that allows for (de-)serialization of objects by external serializers
 */
interface Serializable
{
    /**
     * @param mixed $data the data required to deserialize the data into a new object
     * @return static The object instance
     */
    public static function deserialize($data);

    /**
     * @return mixed a representation of the data that the value object contains. This must be compatible with {@see
     *               deserialize}: feeding the data given by serialize into deserialize must recreate an equal object
     */
    public function serialize();
}


text:
package org.rockey.wechat.mp.sdk.vo.token;

import org.rockey.wechat.mp.sdk.vo.JsonRtn;

import com.alibaba.fastjson.annotation.JSONField;

/**
 *
 * @author RockeyHoo
 */
public class AccessTokenJsonRtn extends JsonRtn {
    @JSONField(name = "access_token")
    private String accessToken;

    @JSONField(name = "expires_in")
    private int expiresIn;

    public AccessTokenJsonRtn() {
    }

    public String getAccessToken() {
        return accessToken;
    }

    public void setAccessToken(String accessToken) {
        this.accessToken = accessToken;
    }

    public int getExpiresIn() {
        return expiresIn;
    }

    public void setExpiresIn(int expiresIn) {
        this.expiresIn = expiresIn;
    }

}


text:
module.exports = {
  serverPort: process.env.PORT || 9000,
  numberMessageLoaded: 3,
  dbChatRef: '/chat',
};


text:
#ifndef BOOST_MPL_AUX_COMMON_NAME_WKND_HPP_INCLUDED
#define BOOST_MPL_AUX_COMMON_NAME_WKND_HPP_INCLUDED

// Copyright Aleksey Gurtovoy 2002-2004
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
// See http://www.boost.org/libs/mpl for documentation.

// $Source: /cvsroot/boost/boost/boost/mpl/aux_/common_name_wknd.hpp,v $
// $Date: 2004/09/02 15:40:43 $
// $Revision: 1.4 $

#include <boost/mpl/aux_/config/workaround.hpp>

#if BOOST_WORKAROUND(__BORLANDC__, < 0x561)
// agurt, 12/nov/02: to suppress the bogus "Cannot have both a template class
// and function named 'xxx'" diagnostic
#   define BOOST_MPL_AUX_COMMON_NAME_WKND(name) \
namespace name_##wknd { \
template< typename > void name(); \
} \
/**/

#else

#   define BOOST_MPL_AUX_COMMON_NAME_WKND(name) /**/

#endif // __BORLANDC__

#endif // BOOST_MPL_AUX_COMMON_NAME_WKND_HPP_INCLUDED


text:
"""
Transform each event in the stream. thingflow.filters.select and
thingflow.filters.map have the same functionality. Just import one -
the @filtermethod decorator will create the other as an alias.
"""
from thingflow.base import OutputThing, FunctionFilter, filtermethod

@filtermethod(OutputThing, alias="map")
def select(this, mapfun):
    """Returns a stream whose elements are the result of
    invoking the transform function on each element of source.
    If the function returns None, no event is passed downstream.
    """
    def on_next(self, x):
        y = mapfun(x)
        if y is not None:
            self._dispatch_next(y)
    return FunctionFilter(this, on_next, name='select')


text:
using System;

namespace ServiceBelt
{
	public interface IResourceManager
	{
        string GetResource(string resourceName);
	}
}