text:
package org.apache.commons.collections4;

import java.util.Collection;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;

/**
 * Defines a map that holds a collection of values against each key.
 *

 * A {@code MultiValuedMap} is a Map with slightly different semantics:
 *

 *

 *
Putting a value into the map will add the value to a {@link Collection} at that key.

 *
Getting a value will return a {@link Collection}, holding all the values put to that key.

 *

 *

 * For example:
 *

 *
{@code
 * MultiValuedMap<Integer, String> map = new ArrayListValuedHashMap<>();
 * map.put(1, "A");
 * map.put(1, "B");
 * map.put(1, "C");
 * Collection<String> coll = map.get(1);
 * }

 *

 * {@code coll} will be a collection containing "A", "B", "C".
 *

 *
 * @param <K> the type of the keys in this map
 * @param <V> the type of the values in this map
 * @since 4.1
 */
public interface MultiValuedMap<K, V> {
    // Query operations

    /**
     * Gets the total size of the map.
     *

     * Implementations would return the total size of the map which is the count
     * of the values from all keys.
     *
     * @return the total size of the map
     */
    int size();

    /**
     * Returns {@code true} if this map contains no key-value mappings.
     *
     * @return {@code true} if this map contains no key-value mappings
     */
    boolean isEmpty();

    /**
     * Returns {@code true} if this map contains a mapping for the specified
     * key. More formally, returns {@code true} if and only if this map contains
     * a mapping for a key {@code k} such that {@code (key==null ? k==null : key.equals(k))}.
     * (There can be at most one such mapping.)
     *
     * @param key  key whose presence in this map is to be tested
     * @return true if this map contains a mapping for the specified key
     * @throws NullPointerException if the specified key is null and this map
     *   does not permit null keys (optional)
     */
    boolean containsKey(Object key);

    /**
     * Checks whether the map contains at least one mapping for the specified value.
     *
     * @param value  the value to search for
     * @return true if the map contains the value
     * @throws NullPointerException if the value is null and null values are not supported
     *   by the used collection types (optional)
     */
    boolean containsValue(Object value);

    /**
     * Checks whether the map contains a mapping for the specified key and value.
     *
     * @param key  the key to search for
     * @param value  the value to search for
     * @return true if the map contains the value
     */
    boolean containsMapping(Object key, Object value);

    /**
     * Returns a view collection of the values associated with the specified key.
     *

     * This method will return an empty collection if {@link #containsKey(Object)}
     * returns {@code false}. Changes to the returned collection will update the underlying
     * {@code MultiValuedMap} and vice-versa.
     *
     * @param key  the key to retrieve
     * @return the {@code Collection} of values, implementations should
     *   return an empty collection for no mapping
     * @throws NullPointerException if the key is null and null keys are invalid (optional)
     */
    Collection<V> get(K key);

    // Modification operations

    /**
     * Adds a key-value mapping to this multivalued map.
     *

     * Unlike a normal {@code Map} the previous value is not replaced.
     * Instead the new value is added to the collection stored against the key.
     * Depending on the collection type used, duplicate key-value mappings may
     * be allowed.
     *

     * The method will return {@code true} if the size of the multivalued map
     * has been increased because of this operation.
     *
     * @param key  the key to store against
     * @param value  the value to add to the collection at the key
     * @return true if the map changed as a result of this put operation, or false
     *   if the map already contained the key-value mapping and the collection
     *   type does not allow duplicate values, e.g. when using a Set
     * @throws UnsupportedOperationException if the put operation is not supported by
     *   this multivalued map, e.g. if it is unmodifiable
     * @throws NullPointerException if the key or value is null and null is invalid (optional)
     * @throws IllegalArgumentException if some aspect of the specified key or value prevents
     *   it from being stored in this multivalued map
     */
    boolean put(K key, V value);

    /**
     * Adds a mapping to the specified key for all values contained in the given Iterable.
     *
     * @param key  the key to store against
     * @param values  the values to add to the collection at the key, may not be null
     * @return true if the map changed as a result of this operation
     * @throws NullPointerException if the specified iterable is null, or if this map
     *   does not permit null keys or values, and the specified key or values contain
     *   null (optional)
     */
    boolean putAll(K key, Iterable<? extends V> values);

    /**
     * Copies all mappings from the specified map to this multivalued map
     * (optional operation).
     *

     * The effect of this call is equivalent to that of calling
     * {@link #put(Object,Object) put(k, v)} on this map once for each mapping
     * from key {@code k} to value {@code v} in the specified map.
     *

     * The behavior of this operation is undefined if the specified map is modified
     * while the operation is in progress.
     *
     * @param map  mappings to be stored in this map, may not be null
     * @return true if the map changed as a result of this operation
     * @throws UnsupportedOperationException if the {@code putAll} operation is
     *   not supported by this map
     * @throws NullPointerException if the specified map is null, or if this map
     *   does not permit null keys or values, and the specified map
     *   contains null keys or values (optional)
     * @throws IllegalArgumentException if some property of a key or value in
     *   the specified map prevents it from being stored in this map
     */
    boolean putAll(Map<? extends K, ? extends V> map);

    /**
     * Copies all mappings from the specified map to this multivalued map
     * (optional operation).
     *

     * The effect of this call is equivalent to that of calling
     * {@link #put(Object,Object) put(k, v)} on this map once for each
     * mapping from key {@code k} to value {@code v} in the specified map.
     *

     * The behavior of this operation is undefined if the specified map is modified
     * while the operation is in progress.
     *
     * @param map  mappings to be stored in this map, may not be null
     * @return true if the map changed as a result of this operation
     * @throws UnsupportedOperationException if the {@code putAll} operation is
     *   not supported by this map
     * @throws NullPointerException if the specified map is null, or if this map
     *   does not permit null keys or values, and the specified map
     *   contains null keys or values (optional)
     * @throws IllegalArgumentException if some property of a key or value in
     *   the specified map prevents it from being stored in this map
     */
    boolean putAll(MultiValuedMap<? extends K, ? extends V> map);

    /**
     * Removes all values associated with the specified key.
     *

     * The returned collection may be modifiable, but updates will not be propagated
     * to this multivalued map. In case no mapping was stored for the specified
     * key, an empty, unmodifiable collection will be returned.
     *
     * @param key  the key to remove values from
     * @return the values that were removed
     * @throws UnsupportedOperationException if the map is unmodifiable
     * @throws NullPointerException if the key is null and null keys are invalid (optional)
     */
    Collection<V> remove(Object key);

    /**
     * Removes a key-value mapping from the map.
     *

     * The item is removed from the collection mapped to the specified key.
     * Other values attached to that key are unaffected.
     *

     * If the last value for a key is removed, implementations typically return
     * an empty collection from a subsequent {@code get(Object)}.
     *
     * @param key  the key to remove from
     * @param item  the item to remove
     * @return true if the mapping was removed, false otherwise
     * @throws UnsupportedOperationException if the map is unmodifiable
     * @throws NullPointerException if the key or value is null and null is invalid (optional)
     */
    boolean removeMapping(Object key, Object item);

    /**
     * Removes all of the mappings from this map (optional operation).
     *

     * The map will be empty after this call returns.
     *
     * @throws UnsupportedOperationException if the map is unmodifiable
     */
    void clear();

    // Views

    /**
     * Returns a {@link Collection} view of the mappings contained in this multivalued map.
     *

     * The collection is backed by the map, so changes to the map are reflected
     * in the collection, and vice-versa.
     *
     * @return a set view of the mappings contained in this map
     */
    Collection<Entry<K, V>> entries();

    /**
     * Returns a {@link MultiSet} view of the keys contained in this multivalued map.
     *

     * The {@link MultiSet#getCount(Object)} method of the returned multiset will give
     * the same result a calling {@code get(Object).size()} for the same key.
     *

     * This multiset is backed by the map, so any changes in the map are reflected in
     * the multiset.
     *
     * @return a multiset view of the keys contained in this map
     */
    MultiSet<K> keys();

    /**
     * Returns a {@link Set} view of the keys contained in this multivalued map.
     *

     * The set is backed by the map, so changes to the map are reflected
     * in the set, and vice-versa.
     *

     * If the map is modified while an iteration over the set is in
     * progress (except through the iterator's own {@code remove} operation),
     * the result of the iteration is undefined. The set supports element
     * removal, which removes the corresponding mapping from the map, via the
     * {@code Iterator.remove}, {@code Set.remove}, {@code removeAll},
     * {@code retainAll}, and {@code clear} operations. It does not support
     * the {@code add} or {@code addAll} operations.
     *
     * @return a set view of the keys contained in this map
     */
    Set<K> keySet();

    /**
     * Gets a {@link Collection} view of all values contained in this multivalued map.
     *

     * Implementations typically return a collection containing the combination
     * of values from all keys.
     *
     * @return a collection view of the values contained in this multivalued map
     */
    Collection<V> values();

    /**
     * Returns a view of this multivalued map as a {@code Map} from each distinct
     * key to the non-empty collection of that key's associated values.
     *

     * Note that {@code this.asMap().get(k)} is equivalent to {@code this.get(k)}
     * only when {@code k} is a key contained in the multivalued map; otherwise it
     * returns {@code null} as opposed to an empty collection.
     *

     * Changes to the returned map or the collections that serve as its values
     * will update the underlying multivalued map, and vice versa. The map does
     * not support {@code put} or {@code putAll}, nor do its entries support
     * {@link java.util.Map.Entry#setValue(Object) setValue}.
     *
     * @return a map view of the mappings in this multivalued map
     */
    Map<K, Collection<V>> asMap();

    // Iterators

    /**
     * Obtains a {@code MapIterator} over this multivalued map.
     *

     * A map iterator is an efficient way of iterating over maps. There is no
     * need to access the entries collection or use {@code Map.Entry} objects.
     *
     * @return a map iterator
     */
    MapIterator<K, V> mapIterator();

}


text:
import {
    SuperMap
} from '../SuperMap';
import {
    Util
} from '../commontypes/Util';
import './ClipParameter';

/**
 * @class SuperMap.InterpolationAnalystParameters
 * @category iServer SpatialAnalyst InterpolationAnalyst
 * @classdesc 插值分析参数类。
 * @param {Object} options - 参数。
 * @param {(SuperMap.Bounds|L.Bounds|ol.extent)} options.bounds - 插值分析的范围,用于确定结果栅格数据集的范围。
 * @param {string} options.outputDatasetName - 插值分析结果数据集的名称。
 * @param {string} options.outputDatasourceName - 插值分析结果数据源的名称。
 * @param {string} [options.zValueFieldName] - 存储用于进行插值分析的字段名称,插值分析不支持文本类型的字段。
 * @param {string} [options.dataset] - 用于做插值分析的数据源中数据集的名称。当插值分析类型(InterpolationAnalystType)为 dataset 时,此参数为必选。
 * @param {Array.<SuperMap.Geometry.Point|L.LatLng|L.Point|ol.geom.Point>} [options.inputPoints] - 用于做插值分析的离散点集合。当插值分析类型(InterpolationAnalystType)为 geometry 时,此参数为必设参数。
 * @param {number} [options.searchRadius=0] - 查找半径,即参与运算点的查找范围,与点数据集单位相同。
 * @param {number} [options.zValueScale=1] - 用于进行插值分析值的缩放比率。
 * @param {number} [options.resolution] - 插值结果栅格数据集的分辨率,即一个像元所代表的实地距离,与点数据集单位相同。
 * @param {SuperMap.FilterParameter} [options.filterQueryParameter] - 属性过滤条件。
 * @param {SuperMap.PixelFormat} [options.pixelFormat] - 指定结果栅格数据集存储的像素格式。
 * @param {string} [options.InterpolationAnalystType="dataset"] - 插值分析类型("dataset" 或 "geometry")。
 */
export class InterpolationAnalystParameters {

    constructor(options) {
        if (!options) {
            return;
        }
        /**
         * @member {(SuperMap.Bounds|L.Bounds|ol.extent)} SuperMap.InterpolationAnalystParameters.prototype.bounds
         * @description 插值分析的范围,用于确定结果栅格数据集的范围。
         * 如果缺省,则默认为原数据集的范围。鉴于此插值方法为内插方法,原数据集的范围内的插值结果才相对有参考价值,
         * 因此建议此参数不大于原数据集范围。
         */
        this.bounds = null;

        /**
         * @member {number} [SuperMap.InterpolationAnalystParameters.prototype.searchRadius=0]
         * @description 查找半径,即参与运算点的查找范围,与点数据集单位相同。
         * 计算某个位置的Z 值时,会以该位置为圆心,以查找范围的值为半径,落在这个范围内的采样点都将参与运算。
         * 该值需要根据待插值点数据的分布状况和点数据集范围进行设置。
         */
        this.searchRadius = 0;

        /**
         * @member {string} SuperMap.InterpolationAnalystParameters.prototype.zValueFieldName
         * @description 数据集插值分析中,用于指定进行插值分析的目标字段名,插值分析不支持文本类型的字段。
         * 含义为每个插值点在插值过程中的权重,可以将所有点此字段值设置为 1,即所有点在整体插值中权重相同。
         * 当插值分析类型(InterpolationAnalystType)为 dataset 时,此为必选参数。
         */
        this.zValueFieldName = null;

        /**
         * @member {number} [SuperMap.InterpolationAnalystParameters.prototype.zValueScale=1]
         * @description 用于进行插值分析值的缩放比率。
         * 参加插值分析的值将乘以该参数值后再进行插值,也就是对进行插值分析的值进行统一的扩大或缩小。
         */
        this.zValueScale = 1;

        /**
         * @member {number} SuperMap.InterpolationAnalystParameters.prototype.resolution
         * @description 插值结果栅格数据集的分辨率,即一个像元所代表的实地距离,与点数据集单位相同。
         * 该值不能超过待分析数据集的范围边长。
         * 且该值设置时,应该考虑点数据集范围大小来取值,一般为结果栅格行列值(即结果栅格数据集范围除以分辨率),在 500 以内可以较好地体现密度走势。
         */
        this.resolution = null;

        /**
         * @member {SuperMap.FilterParameter} [SuperMap.InterpolationAnalystParameters.prototype.filterQueryParameter]
         * @description 过滤条件,对分析数据集中的点进行过滤,设置为 null 表示对数据集中的所有点进行分析。
         */
        this.filterQueryParameter = null;

        /**
         * @member {string} SuperMap.InterpolationAnalystParameters.prototype.outputDatasetName
         * @description 插值分析结果数据集的名称。
         */
        this.outputDatasetName = null;

        /**
         * @member {string} SuperMap.InterpolationAnalystParameters.prototype.outputDatasourceName
         * @description 插值分析结果数据源的名称。
         */
        this.outputDatasourceName = null;

        /**
         * @member {SuperMap.PixelFormat} [SuperMap.InterpolationAnalystParameters.prototype.pixelFormat]
         * @description 指定结果栅格数据集存储的像素格式。支持存储的像素格式有 BIT16、BIT32、DOUBLE、SINGLE、UBIT1、UBIT4、UBIT8、UBIT24、UBIT32。
         */
        this.pixelFormat = null;

        /**
         * @member {string} [SuperMap.InterpolationAnalystParameters.prototype.dataset]
         * @description 用来做插值分析的数据源中数据集的名称,该名称用形如 "数据集名称@数据源别名" 形式来表示。
         * 当插值分析类型(InterpolationAnalystType)为 dataset 时,此参数为必选。
         */
        this.dataset = null;

        /**
         * @member {Array.<SuperMap.Geometry.Point|L.LatLng|L.Point|ol.geom.Point>} [SuperMap.InterpolationAnalystParameters.prototype.inputPoints]
         * @description 用于做插值分析的离散点(离散点包括Z值)集合。
         * 当插值分析类型(InterpolationAnalystType)为 geometry 时,此参数为必设参数。
         * 通过离散点直接进行插值分析不需要指定输入数据集inputDatasourceName,inputDatasetName以及zValueFieldName。
         */
        this.inputPoints = null;

        /**
         * @member {string} [SuperMap.InterpolationAnalystParameters.prototype.InterpolationAnalystType="dataset"]
         * @description  插值分析类型。差值分析包括数据集插值分析和几何插值分析两类,
         *               "dataset" 表示对数据集进行插值分析,"geometry" 表示对离散点数组进行插值分析。
         */
        this.InterpolationAnalystType = "dataset";

        /**
         * @member {Object} SuperMap.InterpolationAnalystParameters.prototype.clipParam
         * @description 对插值分析结果进行裁剪的参数。
         */
        this.clipParam = null;

        Util.extend(this, options);
        this.CLASS_NAME = "SuperMap.InterpolationAnalystParameters";
    }

    /**
     * @function SuperMap.InterpolationAnalystParameters.prototype.destroy
     * @description 释放资源,将引用资源的属性置空。
     */
    destroy() {
        var me = this;
        me.bounds = null;
        me.searchRadius = null;
        me.zValueFieldName = null;
        me.zValueScale = null;

        me.resolution = null;
        me.filterQueryParameter = null;
        me.outputDatasetName = null;
        me.pixelFormat = null;
    }

    /**
     * @function SuperMap.InterpolationAnalystParameters.toObject
     * @param {SuperMap.InterpolationAnalystParameters} interpolationAnalystParameters - 插值分析参数类。
     * @param {SuperMap.InterpolationAnalystParameters} tempObj - 插值分析参数对象。
     * @description 将插值分析参数对象转换成 JSON 对象。
     * @returns JSON 对象。
     */
    static toObject(interpolationAnalystParameters, tempObj) {
        for (var name in interpolationAnalystParameters) {
            if (name === "inputPoints" && interpolationAnalystParameters.InterpolationAnalystType === "geometry") {
                var objs = [];
                for (var i = 0; i < interpolationAnalystParameters.inputPoints.length; i++) {
                    var item = interpolationAnalystParameters.inputPoints[i];
                    var obj = {
                        x: item.x,
                        y: item.y,
                        z: item.tag
                    };
                    objs.push(obj);
                }
                tempObj[name] = objs;
            } else {
                tempObj[name] = interpolationAnalystParameters[name];
            }
        }
    }
}

SuperMap.InterpolationAnalystParameters = InterpolationAnalystParameters;

redpajama_set_name: RedPajamaGithub


text: Hopefully painless deployment of Rails app to DO - work in progress


text:
/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package modelecarnet_1;

import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.util.StringTokenizer;

/**
 *
 * @author AnneT
 */
public class Fichier {

 private   BufferedWriter fW;
 private   BufferedReader fR;
 private   String urlFichier;

 public void setUrlFichier(String tmp){
      urlFichier = tmp;
 }
 // Ouvrir un fichier en lecture
 public boolean  ouvrirEnLecture(String nf) {
	try {
            setUrlFichier(nf);
            File f = new File(urlFichier);
	    fR  = new BufferedReader(new FileReader(f));
            fW = null;
            return true;
	}
	catch (IOException e)	{
                System.out.println(urlFichier+" : Erreur  à l'ouverture en lecture");
		return false;
	}
 }

 public String lire()  {
     try {
	String chaine = fR.readLine();
	return chaine;
        }
	catch (IOException err) {
		System.out.println(urlFichier+" : Erreur  de lecture ");
                return null;
	}
 }

 public String [] extraireDonnees(String tmp)  {
    if (tmp != null) {
      StringTokenizer st = new StringTokenizer(tmp,";");
      int i=0;
      String mot[] = new String[st.countTokens()];
      while (st.hasMoreTokens()) {
         mot[i] = st.nextToken();
         i++;
       }
       return mot;
     }
     else return null;
 }

 public boolean fermer()  {
     try {
       if (fR != null) fR.close();
       else  if (fW != null) fW.close();
       return true;
     }
     catch (IOException err) {
	System.out.println(urlFichier+" : Erreur  à la fermeture ");
        return false;
     }
 }
  // Ouvrir un fichier en écriture
  public boolean  ouvrirEnEcriture(String nf) {
	try {
            setUrlFichier(nf);
            File f = new File(urlFichier);
	    fW = new BufferedWriter(new FileWriter(f));
            fR = null;
            return true;
	}
	catch (IOException e)	{
                System.out.println(urlFichier+" : Erreur  à l'ouverture en écriture ");
		return false;
	}
 }

 public boolean ecrire(String tmp) {
      try {
 	if (tmp != null)   {
		fW.write(tmp,0,tmp.length());
		fW.newLine();
	}
        return true;
        }
	catch (IOException err) {
		System.out.println(urlFichier+" : Erreur  d'écriture ");
                return false;
	}
   }
}


text:
from __future__ import print_function, division, absolute_import

from six import string_types
from varcode import load_vcf
from pysam import AlignmentFile
from collections import OrderedDict

from .protein_sequence_creator import ProteinSequenceCreator
from .read_collector import ReadCollector
from .logging import get_logger
from .isovar_result import IsovarResult
from .default_parameters import (
    MIN_NUM_RNA_ALT_READS,
    MIN_NUM_RNA_ALT_FRAGMENTS,
    MIN_FRACTION_RNA_ALT_READS,
    MIN_FRACTION_RNA_ALT_FRAGMENTS,
    MAX_NUM_RNA_REF_READS,
    MAX_NUM_RNA_REF_FRAGMENTS,
    MAX_FRACTION_RNA_REF_READS,
    MAX_FRACTION_RNA_REF_FRAGMENTS,
    MAX_NUM_RNA_OTHER_READS,
    MAX_NUM_RNA_OTHER_FRAGMENTS,
    MAX_FRACTION_RNA_OTHER_READS,
    MAX_FRACTION_RNA_OTHER_FRAGMENTS,
    MIN_RATIO_RNA_ALT_TO_OTHER_FRAGMENTS,
    MIN_SHARED_FRAGMENTS_FOR_PHASING
)
from .effect_prediction import top_varcode_effect
from .filtering import apply_filters
from .phasing import annotate_phased_variants

logger = get_logger(__name__)

DEFAULT_FILTER_THRESHOLDS =  OrderedDict([
    # alt allele
    ("min_num_alt_reads", MIN_NUM_RNA_ALT_READS),
    ("min_num_alt_fragments", MIN_NUM_RNA_ALT_FRAGMENTS),
    ("min_fraction_alt_reads", MIN_FRACTION_RNA_ALT_READS),
    ("min_fraction_alt_fragments", MIN_FRACTION_RNA_ALT_FRAGMENTS),

    # ref allele coverage and VAF
    ("max_num_ref_reads", MAX_NUM_RNA_REF_READS),
    ("max_num_ref_fragments", MAX_NUM_RNA_REF_FRAGMENTS),
    ("max_fraction_ref_reads", MAX_FRACTION_RNA_REF_READS),
    ("max_fraction_ref_fragments", MAX_FRACTION_RNA_REF_FRAGMENTS),

    # other alleles
    ("max_num_other_reads", MAX_NUM_RNA_OTHER_READS),
    ("max_num_other_fragments", MAX_NUM_RNA_OTHER_FRAGMENTS),
    ("max_fraction_other_reads", MAX_FRACTION_RNA_OTHER_READS),
    ("max_fraction_other_fragments", MAX_FRACTION_RNA_OTHER_FRAGMENTS),

    # misc. filters
    ("min_ratio_alt_to_other_fragments", MIN_RATIO_RNA_ALT_TO_OTHER_FRAGMENTS)
])

DEFAULT_FILTER_FLAGS = [
    "predicted_effect_modifies_protein_sequence",
    "has_mutant_protein_sequence_from_rna",
    "protein_sequence_contains_mutation",
]

def run_isovar(
        variants,
        alignment_file,
        transcript_id_whitelist=None,
        read_collector=None,
        protein_sequence_creator=None,
        filter_thresholds=DEFAULT_FILTER_THRESHOLDS,
        filter_flags=DEFAULT_FILTER_FLAGS,
        min_shared_fragments_for_phasing=MIN_SHARED_FRAGMENTS_FOR_PHASING,
        decompression_threads=1):
    """
    This is the main entrypoint into the Isovar library, which collects
    RNA reads supporting variants and translates their coding sequence
    into amino acid sequences. Collects both the read evidence and
    protein sequences into IsovarResult objects. The values of any filters
    which are supplied in the filter_thresholds argument are attached to
    each IsovarResult's filter_values_dict field.

    Parameters
    ----------
    variants : varcode.VariantCollection
        Somatic variants

    alignment_file : pysam.AlignmentFile
        Aligned tumor RNA reads

    transcript_id_whitelist : set of str or None
        Which transcripts should be considered when predicting DNA-only
        coding effects of mutations and also when trying to establish a
        reading frame for identified cDNA sequences.

    read_collector : ReadCollector or None
        Object used to collect ReadEvidence for each variant, created
        with default settings if not supplied.

    protein_sequence_creator : ProteinSequenceCreator or None
        Object used to turn (Variant, ReadEvidence) into one or more
        ProteinSequence objects. Created with default settings if not
        supplied.

    filter_thresholds : dict or OrderedDict
        Dictionary whose entries have names like "min_num_alt_reads"
        mapping to a numerical threshold value. In general, the keys
        must start with either "min_" or "max_" followed by a property
        of the IsovarResult class.

    filter_flags : list of str
        List of boolean fields of IsovarResult used for filtering,
        they can also be negated by prepending "not_",
        such as "not_has_protein_sequence".

    decompress_threads : int
        Number of threads used by htslib to decompress BAM/CRAM
        files.

    Generator of IsovarResult objects, one for each variant. The
    `protein_sequences` field of the IsovarVar result will be empty
    if no sequences could be determined.
    """
    if isinstance(variants, string_types):
        variants = load_vcf(variants)

    if isinstance(alignment_file, string_types):
        alignment_file = AlignmentFile(
            alignment_file,
            threads=decompression_threads)

    if read_collector is None:
        read_collector = ReadCollector()

    if protein_sequence_creator is None:
        protein_sequence_creator = ProteinSequenceCreator()

    # create generator which returns (Variant, ReadEvidence) pairs
    read_evidence_gen = \
        read_collector.read_evidence_generator(
           variants=variants,
           alignment_file=alignment_file)

    results = []
    for variant, read_evidence in read_evidence_gen:
        # generate protein sequences by assembling variant reads
        protein_sequences = \
            protein_sequence_creator.sorted_protein_sequences_for_variant(
                variant=variant,
                read_evidence=read_evidence,
                transcript_id_whitelist=transcript_id_whitelist)
        predicted_effect = top_varcode_effect(
            variant=variant,
            transcript_id_whitelist=transcript_id_whitelist)
        isovar_result = IsovarResult(
            variant=variant,
            predicted_effect=predicted_effect,
            read_evidence=read_evidence,
            sorted_protein_sequences=protein_sequences)
        isovar_result = apply_filters(
            isovar_result,
            filter_thresholds=filter_thresholds,
            filter_flags=filter_flags)
        results.append(isovar_result)
    results = annotate_phased_variants(
        results,
        min_shared_fragments_for_phasing)
    return results


text:
namespace Fulcrum.Core
{
	public interface IFormModel<out TCommand>
		where TCommand : ICommand
	{
		TCommand Convert();
	}
}


text:
<!DOCTYPE html>

    <meta charset="utf-8">
    <link rel="stylesheet" href="assets/css/{{ charity.css }}" media="screen" charset="utf-8">
    <title>{{ page_title }}</title>

    <link rel="shortcut icon" href="./assets/img/favicons/favicon.ico">
    <link rel="apple-touch-icon" sizes="57x57" href="./assets/img/favicons/apple-touch-icon-57x57.png">
    <link rel="apple-touch-icon" sizes="60x60" href="./assets/img/favicons/apple-touch-icon-60x60.png">
    <link rel="apple-touch-icon" sizes="72x72" href="./assets/img/favicons/apple-touch-icon-72x72.png">
    <link rel="apple-touch-icon" sizes="76x76" href="./assets/img/favicons/apple-touch-icon-76x76.png">
    <link rel="apple-touch-icon" sizes="114x114" href="./assets/img/favicons/apple-touch-icon-114x114.png">
    <link rel="apple-touch-icon" sizes="120x120" href="./assets/img/favicons/apple-touch-icon-120x120.png">
    <link rel="apple-touch-icon" sizes="144x144" href="./assets/img/favicons/apple-touch-icon-144x144.png">
    <link rel="apple-touch-icon" sizes="152x152" href="./assets/img/favicons/apple-touch-icon-152x152.png">
    <link rel="apple-touch-icon" sizes="180x180" href="./assets/img/favicons/apple-touch-icon-180x180.png">
    <link rel="icon" type="image/png" href="./assets/img/favicons/favicon-32x32.png" sizes="32x32">
    <link rel="icon" type="image/png" href="./assets/img/favicons/android-chrome-192x192.png" sizes="192x192">
    <link rel="icon" type="image/png" href="./assets/img/favicons/favicon-96x96.png" sizes="96x96">
    <link rel="icon" type="image/png" href="./assets/img/favicons/favicon-16x16.png" sizes="16x16">
    <link rel="manifest" href="./assets/img/favicons/manifest.json">
    <meta name="msapplication-TileColor" content="#da532c">
    <meta name="msapplication-TileImage" content="./assets/img/favicons/mstile-144x144.png">
    <meta name="theme-color" content="#ffffff">
    <link href='https://fonts.googleapis.com/css?family=Contrail+One' rel='stylesheet' type='text/css'>

FAQ

          Aidez gratuitement

 en répondant à des sondages !

        <form id="mail-catcher" class="layout row" action="{{ dashboard_url }}/register" method="get">
          <input type="email" name="registermail" value="" placeholder="Mon e-mail">
          <input type="hidden" name="registerentity" value="{{ charity.urn }}">
          <button type="submit" id="cta_button">M'inscrire</button>
        </form>

Une nouvelle source de financement pour {{ charity.name }}

          Abibao est une toute jeune startup qui veut aider les associations en construisant un modèle économique intelligent, social et responsable. Leur mission est de permettre à des projets caritatifs de collecter des fonds selon une approche alternative aux solutions classiques. Notre fonds est partenaire d'Abibao, c'est à dire que nous pouvons récolter de l'argent grâce à vos réponses.

Comment ça marche ?

Le fonctionnement

Inscrivez-vous.

Enrichissez votre profil (cela augmente vos chances de recevoir des sondages).

Lorsqu'un sondage apparaît et correspond à vos centres d'intérêt, vous recevez une notification.

Vous répondez et {{ charity.name_long }} recevra de l'argent !

L'inscription est anonyme

              Votre inscription et l'ensemble des réponses que vous apporterez respecteront des critères stricts d'anonymats. Abibao n'a pas besoin de savoir QUI vous êtes, d'ailleurs cela ne vous sera jamais demandé !

Pas de SPAM

              Comme vous, Abibao n'aime pas le spam. Votre adresse email ne sera jamais revendue à des diffuseurs commerciaux. Vous ne serez sollicité par email uniquement lorsqu'il le sera nécessaire, c'est à dire pour récolter de l'argent pour {{ charity.name_long }}.

Une startup sociale

              Abibao ne prend pas de commission sur les dons générés. Ses frais de fonctionnement sont couverts par un ticket d'entrée d'accès à la plateforme facturé aux entreprises. Qui plus est, ces frais sont plafonnés pour être toujours inférieurs aux dons générés. Vos réponses financent d'abord {{ charity.name_long }} et ensuite permettent à Abibao de développer ses outils de récolte de fonds.

Vos amis aussi peuvent nous soutenir !

          Financez {{ charity.name_long }} pour pas un rond, telle est la devise sur Abibao. N'attendez plus pour nous soutenir. Invitez aussi vos amis, votre famille et vos collègues à s'inscrire pour la bonne cause ! Si vous avez facebook, vous pouvez partager la page Abibao.

Les avantages pour {{ charity.name }}

Une nouvelle source de financement

C'est la garantie d'un revenu complémentaire à notre recherche de financements. Si nous arrivons à rassembler plusieurs milliers de soutiens sur Abibao cela nous permettra de financer de nouvelles actions très concrètes.

De la visibilité

C'est un tremplin de visibilité car Abibao attire des particuliers qui ne connaissent pas encore {{ charity.name_long }}. Des hommes et des femmes susceptibles de nous rejoindre dans nos actions.

Des sondages à disposition

La plateforme nous donne un accès gracieux à ses outils de sondage, ce qui nous permet par exemple de mieux connaître l'impact de nos actions auprès de la population française.

Gratuit

              C'est totalement gratuit pour nous ! {{ charity.name_long }} ne paie rien pour être présent sur Abibao. C'est grâce à vous, à votre inscription et à vos réponses que tout ceci est possible.

            NOS PARTENAIRES

            CONTACT

                  Suivez-nous

                  Facebook Abibao

Twitter Abibao

                  Contactez-nous

                  On vous répond sur contact[❤]abibao.com

                  Foire aux Questions

                  Retrouvez toutes les questions les plus posées !

        CGU - Mentions Légales - Contact - Tous droits réservés Abibao 2016


text:
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Orchard.FileSystems.Media {
    public static class StorageProviderExtensions {
        public static void WriteAllText(this IStorageProvider storageProvider, string path, string contents) {
            if (storageProvider.FileExists(path)) {
                storageProvider.DeleteFile(path);
            }

            var file = storageProvider.CreateFile(path);
            using (var stream = file.OpenWrite())
            using (var streamWriter = new StreamWriter(stream)) {
                streamWriter.Write(contents);
            }
        }

        public static string ReadAllText(this IStorageProvider storageProvider, string path) {
            if (!storageProvider.FileExists(path)) {
                return String.Empty;
            }

            var file = storageProvider.GetFile(path);
            using (var stream = file.OpenRead())
            using (var streamReader = new StreamReader(stream)) {
                return streamReader.ReadToEnd();
            }
        }
    }
}


text:
#ifndef ExpandFoundation_FoundationExtension_h_
#define ExpandFoundation_FoundationExtension_h_

#import "NSString+Extensions.h"
#import "NSString+URLExtension.h"
#import "NSObject+Extension.h"
#import "NSDate+Extension.h"
#import "NSBundle+Extension.h"
#import "Blocks+Extentsion.h"
#import "NSError+Extension.h"

#endif


text:
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <title>W29253_text</title>
        <link rel="stylesheet" type="text/css" href="style.css" />

                «

    <p class="styleSans11.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle>">$3
ZAVANNA
(HI
1200 17"1 Street, Ste. 1100
Denver, CO 80202 PhN: 303-595-8004 FAX": 303-595-9847

    <p class="styleSans198.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle>">a The cuttings and mud produced during drilling of the Si urd 5-8 1TFl-l 3H 5TFH 7H 32-29 2H 4TFH
6l-lI 8TFH wells located NE NE Sec. S-153N-99W, Williams County, ND will be disposed at the offsite facilities listed below. No cuttings pit will be located on the Sigurd well location.

No cuttings pit, Cuttings will be hauled to: IHD Sollds Management Permlt#: SP0088
PH#: 701-774-8514
NW 1/4 Sec. 34, T153N, R101W
McKenzie County, ND 58831

MUD TAKEN TO: lHD Liquids Management Permit #: 21392 (Treating Facility) PH#: 701-580-6617
Location: SW V4 Sec. 34, T153N, R101W
McKenzie County, ND 58831

    <p class="styleSans29.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle>">W—
Well Name&Number Latitude Lon itude Le al Descrl tlon wm
Sigurd 5—8 1TFH
Sigurd 5-8 3H Sigurd 5-8 5TFH Sigurd 5-8 7H Sigurd 32-29 2H Sigurd 32-29 4TFH Sigurd 32-29 6H Sigurd 32-29 8TFH
48 deg 06' 34.16"
48 deg 06' 34.16" 48 deg 06' 34.16" 48 deg 06' 34.16" 48 deg 06' 36.53" 46 deg 06' 36.529" 48 deg 06' 36.529" 48 deg 06' 36.529"
103 deg 26' 06.84"
103 deg 26' 08.40" 103 deg 26' 07.95" 103 deg 26' 07.51" 103 deg 26' 08.84" 103 deg 26' 08.401" 103 deg 26' 07.959" 103 deg 26' 07.517"
Williams Co, ND NENE Sec. 5-153N-R99W Williams 00., ND
SAME SAME SAME SAME SAME SAME

    <p class="styleSans12000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle>">

    <p class="styleSans6.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle>">Date:
To:
From:
RE:

    <p class="styleSans10.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle>">August 14, 2014 (Thurs.) NDIC (North Dakota Oil and Gas Division)
Jean Arnold — Sr. Prod. Tech.
Sigurd MWP Cuttings & Offset Disposal Location


text:
(function() {
  var Y = this.YUITest || require("yuitest"),
  util = require("util"),
  Registry = require("../../lib/registry"),
  _ = require("underscore")._;

  var suite = new Y.TestSuite("Registry Tests");

  suite.add(new Y.TestCase({
    name:"Adding and Removing Items",

    setUp: function() {
      this.registry = new Registry();
    },
    tearDown: function() {
      this.registry.dispose();
      delete this.counter;
    },

    testAddingItem: function() {
      var item1 = {id: "item1"};
      var added = this.registry.add(item1);
      Y.Assert.areEqual(added, true, "item should have been added");
      Y.Assert.areEqual(this.registry.items.length, 1, "this.registry.items.length should be 1");
      Y.Assert.areSame(this.registry.items[0], item1, "items should be the same");
    },

    testAddingDuplicateItems: function() {
      var item1 = {id: "item1"};
      var item2 = {id: "item1"};
      this.registry.add(item1);
      try {
        this.registry.add(item2);
      } catch (ex) {
        var err = "Error: All items in this registry instance must have unique IDs.... id: item1";
        Y.Assert.areEqual(ex.message, err, "no duplicate ids allowed");
      }
    },

    testAddRange: function() {
      var items = [
        {id: "item1"},
        {id: "item2"}
      ];
      var more_items = [
        {id: "item3"},
        {id: "item4"}
      ];
      this.registry.addRange(items);
      Y.Assert.areEqual(this.registry.items.length, 2, "first addRange: this.registry.items.length should be 2");
      Y.Assert.areSame(this.registry.items[0], items[0], "first addRange: items should be the same");

      this.registry.addRange(more_items);
      Y.Assert.areEqual(this.registry.items.length, 4, "second addRange: this.registry.items.length should be 4");
      Y.Assert.areSame(this.registry.items[2], more_items[0], "second addRange: items should be the same");
    },

    testRemovingItem: function() {
      var item1 = {id: "item1"};
      this.registry.add(item1);
      Y.Assert.areEqual(this.registry.items.length, 1, "this.registry.items.length should be 1");
      Y.Assert.areSame(this.registry.items[0], item1, "items should be the same");
      var removed = this.registry.remove(item1);
      Y.Assert.areEqual(removed, true, "item should have been removed");
      Y.Assert.areEqual(this.registry.items.length, 0, "this.registry.items.length should be 0");
    },

    testCustomIdKey: function() {
      this.registry.options.idKey = "my_id";
      var item1 = {my_id: "item1"};
      var added = this.registry.add(item1);
      Y.Assert.areEqual(added, true, "item should have been added");
      Y.Assert.areEqual(this.registry.items.length, 1, "this.registry.items.length should be 1");
      Y.Assert.areSame(this.registry.items[0], item1, "items should be the same");
    },

    testFindById: function() {
      var item1 = {id: "item1"};
      var added = this.registry.add(item1);
      Y.Assert.areEqual(added, true, "item should have been added");
      Y.Assert.areEqual(this.registry.items.length, 1, "this.registry.items.length should be 1");
      Y.Assert.areSame(this.registry.items[0], item1, "items should be the same");
      var foundItem = this.registry.findById("item1");
      Y.Assert.areSame(this.registry.items[0], foundItem, "items should be the same");
      Y.Assert.areSame(item1, foundItem, "items should be the same");
    }

  }));

  suite.add(new Y.TestCase({
    name:"Registry Events",

    setUp: function() {
      this.registry = new Registry();
    },
    tearDown: function() {
      this.registry.dispose();
      delete this.counter;
    },

    testItemAdded: function() {
      var test = this;
      var item1 = {id: "item1"};
      this.registry.on("itemAdded", function(item) {
        Y.Assert.areEqual(test.registry.items.length, 1, "test.registry.items.length should be 1");
        Y.Assert.areSame(test.registry.items[0], item, "items should be the same");
        Y.Assert.areSame(item1, item, "items should be the same");
      });
      this.registry.add(item1);
    },

    testItemAddedInRange: function() {
      var test = this;
      var items = [
        {id: "item1"},
        {id: "item2"}
      ];
      var added_items = [];
      this.registry.on("itemAdded", function(item) {
        added_items.push(item);
      });
      this.registry.addRange(items);
      Y.Assert.areEqual(added_items.length, 2, "added_items.length should be 2");
      Y.Assert.areSame(test.registry.items[0], added_items[0], "items should be the same");
      Y.Assert.areSame(test.registry.items[1], added_items[1], "items should be the same");
    },

    testItemRemoved: function() {
      var test = this;
      var item1 = {id: "item1"};
      this.registry.on("itemRemoved", function(item) {
        Y.Assert.areEqual(test.registry.items.length, 0, "test.registry.items.length should be 0");
        Y.Assert.areSame(item1, item, "items should be the same");
      });
      this.registry.add(item1);
      this.registry.remove(item1);
    },

    testCleared: function() {
      var test = this;
      var items = [
        {id: "item1"},
        {id: "item2"}
      ];
      this.registry.on("cleared", function() {
        Y.Assert.areEqual(test.registry.items.length, 0, "test.registry.items.length should be 0");
      });
      this.registry.addRange(items);
      this.registry.removeAll();
    },

    testClearFiresItemRemoved: function() {
      var test = this;
      var items = [
        {id: "item1"},
        {id: "item2"}
      ];
      var counter = 0;
      this.registry.on("itemRemoved", function() {
        counter++;
      });
      this.registry.addRange(items);
      this.registry.removeAll();
      Y.Assert.areEqual(2, counter, "itemRemoved event should have fired two times");
    }

  }));

  Y.TestRunner.add(suite);
})();


text:
- fix dune files for dune 3
- add `for_each` and `for_eachi`

# 1.3

- use `inline` annotations
- prepare for newer mdx (for tests)

# 1.2.1

- fix: use `Stdlib` instead of `Pervasives`
- fix: missing dep on unix for 4.08
- add shims with dune magic for 4.08 compat

# 1.2

- Rename the library to Iter.
- Add `from_labeled_iter`.
- Use `raise_notrace` for internal exceptions.

# 1.1

- perf: use `Set.elements` to convert to list
- fix(compat): compat with 4.07
- Fix the reservoir sampling algorithm.
- Add tests.
- readme: link to gasche's blog post
- readme: add some explanations and comparison with gen

# 1.0

- remove delimcc sublib (breaking)
- move to jbuilder (requires OCaml >= 4.02)
- remove type `t2` (breaking)

- add some functions using `result`
- add `filter_count`

# 0.11

- make `count` lazy
- make `group_by` lazy
- add `Sequence.append_l`
- add `Sequence.filter_mapi`
- update `SequenceLabels` with missing functions
- add `Sequence.pair_with_idx`
- add `{sum,sumf}` for summation over sequences
- add `seq_list` and `seq_list_map`

# 0.10

- add `{union,inter,diff,subset}`
- add `{join_by,join_all_by,group_join_by}`
- add `find_map{,i}` as better alias to existing functions
- add `{max_exn,min_exn}`
- add `count`
- add `doc` and `test` to opam

# 0.9

- distinction between `diagonal,diagonal_l`
- add `init,fold_map,fold_filter_map,sorted,diagonal,findi,…`
- fix a few typos
- update readme: convert into asciidoc, add tutorial
- remove deprecated functions, add missing links to `SequenceLabels`

# 0.8

- loop based implementation for `int_range_by`
- move files to 'src/', use qtest for tests
- add `int_range_by`
- add `Sequence.flat_map_l`

# 0.7

- add missing entry in changelog and missing since annotations
- Add `shuffle`.
- Add `shuffle_buffer`.
- Add `sample`.
- Add `map_by_2`.

# 0.6

- deprecate `flatMap` and `fmap`
- in opam file, depend on ocamlbuild
- add `group_by` (ignores the ordering)
- alias `group_succ_by`, deprecated `group`
- iterate on booleans
- open Bigarray (preparing for 4.03)

# 0.5.5

- new module `SequenceLabels`
- `fold_while` fun
- implement `Set.Adapt.of_list` for `< 4.02`
- removed many warnings, fix tests
- change name of `IO` functions (keep compat)

# 0.5.4

- depend on `bytes`
- compliance with `-safe-string`
- `sequence.bigarray`

# 0.5.3

- bugfix: interaction between `take` and `is_empty`

# 0.5.2

- bugfix in `take`
- `on_list` for mapping lists through sequences

# 0.5.1

- `Sequence.IO` module, a very very simple way to read/write files
- options: `to_opt/of_opt/head/head_exn`

# 0.5

- conversion with `klist`
- add monadic, choice and applicative infix operators and `>|=`
- add several functions:
  * `product2`
  * `find`, `mem`
  * `doubleton`, `cons`, `snoc`
  * `drop_while`, `take_while`...
  * `concat_str`
- aliases to existing functions
- use `delimcc` in a new module, `SequenceInvert`, in order to reverse the
  control flow (here with conversion to Gen)
- fix examples, tests and doc (about `product`)
- reading benchmark for persistent sequences.
- replace `Bench` with `Benchmark`

# 0.4.1

- `persistent_lazy`
- use `bin_annot`

# 0.4

- API change for `persistent`
- more efficient implementation for `persistent`
- remove `TypeClass`
- API change for `min`/`max` (in case the sequence is empty)
- conversion with `Gen`
- use Oasis

# 0.3.7

- decreasing int range
- printing functions

# 0.3.6.1

- documentation
- bugfixes

# 0.3.6

- `fmap`
- functors to adapt `Set` and `Map`

# 0.3.5

- tests and benchmarks
- `join` combinator
- optimization for `Sequence.persistent`

# 0.3.4

- `sort`, `uniq`, `group` and `sort_uniq` combinators implemented
- some conversion functions that use `Sequence.t2`
- infix operators in `Sequence.Infix`
- `Sequence.t2` type for efficient iteration on pairs of elements
- some combinators are adapted to `Sequence.t2`
- `zip`, `unzip` and `zip_i` to convert between `t` and `t2`
- added `scan` combinator

note: `git log --no-merges previous_version..HEAD --pretty=%s`


text:
var url = require("url");

describe('angularAMD', function() {
    var ptor = protractor.getInstance(),
        default_wait_ms = 15000;

    /**
     * Function used to in place of `ptor.get` as the native version will not wait for manual bootstrapping.
     * It adds an 0.5 sec wait before checking that url has been correctly set.
     */
    function ptor_get(rel_path) {
        ptor.driver.get(url.resolve(ptor.baseUrl, rel_path));
        ptor.wait(function () {
            return ptor.driver.getCurrentUrl().then(function(in_url) {
                var re = new RegExp(rel_path, "i");
                return re.test(in_url);
            });
        }, default_wait_ms, "Taking too long to load " + rel_path);
        ptor.sleep(1000);
    }

    function ptor_waitForElementById(nameId) {
        ptor.wait(function () {
            //console.log("Checking if " + nameId + " exists");
            return ptor.driver.isElementPresent(by.id(nameId)).then(function (is_present) {
                return is_present;
            });
        }, default_wait_ms, "Taking too long waiting for element id '" + nameId + "' to be present.");
        return element(by.id(nameId));
    }

    describe("home", function () {
        it('tab should be active', function() {
            ptor_get('#/home');
            var navElem = ptor_waitForElementById("nav-home");
            expect(navElem.getAttribute("class")).toBe("active");
            expect(ptor.getCurrentUrl()).toContain('#/home');
        });

        it("View on GitHub button should exists", function () {
            expect($("#view-on-github").getAttribute('class')).toBe("btn btn-large");
        });

        it("View on GitHub button should exists", function () {
            expect($("#view-on-github").getAttribute('class')).toBe("btn btn-large");
            expect($("#view-on-github i").getAttribute('class')).toBe("icon-github-sign");
        });
    });

    describe("map", function () {
        // As map tab takes a bit longer to become active, probably due to the work to load google map
        it("tab should be active", function () {
            ptor_get('#/map');
            var navElem = ptor_waitForElementById("nav-map");
            ptor.wait(function () {
                return navElem.getAttribute("class").then(function (class_value) {
                    return class_value == "active";
                });
            }, default_wait_ms, "Taking too long for map tab to become active");
        });

        // As map takes a bit to load, give it up to 5 secs for it to load
        it("should be loaded", function () {
            ptor_waitForElementById("map-canvas");
            expect($('#map-canvas .gm-style').getAttribute("style")).toBeDefined();
        });
    })

    describe("module", function () {
        it("modules tab should be active", function () {
            ptor_get('#/modules');
            var navElem = ptor_waitForElementById("nav-modules");
            ptor.wait(function () {
                return navElem.getAttribute("class").then(function (class_value) {
                    return class_value == "active";
                });
            }, default_wait_ms, "Taking too long for map tab to become active");
        });

        it("ng-write to output correct value", function () {
            expect($("#output-ng-write").getText()).toBe("Output from Directive");
        });

        it("DeferredString to output correct value", function () {
            expect($("#output-deferred-string").getText()).toBe("Show case ngWrite with promise");
        });

        it("DeferredObject to output correct value", function () {
            expect($("#output-deferred-object").getText()).toBe("This is defered response");
        });

        it(".run to output correct value", function () {
            expect($("#output-run").getText()).toBe("Greetings from .run");
        });

        it(".config to output correct value", function () {
            expect($("#output-config").getText()).toBe("And config works");
        });

    });

    // This has to be the last as ignoreSynchronization seems to impact remaining tests
    describe("pictures", function () {
        it("tab should be active", function () {
            ptor_get('#/pictures');
            var navElem = ptor_waitForElementById("nav-pictures");
            ptor.wait(function () {
                return navElem.getAttribute("class").then(function (class_value) {
                    return class_value == "active";
                });
            }, default_wait_ms, "Taking too long for pictures tab to become active");
        });

        // Ignoring sync due to use of $timer in ui-bootstrap to change pictures
        describe("ignore sync", function () {
            beforeEach(function () {
                ptor.ignoreSynchronization = true;
            });
            afterEach(function () {
                ptor.ignoreSynchronization = false;
            });

            it("london clicked", function () {
                var btn_london = $('#btn-london'),
                    pictures = element.all(by.repeater('row in rows')),
                    pictures_count = 0;

                btn_london.click().then(function () {
                    expect(btn_london.getAttribute("class")).toMatch('active');

                    // Get the pictures_count using repeater
                    ptor.wait(function () {
                        return pictures.count().then( function (row_count) {
                            if (row_count > 0) {
                                pictures_count = row_count;
                                return true;
                            } else {
                                return false;
                            }
                        });
                    }, default_wait_ms, "Taking too long to load pictures");

                    // Make sure that number of `slide_image` is the same as pictures_count
                    var slideimages = element.all(by.css('.slide-image'));
                    slideimages.count().then(function (row_count) {
                        expect(row_count).toBe(pictures_count);
                    })
                });
            });

            it("rome clicked", function () {
                var btn_rome = $('#btn-rome');
                btn_rome.click().then(function () {
                    expect(btn_rome.getAttribute("class")).toMatch('active');
                });
            });

        });
    })

});


text:
package com.b2international.snowowl.snomed.core.refset.automap;

import java.util.List;

import com.b2international.snowowl.core.api.SnowowlServiceException;

/**
 * Interface for parsing table-like files (eg. xls).
 * Skipping empty lines and headers must be supported and can be controlled by the parser.
 *
 */
public interface ITableParser {

	/**
	 * Execute parsing. Skipping empty lines and headers must be supported and can be controlled by the parser.
	 *
	 * @throws SnowowlServiceException
	 */
	public void parse() throws SnowowlServiceException;

	/**
	 * Returns the parsed content. Members are the textual representation of each cell collected in a {@link List}.
	 * If skipping empty lines is supported but they has to be retained empty list must be created (Collections.emptyList()}).
	 * If a cell is empty, empty string must be added to the list.
	 *
	 * @return List<List<String>>
	 */
	public List<List<String>> getContent();

	/**
	 * Returns the header of the parsed content if there is. Empty list otherwise.
	 *
	 */
	public List<String> getColumnHeader();

	/**
	 * Close resources.
	 */
	public void close();

}


text:
using System;

namespace EQueue.Protocols.NameServers
{
    [Serializable]
    public class TopicAccumulateInfo
    {
        public string Topic { get; set; }
        public int QueueCount { get; set; }
        public string ConsumerGroup { get; set; }
        public long AccumulateCount { get; set; }
        public int OnlineConsumerCount { get; set; }
        public long ConsumeThroughput { get; set; }
    }
}


text:
URI = "http://www.portalcoren-rs.gov.br/index.php?categoria=servicos&pagina=oportunidades"

filename = 'temp_corem.txt'

require 'mechanize'

a = Mechanize.new { |agent|
  agent.user_agent_alias = 'Mac Safari'
}

page = a.get(URL)
page.links.each do |link|
  puts link.text
end


text:
//  Copyright 2004 The Apache Software Foundation
//
// 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.

package org.apache.tapestry.util.prop;

import java.beans.BeanInfo;
import java.beans.IntrospectionException;
import java.beans.Introspector;
import java.beans.PropertyDescriptor;
import java.util.HashMap;
import java.util.Map;

import org.apache.tapestry.ApplicationRuntimeException;
import org.apache.tapestry.Tapestry;

/**
 *
 *  Uses {@link java.beans.Introspector} to get bean information
 *  and analyze properties for those beans.
 *
 *  @author Howard Lewis Ship
 *  @version $Id$
 *  @since 2.2
 *
 **/

public class PropertyFinder
{
    /**
     *  Keyed on bean class value is also a Map.  Inner Map is
     *  keyed on property name, value is a
     *  {@link PropertyInfo}.
     *
     **/

    private static Map _cache = new HashMap();

    /**
     *  Finds the {@link PropertyInfo} for the specified class and
     *  property.  Returns null if the class does not implement
     *  such a property.
     *
     **/

    public synchronized static PropertyInfo getPropertyInfo(Class beanClass, String propertyName)
    {
        Map beanClassMap = (Map) _cache.get(beanClass);

        if (beanClassMap == null)
        {
            beanClassMap = buildBeanClassMap(beanClass);

            _cache.put(beanClass, beanClassMap);
        }

        return (PropertyInfo) beanClassMap.get(propertyName);
    }

    private static Map buildBeanClassMap(Class beanClass)
    {
        Map result = new HashMap();
        BeanInfo bi = null;

        try
        {
            bi = Introspector.getBeanInfo(beanClass);
        }
        catch (IntrospectionException ex)
        {
            throw new ApplicationRuntimeException(
                Tapestry.format("PropertyFinder.unable-to-introspect-class", beanClass.getName()),
                ex);
        }

        PropertyDescriptor[] pd = bi.getPropertyDescriptors();

        for (int i = 0; i < pd.length; i++)
        {
            PropertyDescriptor d = pd[i];

            PropertyInfo info =
                new PropertyInfo(
                    d.getName(),
                    d.getPropertyType(),
                    d.getReadMethod() != null,
                    d.getWriteMethod() != null);

            result.put(d.getName(), info);
        }

        return result;
    }
}


text:
// boost\math\distributions\non_central_t.hpp

// Copyright John Maddock 2008.

// Use, modification and distribution are subject to 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)

#ifndef BOOST_MATH_SPECIAL_NON_CENTRAL_T_HPP
#define BOOST_MATH_SPECIAL_NON_CENTRAL_T_HPP

#include <boost/math/distributions/fwd.hpp>
#include <boost/math/distributions/non_central_beta.hpp> // for nc beta
#include <boost/math/distributions/normal.hpp> // for normal CDF and quantile
#include <boost/math/distributions/students_t.hpp>
#include <boost/math/distributions/detail/generic_quantile.hpp> // quantile

namespace boost
{
   namespace math
   {

      template <class RealType, class Policy>
      class non_central_t_distribution;

      namespace detail{

         template <class T, class Policy>
         T non_central_t2_p(T n, T delta, T x, T y, const Policy& pol, T init_val)
         {
            BOOST_MATH_STD_USING
            //
            // Variables come first:
            //
            boost::uintmax_t max_iter = policies::get_max_series_iterations<Policy>();
            T errtol = ldexp(1.0f, -boost::math::policies::digits<T, Policy>());
            T d2 = delta * delta / 2;
            //
            // k is the starting point for iteration, and is the
            // maximum of the poisson weighting term:
            //
            int k = boost::math::itrunc(d2);
            // Starting Poisson weight:
            T pois = gamma_p_derivative(T(k+1), d2, pol)
               * tgamma_delta_ratio(T(k + 1), T(0.5f))
               * delta / constants::root_two<T>();
            if(pois == 0)
               return init_val;
            // Starting beta term:
            T beta = x < y
               ? ibeta(T(k + 1), n / 2, x, pol)
               : ibetac(n / 2, T(k + 1), y, pol);
            // Recurance term:
            T xterm = x < y
               ? ibeta_derivative(T(k + 1), n / 2, x, pol)
               : ibeta_derivative(n / 2, T(k + 1), y, pol);
            xterm *= y / (n / 2 + k);
            T poisf(pois), betaf(beta), xtermf(xterm);
            T sum = init_val;
            if((xterm == 0) && (beta == 0))
               return init_val;

            //
            // Backwards recursion first, this is the stable
            // direction for recursion:
            //
            boost::uintmax_t count = 0;
            for(int i = k; i >= 0; --i)
            {
               T term = beta * pois;
               sum += term;
               if(fabs(term/sum) < errtol)
                  break;
               pois *= (i + 0.5f) / d2;
               beta += xterm;
               xterm *= (i) / (x * (n / 2 + i - 1));
               ++count;
            }
            for(int i = k + 1; ; ++i)
            {
               poisf *= d2 / (i + 0.5f);
               xtermf *= (x * (n / 2 + i - 1)) / (i);
               betaf -= xtermf;
               T term = poisf * betaf;
               sum += term;
               if(fabs(term/sum) < errtol)
                  break;
               ++count;
               if(count > max_iter)
               {
                  return policies::raise_evaluation_error(
                     "cdf(non_central_t_distribution<%1%>, %1%)",
                     "Series did not converge, closest value was %1%", sum, pol);
               }
            }
            return sum;
         }

         template <class T, class Policy>
         T non_central_t2_q(T n, T delta, T x, T y, const Policy& pol, T init_val)
         {
            BOOST_MATH_STD_USING
            //
            // Variables come first:
            //
            boost::uintmax_t max_iter = policies::get_max_series_iterations<Policy>();
            T errtol = ldexp(1.0f, -boost::math::policies::digits<T, Policy>());
            T d2 = delta * delta / 2;
            //
            // k is the starting point for iteration, and is the
            // maximum of the poisson weighting term:
            //
            int k = boost::math::itrunc(d2);
            // Starting Poisson weight:
            T pois = gamma_p_derivative(T(k+1), d2, pol)
               * tgamma_delta_ratio(T(k + 1), T(0.5f))
               * delta / constants::root_two<T>();
            if(pois == 0)
               return init_val;
            // Starting beta term:
            T beta = x < y
               ? ibetac(T(k + 1), n / 2, x, pol)
               : ibeta(n / 2, T(k + 1), y, pol);
            // Recurance term:
            T xterm = x < y
               ? ibeta_derivative(T(k + 1), n / 2, x, pol)
               : ibeta_derivative(n / 2, T(k + 1), y, pol);
            xterm *= y / (n / 2 + k);
            T poisf(pois), betaf(beta), xtermf(xterm);
            T sum = init_val;
            if((xterm == 0) && (beta == 0))
               return init_val;

            //
            // Forward recursion first, this is the stable direction:
            //
            boost::uintmax_t count = 0;
            for(int i = k + 1; ; ++i)
            {
               poisf *= d2 / (i + 0.5f);
               xtermf *= (x * (n / 2 + i - 1)) / (i);
               betaf += xtermf;

               T term = poisf * betaf;
               sum += term;
               if(fabs(term/sum) < errtol)
                  break;
               if(count > max_iter)
               {
                  return policies::raise_evaluation_error(
                     "cdf(non_central_t_distribution<%1%>, %1%)",
                     "Series did not converge, closest value was %1%", sum, pol);
               }
               ++count;
            }
            //
            // Backwards recursion:
            //
            for(int i = k; i >= 0; --i)
            {
               T term = beta * pois;
               sum += term;
               if(fabs(term/sum) < errtol)
                  break;
               pois *= (i + 0.5f) / d2;
               beta -= xterm;
               xterm *= (i) / (x * (n / 2 + i - 1));
               ++count;
               if(count > max_iter)
               {
                  return policies::raise_evaluation_error(
                     "cdf(non_central_t_distribution<%1%>, %1%)",
                     "Series did not converge, closest value was %1%", sum, pol);
               }
            }
            return sum;
         }

         template <class T, class Policy>
         T non_central_t_cdf(T n, T delta, T t, bool invert, const Policy& pol)
         {
            //
            // For t < 0 we have to use reflect:
            //
            if(t < 0)
            {
               t = -t;
               delta = -delta;
               invert = !invert;
            }
            //
            // x and y are the corresponding random
            // variables for the noncentral beta distribution,
            // with y = 1 - x:
            //
            T x = t * t / (n + t * t);
            T y = n / (n + t * t);
            T d2 = delta * delta;
            T a = 0.5f;
            T b = n / 2;
            T c = a + b + d2 / 2;
            //
            // Crossover point for calculating p or q is the same
            // as for the noncentral beta:
            //
            T cross = 1 - (b / c) * (1 + d2 / (2 * c * c));
            T result;
            if(x < cross)
            {
               //
               // Calculate p:
               //
               if(x != 0)
               {
                  result = non_central_beta_p(a, b, d2, x, y, pol);
                  result = non_central_t2_p(n, delta, x, y, pol, result);
                  result /= 2;
               }
               else
                  result = 0;
               result += cdf(boost::math::normal_distribution<T, Policy>(), -delta);
            }
            else
            {
               //
               // Calculate q:
               //
               invert = !invert;
               if(x != 0)
               {
                  result = non_central_beta_q(a, b, d2, x, y, pol);
                  result = non_central_t2_q(n, delta, x, y, pol, result);
                  result /= 2;
               }
               else
                  result = cdf(complement(boost::math::normal_distribution<T, Policy>(), -delta));
            }
            if(invert)
               result = 1 - result;
            return result;
         }

         template <class T, class Policy>
         T non_central_t_quantile(T v, T delta, T p, T q, const Policy&)
         {
            BOOST_MATH_STD_USING
            static const char* function = "quantile(non_central_t_distribution<%1%>, %1%)";
            typedef typename policies::evaluation<T, Policy>::type value_type;
            typedef typename policies::normalise<
               Policy,
               policies::promote_float<false>,
               policies::promote_double<false>,
               policies::discrete_quantile<>,
               policies::assert_undefined<> >::type forwarding_policy;

               T r;
               if(!detail::check_df(
                  function,
                  v, &r, Policy())
                  ||
               !detail::check_finite(
                  function,
                  delta,
                  &r,
                  Policy())
                  ||
               !detail::check_probability(
                  function,
                  p,
                  &r,
                  Policy()))
                     return r;

            value_type guess = 0;
            if(v > 3)
            {
               value_type mean = delta * sqrt(v / 2) * tgamma_delta_ratio((v - 1) * 0.5f, T(0.5f));
               value_type var = ((delta * delta + 1) * v) / (v - 2) - mean * mean;
               if(p < q)
                  guess = quantile(normal_distribution<value_type, forwarding_policy>(mean, var), p);
               else
                  guess = quantile(complement(normal_distribution<value_type, forwarding_policy>(mean, var), q));
            }
            //
            // We *must* get the sign of the initial guess correct,
            // or our root-finder will fail, so double check it now:
            //
            value_type pzero = non_central_t_cdf(
               static_cast<value_type>(v),
               static_cast<value_type>(delta),
               static_cast<value_type>(0),
               !(p < q),
               forwarding_policy());
            int s;
            if(p < q)
               s = boost::math::sign(p - pzero);
            else
               s = boost::math::sign(pzero - q);
            if(s != boost::math::sign(guess))
            {
               guess = s;
            }

            value_type result = detail::generic_quantile(
               non_central_t_distribution<value_type, forwarding_policy>(v, delta),
               (p < q ? p : q),
               guess,
               (p >= q),
               function);
            return policies::checked_narrowing_cast<T, forwarding_policy>(
               result,
               function);
         }

         template <class T, class Policy>
         T non_central_t2_pdf(T n, T delta, T x, T y, const Policy& pol, T init_val)
         {
            BOOST_MATH_STD_USING
            //
            // Variables come first:
            //
            boost::uintmax_t max_iter = policies::get_max_series_iterations<Policy>();
            T errtol = ldexp(1.0f, -boost::math::policies::digits<T, Policy>());
            T d2 = delta * delta / 2;
            //
            // k is the starting point for iteration, and is the
            // maximum of the poisson weighting term:
            //
            int k = boost::math::itrunc(d2);
            // Starting Poisson weight:
            T pois = gamma_p_derivative(T(k+1), d2, pol)
               * tgamma_delta_ratio(T(k + 1), T(0.5f))
               * delta / constants::root_two<T>();
            // Starting beta term:
            T xterm = x < y
               ? ibeta_derivative(T(k + 1), n / 2, x, pol)
               : ibeta_derivative(n / 2, T(k + 1), y, pol);
            T poisf(pois), xtermf(xterm);
            T sum = init_val;
            if((pois == 0) || (xterm == 0))
               return init_val;

            //
            // Backwards recursion first, this is the stable
            // direction for recursion:
            //
            boost::uintmax_t count = 0;
            for(int i = k; i >= 0; --i)
            {
               T term = xterm * pois;
               sum += term;
               if((fabs(term/sum) < errtol) || (term == 0))
                  break;
               pois *= (i + 0.5f) / d2;
               xterm *= (i) / (x * (n / 2 + i));
               ++count;
               if(count > max_iter)
               {
                  return policies::raise_evaluation_error(
                     "pdf(non_central_t_distribution<%1%>, %1%)",
                     "Series did not converge, closest value was %1%", sum, pol);
               }
            }
            for(int i = k + 1; ; ++i)
            {
               poisf *= d2 / (i + 0.5f);
               xtermf *= (x * (n / 2 + i)) / (i);
               T term = poisf * xtermf;
               sum += term;
               if((fabs(term/sum) < errtol) || (term == 0))
                  break;
               ++count;
               if(count > max_iter)
               {
                  return policies::raise_evaluation_error(
                     "pdf(non_central_t_distribution<%1%>, %1%)",
                     "Series did not converge, closest value was %1%", sum, pol);
               }
            }
            return sum;
         }

         template <class T, class Policy>
         T non_central_t_pdf(T n, T delta, T t, const Policy& pol)
         {
            BOOST_MATH_STD_USING
            //
            // For t < 0 we have to use the reflection formula:
            //
            if(t < 0)
            {
               t = -t;
               delta = -delta;
            }
            if(t == 0)
            {
               //
               // Handle this as a special case, using the formula
               // from Weisstein, Eric W.
               // "Noncentral Student's t-Distribution."
               // From MathWorld--A Wolfram Web Resource.
               // http://mathworld.wolfram.com/NoncentralStudentst-Distribution.html
               //
               // The formula is simplified thanks to the relation
               // 1F1(a,b,0) = 1.
               //
               return tgamma_delta_ratio(n / 2 + 0.5f, T(0.5f))
                  * sqrt(n / constants::pi<T>())
                  * exp(-delta * delta / 2) / 2;
            }
            //
            // x and y are the corresponding random
            // variables for the noncentral beta distribution,
            // with y = 1 - x:
            //
            T x = t * t / (n + t * t);
            T y = n / (n + t * t);
            T a = 0.5f;
            T b = n / 2;
            T d2 = delta * delta;
            //
            // Calculate pdf:
            //
            T dt = n * t / (n * n + 2 * n * t * t + t * t * t * t);
            T result = non_central_beta_pdf(a, b, d2, x, y, pol);
            T tol = tools::epsilon<T>() * result * 500;
            result = non_central_t2_pdf(n, delta, x, y, pol, result);
            if(result <= tol)
               result = 0;
            result *= dt;
            return result;
         }

         template <class T, class Policy>
         T mean(T v, T delta, const Policy& pol)
         {
            BOOST_MATH_STD_USING
            return delta * sqrt(v / 2) * tgamma_delta_ratio((v - 1) * 0.5f, T(0.5f), pol);
         }

         template <class T, class Policy>
         T variance(T v, T delta, const Policy& pol)
         {
            T result = ((delta * delta + 1) * v) / (v - 2);
            T m = mean(v, delta, pol);
            result -= m * m;
            return result;
         }

         template <class T, class Policy>
         T skewness(T v, T delta, const Policy& pol)
         {
            BOOST_MATH_STD_USING
            T mean = boost::math::detail::mean(v, delta, pol);
            T l2 = delta * delta;
            T var = ((l2 + 1) * v) / (v - 2) - mean * mean;
            T result = -2 * var;
            result += v * (l2 + 2 * v - 3) / ((v - 3) * (v - 2));
            result *= mean;
            result /= pow(var, T(1.5f));
            return result;
         }

         template <class T, class Policy>
         T kurtosis_excess(T v, T delta, const Policy& pol)
         {
            BOOST_MATH_STD_USING
            T mean = boost::math::detail::mean(v, delta, pol);
            T l2 = delta * delta;
            T var = ((l2 + 1) * v) / (v - 2) - mean * mean;
            T result = -3 * var;
            result += v * (l2 * (v + 1) + 3 * (3 * v - 5)) / ((v - 3) * (v - 2));
            result *= -mean * mean;
            result += v * v * (l2 * l2 + 6 * l2 + 3) / ((v - 4) * (v - 2));
            result /= var * var;
            return result;
         }

#if 0
         //
         // This code is disabled, since there can be multiple answers to the
         // question, and it's not clear how to find the "right" one.
         //
         template <class RealType, class Policy>
         struct t_degrees_of_freedom_finder
         {
            t_degrees_of_freedom_finder(
               RealType delta_, RealType x_, RealType p_, bool c)
               : delta(delta_), x(x_), p(p_), comp(c) {}

            RealType operator()(const RealType& v)
            {
               non_central_t_distribution<RealType, Policy> d(v, delta);
               return comp ?
                  p - cdf(complement(d, x))
                  : cdf(d, x) - p;
            }
         private:
            RealType delta;
            RealType x;
            RealType p;
            bool comp;
         };

         template <class RealType, class Policy>
         inline RealType find_t_degrees_of_freedom(
            RealType delta, RealType x, RealType p, RealType q, const Policy& pol)
         {
            const char* function = "non_central_t<%1%>::find_degrees_of_freedom";
            if((p == 0) || (q == 0))
            {
               //
               // Can't a thing if one of p and q is zero:
               //
               return policies::raise_evaluation_error<RealType>(function,
                  "Can't find degrees of freedom when the probability is 0 or 1, only possible answer is %1%",
                  RealType(std::numeric_limits<RealType>::quiet_NaN()), Policy());
            }
            t_degrees_of_freedom_finder<RealType, Policy> f(delta, x, p < q ? p : q, p < q ? false : true);
            tools::eps_tolerance<RealType> tol(policies::digits<RealType, Policy>());
            boost::uintmax_t max_iter = policies::get_max_root_iterations<Policy>();
            //
            // Pick an initial guess:
            //
            RealType guess = 200;
            std::pair<RealType, RealType> ir = tools::bracket_and_solve_root(
               f, guess, RealType(2), false, tol, max_iter, pol);
            RealType result = ir.first + (ir.second - ir.first) / 2;
            if(max_iter >= policies::get_max_root_iterations<Policy>())
            {
               policies::raise_evaluation_error<RealType>(function, "Unable to locate solution in a reasonable time:"
                  " or there is no answer to problem.  Current best guess is %1%", result, Policy());
            }
            return result;
         }

         template <class RealType, class Policy>
         struct t_non_centrality_finder
         {
            t_non_centrality_finder(
               RealType v_, RealType x_, RealType p_, bool c)
               : v(v_), x(x_), p(p_), comp(c) {}

            RealType operator()(const RealType& delta)
            {
               non_central_t_distribution<RealType, Policy> d(v, delta);
               return comp ?
                  p - cdf(complement(d, x))
                  : cdf(d, x) - p;
            }
         private:
            RealType v;
            RealType x;
            RealType p;
            bool comp;
         };

         template <class RealType, class Policy>
         inline RealType find_t_non_centrality(
            RealType v, RealType x, RealType p, RealType q, const Policy& pol)
         {
            const char* function = "non_central_t<%1%>::find_t_non_centrality";
            if((p == 0) || (q == 0))
            {
               //
               // Can't do a thing if one of p and q is zero:
               //
               return policies::raise_evaluation_error<RealType>(function,
                  "Can't find non centrality parameter when the probability is 0 or 1, only possible answer is %1%",
                  RealType(std::numeric_limits<RealType>::quiet_NaN()), Policy());
            }
            t_non_centrality_finder<RealType, Policy> f(v, x, p < q ? p : q, p < q ? false : true);
            tools::eps_tolerance<RealType> tol(policies::digits<RealType, Policy>());
            boost::uintmax_t max_iter = policies::get_max_root_iterations<Policy>();
            //
            // Pick an initial guess that we know is the right side of
            // zero:
            //
            RealType guess;
            if(f(0) < 0)
               guess = 1;
            else
               guess = -1;
            std::pair<RealType, RealType> ir = tools::bracket_and_solve_root(
               f, guess, RealType(2), false, tol, max_iter, pol);
            RealType result = ir.first + (ir.second - ir.first) / 2;
            if(max_iter >= policies::get_max_root_iterations<Policy>())
            {
               policies::raise_evaluation_error<RealType>(function, "Unable to locate solution in a reasonable time:"
                  " or there is no answer to problem.  Current best guess is %1%", result, Policy());
            }
            return result;
         }
#endif
      } // namespace detail

      template <class RealType = double, class Policy = policies::policy<> >
      class non_central_t_distribution
      {
      public:
         typedef RealType value_type;
         typedef Policy policy_type;

         non_central_t_distribution(RealType v_, RealType lambda) : v(v_), ncp(lambda)
         {
            const char* function = "boost::math::non_central_t_distribution<%1%>::non_central_t_distribution(%1%,%1%)";
            RealType r;
            detail::check_df(
               function,
               v, &r, Policy());
            detail::check_finite(
               function,
               lambda,
               &r,
               Policy());
         } // non_central_t_distribution constructor.

         RealType degrees_of_freedom() const
         { // Private data getter function.
            return v;
         }
         RealType non_centrality() const
         { // Private data getter function.
            return ncp;
         }
#if 0
         //
         // This code is disabled, since there can be multiple answers to the
         // question, and it's not clear how to find the "right" one.
         //
         static RealType find_degrees_of_freedom(RealType delta, RealType x, RealType p)
         {
            const char* function = "non_central_t<%1%>::find_degrees_of_freedom";
            typedef typename policies::evaluation<RealType, Policy>::type value_type;
            typedef typename policies::normalise<
               Policy,
               policies::promote_float<false>,
               policies::promote_double<false>,
               policies::discrete_quantile<>,
               policies::assert_undefined<> >::type forwarding_policy;
            value_type result = detail::find_t_degrees_of_freedom(
               static_cast<value_type>(delta),
               static_cast<value_type>(x),
               static_cast<value_type>(p),
               static_cast<value_type>(1-p),
               forwarding_policy());
            return policies::checked_narrowing_cast<RealType, forwarding_policy>(
               result,
               function);
         }
         template <class A, class B, class C>
         static RealType find_degrees_of_freedom(const complemented3_type<A,B,C>& c)
         {
            const char* function = "non_central_t<%1%>::find_degrees_of_freedom";
            typedef typename policies::evaluation<RealType, Policy>::type value_type;
            typedef typename policies::normalise<
               Policy,
               policies::promote_float<false>,
               policies::promote_double<false>,
               policies::discrete_quantile<>,
               policies::assert_undefined<> >::type forwarding_policy;
            value_type result = detail::find_t_degrees_of_freedom(
               static_cast<value_type>(c.dist),
               static_cast<value_type>(c.param1),
               static_cast<value_type>(1-c.param2),
               static_cast<value_type>(c.param2),
               forwarding_policy());
            return policies::checked_narrowing_cast<RealType, forwarding_policy>(
               result,
               function);
         }
         static RealType find_non_centrality(RealType v, RealType x, RealType p)
         {
            const char* function = "non_central_t<%1%>::find_t_non_centrality";
            typedef typename policies::evaluation<RealType, Policy>::type value_type;
            typedef typename policies::normalise<
               Policy,
               policies::promote_float<false>,
               policies::promote_double<false>,
               policies::discrete_quantile<>,
               policies::assert_undefined<> >::type forwarding_policy;
            value_type result = detail::find_t_non_centrality(
               static_cast<value_type>(v),
               static_cast<value_type>(x),
               static_cast<value_type>(p),
               static_cast<value_type>(1-p),
               forwarding_policy());
            return policies::checked_narrowing_cast<RealType, forwarding_policy>(
               result,
               function);
         }
         template <class A, class B, class C>
         static RealType find_non_centrality(const complemented3_type<A,B,C>& c)
         {
            const char* function = "non_central_t<%1%>::find_t_non_centrality";
            typedef typename policies::evaluation<RealType, Policy>::type value_type;
            typedef typename policies::normalise<
               Policy,
               policies::promote_float<false>,
               policies::promote_double<false>,
               policies::discrete_quantile<>,
               policies::assert_undefined<> >::type forwarding_policy;
            value_type result = detail::find_t_non_centrality(
               static_cast<value_type>(c.dist),
               static_cast<value_type>(c.param1),
               static_cast<value_type>(1-c.param2),
               static_cast<value_type>(c.param2),
               forwarding_policy());
            return policies::checked_narrowing_cast<RealType, forwarding_policy>(
               result,
               function);
         }
#endif
      private:
         // Data member, initialized by constructor.
         RealType v;   // degrees of freedom
         RealType ncp; // non-centrality parameter
      }; // template <class RealType, class Policy> class non_central_t_distribution

      typedef non_central_t_distribution<double> non_central_t; // Reserved name of type double.

      // Non-member functions to give properties of the distribution.

      template <class RealType, class Policy>
      inline const std::pair<RealType, RealType> range(const non_central_t_distribution<RealType, Policy>& /* dist */)
      { // Range of permissible values for random variable k.
         using boost::math::tools::max_value;
         return std::pair<RealType, RealType>(-max_value<RealType>(), max_value<RealType>());
      }

      template <class RealType, class Policy>
      inline const std::pair<RealType, RealType> support(const non_central_t_distribution<RealType, Policy>& /* dist */)
      { // Range of supported values for random variable k.
         // This is range where cdf rises from 0 to 1, and outside it, the pdf is zero.
         using boost::math::tools::max_value;
         return std::pair<RealType, RealType>(-max_value<RealType>(), max_value<RealType>());
      }

      template <class RealType, class Policy>
      inline RealType mode(const non_central_t_distribution<RealType, Policy>& dist)
      { // mode.
         static const char* function = "mode(non_central_t_distribution<%1%> const&)";
         RealType v = dist.degrees_of_freedom();
         RealType l = dist.non_centrality();
         RealType r;
         if(!detail::check_df(
            function,
            v, &r, Policy())
            ||
         !detail::check_finite(
            function,
            l,
            &r,
            Policy()))
               return (RealType)r;

         BOOST_MATH_STD_USING

         RealType m = v < 3 ? 0 : detail::mean(v, l, Policy());
         RealType var = v < 4 ? 1 : detail::variance(v, l, Policy());

         return detail::generic_find_mode(
            dist,
            m,
            function,
            sqrt(var));
      }

      template <class RealType, class Policy>
      inline RealType mean(const non_central_t_distribution<RealType, Policy>& dist)
      {
         BOOST_MATH_STD_USING
         const char* function = "mean(const non_central_t_distribution<%1%>&)";
         typedef typename policies::evaluation<RealType, Policy>::type value_type;
         typedef typename policies::normalise<
            Policy,
            policies::promote_float<false>,
            policies::promote_double<false>,
            policies::discrete_quantile<>,
            policies::assert_undefined<> >::type forwarding_policy;
         RealType v = dist.degrees_of_freedom();
         RealType l = dist.non_centrality();
         RealType r;
         if(!detail::check_df(
            function,
            v, &r, Policy())
            ||
         !detail::check_finite(
            function,
            l,
            &r,
            Policy()))
               return (RealType)r;
         if(v <= 1)
            return policies::raise_domain_error<RealType>(
               function,
               "The non central t distribution has no defined mean for degrees of freedom <= 1: got v=%1%.", v, Policy());
         // return l * sqrt(v / 2) * tgamma_delta_ratio((v - 1) * 0.5f, RealType(0.5f));
         return policies::checked_narrowing_cast<RealType, forwarding_policy>(
            detail::mean(static_cast<value_type>(v), static_cast<value_type>(l), forwarding_policy()), function);

      } // mean

      template <class RealType, class Policy>
      inline RealType variance(const non_central_t_distribution<RealType, Policy>& dist)
      { // variance.
         const char* function = "variance(const non_central_t_distribution<%1%>&)";
         typedef typename policies::evaluation<RealType, Policy>::type value_type;
         typedef typename policies::normalise<
            Policy,
            policies::promote_float<false>,
            policies::promote_double<false>,
            policies::discrete_quantile<>,
            policies::assert_undefined<> >::type forwarding_policy;
         BOOST_MATH_STD_USING
         RealType v = dist.degrees_of_freedom();
         RealType l = dist.non_centrality();
         RealType r;
         if(!detail::check_df(
            function,
            v, &r, Policy())
            ||
         !detail::check_finite(
            function,
            l,
            &r,
            Policy()))
               return (RealType)r;
         if(v <= 2)
            return policies::raise_domain_error<RealType>(
               function,
               "The non central t distribution has no defined variance for degrees of freedom <= 2: got v=%1%.", v, Policy());
         return policies::checked_narrowing_cast<RealType, forwarding_policy>(
            detail::variance(static_cast<value_type>(v), static_cast<value_type>(l), forwarding_policy()), function);
      }

      // RealType standard_deviation(const non_central_t_distribution<RealType, Policy>& dist)
      // standard_deviation provided by derived accessors.

      template <class RealType, class Policy>
      inline RealType skewness(const non_central_t_distribution<RealType, Policy>& dist)
      { // skewness = sqrt(l).
         const char* function = "skewness(const non_central_t_distribution<%1%>&)";
         typedef typename policies::evaluation<RealType, Policy>::type value_type;
         typedef typename policies::normalise<
            Policy,
            policies::promote_float<false>,
            policies::promote_double<false>,
            policies::discrete_quantile<>,
            policies::assert_undefined<> >::type forwarding_policy;
         RealType v = dist.degrees_of_freedom();
         RealType l = dist.non_centrality();
         RealType r;
         if(!detail::check_df(
            function,
            v, &r, Policy())
            ||
         !detail::check_finite(
            function,
            l,
            &r,
            Policy()))
               return (RealType)r;
         if(v <= 3)
            return policies::raise_domain_error<RealType>(
               function,
               "The non central t distribution has no defined skewness for degrees of freedom <= 3: got v=%1%.", v, Policy());;
         return policies::checked_narrowing_cast<RealType, forwarding_policy>(
            detail::skewness(static_cast<value_type>(v), static_cast<value_type>(l), forwarding_policy()), function);
      }

      template <class RealType, class Policy>
      inline RealType kurtosis_excess(const non_central_t_distribution<RealType, Policy>& dist)
      {
         const char* function = "kurtosis_excess(const non_central_t_distribution<%1%>&)";
         typedef typename policies::evaluation<RealType, Policy>::type value_type;
         typedef typename policies::normalise<
            Policy,
            policies::promote_float<false>,
            policies::promote_double<false>,
            policies::discrete_quantile<>,
            policies::assert_undefined<> >::type forwarding_policy;
         RealType v = dist.degrees_of_freedom();
         RealType l = dist.non_centrality();
         RealType r;
         if(!detail::check_df(
            function,
            v, &r, Policy())
            ||
         !detail::check_finite(
            function,
            l,
            &r,
            Policy()))
               return (RealType)r;
         if(v <= 4)
            return policies::raise_domain_error<RealType>(
               function,
               "The non central t distribution has no defined kurtosis for degrees of freedom <= 4: got v=%1%.", v, Policy());;
         return policies::checked_narrowing_cast<RealType, forwarding_policy>(
            detail::kurtosis_excess(static_cast<value_type>(v), static_cast<value_type>(l), forwarding_policy()), function);
      } // kurtosis_excess

      template <class RealType, class Policy>
      inline RealType kurtosis(const non_central_t_distribution<RealType, Policy>& dist)
      {
         return kurtosis_excess(dist) + 3;
      }

      template <class RealType, class Policy>
      inline RealType pdf(const non_central_t_distribution<RealType, Policy>& dist, const RealType& t)
      { // Probability Density/Mass Function.
         const char* function = "cdf(non_central_t_distribution<%1%>, %1%)";
         typedef typename policies::evaluation<RealType, Policy>::type value_type;
         typedef typename policies::normalise<
            Policy,
            policies::promote_float<false>,
            policies::promote_double<false>,
            policies::discrete_quantile<>,
            policies::assert_undefined<> >::type forwarding_policy;

         RealType v = dist.degrees_of_freedom();
         RealType l = dist.non_centrality();
         RealType r;
         if(!detail::check_df(
            function,
            v, &r, Policy())
            ||
         !detail::check_finite(
            function,
            l,
            &r,
            Policy())
            ||
         !detail::check_x(
            function,
            t,
            &r,
            Policy()))
               return (RealType)r;
         return policies::checked_narrowing_cast<RealType, forwarding_policy>(
            detail::non_central_t_pdf(static_cast<value_type>(v),
               static_cast<value_type>(l),
               static_cast<value_type>(t),
               Policy()),
            function);
      } // pdf

      template <class RealType, class Policy>
      RealType cdf(const non_central_t_distribution<RealType, Policy>& dist, const RealType& x)
      {
         const char* function = "boost::math::non_central_t_distribution<%1%>::cdf(%1%)";
         typedef typename policies::evaluation<RealType, Policy>::type value_type;
         typedef typename policies::normalise<
            Policy,
            policies::promote_float<false>,
            policies::promote_double<false>,
            policies::discrete_quantile<>,
            policies::assert_undefined<> >::type forwarding_policy;

         RealType v = dist.degrees_of_freedom();
         RealType l = dist.non_centrality();
         RealType r;
         if(!detail::check_df(
            function,
            v, &r, Policy())
            ||
         !detail::check_finite(
            function,
            l,
            &r,
            Policy())
            ||
         !detail::check_x(
            function,
            x,
            &r,
            Policy()))
               return (RealType)r;

         if(l == 0)
            return cdf(students_t_distribution<RealType, Policy>(v), x);

         return policies::checked_narrowing_cast<RealType, forwarding_policy>(
            detail::non_central_t_cdf(
               static_cast<value_type>(v),
               static_cast<value_type>(l),
               static_cast<value_type>(x),
               false, Policy()),
            function);
      } // cdf

      template <class RealType, class Policy>
      RealType cdf(const complemented2_type<non_central_t_distribution<RealType, Policy>, RealType>& c)
      { // Complemented Cumulative Distribution Function
         const char* function = "boost::math::non_central_t_distribution<%1%>::cdf(%1%)";
         typedef typename policies::evaluation<RealType, Policy>::type value_type;
         typedef typename policies::normalise<
            Policy,
            policies::promote_float<false>,
            policies::promote_double<false>,
            policies::discrete_quantile<>,
            policies::assert_undefined<> >::type forwarding_policy;

         non_central_t_distribution<RealType, Policy> const& dist = c.dist;
         RealType x = c.param;
         RealType v = dist.degrees_of_freedom();
         RealType l = dist.non_centrality();
         RealType r;
         if(!detail::check_df(
            function,
            v, &r, Policy())
            ||
         !detail::check_finite(
            function,
            l,
            &r,
            Policy())
            ||
         !detail::check_x(
            function,
            x,
            &r,
            Policy()))
               return (RealType)r;

         if(l == 0)
            return cdf(complement(students_t_distribution<RealType, Policy>(v), x));

         return policies::checked_narrowing_cast<RealType, forwarding_policy>(
            detail::non_central_t_cdf(
               static_cast<value_type>(v),
               static_cast<value_type>(l),
               static_cast<value_type>(x),
               true, Policy()),
            function);
      } // ccdf

      template <class RealType, class Policy>
      inline RealType quantile(const non_central_t_distribution<RealType, Policy>& dist, const RealType& p)
      { // Quantile (or Percent Point) function.
         RealType v = dist.degrees_of_freedom();
         RealType l = dist.non_centrality();
         return detail::non_central_t_quantile(v, l, p, 1-p, Policy());
      } // quantile

      template <class RealType, class Policy>
      inline RealType quantile(const complemented2_type<non_central_t_distribution<RealType, Policy>, RealType>& c)
      { // Quantile (or Percent Point) function.
         non_central_t_distribution<RealType, Policy> const& dist = c.dist;
         RealType q = c.param;
         RealType v = dist.degrees_of_freedom();
         RealType l = dist.non_centrality();
         return detail::non_central_t_quantile(v, l, 1-q, q, Policy());
      } // quantile complement.

   } // namespace math
} // namespace boost

// This include must be at the end, *after* the accessors
// for this distribution have been defined, in order to
// keep compilers that support two-phase lookup happy.
#include <boost/math/distributions/detail/derived_accessors.hpp>

#endif // BOOST_MATH_SPECIAL_NON_CENTRAL_T_HPP