text:
/*
 * @(#)MmeTraceStandards.java        1.0 09/12/14
 *
 * This file has been auto-generated by JNC, the
 * Java output format plug-in of pyang.
 * Origin: module "hcta-epc", revision: "2014-09-18".
 */

package hctaEpc.mmeSgsn.trace;
import .ietfInetTypes.Ipv4Address;

import Element;

import Epc;

import JNCException;

import Leaf;

import YangEnumeration;

import YangString;

import com.tailf.jnc.YangElement;

/**
 * This class represents an element from
 * the namespace http://hitachi-cta.com/ns/epc
 * generated to "src/hctaEpc/mmeSgsn/trace/mme-trace-standards"
 * <p>
 * See line 2335 in
 * scConfig.yang
 *
 * @version 1.0 2014-12-09
 * @author Auto Generated
 */
public class MmeTraceStandards extends YangElement {

    private static final long serialVersionUID = 1L;

    /**
     * Constructor for an empty MmeTraceStandards object.
     */
    public MmeTraceStandards() {
        super(Epc.NAMESPACE, "mme-trace-standards");
    }

    /**
     * Constructor for an initialized MmeTraceStandards object,
     *
     * @param targetTypeValue Key argument of child.
     * @param targetValueValue Key argument of child.
     */
    public MmeTraceStandards(YangEnumeration targetTypeValue, YangString targetValueValue)
            throws JNCException {
        super(Epc.NAMESPACE, "mme-trace-standards");
        Leaf targetType = new Leaf(Epc.NAMESPACE, "target-type");
        targetType.setValue(targetTypeValue);
        insertChild(targetType, childrenNames());
        Leaf targetValue = new Leaf(Epc.NAMESPACE, "target-value");
        targetValue.setValue(targetValueValue);
        insertChild(targetValue, childrenNames());
    }

    /**
     * Constructor for an initialized MmeTraceStandards object,
     * with String keys.
     * @param targetTypeValue Key argument of child.
     * @param targetValueValue Key argument of child.
     */
    public MmeTraceStandards(String targetTypeValue, String targetValueValue)
            throws JNCException {
        super(Epc.NAMESPACE, "mme-trace-standards");
        Leaf targetType = new Leaf(Epc.NAMESPACE, "target-type");
        targetType.setValue(new YangEnumeration(targetTypeValue, new String [] {"imsi", "imei", "imeisv", }));
        insertChild(targetType, childrenNames());
        Leaf targetValue = new Leaf(Epc.NAMESPACE, "target-value");
        targetValue.setValue(new YangString(targetValueValue));
        insertChild(targetValue, childrenNames());
    }

    /**
     * Clones this object, returning an exact copy.
     * @return A clone of the object.
     */
    public MmeTraceStandards clone() {
        MmeTraceStandards copy;
        try {
            copy = new MmeTraceStandards(getTargetTypeValue().toString(), getTargetValueValue().toString());
        } catch (JNCException e) {
            copy = null;
        }
        return (MmeTraceStandards)cloneContent(copy);
    }

    /**
     * Clones this object, returning a shallow copy.
     * @return A clone of the object. Children are not included.
     */
    public MmeTraceStandards cloneShallow() {
        MmeTraceStandards copy;
        try {
            copy = new MmeTraceStandards(getTargetTypeValue().toString(), getTargetValueValue().toString());
        } catch (JNCException e) {
            copy = null;
        }
        return (MmeTraceStandards)cloneShallowContent(copy);
    }

    /**
     * @return An array with the identifiers of any key children
     */
    public String[] keyNames() {
        return new String[] {
            "target-type",
            "target-value",
        };
    }

    /**
     * @return An array with the identifiers of any children, in order.
     */
    public String[] childrenNames() {
        return new String[] {
            "target-type",
            "target-value",
            "session-id",
            "mme-interface-mask",
            "mme-event-mask",
            "enb-interface-mask",
            "sgw-interface-mask",
            "sgw-event-mask",
            "pgw-interface-mask",
            "pgw-event-mask",
            "trace-depth",
            "nms-ip",
        };
    }

    /* Access methods for leaf child: "target-type". */

    /**
     * Gets the value for child leaf "target-type".
     * @return The value of the leaf.
     */
    public YangEnumeration getTargetTypeValue() throws JNCException {
        return (YangEnumeration)getValue("target-type");
    }

    /**
     * Sets the value for child leaf "target-type",
     * using instance of generated typedef class.
     * @param targetTypeValue The value to set.
     * @param targetTypeValue used during instantiation.
     */
    public void setTargetTypeValue(YangEnumeration targetTypeValue)
            throws JNCException {
        setLeafValue(Epc.NAMESPACE,
            "target-type",
            targetTypeValue,
            childrenNames());
    }

    /**
     * Sets the value for child leaf "target-type",
     * using a String value.
     * @param targetTypeValue used during instantiation.
     */
    public void setTargetTypeValue(String targetTypeValue) throws JNCException {
        setTargetTypeValue(new YangEnumeration(targetTypeValue, new String[] {
             "imsi",
             "imei",
             "imeisv",
        }));
    }

    /**
     * This method is used for creating a subtree filter.
     * The added "target-type" leaf will not have a value.
     */
    public void addTargetType() throws JNCException {
        setLeafValue(Epc.NAMESPACE,
            "target-type",
            null,
            childrenNames());
    }

    /* Access methods for leaf child: "target-value". */

    /**
     * Gets the value for child leaf "target-value".
     * @return The value of the leaf.
     */
    public YangString getTargetValueValue() throws JNCException {
        return (YangString)getValue("target-value");
    }

    /**
     * Sets the value for child leaf "target-value",
     * using instance of generated typedef class.
     * @param targetValueValue The value to set.
     * @param targetValueValue used during instantiation.
     */
    public void setTargetValueValue(YangString targetValueValue)
            throws JNCException {
        setLeafValue(Epc.NAMESPACE,
            "target-value",
            targetValueValue,
            childrenNames());
    }

    /**
     * Sets the value for child leaf "target-value",
     * using a String value.
     * @param targetValueValue used during instantiation.
     */
    public void setTargetValueValue(String targetValueValue)
            throws JNCException {
        setTargetValueValue(new YangString(targetValueValue));
    }

    /**
     * This method is used for creating a subtree filter.
     * The added "target-value" leaf will not have a value.
     */
    public void addTargetValue() throws JNCException {
        setLeafValue(Epc.NAMESPACE,
            "target-value",
            null,
            childrenNames());
    }

    /* Access methods for optional leaf child: "session-id". */

    /**
     * Gets the value for child leaf "session-id".
     * @return The value of the leaf.
     */
    public YangString getSessionIdValue() throws JNCException {
        return (YangString)getValue("session-id");
    }

    /**
     * Sets the value for child leaf "session-id",
     * using instance of generated typedef class.
     * @param sessionIdValue The value to set.
     * @param sessionIdValue used during instantiation.
     */
    public void setSessionIdValue(YangString sessionIdValue)
            throws JNCException {
        setLeafValue(Epc.NAMESPACE,
            "session-id",
            sessionIdValue,
            childrenNames());
    }

    /**
     * Sets the value for child leaf "session-id",
     * using a String value.
     * @param sessionIdValue used during instantiation.
     */
    public void setSessionIdValue(String sessionIdValue) throws JNCException {
        setSessionIdValue(new YangString(sessionIdValue));
    }

    /**
     * Unsets the value for child leaf "session-id".
     */
    public void unsetSessionIdValue() throws JNCException {
        delete("session-id");
    }

    /**
     * This method is used for creating a subtree filter.
     * The added "session-id" leaf will not have a value.
     */
    public void addSessionId() throws JNCException {
        setLeafValue(Epc.NAMESPACE,
            "session-id",
            null,
            childrenNames());
    }

    /**
     * Marks the leaf "session-id" with operation "replace".
     */
    public void markSessionIdReplace() throws JNCException {
        markLeafReplace("sessionId");
    }

    /**
     * Marks the leaf "session-id" with operation "merge".
     */
    public void markSessionIdMerge() throws JNCException {
        markLeafMerge("sessionId");
    }

    /**
     * Marks the leaf "session-id" with operation "create".
     */
    public void markSessionIdCreate() throws JNCException {
        markLeafCreate("sessionId");
    }

    /**
     * Marks the leaf "session-id" with operation "delete".
     */
    public void markSessionIdDelete() throws JNCException {
        markLeafDelete("sessionId");
    }

    /* Access methods for optional leaf child: "mme-interface-mask". */

    /**
     * Gets the value for child leaf "mme-interface-mask".
     * @return The value of the leaf.
     */
    public YangString getMmeInterfaceMaskValue() throws JNCException {
        YangString mmeInterfaceMask = (YangString)getValue("mme-interface-mask");
        if (mmeInterfaceMask == null) {
            mmeInterfaceMask = new YangString("s11,s10,s6a,s1,s13,s3");  // default
        }
        return mmeInterfaceMask;
    }

    /**
     * Sets the value for child leaf "mme-interface-mask",
     * using instance of generated typedef class.
     * @param mmeInterfaceMaskValue The value to set.
     * @param mmeInterfaceMaskValue used during instantiation.
     */
    public void setMmeInterfaceMaskValue(YangString mmeInterfaceMaskValue)
            throws JNCException {
        setLeafValue(Epc.NAMESPACE,
            "mme-interface-mask",
            mmeInterfaceMaskValue,
            childrenNames());
    }

    /**
     * Sets the value for child leaf "mme-interface-mask",
     * using a String value.
     * @param mmeInterfaceMaskValue used during instantiation.
     */
    public void setMmeInterfaceMaskValue(String mmeInterfaceMaskValue)
            throws JNCException {
        setMmeInterfaceMaskValue(new YangString(mmeInterfaceMaskValue));
    }

    /**
     * Unsets the value for child leaf "mme-interface-mask".
     */
    public void unsetMmeInterfaceMaskValue() throws JNCException {
        delete("mme-interface-mask");
    }

    /**
     * This method is used for creating a subtree filter.
     * The added "mme-interface-mask" leaf will not have a value.
     */
    public void addMmeInterfaceMask() throws JNCException {
        setLeafValue(Epc.NAMESPACE,
            "mme-interface-mask",
            null,
            childrenNames());
    }

    /**
     * Marks the leaf "mme-interface-mask" with operation "replace".
     */
    public void markMmeInterfaceMaskReplace() throws JNCException {
        markLeafReplace("mmeInterfaceMask");
    }

    /**
     * Marks the leaf "mme-interface-mask" with operation "merge".
     */
    public void markMmeInterfaceMaskMerge() throws JNCException {
        markLeafMerge("mmeInterfaceMask");
    }

    /**
     * Marks the leaf "mme-interface-mask" with operation "create".
     */
    public void markMmeInterfaceMaskCreate() throws JNCException {
        markLeafCreate("mmeInterfaceMask");
    }

    /**
     * Marks the leaf "mme-interface-mask" with operation "delete".
     */
    public void markMmeInterfaceMaskDelete() throws JNCException {
        markLeafDelete("mmeInterfaceMask");
    }

    /* Access methods for optional leaf child: "mme-event-mask". */

    /**
     * Gets the value for child leaf "mme-event-mask".
     * @return The value of the leaf.
     */
    public YangString getMmeEventMaskValue() throws JNCException {
        YangString mmeEventMask = (YangString)getValue("mme-event-mask");
        if (mmeEventMask == null) {
            mmeEventMask = new YangString("handover,bearer-act-mod-del,ue-pdn-disconn,att-tau-det,svc-req,ue-pdn-conn");  // default
        }
        return mmeEventMask;
    }

    /**
     * Sets the value for child leaf "mme-event-mask",
     * using instance of generated typedef class.
     * @param mmeEventMaskValue The value to set.
     * @param mmeEventMaskValue used during instantiation.
     */
    public void setMmeEventMaskValue(YangString mmeEventMaskValue)
            throws JNCException {
        setLeafValue(Epc.NAMESPACE,
            "mme-event-mask",
            mmeEventMaskValue,
            childrenNames());
    }

    /**
     * Sets the value for child leaf "mme-event-mask",
     * using a String value.
     * @param mmeEventMaskValue used during instantiation.
     */
    public void setMmeEventMaskValue(String mmeEventMaskValue)
            throws JNCException {
        setMmeEventMaskValue(new YangString(mmeEventMaskValue));
    }

    /**
     * Unsets the value for child leaf "mme-event-mask".
     */
    public void unsetMmeEventMaskValue() throws JNCException {
        delete("mme-event-mask");
    }

    /**
     * This method is used for creating a subtree filter.
     * The added "mme-event-mask" leaf will not have a value.
     */
    public void addMmeEventMask() throws JNCException {
        setLeafValue(Epc.NAMESPACE,
            "mme-event-mask",
            null,
            childrenNames());
    }

    /**
     * Marks the leaf "mme-event-mask" with operation "replace".
     */
    public void markMmeEventMaskReplace() throws JNCException {
        markLeafReplace("mmeEventMask");
    }

    /**
     * Marks the leaf "mme-event-mask" with operation "merge".
     */
    public void markMmeEventMaskMerge() throws JNCException {
        markLeafMerge("mmeEventMask");
    }

    /**
     * Marks the leaf "mme-event-mask" with operation "create".
     */
    public void markMmeEventMaskCreate() throws JNCException {
        markLeafCreate("mmeEventMask");
    }

    /**
     * Marks the leaf "mme-event-mask" with operation "delete".
     */
    public void markMmeEventMaskDelete() throws JNCException {
        markLeafDelete("mmeEventMask");
    }

    /* Access methods for optional leaf child: "enb-interface-mask". */

    /**
     * Gets the value for child leaf "enb-interface-mask".
     * @return The value of the leaf.
     */
    public YangString getEnbInterfaceMaskValue() throws JNCException {
        YangString enbInterfaceMask = (YangString)getValue("enb-interface-mask");
        if (enbInterfaceMask == null) {
            enbInterfaceMask = new YangString("off");  // default
        }
        return enbInterfaceMask;
    }

    /**
     * Sets the value for child leaf "enb-interface-mask",
     * using instance of generated typedef class.
     * @param enbInterfaceMaskValue The value to set.
     * @param enbInterfaceMaskValue used during instantiation.
     */
    public void setEnbInterfaceMaskValue(YangString enbInterfaceMaskValue)
            throws JNCException {
        setLeafValue(Epc.NAMESPACE,
            "enb-interface-mask",
            enbInterfaceMaskValue,
            childrenNames());
    }

    /**
     * Sets the value for child leaf "enb-interface-mask",
     * using a String value.
     * @param enbInterfaceMaskValue used during instantiation.
     */
    public void setEnbInterfaceMaskValue(String enbInterfaceMaskValue)
            throws JNCException {
        setEnbInterfaceMaskValue(new YangString(enbInterfaceMaskValue));
    }

    /**
     * Unsets the value for child leaf "enb-interface-mask".
     */
    public void unsetEnbInterfaceMaskValue() throws JNCException {
        delete("enb-interface-mask");
    }

    /**
     * This method is used for creating a subtree filter.
     * The added "enb-interface-mask" leaf will not have a value.
     */
    public void addEnbInterfaceMask() throws JNCException {
        setLeafValue(Epc.NAMESPACE,
            "enb-interface-mask",
            null,
            childrenNames());
    }

    /**
     * Marks the leaf "enb-interface-mask" with operation "replace".
     */
    public void markEnbInterfaceMaskReplace() throws JNCException {
        markLeafReplace("enbInterfaceMask");
    }

    /**
     * Marks the leaf "enb-interface-mask" with operation "merge".
     */
    public void markEnbInterfaceMaskMerge() throws JNCException {
        markLeafMerge("enbInterfaceMask");
    }

    /**
     * Marks the leaf "enb-interface-mask" with operation "create".
     */
    public void markEnbInterfaceMaskCreate() throws JNCException {
        markLeafCreate("enbInterfaceMask");
    }

    /**
     * Marks the leaf "enb-interface-mask" with operation "delete".
     */
    public void markEnbInterfaceMaskDelete() throws JNCException {
        markLeafDelete("enbInterfaceMask");
    }

    /* Access methods for optional leaf child: "sgw-interface-mask". */

    /**
     * Gets the value for child leaf "sgw-interface-mask".
     * @return The value of the leaf.
     */
    public YangString getSgwInterfaceMaskValue() throws JNCException {
        YangString sgwInterfaceMask = (YangString)getValue("sgw-interface-mask");
        if (sgwInterfaceMask == null) {
            sgwInterfaceMask = new YangString("off");  // default
        }
        return sgwInterfaceMask;
    }

    /**
     * Sets the value for child leaf "sgw-interface-mask",
     * using instance of generated typedef class.
     * @param sgwInterfaceMaskValue The value to set.
     * @param sgwInterfaceMaskValue used during instantiation.
     */
    public void setSgwInterfaceMaskValue(YangString sgwInterfaceMaskValue)
            throws JNCException {
        setLeafValue(Epc.NAMESPACE,
            "sgw-interface-mask",
            sgwInterfaceMaskValue,
            childrenNames());
    }

    /**
     * Sets the value for child leaf "sgw-interface-mask",
     * using a String value.
     * @param sgwInterfaceMaskValue used during instantiation.
     */
    public void setSgwInterfaceMaskValue(String sgwInterfaceMaskValue)
            throws JNCException {
        setSgwInterfaceMaskValue(new YangString(sgwInterfaceMaskValue));
    }

    /**
     * Unsets the value for child leaf "sgw-interface-mask".
     */
    public void unsetSgwInterfaceMaskValue() throws JNCException {
        delete("sgw-interface-mask");
    }

    /**
     * This method is used for creating a subtree filter.
     * The added "sgw-interface-mask" leaf will not have a value.
     */
    public void addSgwInterfaceMask() throws JNCException {
        setLeafValue(Epc.NAMESPACE,
            "sgw-interface-mask",
            null,
            childrenNames());
    }

    /**
     * Marks the leaf "sgw-interface-mask" with operation "replace".
     */
    public void markSgwInterfaceMaskReplace() throws JNCException {
        markLeafReplace("sgwInterfaceMask");
    }

    /**
     * Marks the leaf "sgw-interface-mask" with operation "merge".
     */
    public void markSgwInterfaceMaskMerge() throws JNCException {
        markLeafMerge("sgwInterfaceMask");
    }

    /**
     * Marks the leaf "sgw-interface-mask" with operation "create".
     */
    public void markSgwInterfaceMaskCreate() throws JNCException {
        markLeafCreate("sgwInterfaceMask");
    }

    /**
     * Marks the leaf "sgw-interface-mask" with operation "delete".
     */
    public void markSgwInterfaceMaskDelete() throws JNCException {
        markLeafDelete("sgwInterfaceMask");
    }

    /* Access methods for optional leaf child: "sgw-event-mask". */

    /**
     * Gets the value for child leaf "sgw-event-mask".
     * @return The value of the leaf.
     */
    public YangString getSgwEventMaskValue() throws JNCException {
        YangString sgwEventMask = (YangString)getValue("sgw-event-mask");
        if (sgwEventMask == null) {
            sgwEventMask = new YangString("none");  // default
        }
        return sgwEventMask;
    }

    /**
     * Sets the value for child leaf "sgw-event-mask",
     * using instance of generated typedef class.
     * @param sgwEventMaskValue The value to set.
     * @param sgwEventMaskValue used during instantiation.
     */
    public void setSgwEventMaskValue(YangString sgwEventMaskValue)
            throws JNCException {
        setLeafValue(Epc.NAMESPACE,
            "sgw-event-mask",
            sgwEventMaskValue,
            childrenNames());
    }

    /**
     * Sets the value for child leaf "sgw-event-mask",
     * using a String value.
     * @param sgwEventMaskValue used during instantiation.
     */
    public void setSgwEventMaskValue(String sgwEventMaskValue)
            throws JNCException {
        setSgwEventMaskValue(new YangString(sgwEventMaskValue));
    }

    /**
     * Unsets the value for child leaf "sgw-event-mask".
     */
    public void unsetSgwEventMaskValue() throws JNCException {
        delete("sgw-event-mask");
    }

    /**
     * This method is used for creating a subtree filter.
     * The added "sgw-event-mask" leaf will not have a value.
     */
    public void addSgwEventMask() throws JNCException {
        setLeafValue(Epc.NAMESPACE,
            "sgw-event-mask",
            null,
            childrenNames());
    }

    /**
     * Marks the leaf "sgw-event-mask" with operation "replace".
     */
    public void markSgwEventMaskReplace() throws JNCException {
        markLeafReplace("sgwEventMask");
    }

    /**
     * Marks the leaf "sgw-event-mask" with operation "merge".
     */
    public void markSgwEventMaskMerge() throws JNCException {
        markLeafMerge("sgwEventMask");
    }

    /**
     * Marks the leaf "sgw-event-mask" with operation "create".
     */
    public void markSgwEventMaskCreate() throws JNCException {
        markLeafCreate("sgwEventMask");
    }

    /**
     * Marks the leaf "sgw-event-mask" with operation "delete".
     */
    public void markSgwEventMaskDelete() throws JNCException {
        markLeafDelete("sgwEventMask");
    }

    /* Access methods for optional leaf child: "pgw-interface-mask". */

    /**
     * Gets the value for child leaf "pgw-interface-mask".
     * @return The value of the leaf.
     */
    public YangString getPgwInterfaceMaskValue() throws JNCException {
        YangString pgwInterfaceMask = (YangString)getValue("pgw-interface-mask");
        if (pgwInterfaceMask == null) {
            pgwInterfaceMask = new YangString("off");  // default
        }
        return pgwInterfaceMask;
    }

    /**
     * Sets the value for child leaf "pgw-interface-mask",
     * using instance of generated typedef class.
     * @param pgwInterfaceMaskValue The value to set.
     * @param pgwInterfaceMaskValue used during instantiation.
     */
    public void setPgwInterfaceMaskValue(YangString pgwInterfaceMaskValue)
            throws JNCException {
        setLeafValue(Epc.NAMESPACE,
            "pgw-interface-mask",
            pgwInterfaceMaskValue,
            childrenNames());
    }

    /**
     * Sets the value for child leaf "pgw-interface-mask",
     * using a String value.
     * @param pgwInterfaceMaskValue used during instantiation.
     */
    public void setPgwInterfaceMaskValue(String pgwInterfaceMaskValue)
            throws JNCException {
        setPgwInterfaceMaskValue(new YangString(pgwInterfaceMaskValue));
    }

    /**
     * Unsets the value for child leaf "pgw-interface-mask".
     */
    public void unsetPgwInterfaceMaskValue() throws JNCException {
        delete("pgw-interface-mask");
    }

    /**
     * This method is used for creating a subtree filter.
     * The added "pgw-interface-mask" leaf will not have a value.
     */
    public void addPgwInterfaceMask() throws JNCException {
        setLeafValue(Epc.NAMESPACE,
            "pgw-interface-mask",
            null,
            childrenNames());
    }

    /**
     * Marks the leaf "pgw-interface-mask" with operation "replace".
     */
    public void markPgwInterfaceMaskReplace() throws JNCException {
        markLeafReplace("pgwInterfaceMask");
    }

    /**
     * Marks the leaf "pgw-interface-mask" with operation "merge".
     */
    public void markPgwInterfaceMaskMerge() throws JNCException {
        markLeafMerge("pgwInterfaceMask");
    }

    /**
     * Marks the leaf "pgw-interface-mask" with operation "create".
     */
    public void markPgwInterfaceMaskCreate() throws JNCException {
        markLeafCreate("pgwInterfaceMask");
    }

    /**
     * Marks the leaf "pgw-interface-mask" with operation "delete".
     */
    public void markPgwInterfaceMaskDelete() throws JNCException {
        markLeafDelete("pgwInterfaceMask");
    }

    /* Access methods for optional leaf child: "pgw-event-mask". */

    /**
     * Gets the value for child leaf "pgw-event-mask".
     * @return The value of the leaf.
     */
    public YangString getPgwEventMaskValue() throws JNCException {
        YangString pgwEventMask = (YangString)getValue("pgw-event-mask");
        if (pgwEventMask == null) {
            pgwEventMask = new YangString("none");  // default
        }
        return pgwEventMask;
    }

    /**
     * Sets the value for child leaf "pgw-event-mask",
     * using instance of generated typedef class.
     * @param pgwEventMaskValue The value to set.
     * @param pgwEventMaskValue used during instantiation.
     */
    public void setPgwEventMaskValue(YangString pgwEventMaskValue)
            throws JNCException {
        setLeafValue(Epc.NAMESPACE,
            "pgw-event-mask",
            pgwEventMaskValue,
            childrenNames());
    }

    /**
     * Sets the value for child leaf "pgw-event-mask",
     * using a String value.
     * @param pgwEventMaskValue used during instantiation.
     */
    public void setPgwEventMaskValue(String pgwEventMaskValue)
            throws JNCException {
        setPgwEventMaskValue(new YangString(pgwEventMaskValue));
    }

    /**
     * Unsets the value for child leaf "pgw-event-mask".
     */
    public void unsetPgwEventMaskValue() throws JNCException {
        delete("pgw-event-mask");
    }

    /**
     * This method is used for creating a subtree filter.
     * The added "pgw-event-mask" leaf will not have a value.
     */
    public void addPgwEventMask() throws JNCException {
        setLeafValue(Epc.NAMESPACE,
            "pgw-event-mask",
            null,
            childrenNames());
    }

    /**
     * Marks the leaf "pgw-event-mask" with operation "replace".
     */
    public void markPgwEventMaskReplace() throws JNCException {
        markLeafReplace("pgwEventMask");
    }

    /**
     * Marks the leaf "pgw-event-mask" with operation "merge".
     */
    public void markPgwEventMaskMerge() throws JNCException {
        markLeafMerge("pgwEventMask");
    }

    /**
     * Marks the leaf "pgw-event-mask" with operation "create".
     */
    public void markPgwEventMaskCreate() throws JNCException {
        markLeafCreate("pgwEventMask");
    }

    /**
     * Marks the leaf "pgw-event-mask" with operation "delete".
     */
    public void markPgwEventMaskDelete() throws JNCException {
        markLeafDelete("pgwEventMask");
    }

    /* Access methods for optional leaf child: "trace-depth". */

    /**
     * Gets the value for child leaf "trace-depth".
     * @return The value of the leaf.
     */
    public YangEnumeration getTraceDepthValue() throws JNCException {
        YangEnumeration traceDepth = (YangEnumeration)getValue("trace-depth");
        if (traceDepth == null) {
            traceDepth = new YangEnumeration("med", new String[] {  // default
                "min",
                "med",
                "max",
                "minnovs",
                "mednovs",
                "maxnovs",
            });
        }
        return traceDepth;
    }

    /**
     * Sets the value for child leaf "trace-depth",
     * using instance of generated typedef class.
     * @param traceDepthValue The value to set.
     * @param traceDepthValue used during instantiation.
     */
    public void setTraceDepthValue(YangEnumeration traceDepthValue)
            throws JNCException {
        setLeafValue(Epc.NAMESPACE,
            "trace-depth",
            traceDepthValue,
            childrenNames());
    }

    /**
     * Sets the value for child leaf "trace-depth",
     * using a String value.
     * @param traceDepthValue used during instantiation.
     */
    public void setTraceDepthValue(String traceDepthValue) throws JNCException {
        setTraceDepthValue(new YangEnumeration(traceDepthValue, new String[] {
             "min",
             "med",
             "max",
             "minnovs",
             "mednovs",
             "maxnovs",
        }));
    }

    /**
     * Unsets the value for child leaf "trace-depth".
     */
    public void unsetTraceDepthValue() throws JNCException {
        delete("trace-depth");
    }

    /**
     * This method is used for creating a subtree filter.
     * The added "trace-depth" leaf will not have a value.
     */
    public void addTraceDepth() throws JNCException {
        setLeafValue(Epc.NAMESPACE,
            "trace-depth",
            null,
            childrenNames());
    }

    /**
     * Marks the leaf "trace-depth" with operation "replace".
     */
    public void markTraceDepthReplace() throws JNCException {
        markLeafReplace("traceDepth");
    }

    /**
     * Marks the leaf "trace-depth" with operation "merge".
     */
    public void markTraceDepthMerge() throws JNCException {
        markLeafMerge("traceDepth");
    }

    /**
     * Marks the leaf "trace-depth" with operation "create".
     */
    public void markTraceDepthCreate() throws JNCException {
        markLeafCreate("traceDepth");
    }

    /**
     * Marks the leaf "trace-depth" with operation "delete".
     */
    public void markTraceDepthDelete() throws JNCException {
        markLeafDelete("traceDepth");
    }

    /* Access methods for optional leaf child: "nms-ip". */

    /**
     * Gets the value for child leaf "nms-ip".
     * @return The value of the leaf.
     */
    public Ipv4Address getNmsIpValue() throws JNCException {
        Ipv4Address nmsIp = (Ipv4Address)getValue("nms-ip");
        if (nmsIp == null) {
            nmsIp = new Ipv4Address("0.0.0.0");  // default
        }
        return nmsIp;
    }

    /**
     * Sets the value for child leaf "nms-ip",
     * using a JNC type value.
     * @param nmsIpValue The value to set.
     * @param nmsIpValue used during instantiation.
     */
    public void setNmsIpValue(Ipv4Address nmsIpValue) throws JNCException {
        setLeafValue(Epc.NAMESPACE,
            "nms-ip",
            nmsIpValue,
            childrenNames());
    }

    /**
     * Sets the value for child leaf "nms-ip",
     * using a String value.
     * @param nmsIpValue used during instantiation.
     */
    public void setNmsIpValue(String nmsIpValue) throws JNCException {
        setNmsIpValue(new Ipv4Address(nmsIpValue));
    }

    /**
     * Unsets the value for child leaf "nms-ip".
     */
    public void unsetNmsIpValue() throws JNCException {
        delete("nms-ip");
    }

    /**
     * This method is used for creating a subtree filter.
     * The added "nms-ip" leaf will not have a value.
     */
    public void addNmsIp() throws JNCException {
        setLeafValue(Epc.NAMESPACE,
            "nms-ip",
            null,
            childrenNames());
    }

    /**
     * Marks the leaf "nms-ip" with operation "replace".
     */
    public void markNmsIpReplace() throws JNCException {
        markLeafReplace("nmsIp");
    }

    /**
     * Marks the leaf "nms-ip" with operation "merge".
     */
    public void markNmsIpMerge() throws JNCException {
        markLeafMerge("nmsIp");
    }

    /**
     * Marks the leaf "nms-ip" with operation "create".
     */
    public void markNmsIpCreate() throws JNCException {
        markLeafCreate("nmsIp");
    }

    /**
     * Marks the leaf "nms-ip" with operation "delete".
     */
    public void markNmsIpDelete() throws JNCException {
        markLeafDelete("nmsIp");
    }

    /**
     * Support method for addChild.
     * Adds a child to this object.
     *
     * @param child The child to add
     */
    public void addChild(Element child) {
        super.addChild(child);
    }

}


text:
/**
 * Created by hass on 7/8/2015.
 */
var express = require('express');
var application=express();
application.use(express.static(__dirname + '/musictube'));

application.listen(process.env.PORT || 3000);

redpajama_set_name: RedPajamaGithub


text:
<?php

namespace Symfony\Component\Notifier\EventListener;

use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use Symfony\Component\Messenger\Event\WorkerMessageFailedEvent;
use Symfony\Component\Messenger\Exception\HandlerFailedException;
use Symfony\Component\Notifier\Notification\Notification;
use Symfony\Component\Notifier\Notifier;

/**
 * Sends a rejected message to the notifier.
 *
 * @author Fabien Potencier <fabien@symfony.com>
 */
class SendFailedMessageToNotifierListener implements EventSubscriberInterface
{
    private Notifier $notifier;

    public function __construct(Notifier $notifier)
    {
        $this->notifier = $notifier;
    }

    public function onMessageFailed(WorkerMessageFailedEvent $event)
    {
        if ($event->willRetry()) {
            return;
        }

        $throwable = $event->getThrowable();
        if ($throwable instanceof HandlerFailedException) {
            $throwable = $throwable->getNestedExceptions()[0];
        }
        $envelope = $event->getEnvelope();
        $notification = Notification::fromThrowable($throwable)->importance(Notification::IMPORTANCE_HIGH);
        $notification->subject(sprintf('A "%s" message has just failed: %s.', \get_class($envelope->getMessage()), $notification->getSubject()));

        $this->notifier->send($notification, ...$this->notifier->getAdminRecipients());
    }

    public static function getSubscribedEvents(): array
    {
        return [
            WorkerMessageFailedEvent::class => 'onMessageFailed',
        ];
    }
}


text:
package fr.flegac.experiments.engine.economy.engine;

import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;

import com.google.gson.Gson;

import fr.flegac.experiments.engine.economy.model.DataModel;
import fr.flegac.experiments.engine.economy.model.production.Building;
import fr.flegac.experiments.engine.economy.model.production.EconomicEntity;
import fr.flegac.experiments.engine.economy.model.production.Improvement;
import fr.flegac.experiments.engine.economy.model.production.Land;
import fr.flegac.experiments.engine.economy.model.production.Product;
import fr.flegac.experiments.engine.economy.model.production.Technology;

public class Economy1 implements Economy {
    private static Gson gson = new Gson();

    private Map<String, EconomicEntity> entities = new HashMap<>();

    @Override
    public void load(File file) throws FileNotFoundException {
        if (file.isFile() && file.getName().endsWith(".json")) {
            System.out.println("load : " + file.getName());
            DataModel data = gson.fromJson(new FileReader(file), DataModel.class);

            data.lands.forEach(this::register);
            data.improvements.forEach(this::register);
            data.buildings.forEach(this::register);
            data.products.forEach(this::register);
            data.technologies.forEach(this::register);
            return;
        }

        if (file.isDirectory()) {
            for (File child : file.listFiles()) {
                load(child);
            }
        }

    }

    @Override
    public EconomicEntity get(String id) {
        return entities.get(id);
    }

    @Override
    public Land land(String id) {
        return (Land) get(id);
    }

    @Override
    public Building building(String id) {
        return (Building) get(id);
    }

    @Override
    public Improvement improvement(String id) {
        return (Improvement) get(id);
    }

    @Override
    public Product product(String id) {
        return (Product) get(id);
    }

    @Override
    public Technology technology(String id) {
        return (Technology) get(id);
    }

    @Override
    public void register(EconomicEntity entity) {
        System.out.println("\t" + entity.id);
        entities.put(entity.id, entity);

    }

    @Override
    public Set<String> getAll() {
        return entities.keySet();
    }

    @Override
    public Set<Building> buildings() {
        Set<Building> result = new HashSet<>();
        entities.values().stream().filter(item -> item instanceof Building).forEach(item -> result.add((Building) item));
        return result;
    }

    @Override
    public Set<Technology> technologies() {
        Set<Technology> result = new HashSet<>();
        entities.values().stream().filter(item -> item instanceof Technology).forEach(item -> result.add((Technology) item));
        return result;
    }

    @Override
    public Set<Product> products() {
        Set<Product> result = new HashSet<>();
        entities.values().stream().filter(item -> item instanceof Product).forEach(item -> result.add((Product) item));
        return result;
    }

    @Override
    public Set<Improvement> improvements() {
        Set<Improvement> result = new HashSet<>();
        entities.values().stream().filter(item -> item instanceof Improvement).forEach(item -> result.add((Improvement) item));
        return result;
    }

    @Override
    public Set<Land> lands() {
        Set<Land> result = new HashSet<>();
        entities.values().stream().filter(item -> item instanceof Land).forEach(item -> result.add((Land) item));
        return result;
    }

}


text:
STSymbol *STSymbolCachedSymbolWithName(NSString *name)
{
	NSCParameterAssert(name);

	@synchronized(@"mutex")
	{
		static NSMutableDictionary *symbolCache = nil;
		if(!symbolCache)
			symbolCache = [NSMutableDictionary new];

		STSymbol *cachedSymbol = [symbolCache objectForKey:name];
		if(cachedSymbol)
			return cachedSymbol;

		STSymbol *newSymbol = [[STSymbol alloc] initWithString:name];
		[symbolCache setObject:newSymbol forKey:name];

		return newSymbol;
	}
}

@implementation STSymbol

#pragma mark Creation

- (id)initWithString:(NSString *)string
{
	if((self = [super init]))
	{
		mString = [string copy];
		return self;
	}
	return nil;
}

- (id)init
{
	if((self = [super init]))
	{
		mString = @"";
		return self;
	}
	return nil;
}

#pragma mark - Coding

- (id)initWithCoder:(NSCoder *)decoder
{
	NSAssert([decoder allowsKeyedCoding], @"Non-keyed coder (%@) given to -[STSymbol initWithCoder:].", decoder);

	if((self = [super init]))
	{
		mString = [decoder decodeObjectForKey:@"mString"];
		mIsQuoted = [decoder decodeBoolForKey:@"mIsQuoted"];

		return self;
	}
	return nil;
}

- (void)encodeWithCoder:(NSCoder *)encoder
{
	NSAssert([encoder allowsKeyedCoding], @"Non-keyed coder (%@) given to -[STSymbol encodeWithCoder:].", encoder);

	[encoder encodeObject:mString forKey:@"mString"];
	[encoder encodeBool:mIsQuoted forKey:@"mIsQuoted"];
}

#pragma mark - Properties

@synthesize string = mString;
@synthesize isQuoted = mIsQuoted;

#pragma mark -

@synthesize creationLocation = mCreationLocation;

#pragma mark - Identity

- (BOOL)isEqualTo:(id)object
{
	if([object respondsToSelector:@selector(string)])
		return [mString isEqualToString:[object string]];

	return [super isEqualTo:object];
}

- (BOOL)isEqualToSymbol:(STSymbol *)symbol
{
	return [mString isEqualToString:symbol.string];
}

- (BOOL)isEqualToString:(NSString *)string
{
	return [mString isEqualToString:string];
}

#pragma mark -

- (NSString *)description
{
	return [NSString stringWithFormat:@"<%@:%p %@%@>", [self className], self, mIsQuoted? @"'" : @"", mString];
}

- (NSString *)prettyDescription
{
	return [NSString stringWithFormat:@"%@%@", mIsQuoted? @"'" : @"", mString];
}

@end


text:
<?php

use Clue\React\Quassel\Io\Protocol;
use Clue\React\Quassel\Io\Binary;
use Clue\React\Quassel\Io\PacketParser;
use Clue\QDataStream\Reader;

class ProtocolTest extends TestCase
{
    public function setUp()
    {
        $this->protocol = new Protocol(new Binary());
    }

    public function testVariantList()
    {
        $in = array('first', 'second', 10, false);

        $packet = $this->protocol->writeVariantList($in);
		$reader = Reader::fromString($packet);

        $this->assertEquals($in, $reader->readVariant());
    }

    public function testVariantMap()
    {
        $in = array('hello' => 'world', 'number' => 10, 'boolean' => true);

        $packet = $this->protocol->writeVariantMap($in);
		$reader = Reader::fromString($packet);

        $this->assertEquals($in, $reader->readVariant());
    }

    private function readDataFromPacket($packet)
    {
        $parser = new PacketParser(new Binary());

        $variant = null;

        $parser->push($packet, function ($data) use (&$variant) {
            $variant = $data;
        });

        $this->assertNotNull($variant);

        return $variant;
    }
}


text:
<mods xmlns="http://www.loc.gov/mods/v3" xmlns:exslt="http://exslt.org/common" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xlink="http://www.w3.org/1999/xlink" xsi:schemaLocation="http://www.loc.gov/mods/v3 http://www.loc.gov/standards/mods/v3/mods-3-3.xsd" version="3.3" ID="P0b002ee1814e42f2">
<name type="corporate">
 <namePart>United States Government Printing Office</namePart>
 <role>
  <roleTerm type="text" authority="marcrelator">printer</roleTerm>
  <roleTerm type="code" authority="marcrelator">prt</roleTerm>
</role>
 <role>
  <roleTerm type="text" authority="marcrelator">distributor</roleTerm>
  <roleTerm type="code" authority="marcrelator">dst</roleTerm>
</role>
</name>
<name type="corporate">
 <namePart>United States</namePart>
 <namePart>United States District Court District of Massachusetts</namePart>
 <role>
  <roleTerm type="text" authority="marcrelator">author</roleTerm>
  <roleTerm type="code" authority="marcrelator">aut</roleTerm>
</role>
 <description>Government Organization</description>
</name>
<typeOfResource>text</typeOfResource>
<genre authority="marcgt">government publication</genre>
<language>
 <languageTerm authority="iso639-2b" type="code">eng</languageTerm>
</language>
<extension>
 <collectionCode>USCOURTS</collectionCode>
 <category>Judicial Publications</category>
 <branch>judicial</branch>
 <dateIngested>2011-12-29</dateIngested>
</extension>
<originInfo>
 <publisher>Administrative Office of the United States Courts</publisher>
 <dateIssued encoding="w3cdtf">2011-01-26</dateIssued>
 <issuance>monographic</issuance>
</originInfo>
<physicalDescription>
 <note type="source content type">deposited</note>
 <digitalOrigin>born digital</digitalOrigin>
</physicalDescription>
<classification authority="sudocs">JU 4.15</classification>
<identifier type="uri">http://www.gpo.gov/fdsys/pkg/USCOURTS-mad-4_10-cv-10311</identifier>
<identifier type="local">P0b002ee1814e42f2</identifier>
<recordInfo>
 <recordContentSource authority="marcorg">DGPO</recordContentSource>
 <recordCreationDate encoding="w3cdtf">2011-12-29</recordCreationDate>
 <recordChangeDate encoding="w3cdtf">2011-12-29</recordChangeDate>
 <recordIdentifier source="DGPO">USCOURTS-mad-4_10-cv-10311</recordIdentifier>
 <recordOrigin>machine generated</recordOrigin>
 <languageOfCataloging>
  <languageTerm authority="iso639-2b" type="code">eng</languageTerm>
</languageOfCataloging>
</recordInfo>
<accessCondition type="GPO scope determination">fdlp</accessCondition>
<extension>
 <docClass>USCOURTS</docClass>
 <accessId>USCOURTS-mad-4_10-cv-10311</accessId>
 <courtType>District</courtType>
 <courtCode>mad</courtCode>
 <courtCircuit>1st</courtCircuit>
 <courtState>Massachusetts</courtState>
 <courtSortOrder>2240</courtSortOrder>
 <caseNumber>4:10-cv-10311</caseNumber>
 <caseOffice>Worcester</caseOffice>
 <caseType>civil</caseType>
 <natureSuitCode>190</natureSuitCode>
 <natureSuit>Other Contract Actions</natureSuit>
 <cause>28:1332 Diversity-Breach of Contract</cause>
 <party fullName="America's Servicing Company" lastName="America's Servicing Company" role="Defendant"></party>
 <party firstName="Odalid" fullName="Odalid Bosque" lastName="Bosque" role="Plaintiff"></party>
 <party firstName="Wilfredo" fullName="Wilfredo Bosque" lastName="Bosque" role="Plaintiff"></party>
 <party firstName="Germano" fullName="Germano Depina" lastName="Depina" role="Plaintiff"></party>
 <party firstName="Paul" fullName="Paul Montero" lastName="Montero" role="Plaintiff"></party>
 <party firstName="Vera" fullName="Vera Vicente Meek" lastName="Vicente Meek" role="Plaintiff"></party>
 <party firstName="Gary" fullName="Gary Voltaire" lastName="Voltaire" role="Intervenor Plaintiff"></party>
 <party firstName="Gary" fullName="Gary Voltaire" lastName="Voltaire" role="Plaintiff"></party>
 <party firstName="Jennifer" fullName="Jennifer Ryan Voltaire" lastName="Voltaire" middleName="Ryan" role="Intervenor Plaintiff"></party>
 <party firstName="Jennifer" fullName="Jennifer Ryan Voltaire" lastName="Voltaire" middleName="Ryan" role="Plaintiff"></party>
 <party fullName="Wells Fargo Bank, N.A." lastName="Wells Fargo Bank, N.A." role="Defendant"></party>
 <party fullName="Wells Fargo Home Mortgage" lastName="Wells Fargo Home Mortgage" role="Defendant"></party>
 <party firstName="Jennifer" fullName="Jennifer Williams" lastName="Williams" role="Plaintiff"></party>
</extension>
<titleInfo>
 <title>Bosque et al v. Wells Fargo Bank, N.A.</title>
 <partNumber>4:10-cv-10311</partNumber>
</titleInfo>
<location>
 <url access="object in context" displayLabel="Content Detail">http://www.gpo.gov/fdsys/pkg/USCOURTS-mad-4_10-cv-10311/content-detail.html</url>
</location>
<classification authority="sudocs">JU 4.15</classification>
<identifier type="preferred citation">4:10-cv-10311;10-10311</identifier>
<name type="corporate">
 <namePart>United States District Court District of Massachusetts</namePart>
 <namePart>1st Circuit</namePart>
 <namePart>Worcester</namePart>
 <affiliation>U.S. Courts</affiliation>
 <role>
  <roleTerm authority="marcrelator" type="text">author</roleTerm>
  <roleTerm authority="marcrelator" type="code">aut</roleTerm>
</role>
</name>
<name type="personal">
 <displayForm>America's Servicing Company</displayForm>
 <namePart type="family">America's Servicing Company</namePart>
 <namePart type="given"></namePart>
 <namePart type="termsOfAddress"></namePart>
 <description>Defendant</description>
</name>
<name type="personal">
 <displayForm>Odalid Bosque</displayForm>
 <namePart type="family">Bosque</namePart>
 <namePart type="given">Odalid</namePart>
 <namePart type="termsOfAddress"></namePart>
 <description>Plaintiff</description>
</name>
<name type="personal">
 <displayForm>Wilfredo Bosque</displayForm>
 <namePart type="family">Bosque</namePart>
 <namePart type="given">Wilfredo</namePart>
 <namePart type="termsOfAddress"></namePart>
 <description>Plaintiff</description>
</name>
<name type="personal">
 <displayForm>Germano Depina</displayForm>
 <namePart type="family">Depina</namePart>
 <namePart type="given">Germano</namePart>
 <namePart type="termsOfAddress"></namePart>
 <description>Plaintiff</description>
</name>
<name type="personal">
 <displayForm>Paul Montero</displayForm>
 <namePart type="family">Montero</namePart>
 <namePart type="given">Paul</namePart>
 <namePart type="termsOfAddress"></namePart>
 <description>Plaintiff</description>
</name>
<name type="personal">
 <displayForm>Vera Vicente Meek</displayForm>
 <namePart type="family">Vicente Meek</namePart>
 <namePart type="given">Vera</namePart>
 <namePart type="termsOfAddress"></namePart>
 <description>Plaintiff</description>
</name>
<name type="personal">
 <displayForm>Gary Voltaire</displayForm>
 <namePart type="family">Voltaire</namePart>
 <namePart type="given">Gary</namePart>
 <namePart type="termsOfAddress"></namePart>
 <description>Intervenor Plaintiff</description>
</name>
<name type="personal">
 <displayForm>Gary Voltaire</displayForm>
 <namePart type="family">Voltaire</namePart>
 <namePart type="given">Gary</namePart>
 <namePart type="termsOfAddress"></namePart>
 <description>Plaintiff</description>
</name>
<name type="personal">
 <displayForm>Jennifer Ryan Voltaire</displayForm>
 <namePart type="family">Voltaire</namePart>
 <namePart type="given">Jennifer</namePart>
 <namePart type="termsOfAddress"></namePart>
 <description>Intervenor Plaintiff</description>
</name>
<name type="personal">
 <displayForm>Jennifer Ryan Voltaire</displayForm>
 <namePart type="family">Voltaire</namePart>
 <namePart type="given">Jennifer</namePart>
 <namePart type="termsOfAddress"></namePart>
 <description>Plaintiff</description>
</name>
<name type="personal">
 <displayForm>Wells Fargo Bank, N.A.</displayForm>
 <namePart type="family">Wells Fargo Bank, N.A.</namePart>
 <namePart type="given"></namePart>
 <namePart type="termsOfAddress"></namePart>
 <description>Defendant</description>
</name>
<name type="personal">
 <displayForm>Wells Fargo Home Mortgage</displayForm>
 <namePart type="family">Wells Fargo Home Mortgage</namePart>
 <namePart type="given"></namePart>
 <namePart type="termsOfAddress"></namePart>
 <description>Defendant</description>
</name>
<name type="personal">
 <displayForm>Jennifer Williams</displayForm>
 <namePart type="family">Williams</namePart>
 <namePart type="given">Jennifer</namePart>
 <namePart type="termsOfAddress"></namePart>
 <description>Plaintiff</description>
</name>
<extension>
 <docClass>USCOURTS</docClass>
 <accessId>USCOURTS-mad-4_10-cv-10311</accessId>
 <courtType>District</courtType>
 <courtCode>mad</courtCode>
 <courtCircuit>1st</courtCircuit>
 <courtState>Massachusetts</courtState>
 <courtSortOrder>2240</courtSortOrder>
 <caseNumber>4:10-cv-10311</caseNumber>
 <caseOffice>Worcester</caseOffice>
 <caseType>civil</caseType>
 <natureSuitCode>190</natureSuitCode>
 <natureSuit>Other Contract Actions</natureSuit>
 <cause>28:1332 Diversity-Breach of Contract</cause>
 <party fullName="America's Servicing Company" lastName="America's Servicing Company" role="Defendant"></party>
 <party firstName="Odalid" fullName="Odalid Bosque" lastName="Bosque" role="Plaintiff"></party>
 <party firstName="Wilfredo" fullName="Wilfredo Bosque" lastName="Bosque" role="Plaintiff"></party>
 <party firstName="Germano" fullName="Germano Depina" lastName="Depina" role="Plaintiff"></party>
 <party firstName="Paul" fullName="Paul Montero" lastName="Montero" role="Plaintiff"></party>
 <party firstName="Vera" fullName="Vera Vicente Meek" lastName="Vicente Meek" role="Plaintiff"></party>
 <party firstName="Gary" fullName="Gary Voltaire" lastName="Voltaire" role="Intervenor Plaintiff"></party>
 <party firstName="Gary" fullName="Gary Voltaire" lastName="Voltaire" role="Plaintiff"></party>
 <party firstName="Jennifer" fullName="Jennifer Ryan Voltaire" lastName="Voltaire" middleName="Ryan" role="Intervenor Plaintiff"></party>
 <party firstName="Jennifer" fullName="Jennifer Ryan Voltaire" lastName="Voltaire" middleName="Ryan" role="Plaintiff"></party>
 <party fullName="Wells Fargo Bank, N.A." lastName="Wells Fargo Bank, N.A." role="Defendant"></party>
 <party fullName="Wells Fargo Home Mortgage" lastName="Wells Fargo Home Mortgage" role="Defendant"></party>
 <party firstName="Jennifer" fullName="Jennifer Williams" lastName="Williams" role="Plaintiff"></party>
 <state>Massachusetts</state>
</extension>
<relatedItem type="constituent" ID="id-USCOURTS-mad-4_10-cv-10311-0" xlink:href="http://www.gpo.gov/fdsys/granule/USCOURTS-mad-4_10-cv-10311/USCOURTS-mad-4_10-cv-10311-0/mods.xml">
 <titleInfo>
  <title>Bosque et al v. Wells Fargo Bank, N.A.</title>
  <subTitle>Judge F. Dennis Saylor, IV: MEMORANDUM AND ORDER entered denying 29 Motion for Preliminary Injunction; denying 31 Motion to Certify Class; granting 50 Motion for discovery and denying 15 Motion to Dismiss. (Castles, Martin)</subTitle>
  <partNumber>0</partNumber>
</titleInfo>
 <originInfo>
  <dateIssued>2011-01-26</dateIssued>
</originInfo>
 <relatedItem xlink:href="http://www.gpo.gov/fdsys/pkg/pdf/USCOURTS-mad-4_10-cv-10311-0.pdf" type="otherFormat">
  <identifier type="FDsys Unique ID">D09002ee1815934e6</identifier>
</relatedItem>
 <identifier type="uri">http://www.gpo.gov/fdsys/granule/USCOURTS-mad-4_10-cv-10311/USCOURTS-mad-4_10-cv-10311-0</identifier>
 <identifier type="former granule identifier">mad-4_10-cv-10311_0.pdf</identifier>
 <location>
  <url access="object in context" displayLabel="Content Detail">http://www.gpo.gov/fdsys/granule/USCOURTS-mad-4_10-cv-10311/USCOURTS-mad-4_10-cv-10311-0/content-detail.html</url>
  <url access="raw object" displayLabel="PDF rendition">http://www.gpo.gov/fdsys/pkg/USCOURTS-mad-4_10-cv-10311/pdf/USCOURTS-mad-4_10-cv-10311-0.pdf</url>
</location>
 <extension>
  <searchTitle>USCOURTS 4:10-cv-10311; Bosque et al v. Wells Fargo Bank, N.A.; </searchTitle>
  <courtName>United States District Court District of Massachusetts</courtName>
  <state>Massachusetts</state>
  <accessId>USCOURTS-mad-4_10-cv-10311-0</accessId>
  <sequenceNumber>0</sequenceNumber>
  <dateIssued>2011-01-26</dateIssued>
  <docketText>Judge F. Dennis Saylor, IV: MEMORANDUM AND ORDER entered denying 29 Motion for Preliminary Injunction; denying 31 Motion to Certify Class; granting 50 Motion for discovery and denying 15 Motion to Dismiss. (Castles, Martin)</docketText>
</extension>
</relatedItem>
</mods>


text:
from django.shortcuts import render
from django.contrib import messages
from django.shortcuts import redirect
from django.contrib.auth import login
from django.contrib.auth.models import User
from constance import config
from django.contrib.auth.decorators import login_required
from django.utils import timezone
from django.conf import settings

from . import setup_forms, device_forms
from . import mdnsLocator, serial_integration

from app.models import BrewPiDevice

from .decorators import site_is_configured  # Checks if user has completed constance configuration
import random, configparser

###################################################################################################################
# Initial Setup Views
###################################################################################################################

def setup_add_user(request):
    num_users = User.objects.all().count()

    # We might want to create CRUD for users later, but it shouldn't be part of the guided setup. If a user has
    # already been created, redirect back to siteroot.
    if num_users > 0:
        messages.error(request, 'Cannot use guided setup to create multiple users - use the admin ' +
                                'portal instead.')
        return redirect('siteroot')

    if request.POST:
        form = setup_forms.GuidedSetupUserForm(request.POST)
        if form.is_valid():
            new_user = form.save(commit=False)
            new_user.is_superuser = True
            new_user.is_staff = True
            new_user.save()
            #new_user_creaed = User.objects.create_user(**form.cleaned_data)
            # We login the user right away
            login(request, new_user)
            messages.success(request, 'User {} created and logged in successfully'.format(new_user.username))
            if config.USER_HAS_COMPLETED_CONFIGURATION:
                return redirect('siteroot')
            else:
                return redirect('setup_config')
        else:
            return render(request, template_name='setup/setup_add_user.html', context={'form': form})
    else:
        form = setup_forms.GuidedSetupUserForm()
        return render(request, template_name='setup/setup_add_user.html', context={'form': form})

def set_sentry_status(enabled=True):
    config = configparser.ConfigParser()
    config.read(settings.CONFIG_INI_FILEPATH)
    config['sentry'] = {}

    if enabled:
        config['sentry']['enable_sentry'] = 'yes'
    else:
        config['sentry']['enable_sentry'] = 'no'

    with open(settings.CONFIG_INI_FILEPATH, 'w') as configfile:
        config.write(configfile)

@login_required
def setup_config(request):
    # TODO - Add user permissioning. The wizard creates the user and login so we can check for superuser here
    if request.POST:
        form = setup_forms.GuidedSetupConfigForm(request.POST)
        if form.is_valid():
            f = form.cleaned_data
            config.BREWERY_NAME = f['brewery_name']
            config.CUSTOM_THEME = f['custom_theme']
            config.DATE_TIME_FORMAT_DISPLAY = f['date_time_format_display']
            config.REQUIRE_LOGIN_FOR_DASHBOARD = f['require_login_for_dashboard']
            config.TEMPERATURE_FORMAT = f['temperature_format']
            config.USER_HAS_COMPLETED_CONFIGURATION = True  # Toggle once they've completed the configuration workflow
            config.PREFERRED_TIMEZONE = f['preferred_timezone']
            config.GRAVITY_SUPPORT_ENABLED = f['enable_gravity_support']
            config.GIT_UPDATE_TYPE = f['update_preference']
            config.GRAVITY_DISPLAY_FORMAT = f['gravity_display_format']
            config.SQLITE_OK_DJANGO_2 = True  # If they are completing the configuration workflow, assume that its a new install

            if f['enable_sentry_support'] != settings.ENABLE_SENTRY:
                # The user changed the "Enable Sentry" value - but this doesn't actually take effect until Fermentrack
                # restarts.
                # TODO - Queue a request to Huey to restart fermentrack
                messages.warning(request, "Sentry status has changed - please restart Fermentrack for this to take "
                                          "effect. (This is most easily accomplished by restarting the device running"
                                          "Fermentrack)")

            # This sits outside the if check above in case the user updates the setting before Fermentrack was restarted
            if f['enable_sentry_support']:
                set_sentry_status(enabled=True)
            else:
                set_sentry_status(enabled=False)

            messages.success(request, 'App configuration has been saved')
            return redirect('siteroot')
        else:
            return render(request, template_name='setup/setup_config.html',
                          context={'form': form, 'completed_config': config.USER_HAS_COMPLETED_CONFIGURATION})
    else:
        form = setup_forms.GuidedSetupConfigForm()
        return render(request, template_name='setup/setup_config.html',
                      context={'form': form, 'completed_config': config.USER_HAS_COMPLETED_CONFIGURATION})

def setup_splash(request):
    # Send the number of users we got in the system as a way to know if this is the first run or not.
    context={'num_users': User.objects.all().count(), 'completed_config': config.USER_HAS_COMPLETED_CONFIGURATION}
    return render(request, template_name="setup/setup_unconfigured_splash.html", context=context)

###################################################################################################################
# Guided Setup Views
###################################################################################################################

#
# The general flow of guided setup looks like this:
#   Select device family (select_device)
#     |
#     Need to flash? (And we can flash) (device_flash)
#     |       |
#     | No    | Yes
#     |       |
#     |       Redirect to flash device
#     |       |
#     Select connection type (serial_wifi) *OR* if device doesn't support WiFi, redirect as "serial"
#     |       |
#     | WiFi  | Serial
#     |       \-------------------\
#     |                           |
#     mDNS Device Selection       |
#     |                           |
#     |       /-------------------/
#     |       |
#     |       Serial Device Autodetection
#     |       |
#     |       |
#     Preload device details & set up

@login_required
@site_is_configured
def device_guided_select_device(request):
    # TODO - Add user permissioning
    # if not request.user.has_perm('app.add_device'):
    #     messages.error(request, 'Your account is not permissioned to add devices. Please contact an admin')
    #     return redirect("/")

    if request.POST:
        form = setup_forms.GuidedDeviceSelectForm(request.POST)
        if form.is_valid():
            return redirect('device_guided_flash_prompt', device_family=form.cleaned_data['device_family'])
        else:
            return render(request, template_name='setup/device_guided_select_device.html', context={'form': form})
    else:
        form = setup_forms.GuidedDeviceSelectForm()
        return render(request, template_name='setup/device_guided_select_device.html', context={'form': form})

@login_required
@site_is_configured
def device_guided_flash_prompt(request, device_family):
    # TODO - Add user permissioning
    # if not request.user.has_perm('app.add_device'):
    #     messages.error(request, 'Your account is not permissioned to add devices. Please contact an admin')
    #     return redirect("/")

    can_flash_family = False
    serial_only_families = ['Arduino', 'Spark', 'Fuscus']

    if request.POST:
        form = setup_forms.GuidedDeviceFlashForm(request.POST)
        if form.is_valid():
            if not form.cleaned_data['should_flash_device']:
                if form.cleaned_data['device_family'] in serial_only_families:
                    # The device doesn't support both serial and wifi. Redirect to the serial flow.
                    return redirect('device_guided_serial_autodetect', device_family=form.cleaned_data['device_family'])
                else:
                    # The device can connect via either serial or wifi. prompt
                    return redirect('device_guided_serial_wifi', device_family=form.cleaned_data['device_family'])
            else:
                # I don't think this really will ever get called...
                return redirect('device_guided_flash_prompt', device_family=form.cleaned_data['device_family'])
        else:
            return render(request, template_name='setup/device_guided_flash_prompt.html',
                                       context={'form': form, 'device_family': device_family,
                                                'can_flash_family': can_flash_family})
    else:
        form = setup_forms.GuidedDeviceFlashForm()
        return render(request, template_name='setup/device_guided_flash_prompt.html',
                                   context={'form': form, 'device_family': device_family,
                                            'can_flash_family': can_flash_family})

@login_required
@site_is_configured
def device_guided_serial_wifi(request, device_family):
    # TODO - Add user permissioning
    # if not request.user.has_perm('app.add_device'):
    #     messages.error(request, 'Your account is not permissioned to add devices. Please contact an admin')
    #     return redirect("/")

    return render(request, template_name='setup/device_guided_serial_wifi.html',
                               context={'device_family': device_family})

@login_required
@site_is_configured
def device_guided_find_mdns(request):
    installed_devices, available_devices = mdnsLocator.find_mdns_devices()

    return render(request, template_name="setup/device_guided_mdns_locate.html",
                               context={'installed_devices': installed_devices,
                                        'available_devices': available_devices})

@login_required
@site_is_configured
def device_guided_add_mdns(request, mdns_id):
    # TODO - Add user permissioning
    # if not request.user.has_perm('app.add_device'):
    #     messages.error(request, 'Your account is not permissioned to add devices. Please contact an admin')
    #     return redirect("/")

    # Originally I thought we needed to rescan the network, but so long as ESP8266 is the only device that supports WiFi
    # We can use mdns_id alone to handle the initial values

    # installed_devices, available_devices = mdnsLocator.find_mdns_devices()
    #
    # mdns_device = None
    #
    # for this_device in available_devices:
    #     if this_device['mDNSname'] == mdns_id:
    #         mdns_device = this_device
    #
    # if mdns_device is None:
    #     redirect('device_guided_mdns')

    if request.POST:
        form = device_forms.BrewPiDeviceCreateForm(request.POST)
        if form.is_valid():
            new_device = BrewPiDevice(
                device_name=form.cleaned_data['device_name'],
                temp_format=form.cleaned_data['temp_format'],
                data_point_log_interval=form.cleaned_data['data_point_log_interval'],
                useInetSocket=form.cleaned_data['useInetSocket'],
                socketPort=form.cleaned_data['socketPort'],
                socketHost=form.cleaned_data['socketHost'],
                serial_port=form.cleaned_data['serial_port'],
                serial_alt_port=form.cleaned_data['serial_alt_port'],
                board_type=form.cleaned_data['board_type'],
                socket_name=form.cleaned_data['socket_name'],
                connection_type=form.cleaned_data['connection_type'],
                wifi_host=form.cleaned_data['wifi_host'],
                wifi_port=form.cleaned_data['wifi_port'],
            )

            new_device.save()

            messages.success(request, u'Device {} Added. Please wait a few seconds for controller to start'.format(new_device))
            return redirect("/")

        else:
            return render(request, template_name='setup/device_guided_add_mdns.html', context={'form': form})
    else:
        random_port = random.randint(2000,3000)
        # If we were just passed to the form, provide the initial values
        initial_values = {'board_type': 'esp8266', 'wifi_host': mdns_id, 'wifi_port': 23, 'connection_type': 'wifi',
                          'socketPort': random_port, 'temp_format': config.TEMPERATURE_FORMAT,
                          'modify_not_create': False}

        form = device_forms.BrewPiDeviceCreateForm(initial=initial_values)
        return render(request, template_name='setup/device_guided_add_mdns.html', context={'form': form})

@login_required
@site_is_configured
def device_guided_serial_autodetect(request, device_family):
    # TODO - Add user permissioning
    # if not request.user.has_perm('app.add_device'):
    #     messages.error(request, 'Your account is not permissioned to add devices. Please contact an admin')
    #     return redirect("/")

    # device_guided_serial_autodetect contains all 4 steps in the Serial autodetection guided setup.

    if not request.POST:
        # If we haven't had something posted to us, provide the instructions page. (Step 1)
        return render(request, template_name='setup/device_guided_serial_autodetect_1.html', context={'device_family': device_family})

    else:
        # Something was posted - figure out what step we're on by looking at the "step" field
        if 'step' not in request.POST:
            # We received a form, but not the right form. Redirect to the start of the autodetection flow.
            return render(request, template_name='setup/device_guided_serial_autodetect_1.html',
                                       context={'device_family': device_family})
        elif request.POST['step'] == "2":
            # Step 2 - Cache the current devices & present the next set of instructions to the user
            current_devices = serial_integration.cache_current_devices()
            return render(request, template_name='setup/device_guided_serial_autodetect_2.html',
                                       context={'device_family': device_family, 'current_devices': current_devices})
        elif request.POST['step'] == "3":
            # Step 3 - Detect newly-connected devices & prompt the user to select the one that corresponds to the
            # device they want to configure.
            _, _, _, new_devices_enriched = serial_integration.compare_current_devices_against_cache(device_family)
            return render(request, template_name='setup/device_guided_serial_autodetect_3.html',
                                       context={'device_family': device_family, 'new_devices': new_devices_enriched})
        elif request.POST['step'] == "4":
            # Step 4 - MAGIC.
            if 'serial_port' in request.POST:
                form = device_forms.BrewPiDeviceCreateForm(request.POST)
                if form.is_valid():
                    new_device = BrewPiDevice(
                        device_name=form.cleaned_data['device_name'],
                        temp_format=form.cleaned_data['temp_format'],
                        data_point_log_interval=form.cleaned_data['data_point_log_interval'],
                        useInetSocket=form.cleaned_data['useInetSocket'],
                        socketPort=form.cleaned_data['socketPort'],
                        socketHost=form.cleaned_data['socketHost'],
                        serial_port=form.cleaned_data['serial_port'],
                        serial_alt_port=form.cleaned_data['serial_alt_port'],
                        board_type=form.cleaned_data['board_type'],
                        socket_name=form.cleaned_data['socket_name'],
                        connection_type=form.cleaned_data['connection_type'],
                        wifi_host=form.cleaned_data['wifi_host'],
                        wifi_port=form.cleaned_data['wifi_port'],
                        prefer_connecting_via_udev=form.cleaned_data['prefer_connecting_via_udev'],
                    )

                    new_device.save()

                    # Once the device is added, go ahead and autodetect the udev serial number.
                    if new_device.connection_type == BrewPiDevice.CONNECTION_SERIAL:
                        new_device.set_udev_from_port()

                    messages.success(request, u'Device {} Added. Please wait a few seconds for controller to start'.format(new_device))
                    return redirect("/")

                else:
                    return render(request, template_name='setup/device_guided_serial_autodetect_4_add.html',
                                               context={'form': form, 'device_family': device_family})
            else:
                random_port = random.randint(2000,3000)
                # If we were just passed to the form, provide the initial values
                # TODO - Correctly determine 'board_type'
                if device_family == 'ESP8266':
                    board_type = 'esp8266'
                elif device_family == 'Arduino':
                    board_type = 'uno'
                else:
                    # Invalid board type - shouldn't ever get here.
                    messages.error(request, "Invalid board type for serial autodetection")
                    return redirect("/")

                initial_values = {'board_type': board_type, 'serial_port': request.POST['device'], 'connection_type': 'serial',
                                  'socketPort': random_port, 'temp_format': config.TEMPERATURE_FORMAT,
                                  'modify_not_create': False}

                form = device_forms.BrewPiDeviceCreateForm(initial=initial_values)
                return render(request, template_name='setup/device_guided_serial_autodetect_4_add.html',
                                           context={'form': form, 'device_family': device_family})

        elif request.POST['step'] == "5":
            pass
        else:
            # The step number we received was invalid. Redirect to the start of the autodetection flow.
            return render(request, template_name='setup/device_guided_serial_autodetect_1.html',
                                       context={'device_family': device_family})


text:
package v1

import (
	"encoding/json"
	"reflect"
	"testing"

	"github.com/ugorji/go/codec"
)

func TestVerbsUgorjiMarshalJSON(t *testing.T) {
	cases := []struct {
		input  APIResource
		result string
	}{
		{APIResource{}, `{"name":"","namespaced":false,"kind":"","verbs":null}`},
		{APIResource{Verbs: Verbs([]string{})}, `{"name":"","namespaced":false,"kind":"","verbs":[]}`},
		{APIResource{Verbs: Verbs([]string{"delete"})}, `{"name":"","namespaced":false,"kind":"","verbs":["delete"]}`},
	}

	for i, c := range cases {
		result, err := json.Marshal(&c.input)
		if err != nil {
			t.Errorf("[%d] Failed to marshal input: '%v': %v", i, c.input, err)
		}
		if string(result) != c.result {
			t.Errorf("[%d] Failed to marshal input: '%v': expected '%v', got '%v'", i, c.input, c.result, string(result))
		}
	}
}

func TestVerbsUgorjiUnmarshalJSON(t *testing.T) {
	cases := []struct {
		input  string
		result APIResource
	}{
		{`{}`, APIResource{}},
		{`{"verbs":null}`, APIResource{}},
		{`{"verbs":[]}`, APIResource{Verbs: Verbs([]string{})}},
		{`{"verbs":["delete"]}`, APIResource{Verbs: Verbs([]string{"delete"})}},
	}

	for i, c := range cases {
		var result APIResource
		if err := codec.NewDecoderBytes([]byte(c.input), new(codec.JsonHandle)).Decode(&result); err != nil {
			t.Errorf("[%d] Failed to unmarshal input '%v': %v", i, c.input, err)
		}
		if !reflect.DeepEqual(result, c.result) {
			t.Errorf("[%d] Failed to unmarshal input '%v': expected %+v, got %+v", i, c.input, c.result, result)
		}
	}
}

// TestUgorjiMarshalJSONWithOmit tests that we don't have regressions regarding nil and empty slices with "omit"
func TestUgorjiMarshalJSONWithOmit(t *testing.T) {
	cases := []struct {
		input  LabelSelector
		result string
	}{
		{LabelSelector{}, `{}`},
		{LabelSelector{MatchExpressions: []LabelSelectorRequirement{}}, `{}`},
		{LabelSelector{MatchExpressions: []LabelSelectorRequirement{{}}}, `{"matchExpressions":[{"key":"","operator":""}]}`},
	}

	for i, c := range cases {
		result, err := json.Marshal(&c.input)
		if err != nil {
			t.Errorf("[%d] Failed to marshal input: '%v': %v", i, c.input, err)
		}
		if string(result) != c.result {
			t.Errorf("[%d] Failed to marshal input: '%v': expected '%v', got '%v'", i, c.input, c.result, string(result))
		}
	}
}

func TestVerbsUnmarshalJSON(t *testing.T) {
	cases := []struct {
		input  string
		result APIResource
	}{
		{`{}`, APIResource{}},
		{`{"verbs":null}`, APIResource{}},
		{`{"verbs":[]}`, APIResource{Verbs: Verbs([]string{})}},
		{`{"verbs":["delete"]}`, APIResource{Verbs: Verbs([]string{"delete"})}},
	}

	for i, c := range cases {
		var result APIResource
		if err := json.Unmarshal([]byte(c.input), &result); err != nil {
			t.Errorf("[%d] Failed to unmarshal input '%v': %v", i, c.input, err)
		}
		if !reflect.DeepEqual(result, c.result) {
			t.Errorf("[%d] Failed to unmarshal input '%v': expected %+v, got %+v", i, c.input, c.result, result)
		}
	}
}

func TestVerbsProto(t *testing.T) {
	cases := []APIResource{
		{},
		{Verbs: Verbs([]string{})},
		{Verbs: Verbs([]string{"delete"})},
	}

	for _, input := range cases {
		data, err := input.Marshal()
		if err != nil {
			t.Fatalf("Failed to marshal input: '%v': %v", input, err)
		}
		resource := APIResource{}
		if err := resource.Unmarshal(data); err != nil {
			t.Fatalf("Failed to unmarshal output: '%v': %v", input, err)
		}
		if !reflect.DeepEqual(input, resource) {
			t.Errorf("Marshal->Unmarshal is not idempotent: '%v' vs '%v'", input, resource)
		}
	}
}


text:
"""
Admin views of mturk data
"""

from django.conf import settings
from django.views.decorators.http import require_POST
from django.http import Http404
from django.shortcuts import render
from django.contrib.admin.views.decorators import staff_member_required
from django.db.models import F

from endless_pagination.decorators import page_template
from cacheback.decorators import cacheback

from common.utils import dict_union, dump_queryset_to_static_csv, \
    json_success_response, json_error_response, group_iterable_by_attr

from mturk.models import MtAssignment, Experiment, \
    PendingContent, ExperimentExample
from mturk.aggregate import experiments_as_categories, \
    experiment_slugs, admin_stats_category

@staff_member_required
def admin_experiments(request):
    qset = Experiment.objects.all().select_related('new_hit_settings')
    slugs = group_iterable_by_attr(qset, 'slug')
    slugs = sorted(slugs.iteritems(),
                   key=lambda x: (len(x[1]), x[0]))
    experiments = []
    for s in slugs:
        experiments += s[1]
    experiments.sort(
        key=lambda x: not x.new_hit_settings.auto_add_hits)

    return render(request, "mturk/admin/experiments.html", {
        'nav': 'mturk',
        'subnav': 'experiments',
        'experiments': experiments,
    })

@cacheback(15)
def admin_assignment_csv_url():
    return dump_queryset_to_static_csv(
        MtAssignment.objects.filter(time_ms__isnull=False),
        [
            'time_ms', 'time_load_ms', 'wage',
            ('hit__hit_type__experiment__slug', 'experiment_slug'),
            ('hit__num_contents', 'num_contents'),
        ],
        'mturk-admin-assignment.csv')

@staff_member_required
def admin_stats_table(request, experiment_slug):
    return render(request, "mturk/admin/stats_table.html", {
        'category': admin_stats_category(experiment_slug)
    })

@staff_member_required
def admin_stats(request, experiment_slug='all'):
    return render(request, "mturk/admin/stats.html", {
        'nav': 'mturk-admin',
        'subnav': 'stats',
        'category_slug': experiment_slug,
        'categories': experiments_as_categories(),
        'category': admin_stats_category(experiment_slug),
        'stats_csv_url': admin_assignment_csv_url(),
        'table_template': 'mturk/admin/stats_table.html',
    })

@cacheback(15)
def admin_example_categories():
    ret = filter(lambda x: x['count'] > 0, [
        {'slug': c.slug, 'count': c.examples.count()}
        for c in Experiment.objects.all()
    ])
    ret.sort(key=lambda x: (-x['count'], x['slug']))
    return ret

@staff_member_required
@page_template('grid_page.html')
def admin_example(request, experiment_slug='all',
                  template='mturk/admin/example.html',
                  extra_context=None):

    categories = admin_example_categories()

    entries = ExperimentExample.objects \
        .filter(experiment__slug=experiment_slug) \
        .prefetch_related('content') \
        .order_by('-id')

    # hacky, I know
    if entries and hasattr(entries[0], 'shape_id'):
        entries = list(entries)
        entries.sort(key=lambda x: x.content.shape_id)

    return render(request, template, dict_union({
        'nav': 'mturk-admin',
        'subnav': 'example',
        'entries': entries,
        'categories': categories,
        'category_slug': experiment_slug,
        'entries_per_page': 30,
        'span': 'span3',
        'rowsize': '3',
        'thumb_template_extra': 'mturk/admin/example_thumb_extra.html'
    }, extra_context))

@require_POST
@staff_member_required
def admin_example_ajax(request):
    if 'id' not in request.POST or 'good' not in request.POST:
        return json_error_response(
            'Must have both "id" and "good" in POST params')

    id = request.POST['id']
    good = (request.POST['good'].lower() == 'true')
    updated = ExperimentExample.objects \
        .filter(id=id).update(good=good)

    if updated:
        return json_success_response()
    else:
        return json_error_response('Object (id=%s) not found' % id)

PENDING_CONTENT_FILTERS = {
    'all': {
        'slug': 'All',
        'desc': 'All tracked objects.',
        'filter': {},
    },
    'scheduled': {
        'slug': 'Scheduled',
        'desc': 'These items are part of active HITs.',
        'filter': {'num_outputs_scheduled__gt': 0},
    },
    'unscheduled': {
        'slug': 'Unscheduled',
        'desc': 'These items require more outputs but are not scheduled in any HITs.',
        'filter': {'num_outputs_scheduled__lt':
                   F('num_outputs_max') - F('num_outputs_completed')},
    },
    'incomplete': {
        'slug': 'Incomplete',
        'desc': 'These items require more outputs.',
        'filter': {'num_outputs_completed__lt': F('num_outputs_max')},
    },
    'complete': {
        'slug': 'Complete',
        'desc': 'These items have all of the required outputs.',
        'filter': {'num_outputs_max__gt': 0, 'num_outputs_completed__gte': F('num_outputs_max')},
    },
}

PENDING_CONTENT_FILTERS_LIST = [
    'scheduled', 'unscheduled', 'incomplete', 'complete', 'all',
]

def pending_content_entries(experiment_slug, filter_key):
    if experiment_slug == 'all':
        entries = PendingContent.objects.filter()
    else:
        entries = PendingContent.objects.filter(
            experiment__slug=experiment_slug)

    return entries.filter(**PENDING_CONTENT_FILTERS[filter_key]['filter'])

@cacheback(15)
def admin_pending_content_categories():
    """ Returns a dictionary mapping:
        filter --> category --> {slug, count}
    """
    slugs = experiment_slugs()

    ret = {}
    for filter_key in PENDING_CONTENT_FILTERS_LIST:
        categories = [
            {'slug': slug,
             'count': pending_content_entries(slug, filter_key).count()}
            for slug in slugs
        ]
        categories.append(
            {'slug': 'all',
             'count': pending_content_entries('all', filter_key).count()}
        )
        categories.sort(key=lambda x: (-x['count'], x['slug']))
        ret[filter_key] = categories
    return ret

@page_template('grid_page.html')
@staff_member_required
def admin_pending_content(
    request, experiment_slug='all', filter_key='scheduled',
        template='mturk/admin/pending_content_base.html',
        extra_context=None):

    if filter_key not in PENDING_CONTENT_FILTERS_LIST:
        raise Http404

    categories = admin_pending_content_categories()

    filters = []
    for key in PENDING_CONTENT_FILTERS_LIST:
        count = 0
        for cat in categories[key]:
            if cat['slug'] == experiment_slug:
                count = cat['count']
                break
        else:
            count = categories[key][0]['count']

        filters.append(
            dict_union(
                {'key': key, 'count': count},
                PENDING_CONTENT_FILTERS[key]
            )
        )

    entries = pending_content_entries(experiment_slug, filter_key) \
        .order_by('num_outputs_completed', '-priority')

    return render(request, template, dict_union({
        'nav': 'mturk-admin',
        'subnav': 'pending-content',
        'filters': filters,
        'filter_key': filter_key,
        'categories': categories[filter_key],
        'category_slug': experiment_slug,
        'entries': entries,
        'entries_per_page': 30,
        'span': 'span3',
        'rowsize': '3',
        'thumb_template_extra': 'mturk/admin/pending_content_thumb_extra.html',
    }, extra_context))

@cacheback(15)
def admin_feedback_categories():
    ret = filter(lambda x: x['count'] > 0, [
        {'slug': slug,
         'count': MtAssignment.objects.filter(
             has_feedback=True,
             hit__hit_type__experiment__slug=slug).count()}
        for slug in experiment_slugs()
    ])
    ret.append({
        'slug': 'all',
        'count': MtAssignment.objects.filter(has_feedback=True).count()
    })
    ret.sort(key=lambda x: (-x['count'], x['slug']))
    return ret

@staff_member_required
@page_template('block_page.html')
def admin_feedback(request, experiment_slug='all',
                   template="mturk/admin/feedback.html", extra_context=None):

    assignments = MtAssignment.objects.filter(has_feedback=True)

    if experiment_slug != 'all':
        assignments = assignments.filter(
            hit__hit_type__experiment__slug=experiment_slug)

    if 'worker_id' in request.GET:
        assignments = assignments.filter(
            worker__mturk_worker_id=request.GET['worker_id'])

    entries = assignments \
        .defer('post_data', 'post_meta') \
        .select_related('worker', 'hit__hit_type', 'hit__hit_type__experiment') \
        .order_by('-added')

    return render(request, template, dict_union({
        'nav': 'mturk-admin',
        'subnav': 'feedback',
        'categories': admin_feedback_categories(),
        'category_slug': experiment_slug,
        'entries': entries,
        'entries_per_page': 30,
        'span': 'span9',
        'thumb_template': 'mturk/admin/feedback_entry.html',
    }, extra_context))

SUBMISSION_FILTERS = {
    'all': {
        'slug': 'All',
        'desc': 'All submissions.',
        'filter': {'status__isnull': False},
    },
    'AU': {
        'slug': 'Unblocked',
        'desc': 'All submissions from unblocked users.',
        'filter': {'status__isnull': False, 'worker__blocked': False},
    },
    'S': {
        'slug': 'Pending',
        'desc': 'These assignments are pending (not yet approved/rejected).',
        'filter': {'status': 'S'},
    },
    'A': {
        'slug': 'Approved',
        'desc': 'These assignments were approved.',
        'filter': {'status': 'A'},
    },
    'R': {
        'slug': 'Rejected',
        'desc': 'These assignments were rejected.',
        'filter': {'status': 'R'},
    },
    'HF': {
        'slug': 'Has feedback',
        'desc': 'These assignments have feedback.',
        'filter': {'has_feedback': True},
    },
    'HB': {
        'slug': 'Has bonus',
        'desc': 'These assignments were given a bonus.',
        'filter': {'bonus__gt': 0},
    },
}

SUBMISSION_FILTERS_LIST = ['all', 'AU', 'S', 'A', 'R', 'HF', 'HB']

def submission_entries(experiment_slug, filter_key):
    if experiment_slug == 'all':
        entries = MtAssignment.objects.filter(
            hit__sandbox=False,
            hit__hit_type__experiment__slug=experiment_slug)
    else:
        entries = MtAssignment.objects.filter(
            hit__sandbox=False)

    return entries.filter(**SUBMISSION_FILTERS[filter_key]['filter'])

@cacheback(15)
def admin_submission_categories():
    ret = filter(lambda x: x['count'] > 0, [
        {'slug': slug,
         'count': MtAssignment.objects.filter(
             hit__sandbox=False,
             hit__hit_type__experiment__slug=slug).count()}
        for slug in experiment_slugs()
    ])
    ret.append({
        'slug': 'all',
        'count': MtAssignment.objects.filter(
            hit__sandbox=False,
            status__isnull=False).count()
    })
    ret.sort(key=lambda x: (-x['count'], x['slug']))
    return ret

@staff_member_required
@page_template('block_page.html')
def admin_submission(request, experiment_slug='all', filter_key='all',
                     template="mturk/admin/submission.html", extra_context=None):

    if request.method == 'POST':
        # admin clicked a button in the UI
        try:
            action = request.POST.get['action']
            assignment = MtAssignment.objects.get(
                id=request.POST['assignment_id'])
            if action == 'approve':
                assignment.approve(feedback=request.POST['message'])
                return json_success_response()
            elif action == 'reject':
                assignment.reject(feedback=request.POST['message'])
                return json_success_response()
            elif action == 'auto-approve':
                assignment.experiment_worker().set_auto_approve(
                    message=request.POST['message'])
                return json_success_response()
            elif action == 'block':
                assignment.experiment_worker().block(
                    reason=request.POST['message'],
                    all_tasks=request.POST.get('all_tasks', False),
                    report_to_mturk=request.POST.get('report_to_mturk', False))
                return json_success_response()
            else:
                return json_error_response("Unknown action: '%s'" % action)
        except Exception as e:
            return json_error_response(str(e))

    else:
        extra_filters = {
            'submission_complete': True
        }
        if not settings.MTURK_SANDBOX:
            extra_filters['hit__sandbox'] = False
        if 'worker_id' in request.GET:
            extra_filters['worker__mturk_worker_id'] = request.GET['worker_id']
        if 'hit_id' in request.GET:
            extra_filters['hit_id'] = request.GET['hit_id']

        if filter_key not in SUBMISSION_FILTERS:
            raise Http404
        assignments = MtAssignment.objects.filter(**dict_union(
            extra_filters, SUBMISSION_FILTERS[filter_key]['filter']))

        if experiment_slug != 'all':
            assignments = assignments.filter(
                hit__hit_type__experiment__slug=experiment_slug)

        entries = assignments \
            .defer('post_data', 'post_meta') \
            .order_by('-added') \
            .select_related('worker', 'hit', 'hit__hit_type',
                            'hit__hit_type__experiment') \
            .prefetch_related('submitted_contents__content')

        filters = []
        for key in SUBMISSION_FILTERS_LIST:
            count = 'TODO'
            filters.append(dict_union(
                SUBMISSION_FILTERS[key],
                {'key': key, 'count': count}
            ))

        categories = admin_submission_categories()
        category = None
        for c in categories:
            if c['slug'] == experiment_slug:
                category = c
                break
        else:
            raise Http404

        return render(request, template, dict_union({
            'nav': 'mturk-admin',
            'subnav': 'submission',
            'categories': categories,
            'category_slug': experiment_slug,
            'category': category,
            'filters': filters,
            'filter_key': filter_key,
            'entries': entries,
            'entries_per_page': 1,
            'span': 'span9',
            'thumb_template': 'mturk/admin/submission_entry.html',
        }, extra_context))


text:
package rage.models.daos;

import org.springframework.data.repository.CrudRepository;
import rage.models.ExerciseSkill;

import javax.transaction.Transactional;

@Transactional
public interface ExerciseSkillDao extends CrudRepository<ExerciseSkill, Long> {

    // Only exists to Save stuff currently.

}


text:
<?php

declare(strict_types=1);

use Apine\Core\Error\ErrorHandler;
use PHPUnit\Framework\TestCase;

class ErrorHandlerTest extends TestCase
{
    protected function setUp()
    {
        //$this->markTestSkipped();
    }

    public function testSet()
    {
        ErrorHandler::set(E_NOTICE, true);
        $this->assertEquals(E_NOTICE, ErrorHandler::$reportingLevel);
        $this->assertEquals(true, ErrorHandler::$showTrace);
    }

    /**
     * @depends testSet
     */
    public function testUnset()
    {
        ErrorHandler::unset();
        $this->assertEquals(E_ALL, ErrorHandler::$reportingLevel);
        $this->assertEquals(false, ErrorHandler::$showTrace);
    }

    public function testHandleError()
    {
        try {
            ErrorHandler::handleError(E_USER_ERROR, 'Test Error', __FILE__, 40);
        } catch (\Throwable $e) {
            $this->assertInstanceOf(ErrorException::class, $e);
            $this->assertAttributeEquals(E_USER_ERROR, 'severity', $e);
        }
    }

    public function testHandleException()
    {
        try {
            ErrorHandler::handleError(E_USER_ERROR, 'Test Error', __FILE__, 40);
        } catch (\Throwable $e) {
            ob_start();
            ErrorHandler::handleException($e);
            $content = ob_get_contents();
            ob_end_clean();

            $this->assertTrue(headers_sent());
            $this->assertInternalType('string', $content);
            $this->assertStringStartsWith('Test Error', $content);
        }
    }
}


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
Die Gattung Phlegmacium (Schleimköpfe). Die Pilze Mitteleuropas 4 351 (1960)

#### Original name
Cortinarius vitellinus (Fr.) Bigeard & H. Guill., 1909

### Remarks
null


text:
// RobotBuilder Version: 2.0
//
// This file was generated by RobotBuilder. It contains sections of
// code that are automatically generated and assigned by robotbuilder.
// These sections will be updated in the future when you export to
// Java from RobotBuilder. Do not put any code or make any change in
// the blocks indicating autogenerated code or it will be lost on an
// update. Deleting the comments indicating the section will prevent
// it from being updated in the future.

package org.usfirst.frc157.ProtoBot2017.commands;
import edu.wpi.first.wpilibj.GenericHID;
import edu.wpi.first.wpilibj.command.Command;
import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard;

import org.usfirst.frc157.ProtoBot2017.Robot;
import org.usfirst.frc157.ProtoBot2017.subsystems.Drive;
import org.usfirst.frc157.ProtoBot2017.subsystems.Drive.XY;

/**
 *
 */
public class OperatorDrive extends Command {

    // BEGIN AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=VARIABLE_DECLARATIONS

    // END AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=VARIABLE_DECLARATIONS

    // BEGIN AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=CONSTRUCTOR
    public OperatorDrive() {

    // END AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=CONSTRUCTOR
        // BEGIN AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=VARIABLE_SETTING

        // END AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=VARIABLE_SETTING
        // BEGIN AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=REQUIRES
        requires(Robot.drive);

        // END AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=REQUIRES
    }

    // Called just before this Command runs the first time
    protected void initialize() {
    }

    // Called repeatedly when this Command is scheduled to run
    protected void execute() {
    	Robot.drive.updateHeading();
        // edited by JAmieson Dunne on 1/25/17
		SmartDashboard.putData("DRIVE-IMU", Robot.drive.getImu());
		// Gets x and y values from joystick to pass as arguments
    	double x = Robot.oi.getDriver().getX(GenericHID.Hand.kLeft);
    	double y = Robot.oi.getDriver().getY(GenericHID.Hand.kLeft);

    	// reverse direction so that translation to be consistent with operators expectations
    	x = -x;

    	// gets x value from the joystick to use as argument
    	double rot = Robot.oi.getDriver().getX(GenericHID.Hand.kRight);

    	// reverse direction of rotation to be consistent with operators expectation
    	rot = -rot;

        Robot.drive.stickDriveBot(x, y, rot);
    }

    // Make this return true when this Command no longer needs to run execute()
    protected boolean isFinished() {
        return false;
    }

    // Called once after isFinished returns true
    protected void end() {
    }

    // Called when another command which requires one or more of the same
    // subsystems is scheduled to run
    protected void interrupted() {
    }
}
;


text:
<?php

class TinyMCE_SpellChecker_Engine {
	private static $engines = array();
	private $config;

	public function __constructor($config) {
		$this->config = $config;
	}

	/**
	 * Spellchecks an array of words.
	 *
	 * @param String $lang Selected language code (like en_US or de_DE). Shortcodes like "en" and "de" work with enchant >= 1.4.1
	 * @param Array $words Array of words to check.
	 * @return Name/value object with arrays of suggestions.
	 */
	public function getSuggestions($lang, $words) {
		return array();
	}

	/**
	 * Return true/false if the engine is supported by the server.
	 *
	 * @return boolean True/false if the engine is supported.
	 */
	public function isSupported() {
		return true;
	}

	/**
	 * Sets the config array used to create the instance.
	 *
	 * @param Array $config Name/value array with config options.
	 */
	public function setConfig($config) {
		$this->config = $config;
	}

	/**
	 * Returns the config array used to create the instance.
	 *
	 * @return Array Name/value array with config options.
	 */
	public function getConfig() {
		return $this->config;
	}

	// Static methods

	public static function processRequest($tinymceSpellcheckerConfig) {
		$engine = self::get($tinymceSpellcheckerConfig["engine"]);
		$engine = new $engine();
		$engine->setConfig($tinymceSpellcheckerConfig);

		header('Content-Type: application/json');
		header('Content-Encoding: UTF-8');
		header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
		header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
		header("Cache-Control: no-store, no-cache, must-revalidate");
		header("Cache-Control: post-check=0, pre-check=0", false);
		header("Pragma: no-cache");

		$method = self::getParam("method", "spellcheck");
		$lang = self::getParam("lang", "en_US");
		$text = self::getParam("text");

		if ($method == "spellcheck") {
			try {
				if (!$text) {
					throw new Exception("Missing input parameter 'text'.");
				}

				if (!$engine->isSupported()) {
					throw new Exception("Current spellchecker isn't supported.");
				}

				$words = self::getWords($text);

				echo json_encode((object) array(
					"words" => (object) $engine->getSuggestions($lang, $words)
				));
			} catch (Exception $e) {
				echo json_encode((object) array(
					"error" => $e->getMessage()
				));
			}
		} else {
			echo json_encode((object) array(
				"error" => "Invalid JSON input"
			));
		}
	}

	/**
	 * Returns an request value by name without magic quoting.
	 *
	 * @param String $name Name of parameter to get.
	 * @param String $default_value Default value to return if value not found.
	 * @return String request value by name without magic quoting or default value.
	 */
	public static function getParam($name, $default_value = false) {
		if (isset($_POST[$name])) {
			$req = $_POST;
		} else if (isset($_GET[$name])) {
			$req = $_GET;
		} else {
			return $default_value;
		}

		// Handle magic quotes
		if (ini_get("magic_quotes_gpc")) {
			if (is_array($req[$name])) {
				$out = array();

				foreach ($req[$name] as $name => $value) {
					$out[stripslashes($name)] = stripslashes($value);
				}

				return $out;
			}

			return stripslashes($req[$name]);
		}

		return $req[$name];
	}

	public static function add($name, $className) {
		self::$engines[$name] = $className;
	}

	public static function get($name) {
		if (!isset(self::$engines[$name])) {
			return null;
		}

		return self::$engines[$name];
	}

	public static function getWords($text) {
		preg_match_all('(\w{3,})u', $text, $matches);
		$words = $matches[0];

		for ($i = count($words) - 1;  $i >= 0; $i--) {
			// Exclude words with numbers in them
			if (preg_match('/[0-9]+/', $words[$i])) {
				array_splice($words, $i, 1);
			}
		}

		return $words;
	}
}

?>