text:
namespace swift {
  class ProtocolDecl;
  class ProtocolType;
  class ProtocolCompositionType;

struct ExistentialLayout {
  ExistentialLayout() {
    hasExplicitAnyObject = false;
    containsNonObjCProtocol = false;
    singleProtocol = nullptr;
  }

  ExistentialLayout(ProtocolType *type);
  ExistentialLayout(ProtocolCompositionType *type);

  /// The superclass constraint, if any.
  Type superclass;

  /// Whether the existential contains an explicit '& AnyObject' constraint.
  bool hasExplicitAnyObject : 1;

  /// Whether any protocol members are non-@objc.
  bool containsNonObjCProtocol : 1;

  bool isAnyObject() const;

  bool isObjC() const {
    // FIXME: Does the superclass have to be @objc?
    return ((superclass || hasExplicitAnyObject || !getProtocols().empty()) &&
            !containsNonObjCProtocol);
  }

  /// Whether the existential requires a class, either via an explicit
  /// '& AnyObject' member or because of a superclass or protocol constraint.
  bool requiresClass() const;

  // Does this existential contain the Error protocol?
  bool isExistentialWithError(ASTContext &ctx) const;

  // Does this existential consist of an Error protocol only with no other
  // constraints?
  bool isErrorExistential() const;

  static inline ProtocolType *getProtocolType(const Type &Ty) {
    return cast<ProtocolType>(Ty.getPointer());
  }
  typedef ArrayRefView<Type,ProtocolType*,getProtocolType> ProtocolTypeArrayRef;

  ProtocolTypeArrayRef getProtocols() const & {
    if (singleProtocol)
      return llvm::makeArrayRef(&singleProtocol, 1);
    return protocols;
  }
  /// The returned ArrayRef may point directly to \c this->singleProtocol, so
  /// calling this on a temporary is likely to be incorrect.
  ProtocolTypeArrayRef getProtocols() const && = delete;

  LayoutConstraint getLayoutConstraint() const;

private:
  // The protocol from a ProtocolType
  Type singleProtocol;

  /// Zero or more protocol constraints from a ProtocolCompositionType
  ArrayRef<Type> protocols;
};

}

#endif  // SWIFT_EXISTENTIAL_LAYOUT_H

redpajama_set_name: RedPajamaGithub


text:
JSON export
===========

File extension = `json`
Mime type = `application/octet-stream`

## Usage
```php
<?php
...
use APY\DataGridBundle\Grid\Export\JSONExport;
...
$grid->setSource($source);

$grid->addExport(new JSONExport($title, $fileName, $params, $charset, $role));
...
```

#### JSONExport::__construct parameters

|parameter|Type|Default value|Description|
|:--:|:--|:--|:--|:--|
|title|string||Title of the export in the selector.|
|fileName|string|export|Name of the export file without the extension.|
|params|array|array()|Additionnal parameters.|
|charset|string|UTF-8|Charset to convert the ouput of the export.|
|role|mixed|null|Don't add this export if the access isn't granted for the defined role(s)|

## Additional parameters for the export

_None_

## Example
```php
<?php
...
use APY\DataGridBundle\Grid\Export\JSONExport;
...
$grid->setSource($source);

$grid->addExport(new JSONExport('JSON Export'));
...
```

Output:
```
{"titles":{"text":"Text","datetime":"Datetime"},"rows":[{"text":"abcde","datetime":"Jun 14, 2012 12:01:16 AM"},{"text":"bcdef","datetime":"Jun 14, 2012 12:01:16 AM"}]}
```


text:
package authoring.concretefeatures;

import javafx.scene.control.Button;
import javafx.scene.control.Label;
import javafx.scene.control.TextField;
import javafx.scene.layout.HBox;
import javafx.scene.layout.VBox;
import authoring.data.AuthoringLevel;
import fxml_main.LevelController;

public class LevelCreator extends VBox {
	private AuthoringLevel myLevel;
	private LevelController myLevelController;
	private String myGridShape;

	public LevelCreator(AuthoringLevel level, LevelController levelController,
			String gridShape) {
		myLevel = level;
		myLevelController = levelController;
		myGridShape = gridShape;
		initialize();
	}

	private void initialize() {
		HBox idHBox = new HBox();
		Label idLabel = new Label("ID:");
		TextField idField = new TextField(myLevel.getId());
		idHBox.getChildren().addAll(idLabel, idField);

		VBox gridSizeVBox = new VBox();
		Label gridSizeLabel = new Label("Grid Size:");

		VBox rowVBox = new VBox();
		Label rowLabel = new Label("Rows");
		TextField rowField = new TextField("5");
		rowVBox.getChildren().addAll(rowLabel,rowField);
		VBox colVBox = new VBox();
		Label colLabel = new Label("Columns");
		TextField colField = new TextField("5");
		colVBox.getChildren().addAll(colLabel,colField);

		HBox gridSizeHBox = new HBox();
		gridSizeHBox.getChildren().addAll(rowVBox, colVBox);
		gridSizeVBox.getChildren().addAll(gridSizeLabel,gridSizeHBox);

		Button eventBtn = new Button("Add Global Events...");

		Button okBtn = new Button("OK");
		Button cancelBtn = new Button("Cancel");
		HBox finalizeBtnsHBox = new HBox();
		finalizeBtnsHBox.getChildren().addAll(okBtn, cancelBtn);

//		okBtn.setOnAction(new EventHandler<ActionEvent>() {
//
//
//		});

		getChildren().addAll(idHBox, gridSizeVBox,
				eventBtn, finalizeBtnsHBox);

	}

}


text:
package brut.androlib.res.data;

import brut.androlib.AndrolibException;
import brut.androlib.err.UndefinedResObject;
import java.util.*;

/**
 * @author Ryszard Wiśniewski <brut.alll@gmail.com>
 */
public final class ResType {
    private final String mName;
    private final Map<String, ResResSpec> mResSpecs = new LinkedHashMap<String, ResResSpec>();

    private final ResTable mResTable;
    private final ResPackage mPackage;

    public ResType(String name, ResTable resTable, ResPackage package_) {
        this.mName = name;
        this.mResTable = resTable;
        this.mPackage = package_;
    }

    public String getName() {
        return mName;
    }

    public Set<ResResSpec> listResSpecs() {
        return new LinkedHashSet<ResResSpec>(mResSpecs.values());
    }

    public ResResSpec getResSpec(String name) throws AndrolibException {
        ResResSpec spec = mResSpecs.get(name);
        if (spec == null) {
            throw new UndefinedResObject(String.format("resource spec: %s/%s",
                    getName(), name));
        }
        return spec;
    }

    public void addResSpec(ResResSpec spec) throws AndrolibException {
        if (mResSpecs.put(spec.getName(), spec) != null) {
            throw new AndrolibException(String.format(
                    "Multiple res specs: %s/%s", getName(), spec.getName()));
        }
    }

    @Override
    public String toString() {
        return mName;
    }
}


text:
package org.apache.ignite.ml.inference.storage.model;

import java.lang.ref.WeakReference;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;
import java.util.concurrent.locks.Lock;
import java.util.concurrent.locks.ReentrantLock;

/**
 * Implementation of {@link ModelStorageProvider} based on local {@link ConcurrentHashMap}.
 */
public class LocalModelStorageProvider implements ModelStorageProvider {
    /** Storage of the files and directories. */
    private final ConcurrentMap<String, FileOrDirectory> storage = new ConcurrentHashMap<>();

    /** Storage of the locks. */
    private final ConcurrentMap<String, WeakReference<Lock>> locks = new ConcurrentHashMap<>();

    /** {@inheritDoc} */
    @Override public FileOrDirectory get(String key) {
        return storage.get(key);
    }

    /** {@inheritDoc} */
    @Override public void put(String key, FileOrDirectory file) {
        storage.put(key, file);
    }

    /** {@inheritDoc} */
    @Override public void remove(String key) {
        storage.remove(key);
    }

    /** {@inheritDoc} */
    @Override public Lock lock(String key) {
        Lock lock = new ReentrantLock();
        return locks.computeIfAbsent(key, k -> new WeakReference<>(lock)).get();
    }
}


text:
#ifndef s11n_S11N_NODE_HPP_INCLUDED
#define s11n_S11N_NODE_HPP_INCLUDED

////////////////////////////////////////////////////////////////////////
// s11n_node.hpp
// A reference implementation for s11n's Data Node concept.
// License: Public Domain
// Author: stephan@s11n.net
////////////////////////////////////////////////////////////////////////
#include <string>
#include <map>

#include <vector>
#include <s11n.net/s11n/variant.hpp> // for lexical casting
#include <s11n.net/s11n/export.hpp>

namespace s11n {

/**
s11n_node is a slightly lighter-weight replacement for
the data_node type used in s11n 1.0.x. It will become
the standard node type for s11nlite in 1.1/1.2.
*/
class S11N_EXPORT_API s11n_node
{
public:

/**
The map type this object uses to store properties.
*/
typedef std::map < std::string, std::string > map_type;

/**
A pair type used to store key/value properties
internally.
*/
typedef map_type::value_type value_type;

/** The type used to store property keys. For
compatibility with std::map.
*/
typedef map_type::key_type key_type;

/** The type used to internally store property
values. For compatibility with std::map.
*/
typedef map_type::mapped_type mapped_type;

/**
The container type used to store this object's children.
It contains (s11n_node *).

While the exact type is not guaranteed, it is
guaranteed to obey the most-commonly-used
std::list/vector conventions: push_back(), erase(),
etc.
*/
typedef std::vector<s11n_node *> child_list_type;

/**
Creates a new node with an empty name() and an
class_name() of "s11n::s11n_node". This
node is functionally useless until it's name is
set, as nodes with empty names are not supported by
any current i/o parsers.
*/
s11n_node();

/**
Creates a new node with the given name() and an
class_name() of "s11n::s11n_node".
*/
explicit s11n_node( const std::string & name );

/**
Creates a new node with the given name() and and class_name().

Does not throw.
*/
s11n_node( const std::string & name, const std::string implclass );

/**
Destroys all child objects owned by this object, freeing up
their resources.

Does not throw.
*/
~s11n_node();

/**
Swaps all publically-visible internal state with
rhs. This includes:

- class_name()
- name()
- children()
- properties()

Complexity is, in theory, constant time.  For all
data we use their member swap() implementations,
which should be constant-time for the
containers. The C++ Standard apparently guarantees
O(1) swap() for strings, too.  (Josuttis, The C++
Standard Library, section 11.2.8, page 490.)

Added in version 1.1.3.
*/
void swap( s11n_node & rhs );

/**
Copies the properties, name, class name and
children of rhs. If rhs is this object then this
function does nothing.

Does not throw.
*/
s11n_node & operator=( const s11n_node & rhs );

/**
See copy().

Does not throw.
*/
s11n_node( const s11n_node & rhs );

/**
Returns a list of the s11n_node children of this
object. The caller should not delete any pointers
from this list unless he also removes the pointers
from the list, or else they will get double-deleted
later. In practice it is (almost) never necessary
for client code to manipulate this list directly.
*/
child_list_type & children();

/**
The const form of children().
*/
const child_list_type & children() const;

/**
Removes all properties and deletes all children from
this object, freeing up their resources.

Any pointers to children of this object become
invalided by a call to this function (they get
deleted).
*/
void clear();

/**
Defines the class name which should be used as the
implementation class when this node is
deserialize()d.

Client Serializable types should call this one time
from their serialize() method, after calling
the parent class' serialize() method (if indeed that
is called at all), passing it the name of their class,
using the name expected by the classloader. By convention
the class name is the same as it's C++ name, thus Serializable
class foo::FooBar should call:

node.class_name( "foo::FooBar" );

from it's serialize() function.

If classes to not set this then the serialized data
will not have a proper implementation class
name. That is likely to break deserialization.

TODO: consider returning the old value,
to simplify swap() operations.

Added in 1.1.3.
*/
void class_name( const std::string & n );

/**
Returns the implementation class name set via
class_name().
*/
std::string class_name() const;

/**
The name which should be used as the key for
storing the node. This is normally translated to
something like an XML element name (e.g., <name>),
and should not contain spaces or other characters
which may not be usable as key names. To be safe,
stick to alphanumeric and underscores, starting
with a letter or underscore. (This class does no
enforce any naming conventions, but your data file
parsers very well may.)
*/
void name( const std::string & n );

/**
Returns this node's name, as set via name(string).
*/
std::string name() const;

/**
Returns true if this object has no properties
and no children. The name() and class_name()
are *not* considered.
*/
bool empty() const;

/**
Lexically casts val to a string and stores it as a
property. If this type conversion is not possible
it will fail at compile time. A value-conversion
failure, on the other hand, is not caught at
compile time. T must support complementary
ostream<< and istream>> operators.
*/
template < typename T >
void set( const std::string & key, const T & val )
{
   this->m_map[key] = ::s11n::Detail::variant(val).str();
}

/**
Tries to get a property named key and lexically
cast it to type T. If this type conversion is not
possible it will fail at compile time. A
value-conversion failure, on the other hand, is not
caught at compile time. If value conversion fails,
or if the requested property is not set, then
defaultval is returned. This can be interpretted as
an error value if the client so chooses, and it is
often helpful to pass a known-invalid value here
for that purpose.

*/
template < typename T >
T get( const std::string & key, const T & defaultval ) const
{
   map_type::const_iterator cit = this->m_map.find( key );
   return ( this->m_map.end() == cit ) ? defaultval : ::s11n::Detail::variant( (*cit).second ).cast_to(defaultval);
}

/**
Returns true if this object contains the given
property, else false.
*/
bool is_set( const std::string & key ) const;

/**
Removes the given property from this object.
*/
void unset( const std::string & key );

/**
Returns the map of properties contained by this
node.
*/
map_type & properties();

/** Const overload. */
const map_type & properties() const;

private:
   std::string m_name; // name of this node
   std::string m_iname; // class_name name of this node
   map_type m_map; // stores key/value properties.
   child_list_type m_children; // holds child pointers

   /**
   Copies all properties and child s11n_nodes from
   rhs into this object, as well as any other details
   which need to be copied.

   This can be a very expensive operation, and is rarely
   necessary.
   */
   void copy( const s11n_node & rhs );

   /**
   Removes all property entries from this object.
   */
   void clear_properties();

   /**
   Removes all children from this object, deleting all
   child pointers.
   */
   void clear_children();

}; // class s11n_node

} // namespace s11n

#endif // s11n_S11N_NODE_HPP_INCLUDED


text:
package org.xbib.catalog.entities.pica.zdb.bibdat;

import org.xbib.catalog.entities.CatalogEntity;

import java.util.Map;

/**
 *
 */
public class Location extends CatalogEntity {

    public Location(Map<String, Object> params) {
        super(params);
    }
}


text:
import { cascadeProperties, determineProperties, PROPERTIES_TO_CASCADE } from "../../src/utilities/componentProcessing";

const props1 = {
    one: 1,
    two: 2,
    three: 3,
    [PROPERTIES_TO_CASCADE]:["one", "three"]
};

const props2 = {
    one: 1,
    two: 2,
    three: 3
};

test("no properties returned when empty object provided", () => {
    expect(determineProperties()).toEqual({ [PROPERTIES_TO_CASCADE]: [] });
    expect(determineProperties({})).toEqual({ [PROPERTIES_TO_CASCADE]: [] });
})

test("output with cascading properties", () => {
    const output = determineProperties({ props: props1});
    expect(Object.keys(output)).toHaveLength(3);
    expect(output).toEqual(expect.objectContaining({
        one: 1, three: 3, [PROPERTIES_TO_CASCADE]: ["one","three"]
    }));
    expect(output).not.toHaveProperty("two");
})

test("outout without cascading properties", () => {
    const output = determineProperties({ props: props2, names: ["two","three"]});
    expect(Object.keys(output)).toHaveLength(3);
    expect(output).toEqual(expect.objectContaining({
        two: 2, three: 3, [PROPERTIES_TO_CASCADE]: ["two","three"]
    }));
    expect(output).not.toHaveProperty("one");
})

test("adding to property names", () => {
    const output = determineProperties({ props: props1, names: ["two"]});
    expect(Object.keys(output)).toHaveLength(4);
    expect(output).toEqual(expect.objectContaining({
        one: 1, two: 2, three: 3, [PROPERTIES_TO_CASCADE]: ["one","three","two"]
    }));
})


text:
def makeSampleImage(sequenceOne, sequenceTwo, sequenceLength, pngFileNamePrefix, sampleCount):
	# Convert the fasta sequence pair to the 4 x 4 alphabet and record it in a 16 x sequence length image
	# ASSUMES THAT sequenceOne AND sequenceTwo ARE THE SAME LENGTH (no indels)
	sequenceArray = numpy.zeros((16, sequenceLength))
	for i in range(len(sequenceOne)):
		# Iterate through the bases mark a 1 in the appropriate base combination
		if (sequenceOne[i] == "A") and (sequenceTwo[i] == "A"):
			# At AA, so 0, i is 1
			sequenceArray[0][i] = 1
		elif (sequenceOne[i] == "A") and (sequenceTwo[i] == "C"):
			# At AC, so 1, i is 1
			sequenceArray[1][i] = 1
		elif (sequenceOne[i] == "A") and (sequenceTwo[i] == "G"):
			# At AG, so 2, i is 1
			sequenceArray[2][i] = 1
		elif (sequenceOne[i] == "A") and (sequenceTwo[i] == "T"):
			# At AT, so 3, i is 1
			sequenceArray[3][i] = 1
		elif (sequenceOne[i] == "C") and (sequenceTwo[i] == "A"):
			# At CA, so 4, i is 1
			sequenceArray[4][i] = 1
		elif (sequenceOne[i] == "C") and (sequenceTwo[i] == "C"):
			# At CC, so 5, i is 1
			sequenceArray[5][i] = 1
		elif (sequenceOne[i] == "C") and (sequenceTwo[i] == "G"):
			# At CG, so 6, i is 1
			sequenceArray[6][i] = 1
		elif (sequenceOne[i] == "C") and (sequenceTwo[i] == "T"):
			# At CT, so 7, i is 1
			sequenceArray[7][i] = 1
		elif (sequenceOne[i] == "G") and (sequenceTwo[i] == "A"):
			# At GA, so 8, i is 1
			sequenceArray[8][i] = 1
		elif (sequenceOne[i] == "G") and (sequenceTwo[i] == "C"):
			# At GC, so 9, i is 1
			sequenceArray[9][i] = 1
		elif (sequenceOne[i] == "G") and (sequenceTwo[i] == "G"):
			# At GG, so 10, i is 1
			sequenceArray[10][i] = 1
		elif (sequenceOne[i] == "G") and (sequenceTwo[i] == "T"):
			# At GT, so 11, i is 1
			sequenceArray[11][i] = 1
		elif (sequenceOne[i] == "T") and (sequenceTwo[i] == "A"):
			# At TA, so 12, i is 1
			sequenceArray[12][i] = 1
		elif (sequenceOne[i] == "T") and (sequenceTwo[i] == "C"):
			# At TC, so 13, i is 1
			sequenceArray[13][i] = 1
		elif (sequenceOne[i] == "T") and (sequenceTwo[i] == "G"):
			# At TG, so 14, i is 1
			sequenceArray[14][i] = 1
		elif (sequenceOne[i] == "T") and (sequenceTwo[i] == "T"):
			# At TT, so 15, i is 1
			sequenceArray[15][i] = 1
		elif (sequenceOne[i] == "A") and (sequenceTwo[i] == "N"):
			# At AN, so 0, 1, 2, and 3, i are 0.25
			sequenceArray[0][i] = .25
			sequenceArray[1][i] = .25
			sequenceArray[2][i] = .25
			sequenceArray[3][i] = .25
		elif (sequenceOne[i] == "C") and (sequenceTwo[i] == "N"):
			# At CN, so 4, 5, 6, and 7, i are 0.25
			sequenceArray[4][i] = .25
			sequenceArray[5][i] = .25
			sequenceArray[6][i] = .25
			sequenceArray[7][i] = .25
		elif (sequenceOne[i] == "G") and (sequenceTwo[i] == "N"):
			# At GN, so 8, 9, 10, and 11, i are 0.25
			sequenceArray[8][i] = .25
			sequenceArray[9][i] = .25
			sequenceArray[10][i] = .25
			sequenceArray[11][i] = .25
		elif (sequenceOne[i] == "T") and (sequenceTwo[i] == "N"):
			# At TN, so 12, 13, 14, and 15, i are 0.25
			sequenceArray[12][i] = .25
			sequenceArray[13][i] = .25
			sequenceArray[14][i] = .25
			sequenceArray[15][i] = .25
		elif (sequenceOne[i] == "N") and (sequenceTwo[i] == "A"):
			# At NA, so 0, 4, 8, and 12, i are 0.25
			sequenceArray[0][i] = .25
			sequenceArray[4][i] = .25
			sequenceArray[8][i] = .25
			sequenceArray[12][i] = .25
		elif (sequenceOne[i] == "N") and (sequenceTwo[i] == "C"):
			# At NC, so 1, 5, 9, and 13, i are 0.25
			sequenceArray[1][i] = .25
			sequenceArray[5][i] = .25
			sequenceArray[9][i] = .25
			sequenceArray[13][i] = .25
		elif (sequenceOne[i] == "N") and (sequenceTwo[i] == "G"):
			# At NG, so 2, 6, 10, and 14, i are 0.25
			sequenceArray[2][i] = .25
			sequenceArray[6][i] = .25
			sequenceArray[10][i] = .25
			sequenceArray[14][i] = .25
		elif (sequenceOne[i] == "N") and (sequenceTwo[i] == "A"):
			# At NT, so 3, 7, 11, and 15, i are 0.25
			sequenceArray[3][i] = .25
			sequenceArray[7][i] = .25
			sequenceArray[11][i] = .25
			sequenceArray[15][i] = .25
		elif (sequenceOne[i] == "N") and (sequenceTwo[i] == "N"):
			# At NN, so 0-15, i are 0.0625
			sequenceArray[0][i] = .0625
			sequenceArray[1][i] = .0625
			sequenceArray[2][i] = .0625
			sequenceArray[3][i] = .0625
			sequenceArray[4][i] = .0625
			sequenceArray[5][i] = .0625
			sequenceArray[6][i] = .0625
			sequenceArray[7][i] = .0625
			sequenceArray[8][i] = .0625
			sequenceArray[9][i] = .0625
			sequenceArray[10][i] = .0625
			sequenceArray[11][i] = .0625
			sequenceArray[12][i] = .0625
			sequenceArray[13][i] = .0625
			sequenceArray[14][i] = .0625
			sequenceArray[15][i] = .0625
	pngFileName = pngFileNamePrefix + "_" + str(sampleCount) + ".png"
	misc.imsave(pngFileName, sequenceArray)
	return pngFileName

def makeSequenceInputs(maternalFastaFileName, paternalFastaFileName, peakHeightFileName, peakHeightCol, sequenceLength, pngFileNamePrefix, outputFileName):
	# Convert each fasta sequence to the 4 x 4 alphabet in both directions, do the same for its reverse complement, and record them all as png examples
	# ASSUMES THAT EACH PEAK HEIGHT CORRESPONDS TO THE FASTA ENTRIES WITH THE SAME INDEX
	peakHeightFile = open(peakHeightFileName)
	outputFile = open(outputFileName, 'w+')
	sampleCount = 0
	for seqRecordMaternal, seqRecordPaternal in izip(SeqIO.parse(maternalFastaFileName, "fasta"), SeqIO.parse(paternalFastaFileName, "fasta")):
		# Iterate through the fasta sequences and create the alphabets in both directions for the sequence and the reverse complement of each
		peakHeightLineElements = peakHeightFile.readline().strip().split("\t")
		sampleCount = sampleCount + 1
		pngFileNameOne = makeSampleImage(seqRecordMaternal.seq.upper(), seqRecordPaternal.seq.upper(), sequenceLength, pngFileNamePrefix, sampleCount)
		outputFile.write(pngFileNameOne + "\t" + peakHeightLineElements[peakHeightCol] + "\n")
		sampleCount = sampleCount + 1
		pngFileNameTwo = makeSampleImage(seqRecordPaternal.seq.upper(), seqRecordMaternal.seq.upper(), sequenceLength, pngFileNamePrefix, sampleCount)
		outputFile.write(pngFileNameTwo + "\t" + peakHeightLineElements[peakHeightCol] + "\n")
		seqReverseMaternal = seqRecordMaternal.seq.reverse_complement().upper()
		seqReversePaternal = seqRecordPaternal.seq.reverse_complement().upper()
		sampleCount = sampleCount + 1
		pngFileNameThree = makeSampleImage(seqReverseMaternal, seqReversePaternal, sequenceLength, pngFileNamePrefix, sampleCount)
		outputFile.write(pngFileNameThree + "\t" + peakHeightLineElements[peakHeightCol] + "\n")
		sampleCount = sampleCount + 1
		pngFileNameFour = makeSampleImage(seqReversePaternal, seqReverseMaternal, sequenceLength, pngFileNamePrefix, sampleCount)
		outputFile.write(pngFileNameFour + "\t" + peakHeightLineElements[peakHeightCol] + "\n")
	peakHeightFile.close()
	outputFile.close()

if __name__=="__main__":
	import sys
	from Bio import SeqIO
	import numpy
	from scipy import misc
	from itertools import izip
	maternalFastaFileName = sys.argv[1]
	paternalFastaFileName = sys.argv[2]
	peakHeightFileName = sys.argv[3]
	peakHeightCol = int(sys.argv[4])
	sequenceLength = int(sys.argv[5])
	pngFileNamePrefix = sys.argv[6]
	outputFileName = sys.argv[7]
	makeSequenceInputs(maternalFastaFileName, paternalFastaFileName, peakHeightFileName, peakHeightCol, sequenceLength, pngFileNamePrefix, outputFileName)


text:
"use strict";
const path = require("path");
const should = require("should");

const { encode_decode_round_trip_test } = require("node-opcua-packet-analyzer/dist/test_helpers");

xdescribe("Code Generator", function () {
    const schema_file = path.join(__dirname, "./fixture/fixture_dummy_object_schema.js");

    it("should produce the javascript for new complex type using template ", function () {
        // code should compile
        const DummyObject = require(schema_file).DummyObject;
        const SomeEnumeration = require(schema_file).SomeEnumeration;

        const dummy = new DummyObject({
            viewVersion: 50,
            name: "Paris",
            ArrayInt: [10, 20, 30],
            typeEnum: 2
        });
        dummy.viewVersion.should.eql(50);
        dummy.name.should.eql("Paris");
        dummy.ArrayInt.should.eql([10, 20, 30]);
        dummy.typeEnum.should.eql(SomeEnumeration.SQUARE);

        const dummy_reloaded = encode_decode_round_trip_test(dummy);

        dummy_reloaded.viewVersion.should.eql(dummy.viewVersion);
        dummy_reloaded.name.should.eql(dummy.name);
        dummy_reloaded.ArrayInt.should.eql([10, 20, 30]);
        dummy_reloaded.typeEnum.should.eql(dummy.typeEnum);

        (function () {
            dummy.setTypeEnum("toto");
        }.should.throw());
    });
    it("should handle new type with base class ", function () {
        const FooBarDerived = require(schema_file).FooBarDerived;
        const FooBar = require(schema_file).FooBar;

        const fb = new FooBarDerived({ name: "toto", name2: "titi" });
        fb.name.should.eql("toto");
        fb.name2.should.eql("titi");

        fb.should.be.instanceOf(FooBarDerived);
        fb.should.be.instanceOf(FooBar);

        const fb_reloaded = encode_decode_round_trip_test(fb);
        fb_reloaded.name.should.eql(fb.name);
        fb_reloaded.name2.should.eql(fb.name2);
    });

    it("should handle Schema with recursion ", function () {
        //xx should(function(){
        const schema_file2 = path.join(__dirname, "./fixture/fixture_foo_object_with_recursion_schema.js");
        const FooWithRecursion = require(schema_file2).FooWithRecursion;
        //xx }).not.throwError();

        let foo = new FooWithRecursion({});

        should(foo.inner).be.eql(null);
        // var foo_reloaded = encode_decode_round_trip_test(foo);

        foo = new FooWithRecursion({
            inner: { name: "inside level1" }
        });

        should.exist(foo.inner);
        foo.inner.name.should.eql("inside level1");
        should(foo.inner.inner).eql(null);

        foo = new FooWithRecursion({
            inner: {
                name: "inside level1",
                inner: {
                    name: "inside level2"
                }
            }
        });
        should.exist(foo.inner);
        foo.inner.name.should.eql("inside level1");
        should.exist(foo.inner.inner);
        foo.inner.inner.name.should.eql("inside level2");
        should.not.exist(foo.inner.inner.inner);
    });
});


text:
package org.zstack.header.core.encrypt;

import org.zstack.header.message.MessageReply;

/**
 * Created by kayo on 2018/9/12.
 */
public class EnableEncryptReply extends MessageReply {
}


text:
{% load staticfiles %}
{% load djng_tags %}
<!doctype html>

  <meta charset="utf-8">
  <title>If you brew it, they will come</title>

  <meta name="description" content="">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <link rel="stylesheet" href="{% static "css/bootstrap.min.css" %}">
  <link rel="stylesheet" href="{% static "css/font-awesome.min.css" %}">
  <link rel="stylesheet" href="{% static "css/wow-animate.css" %}">
  <link rel="stylesheet" href="{% static "css/beer-style.css" %}">

        <button type="button" class="close" data-dismiss="modal">×</button>

Your Custom Results

Some beers you'll love!

            <beer-card beer="results[0][0]" hidebtn="true"></beer-card>

            <beer-card beer="results[1][0]" hidebtn="true"></beer-card>

            <beer-card beer="results[2][0]" hidebtn="true"></beer-card>

Some beers you may not be as happy with...

            <beer-card beer="results[results.length-1][0]" hidebtn="true"></beer-card>

            <beer-card beer="results[results.length-2][0]" hidebtn="true"></beer-card>

            <beer-card beer="results[results.length-3][0]" hidebtn="true"></beer-card>

        <button type="button" class="btn btn-default" data-dismiss="modal" ng-click="reset()">Close</button>

Need a beer? Let Avery help

Beer Options

               Search:
               <input style="width:300px;display:inline;" ng-model="searchText" class="form-control">

Pick a couple beers you like and a couple you don't.

               <button class="btn btn-primary btn-lg beerme" ng-click="postBeers()">BEER ME!</button>

                  <beer-card beer="list[$index]" up-vote="upVoteBeer(list[$index])" down-vote="downVoteBeer(list[$index])" ng-hide="!list[$index].name"></beer-card>

                  <beer-card beer="list[$index+1]" up-vote="upVoteBeer(list[$index+1])" down-vote="downVoteBeer(list[$index+1])" ng-hide="!list[$index+1].name"></beer-card>

                  <beer-card beer="list[$index+2]" up-vote="upVoteBeer(list[$index+2])" down-vote="downVoteBeer(list[$index+2])" ng-hide="!list[$index+2].name"></beer-card>

                  <beer-card beer="list[$index+3]" up-vote="upVoteBeer(list[$index+3])" down-vote="downVoteBeer(list[$index+3])" ng-hide="!list[$index+3].name"></beer-card>

    <button type="button" class="btn backtotop" >Back To Top</button>


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<TITLE>
org.hibernate.property (Hibernate JavaDocs)
</TITLE>

<META NAME="date" CONTENT="2013-10-23">

<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../stylesheet.css" TITLE="Style">

      Overview
    Package
      Class
      Use
      Tree
      Deprecated
      Index
      Help

 PREV PACKAGE
 NEXT PACKAGE

  FRAMES
 NO FRAMES

  All Classes

Package org.hibernate.property

        This package abstracts the notion of a "property" of
        an entity.

See:

          Description

Interface Summary

Getter
Gets values of a particular property

PropertyAccessor
Abstracts the notion of a "property".

Setter
Sets values to a particular property.

Class Summary

BackrefPropertyAccessor
Represents a "back-reference" to the id of a collection owner.

BackrefPropertyAccessor.BackrefSetter
Internal implementation of a property setter specific to these back-ref properties.

BasicPropertyAccessor
Accesses property values via a get/set pair, which may be nonpublic.

BasicPropertyAccessor.BasicGetter

BasicPropertyAccessor.BasicSetter

ChainedPropertyAccessor

DirectPropertyAccessor
Accesses fields directly.

DirectPropertyAccessor.DirectGetter

DirectPropertyAccessor.DirectSetter

EmbeddedPropertyAccessor

EmbeddedPropertyAccessor.EmbeddedGetter

EmbeddedPropertyAccessor.EmbeddedSetter

IndexPropertyAccessor
Represents a "back-reference" to the index of a collection.

IndexPropertyAccessor.IndexSetter
The Setter implementation for index backrefs.

MapAccessor

MapAccessor.MapGetter

MapAccessor.MapSetter

NoopAccessor
Used to declare properties not represented at the pojo level

PropertyAccessorFactory
A factory for building/retrieving PropertyAccessor instances.

Package org.hibernate.property Description

        This package abstracts the notion of a "property" of
        an entity. Support for JavaBean properties and
        <tt>Map</tt> elements is included.

      Overview
    Package
      Class
      Use
      Tree
      Deprecated
      Index
      Help

 PREV PACKAGE
 NEXT PACKAGE

  FRAMES
 NO FRAMES

  All Classes

Copyright © 2001-2013 Red Hat, Inc.  All Rights Reserved.


text:
package com.amazonaws.services.cloudfront.model;

import java.io.Serializable;
import javax.annotation.Generated;

/**
 *
 * @see AWS API
 *      Documentation
 */
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class ListKeyGroupsResult extends com.amazonaws.AmazonWebServiceResult<com.amazonaws.ResponseMetadata> implements Serializable, Cloneable {

    /**
     *

     * A list of key groups.
     *

     */
    private KeyGroupList keyGroupList;

    /**
     *

     * A list of key groups.
     *

     *
     * @param keyGroupList
     *        A list of key groups.
     */

    public void setKeyGroupList(KeyGroupList keyGroupList) {
        this.keyGroupList = keyGroupList;
    }

    /**
     *

     * A list of key groups.
     *

     *
     * @return A list of key groups.
     */

    public KeyGroupList getKeyGroupList() {
        return this.keyGroupList;
    }

    /**
     *

     * A list of key groups.
     *

     *
     * @param keyGroupList
     *        A list of key groups.
     * @return Returns a reference to this object so that method calls can be chained together.
     */

    public ListKeyGroupsResult withKeyGroupList(KeyGroupList keyGroupList) {
        setKeyGroupList(keyGroupList);
        return this;
    }

    /**
     * Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be
     * redacted from this string using a placeholder value.
     *
     * @return A string representation of this object.
     *
     * @see java.lang.Object#toString()
     */
    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append("{");
        if (getKeyGroupList() != null)
            sb.append("KeyGroupList: ").append(getKeyGroupList());
        sb.append("}");
        return sb.toString();
    }

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

        if (obj instanceof ListKeyGroupsResult == false)
            return false;
        ListKeyGroupsResult other = (ListKeyGroupsResult) obj;
        if (other.getKeyGroupList() == null ^ this.getKeyGroupList() == null)
            return false;
        if (other.getKeyGroupList() != null && other.getKeyGroupList().equals(this.getKeyGroupList()) == false)
            return false;
        return true;
    }

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

        hashCode = prime * hashCode + ((getKeyGroupList() == null) ? 0 : getKeyGroupList().hashCode());
        return hashCode;
    }

    @Override
    public ListKeyGroupsResult clone() {
        try {
            return (ListKeyGroupsResult) super.clone();
        } catch (CloneNotSupportedException e) {
            throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e);
        }
    }

}


text:
/* This is a managed file. Do not delete this comment. */

#include <include/test.h>
void test_Attributes_tc_isDefaultPersistent(
    test_Attributes this)
{

    corto_int32__create_auto(NULL, i, 10);
    test_assert(i != NULL);
    test_assert(!corto_check_attr(i, CORTO_ATTR_PERSISTENT));
    corto_delete(i);

}

void test_Attributes_tc_isDefaultScopedPersistent(
    test_Attributes this)
{

    corto_int32__create_auto(root_o, i, 10);
    test_assert(i != NULL);
    test_assert(corto_check_attr(i, CORTO_ATTR_PERSISTENT));
    corto_delete(i);

}

void test_Attributes_tc_testDefaultSet(
    test_Attributes this)
{

    test_assertint(corto_get_attr(), CORTO_ATTR_DEFAULT);

}

void test_Attributes_tc_testTargetAttr(
    test_Attributes this)
{

    corto_object o = corto_create(root_o, "a", test_TargetActual_o);
    test_assert(o != NULL);
    test_assert(corto_typeof(o) == corto_type(test_TargetActual_o));
    test_assert(corto_check_attr(o, CORTO_ATTR_PERSISTENT));
    test_assert(corto_delete(o) == 0);

}

void test_Attributes_tc_testTargetOrphanAttr(
    test_Attributes this)
{

    test_TargetActualMember* o = corto_create(root_o, "a", test_TargetActualMember_o);
    test_assert(o != NULL);
    test_assert(corto_typeof(o) == corto_type(test_TargetActualMember_o));
    test_assert(corto_check_attr(o, CORTO_ATTR_PERSISTENT));
    test_assert(!corto_check_attr(o->m, CORTO_ATTR_PERSISTENT));
    test_assert(corto_delete(o) == 0);

}

void test_Attributes_tc_typeOverridesAttributes(
    test_Attributes this)
{

    corto_object o = corto_create(NULL, NULL, test_TypeAttr_o);
    test_assert(o != NULL);
    test_assertint(corto_attrof(o), CORTO_ATTR_OBSERVABLE);
    test_assert(corto_delete(o) == 0);

}


text:
var Model = require('../fixtures/crud'),
    assert = require('assert');

describe('Query', function() {
  var User;

  before(function(done) {
    User = new Model({ adapters: { test: Adapter }}, function(err) {
      if(err) return done(err);
      done();
    });
  });

  describe('SKIP Query Modifier', function() {

    before(function(done) {

      // Insert 10 Users
      var users = [];

      for(var i=0; i<10; i++) {
        users.push({first_name: 'skip_user' + i, type: 'skip test'});
      }

      User.createEach(users, function(err, users) {
        if(err) return done(err);
        done();
      });
    });

    it('should return the correct amount of records', function(done) {
      User.find({ where: { type: 'skip test' }, skip: 3 }, function(err, users) {
        assert(!err);
        assert(Array.isArray(users));
        assert(users.length === 7);
        done();
      });
    });

    it('dynamic finder usage should return the correct amount of records', function(done) {
      User.findByType('skip test', { skip: 3 }, function(err, users) {
        assert(!err);
        assert(Array.isArray(users));
        assert(users.length === 7);
        done();
      });
    });

    it('as an option should return correct amount of records', function(done) {
      User.find({ where: { type: 'skip test' } }, { skip: 3 }, function(err, users) {
        assert(!err);
        assert(Array.isArray(users));
        assert(users.length === 7);
        done();
      });
    });

  });
});


text:
<?php

declare(strict_types=1);

namespace Cortex\Foundation\Console;

use ReflectionClass;
use Illuminate\Support\Arr;
use Illuminate\Support\Str;
use Illuminate\Console\Command;
use Symfony\Component\Finder\Finder;
use Illuminate\Console\Scheduling\Schedule;
use Illuminate\Console\Application as Artisan;
use Cortex\Foundation\Console\Commands\MigrateMakeCommand;
use Illuminate\Foundation\Console\Kernel as ConsoleKernel;

class Kernel extends ConsoleKernel
{
    /**
     * The Artisan commands provided by your application.
     *
     * @var array
     */
    protected $commands = [
        //
    ];

    /**
     * The Artisan commands ignored by auto loading.
     *
     * @var array
     */
    protected $ignoreCommads = [
        MigrateMakeCommand::class,
    ];

    /**
     * The bootstrap classes for the application.
     *
     * @var string[]
     */
    protected $bootstrappers = [
        \Illuminate\Foundation\Bootstrap\LoadEnvironmentVariables::class,
        \Illuminate\Foundation\Bootstrap\LoadConfiguration::class,
        \Illuminate\Foundation\Bootstrap\HandleExceptions::class,
        \Illuminate\Foundation\Bootstrap\RegisterFacades::class,
        \Cortex\Foundation\Bootstrapers\SetRequestForConsole::class,
        \Illuminate\Foundation\Bootstrap\RegisterProviders::class,
        \Illuminate\Foundation\Bootstrap\BootProviders::class,
    ];

    /**
     * Define the application's command schedule.
     *
     * @param \Illuminate\Console\Scheduling\Schedule $schedule
     *
     * @return void
     */
    protected function schedule(Schedule $schedule)
    {
        $moduleResources = $this->app['files']->moduleResources('bootstrap/schedule.php');

        collect($moduleResources)
            ->prioritizeLoading()
            ->each(fn ($file) => (require $file)($schedule));
    }

    /**
     * Register the commands for the application.
     *
     * @return void
     */
    protected function commands(): void
    {
        $this->load($this->discoverCommands());
    }

    /**
     * Discover the artisan commands for the application.
     *
     * @return array
     */
    public function discoverCommands(): array
    {
        $moduleResources = $this->app['files']->moduleResources('src/Console/Commands', 'directories', 2);

        return collect($moduleResources)->map->getPathname()->toArray();
    }

    /**
     * Register all of the commands in the given directory.
     *
     * @TODO: support loading dev commands on dev env only, and production commands everywhere,
     *        maybe we can add a property inside each command, and check it here if exists before loading.
     *
     * @param array|string $paths
     *
     * @return void
     */
    protected function load($paths)
    {
        $paths = array_unique(Arr::wrap($paths));

        $paths = array_filter($paths, function ($path) {
            return is_dir($path);
        });

        if (empty($paths)) {
            return;
        }

        foreach ((new Finder())->in($paths)->files() as $command) {
            $command = ucwords(str_replace(
                ['src/', '/', '.php'],
                ['', '\\', ''],
                Str::after($command->getRealPath(), realpath(app_path()).DIRECTORY_SEPARATOR)
            ), '\\');

            if (is_subclass_of($command, Command::class) && ! (new ReflectionClass($command))->isAbstract() && ! in_array($command, $this->ignoreCommads)) {
                Artisan::starting(function ($artisan) use ($command) {
                    $artisan->resolve($command);
                });
            }
        }
    }
}


text:
using System.Collections.Generic;
using System.IO;
using System.Text;
using System.Diagnostics.Contracts;
using System;

// Disable the "this variable is not used" warning as every field would imply it.
#pragma warning disable 0414
// Disable the "this variable is never assigned to".
#pragma warning disable 0067
// Disable the "this event is never assigned to".
#pragma warning disable 0649
// Disable the "this variable is never used".
#pragma warning disable 0169
// Disable the "new keyword not required" warning.
#pragma warning disable 0109
// Disable the "extern without DllImport" warning.
#pragma warning disable 0626
// Disable the "could hide other member" warning, can happen on certain properties.
#pragma warning disable 0108

namespace System.ComponentModel.Design
{
  public partial class ActiveDesignerEventArgs : EventArgs
  {
    #region Methods and constructors
    public ActiveDesignerEventArgs(IDesignerHost oldDesigner, IDesignerHost newDesigner)
    {
    }
    #endregion

    #region Properties and indexers
    public IDesignerHost NewDesigner
    {
      get
      {
        return default(IDesignerHost);
      }
    }

    public IDesignerHost OldDesigner
    {
      get
      {
        return default(IDesignerHost);
      }
    }
    #endregion
  }
}


text:
<?php

namespace Modes;

use \Modes\Forward\ForwardCallOutputBuilder;
use \Modes\NoBuilderFoundException;
use \Modes\Reject\RejectCallOutputBuilder;

class OutputModeSelector {

    private $builders;

    public function __construct() {
        $this->builders = [
            new ForwardCallOutputBuilder(),
            new RejectCallOutputBuilder()
        ];
    }

    public function builderFor($groupMode) {
        $candidates = array_filter(
            $this->builders,
            function($b) use($groupMode) { return $b->canHandle($groupMode); }
        );

        if (count($candidates)>0)
            return array_shift($candidates);
        else
            throw new NoBuilderFoundException();
    }

}


text:
import * as moment from 'moment';

export interface IMaxAgeConfig {
  maxAge: number;
}

export interface IVersionConfig {
  version: number;
}

export interface IInfrastructureCacheConfig {
  [key: string]: any;
  networks: IVersionConfig;
  vpcs: IVersionConfig;
  subnets: IVersionConfig;
  applications: IMaxAgeConfig;
  loadBalancers: IMaxAgeConfig;
  securityGroups: IVersionConfig;
  instanceTypes: IMaxAgeConfig & IVersionConfig;
  healthChecks: IVersionConfig;
  certificates: IVersionConfig;
  backendServices: IVersionConfig;
  addresses: IVersionConfig;
  credentials: any;
  buildMasters: any;
}

export const INFRASTRUCTURE_CACHE_CONFIG: IInfrastructureCacheConfig = {
  networks: {
    version: 2
  },
  vpcs: {
    version: 2
  },
  subnets: {
    version: 2
  },
  applications: {
    maxAge: moment.duration(30, 'days').asMilliseconds() // it gets refreshed every time the user goes to the application list, anyway
  },
  loadBalancers: {
    maxAge: moment.duration(1, 'hour').asMilliseconds()
  },
  securityGroups: {
    version: 2 // increment to force refresh of cache on next page load - can be added to any cache
  },
  instanceTypes: {
    maxAge: moment.duration(7, 'days').asMilliseconds(),
    version: 2
  },
  healthChecks: {
    version: 2
  },
  certificates: {
    version: 2
  },
  backendServices: {
    version: 2
  },
  addresses: {
    version: 2
  },
  credentials: {},
  buildMasters: {}
};


text:
{{title}}

This module has been refreshed {{no_of_times}} times

	<input id="footerfresh" type="button" value="Refresh me!!"/>


text:
@implementation CSSocketPack
- (instancetype)initWithTag:(unsigned long)tag bytesAvaliable:(unsigned long)bytesAvaliable totalBytes:(unsigned long)totalBytes{
    self = [super init];
    if (self) {
        _tag = tag;
        _bytesAvaliable = bytesAvaliable;
        _totalBytes = totalBytes;
    }
    return self;
}

@end

@implementation CSSocketWritePack

- (instancetype)initWithTag:(unsigned long)tag data:(NSData *)sendData{
    unsigned long bytesAvaliable = sendData.length;
    unsigned long totalBytes = sendData.length;
    self = [super initWithTag:tag bytesAvaliable:bytesAvaliable totalBytes:totalBytes];
    if (self) {
        _sendData = sendData;
    }
    return self;
}

@end

@implementation CSSocketReadPack

- (instancetype)initWithTag:(unsigned long)tag bytesAvaliable:(unsigned long)bytesAvaliable totalBytes:(unsigned long)totalBytes{
    self = [super initWithTag:tag bytesAvaliable:bytesAvaliable totalBytes:totalBytes];
    if (self) {
        _receiveData = [NSMutableData dataWithCapacity:totalBytes];
    }
    return self;
}

- (unsigned long)readLengthWithMaxReadLength:(unsigned long)maxLength{
    if (MIN(self.bytesAvaliable, maxLength) == self.bytesAvaliable) {
        return self.bytesAvaliable;
    }else{
        return maxLength;
    }
}

- (void)appendData:(NSData *)data{
    [self modifyBytesAvaliable:data.length];
    [self.receiveData appendData:data];
}

- (BOOL)appendReadPack:(CSSocketReadPack *)pack{
    if (!pack.receiveData.length  || !self.receiveData) {
        return NO;
    }
    if (pack.tag != self.tag) {
        return NO;
    }
    [self appendData:pack.receiveData];
    return YES;
}

- (void)modifyBytesAvaliable:(unsigned long)dataLen{
    _offset += dataLen;
    _hasBytesAvaliable = ( ABS(self.totalBytes - _offset) != 0 );
}
@end


text:
package org.motechproject.nms.api.web.service;

import org.motechproject.nms.rch.domain.RchUserType;
import java.io.IOException;

/**
 * Created by beehyv on 19/6/18.
 */
public interface BeneficiaryUpdateService {

    void rchBulkUpdate(Long stateId, RchUserType rchUserType, String origin) throws IOException;

}


text:
#import <Foundation/Foundation.h>

@interface NSArray (KZNGAdditions)
- (NSArray *)reversedArray;
@end

@interface NSMutableArray (KZNGAdditions)
- (void)reverse;
@end


text:
package org.typelevel.scalatest

import org.scalatest.exceptions.{ TestFailedException, StackDepthException }
import org.scalactic.source

import scalaz.{ Validation, Success, Failure }
import scalaz.syntax.validation._

trait ValidationValues {
  import scala.language.implicitConversions

  /**
   * Implicit conversion that adds a `value` method to `scalaz.Validation`
   *
   * @param validation the `scalaz.Validation` on which to add the `value` method
   */
  implicit def convertValidationToValidationable[E, T](validation: Validation[E, T])(implicit pos: source.Position): Validationable[E, T] = new Validationable(validation, pos)

  // TODO: Fix me as a proper repl session example
  /**
   * Container class for matching success
   * type stuff in `scalaz.Validation` containers,
   * similar to `org.scalatest.OptionValues.Valuable`
   *
   * Meant to allow you to make statements like:
   *
   *

   *   result.value should be > 15
   *

   *
   * Where it only matches if result is `Success(9)`
   *
   * Otherwise your test will fail, indicating that it was left instead of right
   *
   * @param validation A `scalaz.Validation` object to try converting to a `Validationable`
   *
   * @see org.scalatest.OptionValues.Valuable
   */
  class Validationable[E, T](validation: Validation[E, T], pos: source.Position) {
    def value: T = {
      validation match {
        case Success(right) =>
          right
        case Failure(left) =>
          throw new TestFailedException((_: StackDepthException) => Some(s"$left is Failure, expected Success."), None, pos)
      }
    }

    /**
     * Allow .leftValue on an Validation to extract the left side. Like .value, but for the left.
     */
    def leftValue: E = {
      validation match {
        case Success(right) =>
          throw new TestFailedException((_: StackDepthException) => Some(s"$right is Success, expected Failure."), None, pos)
        case Failure(left) =>
          left
      }
    }
  }

}

// TODO: Fix me as a proper repl session example
/**
 *
 * Companion object for easy importing – rather than mixing in – to allow `ValidationValues` operations.
 *
 * This will permit you to invoke a `value` method on an instance of a `scalaz.Validation`,
 * which attempts to unwrap the right validation
 *
 * Similar to `org.scalatest.OptionValues.Valuable`
 *
 * Meant to allow you to make statements like:
 *
 *

 *   result.value should be > 15
 *

 *
 * Where it only matches if result is `Success(9)`
 *
 * Otherwise your test will fail, indicating that it was left instead of right
 *
 * @see org.scalatest.OptionValues.Valuable
 */
object ValidationValues extends ValidationValues


text:
<?php

namespace Drupal\blazy\Dejavu;

use Drupal\blazy\Form\BlazyAdminInterface;
use Drupal\blazy\Form\BlazyAdminFormatterBase;

/**
 * Provides re-usable admin functions, or form elements.
 */
class BlazyAdminExtended extends BlazyAdminFormatterBase implements BlazyAdminInterface {

  /**
   * Returns shared form elements across field formatter and Views.
   */
  public function openingForm(array &$form, $definition = []) {
    $namespace = isset($definition['namespace']) ? $definition['namespace'] : 'blazy';

    if (!empty($definition['vanilla'])) {
      $form['vanilla'] = [
        '#type'        => 'checkbox',
        '#title'       => $this->t('Vanilla @namespace', ['@namespace' => $namespace]),
        '#description' => $this->t('Check:

To render individual item as is as without extra logic.

To disable 99% @module features, and most of the mentioned options here, such as layouts, et al.

When the @module features can not satisfy the need.

Things may be broken! You are on your own.

Uncheck:

To get consistent markups and its advanced features -- relevant for the provided options as @module needs to know what to style/work with.

', ['@module' => $namespace]),
        '#weight'      => -109,
        '#enforced'    => TRUE,
        '#attributes'  => ['class' => ['form-checkbox--vanilla']],
        '#wrapper_attributes' => ['class' => ['form-item--full', 'form-item--tooltip-bottom']],
      ];
    }

    if (!empty($definition['optionsets']) && $namespace != 'blazy') {
      $form['optionset'] = [
        '#type'        => 'select',
        '#title'       => $this->t('Optionset'),
        '#options'     => $definition['optionsets'],
        '#enforced'    => TRUE,
        '#description' => $this->t('Enable the optionset UI module to manage the optionsets.'),
        '#weight'      => -108,
      ];
    }

    parent::openingForm($form, $definition);
  }

  /**
   * Returns re-usable fieldable formatter form elements.
   */
  public function fieldableForm(array &$form, $definition = []) {
    if (isset($definition['images'])) {
      $form['image'] = [
        '#type'        => 'select',
        '#title'       => $this->t('Main stage'),
        '#options'     => is_array($definition['images']) ? $definition['images'] : [],
        '#description' => $this->t('Main background/stage image field.'),
        '#prefix'      => '
' . $this->t('Fields') . '
',
      ];
    }

    if (isset($definition['thumbnails'])) {
      $form['thumbnail'] = [
        '#type'        => 'select',
        '#title'       => $this->t('Thumbnail image'),
        '#options'     => is_array($definition['thumbnails']) ? $definition['thumbnails'] : [],
        '#description' => $this->t('Leave empty to not use thumbnail pager.'),
      ];
    }

    if (isset($definition['overlays'])) {
      $form['overlay'] = [
        '#type'        => 'select',
        '#title'       => $this->t('Overlay media'),
        '#options'     => is_array($definition['overlays']) ? $definition['overlays'] : [],
        '#description' => $this->t('Overlay is displayed over the main stage.'),
      ];
    }

    if (isset($definition['titles'])) {
      $form['title'] = [
        '#type'        => 'select',
        '#title'       => $this->t('Title'),
        '#options'     => is_array($definition['titles']) ? $definition['titles'] : [],
        '#description' => $this->t('If provided, it will bre wrapped with H2.'),
      ];
    }

    if (isset($definition['links'])) {
      $form['link'] = [
        '#type'        => 'select',
        '#title'       => $this->t('Link'),
        '#options'     => is_array($definition['links']) ? $definition['links'] : [],
        '#description' => $this->t('Link to content: Read more, View Case Study, etc.'),
      ];
    }

    if (isset($definition['classes'])) {
      $form['class'] = [
        '#type'        => 'select',
        '#title'       => $this->t('Item class'),
        '#options'     => is_array($definition['classes']) ? $definition['classes'] : [],
        '#description' => $this->t('If provided, individual item will have this class, e.g.: to have different background with transparent images. Be sure its formatter is Key or Label. Accepted field types: list text, string (e.g.: node title), term/entity reference label.'),
        '#weight'      => 6,
      ];
    }

    if (!empty($definition['id'])) {
      $form['id'] = [
        '#type'         => 'textfield',
        '#title'        => $this->t('@namespace ID', ['@namespace' => $definition['namespace']]),
        '#size'         => 40,
        '#maxlength'    => 255,
        '#field_prefix' => '#',
        '#enforced'     => TRUE,
        '#description'  => $this->t("Manually define the container ID. This ID is used for the cache identifier, so be sure it is unique. Leave empty to have a guaranteed unique ID managed by the module."),
        '#weight'       => 94,
      ];
    }

    if (isset($form['caption'])) {
      $form['caption']['#description'] = $this->t('Enable any of the following fields as captions. These fields are treated and wrapped as captions.');
    }

    if (empty($definition['id'])) {
      if (isset($form['caption'])) {
        $form['caption']['#description'] .= ' ' . $this->t('Be sure to make them visible at their relevant Manage display.');
      }
    }
    else {
      if (isset($form['overlay'])) {
        $form['overlay']['#description'] .= ' ' . $this->t('Be sure to CHECK "Use field template" under its formatter if using Slick field formatter.');
      }
    }
  }

  /**
   * Returns shared ending form elements across field formatter and Views.
   */
  public function closingForm(array &$form, $definition = []) {
    if (!empty($definition['caches'])) {
      $form['cache'] = [
        '#type'        => 'select',
        '#title'       => $this->t('Cache'),
        '#options'     => $this->getCacheOptions(),
        '#weight'      => 98,
        '#enforced'    => TRUE,
        '#description' => $this->t('Ditch all the logic to cached bare HTML.

Permanent: cached contents will persist (be displayed) till the next cron runs.

Any number: expired by the selected expiration time, and fresh contents are fetched till the next cache rebuilt.

A working cron job is required to clear stale cache. At any rate, cached contents will be refreshed regardless of the expiration time after the cron hits.
Leave it empty to disable caching.
Warning! Be sure no useless/ sensitive data such as Edit links as they are rendered as is regardless permissions. No permissions are changed, just ugly. Only enable it when all is done, otherwise cached options will be displayed while changing them.'),
      ];

      if (!empty($definition['_views'])) {
        $form['cache']['#description'] .= ' ' . $this->t('Also disable Views cache (Advanced > Caching) temporarily _only if trouble to see updated settings.');
      }
    }

    parent::closingForm($form, $definition);
  }

}


text: Final lab of alternative credit for EECE 1080C


text:
import _filter from 'lodash/filter';

import ScalarField from '../ScalarField';

function getScalarFields() {
	return _filter(this.getFields(), function(field) {
		return field instanceof ScalarField;
	});
};

export default getScalarFields;


text:
'use strict';

var gutil = require('gulp-util');
var exec = require('child_process').exec;
var escape = require('any-shell-escape');

module.exports = function (remote, opt, cb) {
  if (!cb && typeof opt === 'function') {
    // optional options
    cb = opt;
    opt = {};
  }
  if (!cb || typeof cb !== 'function') cb = function () {};
  if (!remote) cb(new Error('gulp-git: remote is required git.removeRemote("origin")'));
  if (!opt) opt = {};
  if (!opt.cwd) opt.cwd = process.cwd();
  if (!opt.args) opt.args = ' ';

  var cmd = 'git remote remove ' + opt.args + ' ' + escape([remote]);
  return exec(cmd, {cwd: opt.cwd}, function(err, stdout, stderr){
    if (err) cb(err);
    if (!opt.quiet) gutil.log(stdout, stderr);
    cb();
  });
};


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

    <string name="app_name">commande-GoDo</string>
    <string name="hello_world">Hello world!</string>
    <string name="action_settings">Settings</string>
    <string name="new_todo">New</string>
    <string name="select_todos">Select</string>
    <string name="save_todo">Save</string>
    <string name="cancel">Cancel</string>
    <string name="new_todo_hint">Enter a title for your new todo...</string>
    <string name="email_todos">Email</string>
    <string name="archive_todos">Archive</string>
    <string name="unarchive_todos">Unarchive</string>
    <string name="delete_todos">Delete</string>
    <string name="cancel_select">Cancel</string>
    <string name="select_all">All</string>
    <string name="action_displayactive">Inbox</string>
    <string name="action_displayarchived">Archive</string>
    <string name="email_all">Email All Todos...</string>
    <string name="summary">Summary</string>

</resources>