text:
//
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.6
// See http://java.sun.com/xml/jaxb
// Any modifications to this file will be lost upon recompilation of the source schema.
// Generated on: 2013.12.25 at 12:17:53 PM CST
//

package ca.ieso.reports.schema.trapostauctionmcpstr1;

import java.math.BigDecimal;
import java.math.BigInteger;
import java.util.ArrayList;
import java.util.List;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlSchemaType;
import javax.xml.bind.annotation.XmlType;
import javax.xml.datatype.XMLGregorianCalendar;

/**
 *
Java class for anonymous complex type.
 *
 *
The following schema fragment specifies the expected content contained within this class.
 *
 *

 * <complexType>
 *   <complexContent>
 *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
 *       <sequence>
 *         <element name="AuctionName" type="{http://www.w3.org/2001/XMLSchema}string"/>
 *         <element name="AuctionRoundNumber" type="{http://www.w3.org/2001/XMLSchema}integer"/>
 *         <element name="AuctionRoundCloseDate" type="{http://www.w3.org/2001/XMLSchema}dateTime"/>
 *         <element name="AuctionTimeStructure" type="{http://www.w3.org/2001/XMLSchema}string"/>
 *         <element name="AuctionEarliestDate" type="{http://www.w3.org/2001/XMLSchema}date"/>
 *         <element name="AuctionLastDate" type="{http://www.w3.org/2001/XMLSchema}date"/>
 *         <element name="AuctionSalesSummary" maxOccurs="unbounded">
 *           <complexType>
 *             <complexContent>
 *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
 *                 <sequence>
 *                   <element name="InjectionZone" type="{http://www.w3.org/2001/XMLSchema}string"/>
 *                   <element name="WithdrawalZone" type="{http://www.w3.org/2001/XMLSchema}string"/>
 *                   <element name="EnergyMW" type="{http://www.ieso.ca/schema}MW_decimal5.1"/>
 *                   <element name="MCP" type="{http://www.ieso.ca/schema}Money"/>
 *                 </sequence>
 *               </restriction>
 *             </complexContent>
 *           </complexType>
 *         </element>
 *         <element name="AuctionUnavialableHours" minOccurs="0">
 *           <complexType>
 *             <complexContent>
 *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
 *                 <sequence>
 *                   <element name="DailyHours" maxOccurs="unbounded">
 *                     <complexType>
 *                       <complexContent>
 *                         <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
 *                           <sequence>
 *                             <element name="Day" type="{http://www.w3.org/2001/XMLSchema}date"/>
 *                             <element name="Hour" type="{http://www.w3.org/2001/XMLSchema}integer" maxOccurs="24"/>
 *                           </sequence>
 *                         </restriction>
 *                       </complexContent>
 *                     </complexType>
 *                   </element>
 *                 </sequence>
 *               </restriction>
 *             </complexContent>
 *           </complexType>
 *         </element>
 *       </sequence>
 *     </restriction>
 *   </complexContent>
 * </complexType>
 *

 *
 *
 */
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "", propOrder = {
    "auctionName",
    "auctionRoundNumber",
    "auctionRoundCloseDate",
    "auctionTimeStructure",
    "auctionEarliestDate",
    "auctionLastDate",
    "auctionSalesSummary",
    "auctionUnavialableHours"
})
@XmlRootElement(name = "DocBody")
public class DocBody {

    @XmlElement(name = "AuctionName", required = true)
    protected String auctionName;
    @XmlElement(name = "AuctionRoundNumber", required = true)
    protected BigInteger auctionRoundNumber;
    @XmlElement(name = "AuctionRoundCloseDate", required = true)
    @XmlSchemaType(name = "dateTime")
    protected XMLGregorianCalendar auctionRoundCloseDate;
    @XmlElement(name = "AuctionTimeStructure", required = true)
    protected String auctionTimeStructure;
    @XmlElement(name = "AuctionEarliestDate", required = true)
    @XmlSchemaType(name = "date")
    protected XMLGregorianCalendar auctionEarliestDate;
    @XmlElement(name = "AuctionLastDate", required = true)
    @XmlSchemaType(name = "date")
    protected XMLGregorianCalendar auctionLastDate;
    @XmlElement(name = "AuctionSalesSummary", required = true)
    protected List<DocBody.AuctionSalesSummary> auctionSalesSummary;
    @XmlElement(name = "AuctionUnavialableHours")
    protected DocBody.AuctionUnavialableHours auctionUnavialableHours;

    /**
     * Gets the value of the auctionName property.
     *
     * @return
     *     possible object is
     *     {@link String }
     *
     */
    public String getAuctionName() {
        return auctionName;
    }

    /**
     * Sets the value of the auctionName property.
     *
     * @param value
     *     allowed object is
     *     {@link String }
     *
     */
    public void setAuctionName(String value) {
        this.auctionName = value;
    }

    /**
     * Gets the value of the auctionRoundNumber property.
     *
     * @return
     *     possible object is
     *     {@link BigInteger }
     *
     */
    public BigInteger getAuctionRoundNumber() {
        return auctionRoundNumber;
    }

    /**
     * Sets the value of the auctionRoundNumber property.
     *
     * @param value
     *     allowed object is
     *     {@link BigInteger }
     *
     */
    public void setAuctionRoundNumber(BigInteger value) {
        this.auctionRoundNumber = value;
    }

    /**
     * Gets the value of the auctionRoundCloseDate property.
     *
     * @return
     *     possible object is
     *     {@link XMLGregorianCalendar }
     *
     */
    public XMLGregorianCalendar getAuctionRoundCloseDate() {
        return auctionRoundCloseDate;
    }

    /**
     * Sets the value of the auctionRoundCloseDate property.
     *
     * @param value
     *     allowed object is
     *     {@link XMLGregorianCalendar }
     *
     */
    public void setAuctionRoundCloseDate(XMLGregorianCalendar value) {
        this.auctionRoundCloseDate = value;
    }

    /**
     * Gets the value of the auctionTimeStructure property.
     *
     * @return
     *     possible object is
     *     {@link String }
     *
     */
    public String getAuctionTimeStructure() {
        return auctionTimeStructure;
    }

    /**
     * Sets the value of the auctionTimeStructure property.
     *
     * @param value
     *     allowed object is
     *     {@link String }
     *
     */
    public void setAuctionTimeStructure(String value) {
        this.auctionTimeStructure = value;
    }

    /**
     * Gets the value of the auctionEarliestDate property.
     *
     * @return
     *     possible object is
     *     {@link XMLGregorianCalendar }
     *
     */
    public XMLGregorianCalendar getAuctionEarliestDate() {
        return auctionEarliestDate;
    }

    /**
     * Sets the value of the auctionEarliestDate property.
     *
     * @param value
     *     allowed object is
     *     {@link XMLGregorianCalendar }
     *
     */
    public void setAuctionEarliestDate(XMLGregorianCalendar value) {
        this.auctionEarliestDate = value;
    }

    /**
     * Gets the value of the auctionLastDate property.
     *
     * @return
     *     possible object is
     *     {@link XMLGregorianCalendar }
     *
     */
    public XMLGregorianCalendar getAuctionLastDate() {
        return auctionLastDate;
    }

    /**
     * Sets the value of the auctionLastDate property.
     *
     * @param value
     *     allowed object is
     *     {@link XMLGregorianCalendar }
     *
     */
    public void setAuctionLastDate(XMLGregorianCalendar value) {
        this.auctionLastDate = value;
    }

    /**
     * Gets the value of the auctionSalesSummary property.
     *
     *

     * This accessor method returns a reference to the live list,
     * not a snapshot. Therefore any modification you make to the
     * returned list will be present inside the JAXB object.
     * This is why there is not a set method for the auctionSalesSummary property.
     *
     *

     * For example, to add a new item, do as follows:
     *

     *    getAuctionSalesSummary().add(newItem);
     *

     *
     *
     *

     * Objects of the following type(s) are allowed in the list
     * {@link DocBody.AuctionSalesSummary }
     *
     *
     */
    public List<DocBody.AuctionSalesSummary> getAuctionSalesSummary() {
        if (auctionSalesSummary == null) {
            auctionSalesSummary = new ArrayList<DocBody.AuctionSalesSummary>();
        }
        return this.auctionSalesSummary;
    }

    /**
     * Gets the value of the auctionUnavialableHours property.
     *
     * @return
     *     possible object is
     *     {@link DocBody.AuctionUnavialableHours }
     *
     */
    public DocBody.AuctionUnavialableHours getAuctionUnavialableHours() {
        return auctionUnavialableHours;
    }

    /**
     * Sets the value of the auctionUnavialableHours property.
     *
     * @param value
     *     allowed object is
     *     {@link DocBody.AuctionUnavialableHours }
     *
     */
    public void setAuctionUnavialableHours(DocBody.AuctionUnavialableHours value) {
        this.auctionUnavialableHours = value;
    }

    /**
     *
Java class for anonymous complex type.
     *
     *
The following schema fragment specifies the expected content contained within this class.
     *
     *

     * <complexType>
     *   <complexContent>
     *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
     *       <sequence>
     *         <element name="InjectionZone" type="{http://www.w3.org/2001/XMLSchema}string"/>
     *         <element name="WithdrawalZone" type="{http://www.w3.org/2001/XMLSchema}string"/>
     *         <element name="EnergyMW" type="{http://www.ieso.ca/schema}MW_decimal5.1"/>
     *         <element name="MCP" type="{http://www.ieso.ca/schema}Money"/>
     *       </sequence>
     *     </restriction>
     *   </complexContent>
     * </complexType>
     *

     *
     *
     */
    @XmlAccessorType(XmlAccessType.FIELD)
    @XmlType(name = "", propOrder = {
        "injectionZone",
        "withdrawalZone",
        "energyMW",
        "mcp"
    })
    public static class AuctionSalesSummary {

        @XmlElement(name = "InjectionZone", required = true)
        protected String injectionZone;
        @XmlElement(name = "WithdrawalZone", required = true)
        protected String withdrawalZone;
        @XmlElement(name = "EnergyMW", required = true)
        protected BigDecimal energyMW;
        @XmlElement(name = "MCP", required = true)
        protected BigDecimal mcp;

        /**
         * Gets the value of the injectionZone property.
         *
         * @return
         *     possible object is
         *     {@link String }
         *
         */
        public String getInjectionZone() {
            return injectionZone;
        }

        /**
         * Sets the value of the injectionZone property.
         *
         * @param value
         *     allowed object is
         *     {@link String }
         *
         */
        public void setInjectionZone(String value) {
            this.injectionZone = value;
        }

        /**
         * Gets the value of the withdrawalZone property.
         *
         * @return
         *     possible object is
         *     {@link String }
         *
         */
        public String getWithdrawalZone() {
            return withdrawalZone;
        }

        /**
         * Sets the value of the withdrawalZone property.
         *
         * @param value
         *     allowed object is
         *     {@link String }
         *
         */
        public void setWithdrawalZone(String value) {
            this.withdrawalZone = value;
        }

        /**
         * Gets the value of the energyMW property.
         *
         * @return
         *     possible object is
         *     {@link BigDecimal }
         *
         */
        public BigDecimal getEnergyMW() {
            return energyMW;
        }

        /**
         * Sets the value of the energyMW property.
         *
         * @param value
         *     allowed object is
         *     {@link BigDecimal }
         *
         */
        public void setEnergyMW(BigDecimal value) {
            this.energyMW = value;
        }

        /**
         * Gets the value of the mcp property.
         *
         * @return
         *     possible object is
         *     {@link BigDecimal }
         *
         */
        public BigDecimal getMCP() {
            return mcp;
        }

        /**
         * Sets the value of the mcp property.
         *
         * @param value
         *     allowed object is
         *     {@link BigDecimal }
         *
         */
        public void setMCP(BigDecimal value) {
            this.mcp = value;
        }

    }

    /**
     *
Java class for anonymous complex type.
     *
     *
The following schema fragment specifies the expected content contained within this class.
     *
     *

     * <complexType>
     *   <complexContent>
     *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
     *       <sequence>
     *         <element name="DailyHours" maxOccurs="unbounded">
     *           <complexType>
     *             <complexContent>
     *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
     *                 <sequence>
     *                   <element name="Day" type="{http://www.w3.org/2001/XMLSchema}date"/>
     *                   <element name="Hour" type="{http://www.w3.org/2001/XMLSchema}integer" maxOccurs="24"/>
     *                 </sequence>
     *               </restriction>
     *             </complexContent>
     *           </complexType>
     *         </element>
     *       </sequence>
     *     </restriction>
     *   </complexContent>
     * </complexType>
     *

     *
     *
     */
    @XmlAccessorType(XmlAccessType.FIELD)
    @XmlType(name = "", propOrder = {
        "dailyHours"
    })
    public static class AuctionUnavialableHours {

        @XmlElement(name = "DailyHours", required = true)
        protected List<DocBody.AuctionUnavialableHours.DailyHours> dailyHours;

        /**
         * Gets the value of the dailyHours property.
         *
         *

         * This accessor method returns a reference to the live list,
         * not a snapshot. Therefore any modification you make to the
         * returned list will be present inside the JAXB object.
         * This is why there is not a set method for the dailyHours property.
         *
         *

         * For example, to add a new item, do as follows:
         *

         *    getDailyHours().add(newItem);
         *

         *
         *
         *

         * Objects of the following type(s) are allowed in the list
         * {@link DocBody.AuctionUnavialableHours.DailyHours }
         *
         *
         */
        public List<DocBody.AuctionUnavialableHours.DailyHours> getDailyHours() {
            if (dailyHours == null) {
                dailyHours = new ArrayList<DocBody.AuctionUnavialableHours.DailyHours>();
            }
            return this.dailyHours;
        }

        /**
         *
Java class for anonymous complex type.
         *
         *
The following schema fragment specifies the expected content contained within this class.
         *
         *

         * <complexType>
         *   <complexContent>
         *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
         *       <sequence>
         *         <element name="Day" type="{http://www.w3.org/2001/XMLSchema}date"/>
         *         <element name="Hour" type="{http://www.w3.org/2001/XMLSchema}integer" maxOccurs="24"/>
         *       </sequence>
         *     </restriction>
         *   </complexContent>
         * </complexType>
         *

         *
         *
         */
        @XmlAccessorType(XmlAccessType.FIELD)
        @XmlType(name = "", propOrder = {
            "day",
            "hour"
        })
        public static class DailyHours {

            @XmlElement(name = "Day", required = true)
            @XmlSchemaType(name = "date")
            protected XMLGregorianCalendar day;
            @XmlElement(name = "Hour", required = true)
            protected List<BigInteger> hour;

            /**
             * Gets the value of the day property.
             *
             * @return
             *     possible object is
             *     {@link XMLGregorianCalendar }
             *
             */
            public XMLGregorianCalendar getDay() {
                return day;
            }

            /**
             * Sets the value of the day property.
             *
             * @param value
             *     allowed object is
             *     {@link XMLGregorianCalendar }
             *
             */
            public void setDay(XMLGregorianCalendar value) {
                this.day = value;
            }

            /**
             * Gets the value of the hour property.
             *
             *

             * This accessor method returns a reference to the live list,
             * not a snapshot. Therefore any modification you make to the
             * returned list will be present inside the JAXB object.
             * This is why there is not a set method for the hour property.
             *
             *

             * For example, to add a new item, do as follows:
             *

             *    getHour().add(newItem);
             *

             *
             *
             *

             * Objects of the following type(s) are allowed in the list
             * {@link BigInteger }
             *
             *
             */
            public List<BigInteger> getHour() {
                if (hour == null) {
                    hour = new ArrayList<BigInteger>();
                }
                return this.hour;
            }

        }

    }

}


text:
using System;
using System.Reflection;

namespace LeapInternal
{
  public static class Logger
  {
    //
    // Summary:
    //     Logs message to the a Console.
    public static void Log(object message)
    {
#if DEBUG
#if UNITY_EDITOR
                    UnityEngine.Debug.Log(message);
#else
                    Console.WriteLine(message);
#endif
#endif
    }

    public static void LogStruct(object thisObject, string title = "")
    {
      try
      {
        if (!thisObject.GetType().IsValueType)
        {
          Logger.Log(title + " ---- Trying to log non-struct with struct logger");
          return;
        }
        Logger.Log(title + " ---- " + thisObject.GetType().ToString());
        FieldInfo[] fieldInfos;
        fieldInfos = thisObject.GetType().GetFields(
            BindingFlags.Public | BindingFlags.NonPublic // Get public and non-public
            | BindingFlags.Static | BindingFlags.Instance  // Get instance + static
            | BindingFlags.FlattenHierarchy); // Search up the hierarchy

        // write member names
        foreach (FieldInfo fieldInfo in fieldInfos)
        {
          string value = fieldInfo.GetValue(thisObject).ToString();
          Logger.Log(" -------- Name: " + fieldInfo.Name + ", Value = " + value);
        }
      }
      catch (Exception exception)
      {
        Logger.Log(exception.Message);
      }
    }
  }
}

redpajama_set_name: RedPajamaGithub


text:
#ifndef _SAM4L_ABDACB_INSTANCE_
#define _SAM4L_ABDACB_INSTANCE_

/* ========== Register definition for ABDACB peripheral ========== */
#if (defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__))
#define REG_ABDACB_CR              (0x40064000U) /**< \brief (ABDACB) Control Register */
#define REG_ABDACB_SDR0            (0x40064004U) /**< \brief (ABDACB) Sample Data Register 0 */
#define REG_ABDACB_SDR1            (0x40064008U) /**< \brief (ABDACB) Sample Data Register 1 */
#define REG_ABDACB_VCR0            (0x4006400CU) /**< \brief (ABDACB) Volume Control Register 0 */
#define REG_ABDACB_VCR1            (0x40064010U) /**< \brief (ABDACB) Volume Control Register 1 */
#define REG_ABDACB_IER             (0x40064014U) /**< \brief (ABDACB) Interrupt Enable Register */
#define REG_ABDACB_IDR             (0x40064018U) /**< \brief (ABDACB) Interupt Disable Register */
#define REG_ABDACB_IMR             (0x4006401CU) /**< \brief (ABDACB) Interrupt Mask Register */
#define REG_ABDACB_SR              (0x40064020U) /**< \brief (ABDACB) Status Register */
#define REG_ABDACB_SCR             (0x40064024U) /**< \brief (ABDACB) Status Clear Register */
#define REG_ABDACB_PARAMETER       (0x40064028U) /**< \brief (ABDACB) Parameter Register */
#define REG_ABDACB_VERSION         (0x4006402CU) /**< \brief (ABDACB) Version Register */
#else
#define REG_ABDACB_CR              (*(RwReg  *)0x40064000U) /**< \brief (ABDACB) Control Register */
#define REG_ABDACB_SDR0            (*(RwReg  *)0x40064004U) /**< \brief (ABDACB) Sample Data Register 0 */
#define REG_ABDACB_SDR1            (*(RwReg  *)0x40064008U) /**< \brief (ABDACB) Sample Data Register 1 */
#define REG_ABDACB_VCR0            (*(RwReg  *)0x4006400CU) /**< \brief (ABDACB) Volume Control Register 0 */
#define REG_ABDACB_VCR1            (*(RwReg  *)0x40064010U) /**< \brief (ABDACB) Volume Control Register 1 */
#define REG_ABDACB_IER             (*(WoReg  *)0x40064014U) /**< \brief (ABDACB) Interrupt Enable Register */
#define REG_ABDACB_IDR             (*(WoReg  *)0x40064018U) /**< \brief (ABDACB) Interupt Disable Register */
#define REG_ABDACB_IMR             (*(RoReg  *)0x4006401CU) /**< \brief (ABDACB) Interrupt Mask Register */
#define REG_ABDACB_SR              (*(RoReg  *)0x40064020U) /**< \brief (ABDACB) Status Register */
#define REG_ABDACB_SCR             (*(WoReg  *)0x40064024U) /**< \brief (ABDACB) Status Clear Register */
#define REG_ABDACB_PARAMETER       (*(RoReg  *)0x40064028U) /**< \brief (ABDACB) Parameter Register */
#define REG_ABDACB_VERSION         (*(RoReg  *)0x4006402CU) /**< \brief (ABDACB) Version Register */
#endif /* (defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */

/* ========== Instance parameters for ABDACB peripheral ========== */
#define ABDACB_GCLK_NUM             6
#define ABDACB_PDCA_ID_TX_CH0       31
#define ABDACB_PDCA_ID_TX_CH1       32

#endif /* _SAM4L_ABDACB_INSTANCE_ */


text:
from os_win import exceptions as os_win_exc
from os_win import utilsfactory
from oslo_log import log as logging

from os_brick import exception
from os_brick.i18n import _
from os_brick.initiator.connectors import base_iscsi
from os_brick.initiator.windows import base as win_conn_base
from os_brick import utils

LOG = logging.getLogger(__name__)

class WindowsISCSIConnector(win_conn_base.BaseWindowsConnector,
                            base_iscsi.BaseISCSIConnector):
    def __init__(self, *args, **kwargs):
        super(WindowsISCSIConnector, self).__init__(*args, **kwargs)
        self.use_multipath = kwargs.pop('use_multipath', False)
        self.initiator_list = kwargs.pop('initiator_list', [])

        self._iscsi_utils = utilsfactory.get_iscsi_initiator_utils()

        self.validate_initiators()

    def validate_initiators(self):
        """Validates the list of requested initiator HBAs

        Validates the list of requested initiator HBAs to be used
        when establishing iSCSI sessions.
        """
        valid_initiator_list = True
        if not self.initiator_list:
            LOG.info("No iSCSI initiator was explicitly requested. "
                     "The Microsoft iSCSI initiator will choose the "
                     "initiator when establishing sessions.")
        else:
            available_initiators = self._iscsi_utils.get_iscsi_initiators()
            for initiator in self.initiator_list:
                if initiator not in available_initiators:
                    LOG.warning("The requested initiator %(req_initiator)s "
                                "is not in the list of available initiators: "
                                "%(avail_initiators)s.",
                                dict(req_initiator=initiator,
                                     avail_initiators=available_initiators))
                    valid_initiator_list = False
        return valid_initiator_list

    def get_initiator(self):
        """Returns the iSCSI initiator node name."""
        return self._iscsi_utils.get_iscsi_initiator()

    @staticmethod
    def get_connector_properties(*args, **kwargs):
        iscsi_utils = utilsfactory.get_iscsi_initiator_utils()
        initiator = iscsi_utils.get_iscsi_initiator()
        return dict(initiator=initiator)

    def _get_all_paths(self, connection_properties):
        initiator_list = self.initiator_list or [None]
        all_targets = self._get_all_targets(connection_properties)
        paths = [(initiator_name, target_portal, target_iqn, target_lun)
                 for target_portal, target_iqn, target_lun in all_targets
                 for initiator_name in initiator_list]
        return paths

    @utils.trace
    def connect_volume(self, connection_properties):
        connected_target_mappings = set()
        volume_connected = False

        for (initiator_name,
             target_portal,
             target_iqn,
             target_lun) in self._get_all_paths(connection_properties):
            try:
                LOG.info("Attempting to establish an iSCSI session to "
                         "target %(target_iqn)s on portal %(target_portal)s "
                         "accessing LUN %(target_lun)s using initiator "
                         "%(initiator_name)s.",
                         dict(target_portal=target_portal,
                              target_iqn=target_iqn,
                              target_lun=target_lun,
                              initiator_name=initiator_name))
                self._iscsi_utils.login_storage_target(
                    target_lun=target_lun,
                    target_iqn=target_iqn,
                    target_portal=target_portal,
                    auth_username=connection_properties.get('auth_username'),
                    auth_password=connection_properties.get('auth_password'),
                    mpio_enabled=self.use_multipath,
                    initiator_name=initiator_name,
                    ensure_lun_available=False)

                connected_target_mappings.add((target_iqn, target_lun))

                if not self.use_multipath:
                    break
            except os_win_exc.OSWinException:
                LOG.exception("Could not establish the iSCSI session.")

        for target_iqn, target_lun in connected_target_mappings:
            try:
                (device_number,
                 device_path) = self._iscsi_utils.get_device_number_and_path(
                    target_iqn, target_lun,
                    retry_attempts=self.device_scan_attempts,
                    retry_interval=self.device_scan_interval,
                    rescan_disks=True,
                    ensure_mpio_claimed=self.use_multipath)
                volume_connected = True
            except os_win_exc.OSWinException:
                LOG.exception("Could not retrieve device path for target "
                              "%(target_iqn)s and lun %(target_lun)s.",
                              dict(target_iqn=target_iqn,
                                   target_lun=target_lun))

        if not volume_connected:
            raise exception.BrickException(
                _("Could not connect volume %s.") % connection_properties)

        scsi_wwn = self._get_scsi_wwn(device_number)

        device_info = {'type': 'block',
                       'path': device_path,
                       'number': device_number,
                       'scsi_wwn': scsi_wwn}
        return device_info

    @utils.trace
    def disconnect_volume(self, connection_properties, device_info=None,
                          force=False, ignore_errors=False):
        # We want to refresh the cached information first.
        self._diskutils.rescan_disks()
        for (target_portal,
             target_iqn,
             target_lun) in self._get_all_targets(connection_properties):

            luns = self._iscsi_utils.get_target_luns(target_iqn)
            # We disconnect the target only if it does not expose other
            # luns which may be in use.
            if not luns or luns == [target_lun]:
                self._iscsi_utils.logout_storage_target(target_iqn)

    @utils.trace
    def get_volume_paths(self, connection_properties):
        device_paths = set()

        for (target_portal,
             target_iqn,
             target_lun) in self._get_all_targets(connection_properties):

            (device_number,
             device_path) = self._iscsi_utils.get_device_number_and_path(
                target_iqn, target_lun,
                ensure_mpio_claimed=self.use_multipath)
            if device_path:
                device_paths.add(device_path)

        self._check_device_paths(device_paths)
        return list(device_paths)


text:
<?php

class HighchartsAppModel extends AppModel {
}


text:
"""
    cobra
    ~~~~~

    Implements cobra main

    :author:    BlBana <635373043@qq.com>
    :homepage:  https://github.com/WhaleShark-Team/cobra
    :license:   MIT, see LICENSE for more details.
    :copyright: Copyright (c) 2018 Feei. All rights reserved
"""
import xml.etree.ElementTree as eT
from cobra.detection import Detection
from cobra.config import project_directory

vul_path = project_directory+'/tests/vulnerabilities/'
examples_path = project_directory+'/tests/examples'

def test_framework():
    detection = Detection(vul_path+'requirements.txt', '.')
    frame = detection.framework
    assert frame == 'Flask'

def test_param_xml():
    detection = Detection(examples_path, '.')
    frame_data = {}
    language_data = {}
    tree = detection.rule()
    root = tree.getroot()
    frame_data, language_data = detection.parse_xml(root, frame_data, language_data)
    assert 'WordPress' in frame_data
    assert 'php' in language_data

def test_rule():
    detection = Detection(examples_path, '.')
    root = eT.ElementTree(file=examples_path+'/param_xml.xml')
    tree = detection.rule()
    assert type(root) is type(tree)

def test_get_dict():
    detection = Detection(examples_path, '.')
    extension = ['php', 'js', 'java']
    type_num = {}
    type_num = detection.get_dict(extension, type_num)
    print(type(type_num))
    assert type_num['php']['blank'] == 0

def test_project_information():
    extension = ['php', 'js', 'java']
    allfiles = Detection.project_information(examples_path, extension)
    assert examples_path+'/cloc.html' in allfiles

def test_count_py_line():
    count = Detection.count_py_line(examples_path+'/cloc.py')
    type_count = ['count_blank', 'count_code', 'count_pound']
    assert count['count_code'] == 5

def test_count_php_line():
    count = Detection.count_php_line(examples_path+'/cloc.php')
    type_count = ['count_blank', 'count_code', 'count_pound']
    assert count['count_code'] == 2

def test_count_java_line():
    count = Detection.count_java_line(examples_path+'/cloc.java')
    type_count = ['count_blank', 'count_code', 'count_pound']
    assert count['count_code'] == 1

def test_count_html_line():
    count = Detection.count_html_line(examples_path+'/cloc.html')
    type_count = ['count_blank', 'count_code', 'count_pound']
    assert count['count_code'] == 9

def test_count_data_line():
    count = Detection.count_data_line(examples_path+'/param_xml.xml')
    type_count = ['count_blank', 'count_code', 'count_pound']
    assert count['count_code'] == 81

def test_countnum():
    count = {'count_blank': 10, 'count_code': 20, 'count_pound': 30}
    type_num = {'php': {'blank': 10, 'code': 10, 'pound': 10, 'files': 2}}
    ext = 'php'
    type_num = Detection.countnum(count, type_num, ext)
    assert 'php' in type_num

def test_count_total_num():
    type_num = {'php': {'blank': 10, 'code': 10, 'pound': 10, 'files': 2},
                'java': {'blank': 10, 'code': 10, 'pound': 10, 'files': 2}}
    extension = ['php', 'java']
    total_file = 0
    total_blank_line = 0
    total_pound_line = 0
    total_code_line = 0
    total_file, total_blank_line, total_pound_line, total_code_line = Detection.count_total_num(type_num, extension,
                                                                                total_file,
                                                                                total_blank_line,
                                                                                total_pound_line,
                                                                                total_code_line)
    assert isinstance(total_file, int)
    assert isinstance(total_blank_line, int)
    assert isinstance(total_pound_line, int)
    assert isinstance(total_code_line, int)

def test_cloc():
    assert Detection(examples_path, '.').cloc()


text:
set DATE_TAG=20200712

echo ================================================================================
date /T
time /T
echo "DATE_TAG = "%DATE_TAG%
echo

echo "Start process data ..."

echo ------------------------------------------------------------
Metacritic_ConvertHtmlToRawData.bat %DATE_TAG%

rem Above commands will exit this parent script.


text:
ES6 `Object.observe` with nested object support; e.g. the way I want it.

[![Build Status](https://travis-ci.org/aheckmann/observed.svg?branch=master)](https://travis-ci.org/aheckmann/observed)

## What?

Do you dream of observing a plain javascript object for changes and reacting to it later? Now you can.

Available in **Node >= 0.11.13**, the standards compliant [Object.observe](http://wiki.ecmascript.org/doku.php?id=harmony:observe) treasure resides.

`Object.observe` allows us to register a listener for any type of change to a given object.

```js
var o = { name: 'harmony' };
Object.observe(o, function (changes) {
  console.log(changes);
})
o.name = 'ES6!'
o.kind = 'observed';

// logs..
// [ { type: 'update',
//     object: { name: 'ES6!', kind: 'observed' },
//     name: 'name',
//     oldValue: 'harmony' },
//   { type: 'add',
//     object: { name: 'ES6!', kind: 'observed' },
//     name: 'kind' } ]
```

You'll notice our callback received an array of all changes that occured. Cool.
But what about nested objects? Do they get automatically observed as well?

```js
var o = { nested: { deeper: true }};
Object.observe(o, function (changes) {
  console.log(changes);
})
o.nested.deeper = false
// crickets ..
```

Turns out they don't. And that's what `observed` is for: watching object modifications without having to care about whether or not they have nested objects and arrays.

## Usage

`observed` returns an `EventEmitter` which you listen to for changes.
There are five classes of events, closely mirroring `Object.observe`

- `add`
- `update`
- `delete`
- `reconfigure`
- `change` - fired when any of the above events are emitted

```js
var O = require('observed')
var object = { name: {} }
var ee = O(object)

ee.on('add', console.log)

object.name.last = 'observed'

// logs
// { path: 'name.last',
//   name: 'last',
//   type: 'add',
//   object: { last: 'observed' },
//   value: 'observed',
//   oldValue: undefined }
```

You'll notice we now receive more information compared to `Object.observe`

- `path`: full path to the property, including nesting
- `name`: name of the path reported by `Object.observe`
- `type`: name of the event reported by `Object.observe`
- `object`: object reported from `Object.observe`
- `value`: current value for the given `path`. same as `object[name]`
- `oldValue`: previous value of the property as reported by `Object.observe`

You may also listen for changes to specific paths:

```js
var O = require('observed')
var object = { name: { last: 'Heckmann', first: 'aaron' }}
var ee = O(object)

ee.on('update name.first', console.log)

object.name.first = 'Aaron'

// logs
// { path: 'name.first',
//   name: 'first',
//   type: 'update',
//   object: { last: 'Heckmann', first: 'Aaron' },
//   value: 'Aaron',
//   oldValue: 'aaron' }
```

### deliverChanges()

There are occasions where we want to immediately force all pending changes to
emit instead of waiting for the next turn of the event loop. `observed` has
us covered here too. Just call its `deliverChanges()` method and all pending
changes will emit.

```js
var O = require('observed');
var obj = { movie: { title: 'Godzilla' }};
var ee = O(obj);

var emitted = false;
ee.on('change', function(){ emitted = true });

obj.movie.year = 2014;
assert.equal(false, emitted);

ee.deliverChanges();
assert.equal(true, emitted);
// :)
```

## Use cases

1. passing object changes down to a browser in realtime using something like [primus](https://github.com/primus/primus).
2. fanning out object changes across multiple nodes using something like [axon](https://github.com/visionmedia/axon).
3. buffering changes and pass them off to your database of choice in one `save` action.

## Features

1. Object tracking: Using ES6 `Object.observe` we provide support for rich object tracking without manual getters/setters.
2. Unobtrusive: Your object remains untouched and you may work with it as a plain js object.
3. Events: Receive an `EventEmitter` back which emits the following events:

- `add`
- `update`
- `delete`
- `reconfigure`
- `change` - fired when any of the above events are emitted

## Node version requirements

`Object.observe` is available by default in Node >= `0.11.13`.

```
> node yourProgram.js
```

If you are running Node `>= 0.11.0 < 0.11.13` you must run Node using the `--harmony` flag
and use a `0.0.n` version of this module.

```
> npm install observed@0.0.3
> node --harmony yourProgram.js
```

## Tests

Run em with `npm test`

## License

[MIT](https://github.com/aheckmann/observed/blob/master/LICENSE)


text:
// Type definitions for html-minifier 3.5
// Project: https://github.com/kangax/html-minifier, https://kangax.github.io/html-minifier
// Definitions by: Tanguy Krotoff <https://github.com/tkrotoff>
//                 Riku <https://github.com/rikuayanokozy>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.2

import * as UglifyJS from 'uglify-js';
import * as CleanCSS from 'clean-css';
import * as RelateUrl from 'relateurl';

export function minify(text: string, options?: Options): string;

export interface Options {
    // Treat attributes in case sensitive manner (useful for custom HTML tags)
    caseSensitive?: boolean;

    // Omit attribute values from boolean attributes
    collapseBooleanAttributes?: boolean;

    // Don't leave any spaces between display:inline; elements when collapsing. Must be used in conjunction with collapseWhitespace=true
    collapseInlineTagWhitespace?: boolean;

    /**
     * Collapse white space that contributes to text nodes in a document tree
     * @see http://perfectionkills.com/experimenting-with-html-minifier/#collapse_whitespace
     */
    collapseWhitespace?: boolean;

    // Always collapse to 1 space (never remove it entirely). Must be used in conjunction with collapseWhitespace=true
    conservativeCollapse?: boolean;

    // Arrays of regex'es that allow to support custom attribute assign expressions (e.g. '<div flex?="{{mode != cover}}"></div>')
    customAttrAssign?: RegExp[];

    // Regex that specifies custom attribute to strip newlines from (e.g. /ng-class/)
    customAttrCollapse?: RegExp;

    // Arrays of regex'es that allow to support custom attribute surround expressions (e.g. <input {{#if value}}checked="checked"{{/if}}>)
    customAttrSurround?: RegExp[];

    // Arrays of regex'es that allow to support custom event attributes for minifyJS (e.g. ng-click)
    customEventAttributes?: RegExp[];

    // Use direct Unicode characters whenever possible
    decodeEntities?: boolean;

    // Parse input according to HTML5 specifications
    html5?: boolean;

    // Array of regex'es that allow to ignore certain comments, when matched
    ignoreCustomComments?: RegExp[];

    // Array of regex'es that allow to ignore certain fragments, when matched (e.g. <?php ... ?>, {{ ... }}, etc.)
    ignoreCustomFragments?: RegExp[];

    // Insert tags generated by HTML parser
    includeAutoGeneratedTags?: boolean;

    // Keep the trailing slash on singleton elements
    keepClosingSlash?: boolean;

    // Specify a maximum line length. Compressed output will be split by newlines at valid HTML split-points
    maxLineLength?: number;

    // Minify CSS in style elements and style attributes (uses clean-css or function specified)
    minifyCSS?: boolean | CleanCSS.Options | ((text: string) => string);

    // Minify JavaScript in script elements and event attributes (uses UglifyJS or function specified)
    minifyJS?: boolean | UglifyJS.MinifyOptions | ((text: string, inline: boolean) => string);

    // Minify URLs in various attributes (uses relateurl or function specified)
    minifyURLs?: boolean | RelateUrl.Options | ((text: string) => string);

    // Always collapse to 1 line break (never remove it entirely) when whitespace between tags include a line break. Must be used in conjunction with collapseWhitespace=true
    preserveLineBreaks?: boolean;

    // Prevents the escaping of the values of attributes
    preventAttributesEscaping?: boolean;

    // Process contents of conditional comments through minifier
    processConditionalComments?: boolean;

    // Array of strings corresponding to types of script elements to process through minifier (e.g. text/ng-template, text/x-handlebars-template, etc.)
    processScripts?: string[];

    // Type of quote to use for attribute values (' or ")
    quoteCharacter?: string;

    /**
     * Remove quotes around attributes when possible
     * @see http://perfectionkills.com/experimenting-with-html-minifier/#remove_attribute_quotes
     */
    removeAttributeQuotes?: boolean;

    /**
     * Strip HTML comments
     * @see http://perfectionkills.com/experimenting-with-html-minifier/#remove_comments
     */
    removeComments?: boolean;

    /**
     * Remove all attributes with whitespace-only values
     * @see http://perfectionkills.com/experimenting-with-html-minifier/#remove_empty_or_blank_attributes
     */
    removeEmptyAttributes?: boolean | ((attrName: string, tag: string) => boolean);

    /**
     * Remove all elements with empty contents
     * @see http://perfectionkills.com/experimenting-with-html-minifier/#remove_empty_elements
     */
    removeEmptyElements?: boolean;

    /**
     * Remove optional tags
     * @see http://perfectionkills.com/experimenting-with-html-minifier/#remove_optional_tags
     */
    removeOptionalTags?: boolean;

    /**
     * Remove attributes when value matches default.
     * @see http://perfectionkills.com/experimenting-with-html-minifier/#remove_redundant_attributes
     */
    removeRedundantAttributes?: boolean;

    // Remove type="text/javascript" from script tags. Other type attribute values are left intact
    removeScriptTypeAttributes?: boolean;

    // Remove type="text/css" from style and link tags. Other type attribute values are left intact
    removeStyleLinkTypeAttributes?: boolean;

    // Remove space between attributes whenever possible. Note that this will result in invalid HTML!
    removeTagWhitespace?: boolean;

    /**
     * Sort attributes by frequency
     *
     * Minifier options like sortAttributes and sortClassName won't impact the plain-text size
     * of the output. However, they form long repetitive chains of characters that should improve
     * compression ratio of gzip used in HTTP compression.
     *
     * @see https://github.com/kangax/html-minifier#sorting-attributes--style-classes
     */
    sortAttributes?: boolean;

    /**
     * Sort style classes by frequency
     *
     * Minifier options like sortAttributes and sortClassName won't impact the plain-text size
     * of the output. However, they form long repetitive chains of characters that should improve
     * compression ratio of gzip used in HTTP compression.
     *
     * @see https://github.com/kangax/html-minifier#sorting-attributes--style-classes
     */
    sortClassName?: boolean;

    // Trim white space around ignoreCustomFragments
    trimCustomFragments?: boolean;

    /**
     * Replaces the doctype with the short (HTML5) doctype
     * @see http://perfectionkills.com/experimenting-with-html-minifier/#use_short_doctype
     */
    useShortDoctype?: boolean;
}


text:
"""Reading and writing from KlustaKwik-format files.
Ref: http://klusters.sourceforge.net/UserManual/data-files.html

Supported : Read, Write

Author : Chris Rodgers

TODO:
* When reading, put the Unit into the RCG, RC hierarchy
* When writing, figure out how to get group and cluster if those annotations
weren't set. Consider removing those annotations if they are redundant.
* Load features in addition to spiketimes.
"""

# I need to subclass BaseIO
from .baseio import BaseIO

# to import : Block, Segment, AnalogSignal, SpikeTrain, SpikeTrainList
from ..core import *
from .tools import create_many_to_one_relationship

# note neo.core need only numpy and quantitie
import numpy as np
import quantities as pq

# Pasted version of feature file format spec
"""
The Feature File

Generic file name: base.fet.n

Format: ASCII, integer values

The feature file lists for each spike the PCA coefficients for each
electrode, followed by the timestamp of the spike (more features can
be inserted between the PCA coefficients and the timestamp).
The first line contains the number of dimensions.
Assuming N1 spikes (spike1...spikeN1), N2 electrodes (e1...eN2) and
N3 coefficients (c1...cN3), this file looks like:

nbDimensions
c1_e1_spike1   c2_e1_spike1  ... cN3_e1_spike1   c1_e2_spike1  ... cN3_eN2_spike1   timestamp_spike1
c1_e1_spike2   c2_e1_spike2  ... cN3_e1_spike2   c1_e2_spike2  ... cN3_eN2_spike2   timestamp_spike2
...
c1_e1_spikeN1  c2_e1_spikeN1 ... cN3_e1_spikeN1  c1_e2_spikeN1 ... cN3_eN2_spikeN1  timestamp_spikeN1

The timestamp is expressed in multiples of the sampling interval. For
instance, for a 20kHz recording (50 microsecond sampling interval), a
timestamp of 200 corresponds to 200x0.000050s=0.01s from the beginning
of the recording session.

Notice that the last line must end with a newline or carriage return.
"""

import numpy as np
import glob
import matplotlib.mlab as mlab
import os.path
import shutil
import logging

class KlustaKwikIO(BaseIO):
    """Reading and writing from KlustaKwik-format files."""
    # Class variables demonstrating capabilities of this IO
    is_readable        = True
    is_writable        = True

    # This IO can only manipulate objects relating to spike times
    supported_objects  = [Block, SpikeTrain, Unit]

    # Keep things simple by always returning a block
    readable_objects    = [Block]

    # And write a block
    writeable_objects   = [Block]

    # Not sure what these do, if anything
    has_header         = False
    is_streameable     = False

    # GUI params
    read_params = {}

    # GUI params
    write_params = {}

    # The IO name and the file extensions it uses
    name               = 'KlustaKwik'
    extensions          = ['fet', 'clu', 'res', 'spk']

    # Operates on directories
    mode = 'file'

    def __init__(self, filename, sampling_rate=30000.):
        """Create a new IO to operate on a directory

        filename : the directory to contain the files
        basename : string, basename of KlustaKwik format, or None
        sampling_rate : in Hz, necessary because the KlustaKwik files
            stores data in samples.
        """
        BaseIO.__init__(self)
        #self.filename = os.path.normpath(filename)
        self.filename, self.basename = os.path.split(os.path.abspath(filename))
        self.sampling_rate = float(sampling_rate)

        # error check
        if not os.path.isdir(self.filename):
            raise ValueError("filename must be a directory")

        # initialize a helper object to parse filenames
        self._fp = FilenameParser(dirname=self.filename, basename=self.basename)

    # The reading methods. The `lazy` and `cascade` parameters are imposed
    # by neo.io API
    def read_block(self, lazy=False, cascade=True):
        """Returns a Block containing spike information.

        There is no obvious way to infer the segment boundaries from
        raw spike times, so for now all spike times are returned in one
        big segment. The way around this would be to specify the segment
        boundaries, and then change this code to put the spikes in the right
        segments.
        """
        # Create block and segment to hold all the data
        block = Block()
        # Search data directory for KlustaKwik files.
        # If nothing found, return empty block
        self._fetfiles = self._fp.read_filenames('fet')
        self._clufiles = self._fp.read_filenames('clu')
        if len(self._fetfiles) == 0 or not cascade:
            return block

        # Create a single segment to hold all of the data
        seg = Segment(name='seg0', index=0, file_origin=self.filename)
        block.segments.append(seg)

        # Load spike times from each group and store in a dict, keyed
        # by group number
        self.spiketrains = dict()
        for group in sorted(self._fetfiles.keys()):
            # Load spike times
            fetfile = self._fetfiles[group]
            spks, features = self._load_spike_times(fetfile)

            # Load cluster ids or generate
            if group in self._clufiles:
                clufile = self._clufiles[group]
                uids = self._load_unit_id(clufile)
            else:
                # unclustered data, assume all zeros
                uids = np.zeros(spks.shape, dtype=np.int32)

            # error check
            if len(spks) != len(uids):
                raise ValueError("lengths of fet and clu files are different")

            # Create Unit for each cluster
            unique_unit_ids = np.unique(uids)
            for unit_id in sorted(unique_unit_ids):
                # Initialize the unit
                u = Unit(name=('unit %d from group %d' % (unit_id, group)),
                    index=unit_id, group=group)

                # Initialize a new SpikeTrain for the spikes from this unit
                if lazy:
                    st = SpikeTrain(
                        times=[],
                        units='sec', t_start=0.0,
                        t_stop=spks.max() / self.sampling_rate,
                        name=('unit %d from group %d' % (unit_id, group)))
                    st.lazy_shape = len(spks[uids==unit_id])
                else:
                    st = SpikeTrain(
                        times=spks[uids==unit_id] / self.sampling_rate,
                        units='sec', t_start=0.0,
                        t_stop=spks.max() / self.sampling_rate,
                        name=('unit %d from group %d' % (unit_id, group)))
                st.annotations['cluster'] = unit_id
                st.annotations['group'] = group

                # put features in
                if not lazy and len(features) != 0:
                    st.annotations['waveform_features'] = features

                # Link
                u.spiketrains.append(st)
                seg.spiketrains.append(st)

        create_many_to_one_relationship(block)
        return block

    # Helper hidden functions for reading
    def _load_spike_times(self, fetfilename):
        """Reads and returns the spike times and features"""
        f = file(fetfilename, 'r')

        # Number of clustering features is integer on first line
        nbFeatures = int(f.readline().strip())

        # Each subsequent line consists of nbFeatures values, followed by
        # the spike time in samples.
        names = ['fet%d' % n for n in xrange(nbFeatures)]
        names.append('spike_time')

        # Load into recarray
        data = mlab.csv2rec(f, names=names, skiprows=1, delimiter=' ')
        f.close()

        # get features
        features = np.array([data['fet%d' % n] for n in xrange(nbFeatures)])

        # Return the spike_time column
        return data['spike_time'], features.transpose()

    def _load_unit_id(self, clufilename):
        """Reads and return the cluster ids as int32"""
        f = file(clufilename, 'r')

        # Number of clusters on this tetrode is integer on first line
        nbClusters = int(f.readline().strip())

        # Read each cluster name as a string
        cluster_names = f.readlines()
        f.close()

        # Convert names to integers
        # I think the spec requires cluster names to be integers, but
        # this code could be modified to support string names which are
        # auto-numbered.
        try:
            cluster_ids = [int(name) for name in cluster_names]
        except ValueError:
            raise ValueError(
                "Could not convert cluster name to integer in %s" % clufilename)

        # convert to numpy array and error check
        cluster_ids = np.array(cluster_ids, dtype=np.int32)
        if len(np.unique(cluster_ids)) != nbClusters:
            logging.warning("warning: I got %d clusters instead of %d in %s" % (
                len(np.unique(cluster_ids)), nbClusters, clufilename))

        return cluster_ids

    # writing functions
    def write_block(self, block):
        """Write spike times and unit ids to disk.

        Currently descends hierarchy from block to segment to spiketrain.
        Then gets group and cluster information from spiketrain.
        Then writes the time and cluster info to the file associated with
        that group.

        The group and cluster information are extracted from annotations,
        eg `sptr.annotations['group']`. If no cluster information exists,
        it is assigned to cluster 0.

        Note that all segments are essentially combined in
        this process, since the KlustaKwik format does not allow for
        segment boundaries.

        As implemented currently, does not use the `Unit` object at all.

        We first try to use the sampling rate of each SpikeTrain, or if this
        is not set, we use `self.sampling_rate`.

        If the files already exist, backup copies are created by appending
        the filenames with a "~".
        """
        # set basename
        if self.basename is None:
            logging.warning("warning: no basename provided, using `basename`")
            self.basename = 'basename'

        # First create file handles for each group which will be stored
        self._make_all_file_handles(block)

        # We'll detect how many features belong in each group
        self._group2features = {}

        # Iterate through segments in this block
        for seg in block.segments:
            # Write each spiketrain of the segment
            for st in seg.spiketrains:
                # Get file handles for this spiketrain using its group
                group = self.st2group(st)
                fetfilehandle = self._fetfilehandles[group]
                clufilehandle = self._clufilehandles[group]

                # Get the id to write to clu file for this spike train
                cluster = self.st2cluster(st)

                # Choose sampling rate to convert to samples
                try:
                    sr = st.annotations['sampling_rate']
                except KeyError:
                    sr = self.sampling_rate

                # Convert to samples
                spike_times_in_samples = np.rint(
                    np.array(st) * sr).astype(np.int)

                # Try to get features from spiketrain
                try:
                    all_features = st.annotations['waveform_features']
                except KeyError:
                    # Use empty
                    all_features = [
                        [] for n in range(len(spike_times_in_samples))]
                all_features = np.asarray(all_features)
                if all_features.ndim != 2:
                    raise ValueError("waveform features should be 2d array")

                # Check number of features we're supposed to have
                try:
                    n_features = self._group2features[group]
                except KeyError:
                    # First time through .. set number of features
                    n_features = all_features.shape[1]
                    self._group2features[group] = n_features

                    # and write to first line of file
                    fetfilehandle.write("%d\n" % n_features)
                if n_features != all_features.shape[1]:
                    raise ValueError("inconsistent number of features: " +
                        "supposed to be %d but I got %d" %\
                        (n_features, all_features.shape[1]))

                # Write features and time for each spike
                for stt, features in zip(spike_times_in_samples, all_features):
                    # first features
                    for val in features:
                        fetfilehandle.write(str(val))
                        fetfilehandle.write(" ")

                    # now time
                    fetfilehandle.write("%d\n" % stt)

                    # and cluster id
                    clufilehandle.write("%d\n" % cluster)

        # We're done, so close the files
        self._close_all_files()

    # Helper functions for writing
    def st2group(self, st):
        # Not sure this is right so make it a method in case we change it
        try:
            return st.annotations['group']
        except KeyError:
            return 0

    def st2cluster(self, st):
        # Not sure this is right so make it a method in case we change it
        try:
            return st.annotations['cluster']
        except KeyError:
            return 0

    def _make_all_file_handles(self, block):
        """Get the tetrode (group) of each neuron (cluster) by descending
        the hierarchy through segment and block.
        Store in a dict {group_id: list_of_clusters_in_that_group}
        """
        group2clusters = {}
        for seg in block.segments:
            for st in seg.spiketrains:
                group = self.st2group(st)
                cluster = self.st2cluster(st)

                if group in group2clusters:
                    if cluster not in group2clusters[group]:
                        group2clusters[group].append(cluster)
                else:
                    group2clusters[group] = [cluster]

        # Make new file handles for each group
        self._fetfilehandles, self._clufilehandles = {}, {}
        for group, clusters in group2clusters.items():
            self._new_group(group, nbClusters=len(clusters))

    def _new_group(self, id_group, nbClusters):
        # generate filenames
        fetfilename = os.path.join(self.filename,
            self.basename + ('.fet.%d' % id_group))
        clufilename = os.path.join(self.filename,
            self.basename + ('.clu.%d' % id_group))

        # back up before overwriting
        if os.path.exists(fetfilename):
            shutil.copyfile(fetfilename, fetfilename + '~')
        if os.path.exists(clufilename):
            shutil.copyfile(clufilename, clufilename + '~')

        # create file handles
        self._fetfilehandles[id_group] = file(fetfilename, 'w')
        self._clufilehandles[id_group] = file(clufilename, 'w')

        # write out first line
        #self._fetfilehandles[id_group].write("0\n") # Number of features
        self._clufilehandles[id_group].write("%d\n" % nbClusters)

    def _close_all_files(self):
        for val in self._fetfilehandles.values(): val.close()
        for val in self._clufilehandles.values(): val.close()

class FilenameParser:
    """Simple class to interpret user's requests into KlustaKwik filenames"""
    def __init__(self, dirname, basename=None):
        """Initialize a new parser for a directory containing files

        dirname: directory containing files
        basename: basename in KlustaKwik format spec

        If basename is left None, then files with any basename in the directory
        will be used. An error is raised if files with multiple basenames
        exist in the directory.
        """
        self.dirname = os.path.normpath(dirname)
        self.basename = basename

        # error check
        if not os.path.isdir(self.dirname):
            raise ValueError("filename must be a directory")

    def read_filenames(self, typestring='fet'):
        """Returns filenames in the data directory matching the type.

        Generally, `typestring` is one of the following:
            'fet', 'clu', 'spk', 'res'

        Returns a dict {group_number: filename}, e.g.:
            {   0: 'basename.fet.0',
                1: 'basename.fet.1',
                2: 'basename.fet.2'}

        'basename' can be any string not containing whitespace.

        Only filenames that begin with "basename.typestring." and end with
        a sequence of digits are valid. The digits are converted to an integer
        and used as the group number.
        """
        all_filenames = glob.glob(os.path.join(self.dirname, '*'))

        # Fill the dict with valid filenames
        d = {}
        for v in all_filenames:
            # Test whether matches format, ie ends with digits
            split_fn = os.path.split(v)[1]
            m = glob.re.search(('^(\w+)\.%s\.(\d+)$' % typestring), split_fn)
            if m is not None:
                # get basename from first hit if not specified
                if self.basename is None:
                    self.basename = m.group(1)

                # return files with correct basename
                if self.basename == m.group(1):
                    # Key the group number to the filename
                    # This conversion to int should always work since only
                    # strings of digits will match the regex
                    tetn = int(m.group(2))
                    d[tetn] = v

        return d


text:
My mindmup maps are:
- stored in this repositoty, and
- published here
  - web page: [masterclass_dobles_de_test](https://atlas.mindmup.com/2015/10/fc0c3b005d340133db4d4147ed4fb840/masterclass_dobles_de_test/index.html)
  - thumbnail image: [masterclass_dobles_de_test](https://atlas.mindmup.com/2015/10/fc0c3b005d340133db4d4147ed4fb840/masterclass_dobles_de_test/thumb.png)


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

namespace AuctionHouse.DataStore.Mock.Helpers
{
    public static class CollectionExtensions
    {
        static Random rnd = new Random();

        public static T SelectRandom<T>(this List<T> list) => list[rnd.Next(list.Count)];

    }
}


text:
package com.tradeshift.reaktive.marshal.stream;

import static io.vavr.control.Option.none;
import static io.vavr.control.Option.some;

import java.util.function.Function;
import java.util.function.Supplier;

import com.tradeshift.reaktive.marshal.WriteProtocol;
import com.tradeshift.reaktive.marshal.Writer;

import akka.stream.Attributes;
import akka.stream.FlowShape;
import akka.stream.Inlet;
import akka.stream.Outlet;
import akka.stream.stage.AbstractInHandler;
import akka.stream.stage.AbstractOutHandler;
import akka.stream.stage.GraphStage;
import akka.stream.stage.GraphStageLogic;
import io.vavr.collection.Seq;
import io.vavr.collection.Vector;
import io.vavr.control.Option;

public class ProtocolWriter {
    /**
     * Transforms a stream of T into a stream of events E, by applying a {@link WriteProtocol} to each element T.
     */
    public static <T,E> GraphStage<FlowShape<T, E>> of(WriteProtocol<E,T> protocol) {
        return ProtocolWriter.using(() -> {
            Writer<E, T> writer = protocol.writer();
            return t -> writer;
        });
    }

    /**
     * Returns a graph stage which writes each element T using (potentially) its own writer that is created using
     * the given factory.
     *
     * @param factory Supplier returning a function that returns the writer for an element. The supplier is invoked
     * each time the graph stage is materialized; the function is then invoked on each element.
     */
    public static <T,E> GraphStage<FlowShape<T, E>> using(Supplier<Function<T,Writer<E,T>>> factory) {
        return new GraphStage<FlowShape<T, E>>() {
            private final Inlet<T> in = Inlet.create("in");
            private final Outlet<E> out = Outlet.create("out");
            private final FlowShape<T, E> shape = FlowShape.of(in, out);

            @Override
            public FlowShape<T, E> shape() {
                return shape;
            }

            @Override
            public GraphStageLogic createLogic(Attributes attr) throws Exception {
                Function<T, Writer<E, T>> writerFn = factory.get();
                return new GraphStageLogic(shape) {
                    private Option<Writer<E,T>> writer = none();
                {
                    setHandler(out, new AbstractOutHandler() {
                        @Override
                        public void onPull() throws Exception {
                            pull(in);
                        }
                    });

                    setHandler(in, new AbstractInHandler() {
                        @Override
                        public void onPush() throws Exception {
                            T t = grab(in);
                            writer = some(writerFn.apply(t));
                            Seq<E> events = writer.get().apply(t);
                            emitMultiple(out, events.iterator());
                        }

                        @Override
                        public void onUpstreamFinish() throws Exception {
                            Seq<E> events = writer.map(w -> w.reset()).getOrElse(Vector.empty());
                            emitMultiple(out, events.iterator(), () -> complete(out));
                        }
                    });
                }};
            }
        };
    }

}


text:
package dao

import java.util.UUID
import base.PostgresDbSpec
import database.RoleDb
import database.helper.LdapUserStatus._
import models.{Authority, Role}
import play.api.inject.guice.GuiceableModule
import security.LWMRole
import security.LWMRole._
import slick.dbio.Effect.Write
import slick.jdbc.PostgresProfile.api._

import scala.concurrent.Future

class RoleDaoSpec extends PostgresDbSpec {

  import scala.concurrent.ExecutionContext.Implicits.global

  val dao = app.injector.instanceOf(classOf[RoleDao])
  val roles = LWMRole.all.map(r => RoleDb(r.label))

  def studentRole = roles.find(_.label == StudentRole.label).get

  def employeeRole = roles.find(_.label == EmployeeRole.label).get

  def adminRole = roles.find(_.label == Admin.label).get

  def courseEmployeeRole = roles.find(_.label == CourseEmployee.label).get

  def courseStudentRole = roles.find(_.label == CourseAssistant.label).get

  "A RoleDaoSpec" should {

    "return role which matches user status" in {
      runAsyncSequence(
        dao.byUserStatusQuery(StudentStatus) map (_.value shouldBe studentRole),
        dao.byUserStatusQuery(EmployeeStatus) map (_.value shouldBe employeeRole),
        dao.byUserStatusQuery(LecturerStatus) map (_.value shouldBe employeeRole)
      )
    }

    "return role which matches role label" in {
      runAsyncSequence(
        dao.byRoleLabelQuery(StudentRole.label) map (_.value shouldBe studentRole),
        dao.byRoleLabelQuery(EmployeeRole.label) map (_.value shouldBe employeeRole),
        dao.byRoleLabelQuery(Admin.label) map (_.value shouldBe adminRole)
      )
    }

    "not return role when not found" in {
      runAsyncSequence(
        dao.byRoleLabelQuery(God.label) map (_ shouldBe None),
        dao.byRoleLabelQuery("other") map (_ shouldBe None)
      )
    }

    "always pass authority validation if the user is an admin" in {
      val auths = List(Authority(UUID.randomUUID, adminRole.id))

      val results = Future.sequence(LWMRole.all.map(role => dao.isAuthorized(Some(UUID.randomUUID), List(role))(auths)))
      async(results)(_.reduce(_ && _) shouldBe true)
    }

    "always deny authority validation if god is requested" in {
      val user = UUID.randomUUID
      val auths = roles.map(r => Authority(user, r.id))

      async(dao.isAuthorized(None, List(God))(auths))(_ shouldBe false)
    }

    "check authority validation in different cases" in {
      val course1 = UUID.randomUUID
      val course2 = UUID.randomUUID
      val auths = List(
        Authority(UUID.randomUUID, employeeRole.id),
        Authority(UUID.randomUUID, courseEmployeeRole.id, Some(course1)),
        Authority(UUID.randomUUID, courseStudentRole.id, Some(course2))
      )

      async(dao.isAuthorized(None, List(EmployeeRole, StudentRole))(auths))(_ shouldBe true)
      async(dao.isAuthorized(Some(course1), List(CourseEmployee))(auths))(_ shouldBe true)
      async(dao.isAuthorized(Some(course1), List(CourseEmployee, CourseAssistant))(auths))(_ shouldBe true)
      async(dao.isAuthorized(Some(course1), List(EmployeeRole, CourseEmployee))(auths))(_ shouldBe true)
      async(dao.isAuthorized(Some(course2), List(CourseEmployee, CourseAssistant))(auths))(_ shouldBe true)
      async(dao.isAuthorized(Some(course2), List(EmployeeRole, CourseEmployee))(auths))(_ shouldBe false)
      async(dao.isAuthorized(Some(UUID.randomUUID), List(CourseEmployee, CourseAssistant))(auths))(_ shouldBe false)
      async(dao.isAuthorized(None, List(StudentRole))(auths))(_ shouldBe false)
      async(dao.isAuthorized(None, List(CourseManager))(auths))(_ shouldBe false)
      async(dao.isAuthorized(None, List(Admin))(auths))(_ shouldBe false)
      async(dao.isAuthorized(Some(course1), List(Admin))(auths))(_ shouldBe false)
      async(dao.isAuthorized(Some(UUID.randomUUID), List.empty)(auths))(_ shouldBe false)
      async(dao.isAuthorized(None, List.empty)(auths))(_ shouldBe false)
      async(dao.isAuthorized(None, List(StudentRole))(Seq.empty))(_ shouldBe false)
    }
  }

  override protected def beforeAll(): Unit = {
    super.beforeAll()

    async(dao.createMany(roles))(_ => Unit)
  }

  override protected def bindings: Seq[GuiceableModule] = Seq.empty

  override protected val dependencies: DBIOAction[Unit, NoStream, Write] = DBIO.seq()
}


text:
"""Validator for ensuring filenames match object name"""

from __future__ import absolute_import
from __future__ import division
from __future__ import print_function

import inflection
from gwv import validator

import unittest
from gwv import schema
from gwv import validator
from nwv.validators import filename_validator

class TestFilenameValidator(validator.ValidatorTestCase):

  def test_wrong_name(self):
    trait = self.get_test_trait()
    trait.file.base_name = 'testtrait'

    self.assert_invalid(filename_validator.FilenameValidator, r'Filename .+ should match the schema obj name')

  def test_simple_name(self):
    trait = self.get_test_trait()
    trait.file.base_name = 'test_trait'

    self.assert_valid(filename_validator.FilenameValidator)

  def test_acronym_name(self):
    trait = self.get_test_trait()
    trait.base_name = 'TestXXTrait'
    trait.file.base_name = 'test_xx_trait'

    self.assert_valid(filename_validator.FilenameValidator)


text:
from panda3d.core import *
from panda3d.direct import *
from panda3d.core import *
from panda3d.direct import *
from direct.interval.IntervalGlobal import *
from direct.distributed.ClockDelta import *
import MovingPlatform
from toontown.toonbase import ToontownGlobals
from direct.directnotify import DirectNotifyGlobal
from direct.fsm import ClassicFSM
import DistributedSwitch
from toontown.toonbase import TTLocalizer

class DistributedButton(DistributedSwitch.DistributedSwitch):
    countdownSeconds = 3.0

    def __init__(self, cr):
        self.countdownTrack = None
        DistributedSwitch.DistributedSwitch.__init__(self, cr)
        return

    def setSecondsOn(self, secondsOn):
        self.secondsOn = secondsOn

    def avatarExit(self, avatarId):
        DistributedSwitch.DistributedSwitch.avatarExit(self, avatarId)
        if self.secondsOn != -1.0 and self.secondsOn > 0.0 and self.countdownSeconds > 0.0 and self.countdownSeconds < self.secondsOn and self.fsm.getCurrentState().getName() == 'playing':
            track = self.switchCountdownTrack()
            if track is not None:
                track.start(0.0)
                self.countdownTrack = track
        return

    def setupSwitch(self):
        model = loader.loadModel('phase_9/models/cogHQ/CogDoor_Button')
        if model:
            buttonBase = model.find('**/buttonBase')
            change = render.attachNewNode('changePos')
            buttonBase.reparentTo(change)
            rootNode = render.attachNewNode(self.getName() + '-buttonBase_root')
            change.reparentTo(rootNode)
            self.buttonFrameNode = rootNode
            self.buttonFrameNode.show()
            button = model.find('**/button')
            change = render.attachNewNode('change')
            button.reparentTo(change)
            rootNode = render.attachNewNode(self.getName() + '-button_root')
            rootNode.setColor(self.color)
            change.reparentTo(rootNode)
            self.buttonNode = rootNode
            self.buttonNode.show()
            self.buttonFrameNode.reparentTo(self)
            self.buttonNode.reparentTo(self)
            if 1:
                radius = 0.5
                cSphere = CollisionSphere(0.0, 0.0, radius, radius)
                cSphere.setTangible(0)
                cSphereNode = CollisionNode(self.getName())
                cSphereNode.addSolid(cSphere)
                cSphereNode.setCollideMask(ToontownGlobals.WallBitmask)
                self.cSphereNodePath = rootNode.attachNewNode(cSphereNode)
            if 1:
                collisionFloor = button.find('**/collision_floor')
                if collisionFloor.isEmpty():
                    top = 0.475
                    size = 0.5
                    floor = CollisionPolygon(Point3(-size, -size, top),
                                             Point3( size, -size, top),
                                             Point3( size,  size, top),
                                             Point3(-size,  size, top))
                    floor.setTangible(1)
                    floorNode = CollisionNode('collision_floor')
                    floorNode.addSolid(floor)
                    collisionFloor = button.attachNewNode(floorNode)
                else:
                    change = collisionFloor.getParent().attachNewNode('changeFloor')
                    change.setScale(0.5, 0.5, 1.0)
                    collisionFloor.reparentTo(change)
                collisionFloor.node().setFromCollideMask(BitMask32.allOff())
                collisionFloor.node().setIntoCollideMask(ToontownGlobals.FloorBitmask)
            self.buttonFrameNode.flattenMedium()
            self.buttonNode.flattenMedium()

    def delete(self):
        DistributedSwitch.DistributedSwitch.delete(self)

    def enterTrigger(self, args = None):
        DistributedSwitch.DistributedSwitch.enterTrigger(self, args)

    def exitTrigger(self, args = None):
        DistributedSwitch.DistributedSwitch.exitTrigger(self, args)

    def switchOnTrack(self):
        onSfx = base.loadSfx('phase_9/audio/sfx/CHQ_FACT_switch_pressed.ogg')
        duration = 0.8
        halfDur = duration * 0.5
        pos = Vec3(0.0, 0.0, -0.2)
        color = Vec4(0.0, 1.0, 0.0, 1.0)
        track = Sequence(Func(self.setIsOn, 1), Parallel(SoundInterval(onSfx, node=self.node, volume=0.9), LerpPosInterval(nodePath=self.buttonNode, duration=duration, pos=pos, blendType='easeInOut'), Sequence(Wait(halfDur), LerpColorInterval(nodePath=self.buttonNode, duration=halfDur, color=color, override=1, blendType='easeOut'))))
        return track

    def switchCountdownTrack(self):
        wait = self.secondsOn - self.countdownSeconds
        countDownSfx = base.loadSfx('phase_9/audio/sfx/CHQ_FACT_switch_depressed.ogg')
        track = Parallel(
            SoundInterval(countDownSfx),
            Sequence(
                Wait(wait),
                Wait(0.5),
                LerpColorInterval(nodePath=self.buttonNode, duration=0.1, color=self.color, override=1, blendType='easeIn'),
                LerpColorInterval(nodePath=self.buttonNode, duration=0.1, color=Vec4(0.0, 1.0, 0.0, 1.0), override=1, blendType='easeOut'),
                Wait(0.5),
                LerpColorInterval(nodePath=self.buttonNode, duration=0.1, color=self.color, override=1, blendType='easeIn'),
                LerpColorInterval(nodePath=self.buttonNode, duration=0.1, color=Vec4(0.0, 1.0, 0.0, 1.0), override=1, blendType='easeOut'),
                Wait(0.4),
                LerpColorInterval(nodePath=self.buttonNode, duration=0.1, color=self.color, override=1, blendType='easeIn'),
                LerpColorInterval(nodePath=self.buttonNode, duration=0.1, color=Vec4(0.0, 1.0, 0.0, 1.0), override=1, blendType='easeOut'),
                Wait(0.3),
                LerpColorInterval(nodePath=self.buttonNode, duration=0.1, color=self.color, override=1, blendType='easeIn'),
                LerpColorInterval(nodePath=self.buttonNode, duration=0.1, color=Vec4(0.0, 1.0, 0.0, 1.0), override=1, blendType='easeOut'),
                Wait(0.2),
                LerpColorInterval(nodePath=self.buttonNode, duration=0.1, color=self.color, override=1, blendType='easeIn'),
                LerpColorInterval(nodePath=self.buttonNode, duration=0.1, override=1, color=Vec4(0.0, 1.0, 0.0, 1.0), blendType='easeOut'),
                Wait(0.1)))
        return track

    def switchOffTrack(self):
        offSfx = base.loadSfx('phase_9/audio/sfx/CHQ_FACT_switch_popup.ogg')
        duration = 1.0
        halfDur = duration * 0.5
        pos = Vec3(0.0)
        track = Sequence(Parallel(SoundInterval(offSfx, node=self.node, volume=1.0), LerpPosInterval(nodePath=self.buttonNode, duration=duration, pos=pos, blendType='easeInOut'), Sequence(Wait(halfDur), LerpColorInterval(nodePath=self.buttonNode, duration=halfDur, color=self.color, override=1, blendType='easeIn'))), Func(self.setIsOn, 0))
        return track

    def exitPlaying(self):
        if self.countdownTrack:
            self.countdownTrack.finish()
        self.countdownTrack = None
        DistributedSwitch.DistributedSwitch.exitPlaying(self)


text:
import re

from jenkins_autojobs import main

def test_filter_jobs():
    class Job:
        def __init__(self, name):
            self.name = name

    class jenkins:
        @staticmethod
        def view_jobs(x):
            return {
                'v1': [Job('scratch-one'), Job('scratch-two')],
                'v2': [Job('release-one'), Job('maintenance-three')]
            }[x]

    names = ['feature-one', 'feature-two', 'release-one', 'release-two']
    jenkins.jobs = [Job(i) for i in names]
    filter_jobs = lambda **kw: {i.name for i in main.filter_jobs(jenkins, **kw)}

    #-------------------------------------------------------------------------
    assert filter_jobs() == {'feature-one', 'feature-two', 'release-one', 'release-two'}

    res = filter_jobs(by_name_regex=[re.compile('feature-')])
    assert res == {'feature-one', 'feature-two'}

    res = filter_jobs(by_name_regex=[re.compile('.*one'), re.compile('.*two')])
    assert res == {'feature-one', 'feature-two', 'release-one', 'release-two'}

    #-------------------------------------------------------------------------
    res = filter_jobs(by_views=['v1'])
    assert res == {'scratch-one', 'scratch-two'}

    res = filter_jobs(by_views=['v1', 'v2'])
    assert res == {'scratch-one', 'scratch-two', 'release-one', 'maintenance-three'}


text:
<!DOCTYPE html>

  <meta charset="utf-8">
  <title>THE SCHEMING REPL!</title>


text:
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Changelog for package flexbe_msgs
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

1.3.1 (2020-12-11)
------------------

1.3.0 (2020-11-19)
------------------
* Merge remote-tracking branch 'origin/feature/core_rework' into develop
  # Conflicts:
  #	flexbe_core/src/flexbe_core/core/operatable_state_machine.py
  #	flexbe_onboard/src/flexbe_onboard/flexbe_onboard.py
* Remove smach dependency
* Contributors: Philipp Schillinger

1.2.5 (2020-06-14)
------------------
* Merge branch 'develop' into feature/state_logger_rework
* [flexbe_msgs] Remove deprecated constants from input action
* Contributors: Philipp Schillinger

1.2.4 (2020-03-25)
------------------
* [flexbe_msgs] [flexbe_core] Add debug level to logger
  (see `#101 <https://github.com/team-vigir/flexbe_behavior_engine/issues/101>`_)
* Contributors: Philipp Schillinger

1.2.3 (2020-01-10)
------------------
* Merge remote-tracking branch 'origin/develop' into feature/test_behaviors
  # Conflicts:
  #	flexbe_testing/bin/testing_node
  #	flexbe_testing/src/flexbe_testing/state_tester.py
* Contributors: Philipp Schillinger

1.2.2 (2019-09-16)
------------------

1.2.1 (2019-06-02)
------------------
* Merge remote-tracking branch 'origin/feature/sub_parameters' into develop
* Bump required flexbe_app version
* Merge remote-tracking branch 'origin/master' into develop
* Contributors: Philipp Schillinger

1.1.2 (2019-04-09)
------------------
* Merge remote-tracking branch 'origin/master' into develop
* Contributors: Philipp Schillinger

1.1.1 (2018-12-18)
------------------
* Merge remote-tracking branch 'origin/master' into develop
* Contributors: Philipp Schillinger

1.1.0 (2018-12-01)
------------------
* Merge branch 'develop'
* Merge branch 'feature/flexbe_app' into develop
* Update maintainer information
* Merge remote-tracking branch 'origin/develop'
* Merge remote-tracking branch 'origin/develop' into feature/flexbe_app
* Merge pull request `#52 <https://github.com/team-vigir/flexbe_behavior_engine/issues/52>`_ from ruvu/fix/catkin_lint_errors_and_warnings
  chore: ran catkin_lint and fixed warnings and errors
* chore: ran catkin_lint and fixed warnings and errors
* Find behaviors by export tag and execute via checksum
* Merge remote-tracking branch 'origin/develop'
* [flexbe_msgs] Increase field size of behavior modification index
* Provide option to set userdata input on behavior action calls
* Merge remote-tracking branch 'origin/master' into feature/multirobot
  Conflicts:
  flexbe_core/src/flexbe_core/core/monitoring_state.py
  flexbe_core/src/flexbe_core/core/operatable_state.py
* [flexbe_msgs] Added priority container to state class options
* [flexbe_msgs] Changed autonomy encoding in StateInstantation to prevent Python issues
* [flexbe_msgs] Extended behavior synthesis interface
  * Added support for concurrency container
  * Can now set input and output keys for containers, including root
  * Can now specify positions of states in the editor for improved visualization
* [flexbe_msgs] Added new message type for UI commands from ROS
* [flexbe_msgs] Added default synthesis message types
* [flexbe_msgs] Added action message for behavior execution
* Removed some old and unused project files
* Initial commit of software
* Contributors: Philipp Schillinger, Rein Appeldoorn


text:
package com.consol.citrus.ws.validation;

import com.consol.citrus.ws.message.SoapAttachment;
import com.consol.citrus.ws.message.SoapMessage;

import java.util.List;

/**
 * Interface for SOAP attachment validators.
 *
 * The Citrus {@link com.consol.citrus.ws.server.WebServiceEndpoint} implementation adds the received SOAP attachments as
 * {@link org.springframework.ws.mime.Attachment} implementations to the Spring integration message header. The header name will be the
 * attachment's contentId. The header value is the {@link org.springframework.ws.mime.Attachment} object.
 *
 * @author Christoph Deppisch
 */
public interface SoapAttachmentValidator {

    /**
     * Validate attachments in soap message. List of control attachments should
     * be present and get validated.
     *
     * @param soapMessage
     * @param controlAttachments
     */
    void validateAttachment(SoapMessage soapMessage, List<SoapAttachment> controlAttachments);
}


text:
'use strict';
var $export     = require('./_export')
  , toObject    = require('./_to-object')
  , toPrimitive = require('./_to-primitive');

$export($export.P + $export.F * require('./_fails')(function(){
  return new Date(NaN).toJSON() !== null || Date.prototype.toJSON.call({toISOString: function(){ return 1; }}) !== 1;
}), 'Date', {
  toJSON: function toJSON(key){
    var O  = toObject(this)
      , pv = toPrimitive(O);
    return typeof pv == 'number' && !isFinite(pv) ? null : O.toISOString();
  }
});