text:
// Licensed to the Apache Software Foundation (ASF) under one
// or more contributor license agreements.  See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership.  The ASF licenses this file
// to you under the Apache License, Version 2.0 (the
// "License"); you may not use this file except in compliance
// with the License.  You may obtain a copy of the License at
//
//   http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing,
// software distributed under the License is distributed on an
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
// KIND, either express or implied.  See the License for the
// specific language governing permissions and limitations
// under the License.

/**
 * ImportInstanceVolumeDetailItemType.java
 *
 * This file was auto-generated from WSDL
 * by the Apache Axis2 version: 1.5.1  Built on : Oct 19, 2009 (10:59:34 EDT)
 */

                package com.amazon.ec2;

            /**
            *  ImportInstanceVolumeDetailItemType bean class
            */

        public  class ImportInstanceVolumeDetailItemType
        implements org.apache.axis2.databinding.ADBBean{
        /* This type was generated from the piece of schema that had
                name = ImportInstanceVolumeDetailItemType
                Namespace URI = http://ec2.amazonaws.com/doc/2010-11-15/
                Namespace Prefix = ns1
                */

        private static java.lang.String generatePrefix(java.lang.String namespace) {
            if(namespace.equals("http://ec2.amazonaws.com/doc/2010-11-15/")){
                return "ns1";
            }
            return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix();
        }

                        /**
                        * field for BytesConverted
                        */

                                    protected long localBytesConverted ;

                           /**
                           * Auto generated getter method
                           * @return long
                           */
                           public  long getBytesConverted(){
                               return localBytesConverted;
                           }

                            /**
                               * Auto generated setter method
                               * @param param BytesConverted
                               */
                               public void setBytesConverted(long param){

                                            this.localBytesConverted=param;

                               }

                        /**
                        * field for AvailabilityZone
                        */

                                    protected java.lang.String localAvailabilityZone ;

                           /**
                           * Auto generated getter method
                           * @return java.lang.String
                           */
                           public  java.lang.String getAvailabilityZone(){
                               return localAvailabilityZone;
                           }

                            /**
                               * Auto generated setter method
                               * @param param AvailabilityZone
                               */
                               public void setAvailabilityZone(java.lang.String param){

                                            this.localAvailabilityZone=param;

                               }

                        /**
                        * field for Image
                        */

                                    protected com.amazon.ec2.DiskImageDescriptionType localImage ;

                           /**
                           * Auto generated getter method
                           * @return com.amazon.ec2.DiskImageDescriptionType
                           */
                           public  com.amazon.ec2.DiskImageDescriptionType getImage(){
                               return localImage;
                           }

                            /**
                               * Auto generated setter method
                               * @param param Image
                               */
                               public void setImage(com.amazon.ec2.DiskImageDescriptionType param){

                                            this.localImage=param;

                               }

                        /**
                        * field for Description
                        */

                                    protected java.lang.String localDescription ;

                           /*  This tracker boolean wil be used to detect whether the user called the set method
                          *   for this attribute. It will be used to determine whether to include this field
                           *   in the serialized XML
                           */
                           protected boolean localDescriptionTracker = false ;

                           /**
                           * Auto generated getter method
                           * @return java.lang.String
                           */
                           public  java.lang.String getDescription(){
                               return localDescription;
                           }

                            /**
                               * Auto generated setter method
                               * @param param Description
                               */
                               public void setDescription(java.lang.String param){

                                       if (param != null){
                                          //update the setting tracker
                                          localDescriptionTracker = true;
                                       } else {
                                          localDescriptionTracker = false;

                                       }

                                            this.localDescription=param;

                               }

                        /**
                        * field for Volume
                        */

                                    protected com.amazon.ec2.DiskImageVolumeDescriptionType localVolume ;

                           /**
                           * Auto generated getter method
                           * @return com.amazon.ec2.DiskImageVolumeDescriptionType
                           */
                           public  com.amazon.ec2.DiskImageVolumeDescriptionType getVolume(){
                               return localVolume;
                           }

                            /**
                               * Auto generated setter method
                               * @param param Volume
                               */
                               public void setVolume(com.amazon.ec2.DiskImageVolumeDescriptionType param){

                                            this.localVolume=param;

                               }

                        /**
                        * field for Status
                        */

                                    protected java.lang.String localStatus ;

                           /**
                           * Auto generated getter method
                           * @return java.lang.String
                           */
                           public  java.lang.String getStatus(){
                               return localStatus;
                           }

                            /**
                               * Auto generated setter method
                               * @param param Status
                               */
                               public void setStatus(java.lang.String param){

                                            this.localStatus=param;

                               }

                        /**
                        * field for StatusMessage
                        */

                                    protected java.lang.String localStatusMessage ;

                           /*  This tracker boolean wil be used to detect whether the user called the set method
                          *   for this attribute. It will be used to determine whether to include this field
                           *   in the serialized XML
                           */
                           protected boolean localStatusMessageTracker = false ;

                           /**
                           * Auto generated getter method
                           * @return java.lang.String
                           */
                           public  java.lang.String getStatusMessage(){
                               return localStatusMessage;
                           }

                            /**
                               * Auto generated setter method
                               * @param param StatusMessage
                               */
                               public void setStatusMessage(java.lang.String param){

                                       if (param != null){
                                          //update the setting tracker
                                          localStatusMessageTracker = true;
                                       } else {
                                          localStatusMessageTracker = false;

                                       }

                                            this.localStatusMessage=param;

                               }

     /**
     * isReaderMTOMAware
     * @return true if the reader supports MTOM
     */
   public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) {
        boolean isReaderMTOMAware = false;

        try{
          isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE));
        }catch(java.lang.IllegalArgumentException e){
          isReaderMTOMAware = false;
        }
        return isReaderMTOMAware;
   }

        /**
        *
        * @param parentQName
        * @param factory
        * @return org.apache.axiom.om.OMElement
        */
       public org.apache.axiom.om.OMElement getOMElement (
               final javax.xml.namespace.QName parentQName,
               final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException{

               org.apache.axiom.om.OMDataSource dataSource =
                       new org.apache.axis2.databinding.ADBDataSource(this,parentQName){

                 public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException {
                       ImportInstanceVolumeDetailItemType.this.serialize(parentQName,factory,xmlWriter);
                 }
               };
               return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl(
               parentQName,factory,dataSource);

       }

         public void serialize(final javax.xml.namespace.QName parentQName,
                                       final org.apache.axiom.om.OMFactory factory,
                                       org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter)
                                throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{
                           serialize(parentQName,factory,xmlWriter,false);
         }

         public void serialize(final javax.xml.namespace.QName parentQName,
                               final org.apache.axiom.om.OMFactory factory,
                               org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter,
                               boolean serializeType)
            throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{

                java.lang.String prefix = null;
                java.lang.String namespace = null;

                    prefix = parentQName.getPrefix();
                    namespace = parentQName.getNamespaceURI();

                    if ((namespace != null) && (namespace.trim().length() > 0)) {
                        java.lang.String writerPrefix = xmlWriter.getPrefix(namespace);
                        if (writerPrefix != null) {
                            xmlWriter.writeStartElement(namespace, parentQName.getLocalPart());
                        } else {
                            if (prefix == null) {
                                prefix = generatePrefix(namespace);
                            }

                            xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace);
                            xmlWriter.writeNamespace(prefix, namespace);
                            xmlWriter.setPrefix(prefix, namespace);
                        }
                    } else {
                        xmlWriter.writeStartElement(parentQName.getLocalPart());
                    }

                  if (serializeType){

                   java.lang.String namespacePrefix = registerPrefix(xmlWriter,"http://ec2.amazonaws.com/doc/2010-11-15/");
                   if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){
                       writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type",
                           namespacePrefix+":ImportInstanceVolumeDetailItemType",
                           xmlWriter);
                   } else {
                       writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type",
                           "ImportInstanceVolumeDetailItemType",
                           xmlWriter);
                   }

                   }

                                    namespace = "http://ec2.amazonaws.com/doc/2010-11-15/";
                                    if (! namespace.equals("")) {
                                        prefix = xmlWriter.getPrefix(namespace);

                                        if (prefix == null) {
                                            prefix = generatePrefix(namespace);

                                            xmlWriter.writeStartElement(prefix,"bytesConverted", namespace);
                                            xmlWriter.writeNamespace(prefix, namespace);
                                            xmlWriter.setPrefix(prefix, namespace);

                                        } else {
                                            xmlWriter.writeStartElement(namespace,"bytesConverted");
                                        }

                                    } else {
                                        xmlWriter.writeStartElement("bytesConverted");
                                    }

                                               if (localBytesConverted==java.lang.Long.MIN_VALUE) {

                                                         throw new org.apache.axis2.databinding.ADBException("bytesConverted cannot be null!!");

                                               } else {
                                                    xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localBytesConverted));
                                               }

                                   xmlWriter.writeEndElement();

                                    namespace = "http://ec2.amazonaws.com/doc/2010-11-15/";
                                    if (! namespace.equals("")) {
                                        prefix = xmlWriter.getPrefix(namespace);

                                        if (prefix == null) {
                                            prefix = generatePrefix(namespace);

                                            xmlWriter.writeStartElement(prefix,"availabilityZone", namespace);
                                            xmlWriter.writeNamespace(prefix, namespace);
                                            xmlWriter.setPrefix(prefix, namespace);

                                        } else {
                                            xmlWriter.writeStartElement(namespace,"availabilityZone");
                                        }

                                    } else {
                                        xmlWriter.writeStartElement("availabilityZone");
                                    }

                                          if (localAvailabilityZone==null){
                                              // write the nil attribute

                                                     throw new org.apache.axis2.databinding.ADBException("availabilityZone cannot be null!!");

                                          }else{

                                                   xmlWriter.writeCharacters(localAvailabilityZone);

                                          }

                                   xmlWriter.writeEndElement();

                                            if (localImage==null){
                                                 throw new org.apache.axis2.databinding.ADBException("image cannot be null!!");
                                            }
                                           localImage.serialize(new javax.xml.namespace.QName("http://ec2.amazonaws.com/doc/2010-11-15/","image"),
                                               factory,xmlWriter);
                                         if (localDescriptionTracker){
                                    namespace = "http://ec2.amazonaws.com/doc/2010-11-15/";
                                    if (! namespace.equals("")) {
                                        prefix = xmlWriter.getPrefix(namespace);

                                        if (prefix == null) {
                                            prefix = generatePrefix(namespace);

                                            xmlWriter.writeStartElement(prefix,"description", namespace);
                                            xmlWriter.writeNamespace(prefix, namespace);
                                            xmlWriter.setPrefix(prefix, namespace);

                                        } else {
                                            xmlWriter.writeStartElement(namespace,"description");
                                        }

                                    } else {
                                        xmlWriter.writeStartElement("description");
                                    }

                                          if (localDescription==null){
                                              // write the nil attribute

                                                     throw new org.apache.axis2.databinding.ADBException("description cannot be null!!");

                                          }else{

                                                   xmlWriter.writeCharacters(localDescription);

                                          }

                                   xmlWriter.writeEndElement();
                             }
                                            if (localVolume==null){
                                                 throw new org.apache.axis2.databinding.ADBException("volume cannot be null!!");
                                            }
                                           localVolume.serialize(new javax.xml.namespace.QName("http://ec2.amazonaws.com/doc/2010-11-15/","volume"),
                                               factory,xmlWriter);

                                    namespace = "http://ec2.amazonaws.com/doc/2010-11-15/";
                                    if (! namespace.equals("")) {
                                        prefix = xmlWriter.getPrefix(namespace);

                                        if (prefix == null) {
                                            prefix = generatePrefix(namespace);

                                            xmlWriter.writeStartElement(prefix,"status", namespace);
                                            xmlWriter.writeNamespace(prefix, namespace);
                                            xmlWriter.setPrefix(prefix, namespace);

                                        } else {
                                            xmlWriter.writeStartElement(namespace,"status");
                                        }

                                    } else {
                                        xmlWriter.writeStartElement("status");
                                    }

                                          if (localStatus==null){
                                              // write the nil attribute

                                                     throw new org.apache.axis2.databinding.ADBException("status cannot be null!!");

                                          }else{

                                                   xmlWriter.writeCharacters(localStatus);

                                          }

                                   xmlWriter.writeEndElement();
                              if (localStatusMessageTracker){
                                    namespace = "http://ec2.amazonaws.com/doc/2010-11-15/";
                                    if (! namespace.equals("")) {
                                        prefix = xmlWriter.getPrefix(namespace);

                                        if (prefix == null) {
                                            prefix = generatePrefix(namespace);

                                            xmlWriter.writeStartElement(prefix,"statusMessage", namespace);
                                            xmlWriter.writeNamespace(prefix, namespace);
                                            xmlWriter.setPrefix(prefix, namespace);

                                        } else {
                                            xmlWriter.writeStartElement(namespace,"statusMessage");
                                        }

                                    } else {
                                        xmlWriter.writeStartElement("statusMessage");
                                    }

                                          if (localStatusMessage==null){
                                              // write the nil attribute

                                                     throw new org.apache.axis2.databinding.ADBException("statusMessage cannot be null!!");

                                          }else{

                                                   xmlWriter.writeCharacters(localStatusMessage);

                                          }

                                   xmlWriter.writeEndElement();
                             }
                    xmlWriter.writeEndElement();

        }

         /**
          * Util method to write an attribute with the ns prefix
          */
          private void writeAttribute(java.lang.String prefix,java.lang.String namespace,java.lang.String attName,
                                      java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{
              if (xmlWriter.getPrefix(namespace) == null) {
                       xmlWriter.writeNamespace(prefix, namespace);
                       xmlWriter.setPrefix(prefix, namespace);

              }

              xmlWriter.writeAttribute(namespace,attName,attValue);

         }

        /**
          * Util method to write an attribute without the ns prefix
          */
          private void writeAttribute(java.lang.String namespace,java.lang.String attName,
                                      java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{
                if (namespace.equals(""))
              {
                  xmlWriter.writeAttribute(attName,attValue);
              }
              else
              {
                  registerPrefix(xmlWriter, namespace);
                  xmlWriter.writeAttribute(namespace,attName,attValue);
              }
          }

           /**
             * Util method to write an attribute without the ns prefix
             */
            private void writeQNameAttribute(java.lang.String namespace, java.lang.String attName,
                                             javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException {

                java.lang.String attributeNamespace = qname.getNamespaceURI();
                java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace);
                if (attributePrefix == null) {
                    attributePrefix = registerPrefix(xmlWriter, attributeNamespace);
                }
                java.lang.String attributeValue;
                if (attributePrefix.trim().length() > 0) {
                    attributeValue = attributePrefix + ":" + qname.getLocalPart();
                } else {
                    attributeValue = qname.getLocalPart();
                }

                if (namespace.equals("")) {
                    xmlWriter.writeAttribute(attName, attributeValue);
                } else {
                    registerPrefix(xmlWriter, namespace);
                    xmlWriter.writeAttribute(namespace, attName, attributeValue);
                }
            }
        /**
         *  method to handle Qnames
         */

        private void writeQName(javax.xml.namespace.QName qname,
                                javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException {
            java.lang.String namespaceURI = qname.getNamespaceURI();
            if (namespaceURI != null) {
                java.lang.String prefix = xmlWriter.getPrefix(namespaceURI);
                if (prefix == null) {
                    prefix = generatePrefix(namespaceURI);
                    xmlWriter.writeNamespace(prefix, namespaceURI);
                    xmlWriter.setPrefix(prefix,namespaceURI);
                }

                if (prefix.trim().length() > 0){
                    xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname));
                } else {
                    // i.e this is the default namespace
                    xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname));
                }

            } else {
                xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname));
            }
        }

        private void writeQNames(javax.xml.namespace.QName[] qnames,
                                 javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException {

            if (qnames != null) {
                // we have to store this data until last moment since it is not possible to write any
                // namespace data after writing the charactor data
                java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer();
                java.lang.String namespaceURI = null;
                java.lang.String prefix = null;

                for (int i = 0; i < qnames.length; i++) {
                    if (i > 0) {
                        stringToWrite.append(" ");
                    }
                    namespaceURI = qnames[i].getNamespaceURI();
                    if (namespaceURI != null) {
                        prefix = xmlWriter.getPrefix(namespaceURI);
                        if ((prefix == null) || (prefix.length() == 0)) {
                            prefix = generatePrefix(namespaceURI);
                            xmlWriter.writeNamespace(prefix, namespaceURI);
                            xmlWriter.setPrefix(prefix,namespaceURI);
                        }

                        if (prefix.trim().length() > 0){
                            stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i]));
                        } else {
                            stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i]));
                        }
                    } else {
                        stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i]));
                    }
                }
                xmlWriter.writeCharacters(stringToWrite.toString());
            }

        }

         /**
         * Register a namespace prefix
         */
         private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException {
                java.lang.String prefix = xmlWriter.getPrefix(namespace);

                if (prefix == null) {
                    prefix = generatePrefix(namespace);

                    while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) {
                        prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix();
                    }

                    xmlWriter.writeNamespace(prefix, namespace);
                    xmlWriter.setPrefix(prefix, namespace);
                }

                return prefix;
            }

        /**
        * databinding method to get an XML representation of this object
        *
        */
        public javax.xml.stream.XMLStreamReader getPullParser(javax.xml.namespace.QName qName)
                    throws org.apache.axis2.databinding.ADBException{

                 java.util.ArrayList elementList = new java.util.ArrayList();
                 java.util.ArrayList attribList = new java.util.ArrayList();

                                      elementList.add(new javax.xml.namespace.QName("http://ec2.amazonaws.com/doc/2010-11-15/",
                                                                      "bytesConverted"));

                                elementList.add(
                                   org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localBytesConverted));

                                      elementList.add(new javax.xml.namespace.QName("http://ec2.amazonaws.com/doc/2010-11-15/",
                                                                      "availabilityZone"));

                                        if (localAvailabilityZone != null){
                                            elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localAvailabilityZone));
                                        } else {
                                           throw new org.apache.axis2.databinding.ADBException("availabilityZone cannot be null!!");
                                        }

                            elementList.add(new javax.xml.namespace.QName("http://ec2.amazonaws.com/doc/2010-11-15/",
                                                                      "image"));

                                    if (localImage==null){
                                         throw new org.apache.axis2.databinding.ADBException("image cannot be null!!");
                                    }
                                    elementList.add(localImage);
                                 if (localDescriptionTracker){
                                      elementList.add(new javax.xml.namespace.QName("http://ec2.amazonaws.com/doc/2010-11-15/",
                                                                      "description"));

                                        if (localDescription != null){
                                            elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localDescription));
                                        } else {
                                           throw new org.apache.axis2.databinding.ADBException("description cannot be null!!");
                                        }
                                    }
                            elementList.add(new javax.xml.namespace.QName("http://ec2.amazonaws.com/doc/2010-11-15/",
                                                                      "volume"));

                                    if (localVolume==null){
                                         throw new org.apache.axis2.databinding.ADBException("volume cannot be null!!");
                                    }
                                    elementList.add(localVolume);

                                      elementList.add(new javax.xml.namespace.QName("http://ec2.amazonaws.com/doc/2010-11-15/",
                                                                      "status"));

                                        if (localStatus != null){
                                            elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localStatus));
                                        } else {
                                           throw new org.apache.axis2.databinding.ADBException("status cannot be null!!");
                                        }
                                     if (localStatusMessageTracker){
                                      elementList.add(new javax.xml.namespace.QName("http://ec2.amazonaws.com/doc/2010-11-15/",
                                                                      "statusMessage"));

                                        if (localStatusMessage != null){
                                            elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localStatusMessage));
                                        } else {
                                           throw new org.apache.axis2.databinding.ADBException("statusMessage cannot be null!!");
                                        }
                                    }

                return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), attribList.toArray());

        }

     /**
      *  Factory class that keeps the parse method
      */
    public static class Factory{

        /**
        * static method to create the object
        * Precondition:  If this object is an element, the current or next start element starts this object and any intervening reader events are ignorable
        *                If this object is not an element, it is a complex type and the reader is at the event just after the outer start element
        * Postcondition: If this object is an element, the reader is positioned at its end element
        *                If this object is a complex type, the reader is positioned at the end element of its outer element
        */
        public static ImportInstanceVolumeDetailItemType parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{
            ImportInstanceVolumeDetailItemType object =
                new ImportInstanceVolumeDetailItemType();

            int event;
            java.lang.String nillableValue = null;
            java.lang.String prefix ="";
            java.lang.String namespaceuri ="";
            try {

                while (!reader.isStartElement() && !reader.isEndElement())
                    reader.next();

                if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance","type")!=null){
                  java.lang.String fullTypeName = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance",
                        "type");
                  if (fullTypeName!=null){
                    java.lang.String nsPrefix = null;
                    if (fullTypeName.indexOf(":") > -1){
                        nsPrefix = fullTypeName.substring(0,fullTypeName.indexOf(":"));
                    }
                    nsPrefix = nsPrefix==null?"":nsPrefix;

                    java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":")+1);

                            if (!"ImportInstanceVolumeDetailItemType".equals(type)){
                                //find namespace for the prefix
                                java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix);
                                return (ImportInstanceVolumeDetailItemType)com.amazon.ec2.ExtensionMapper.getTypeObject(
                                     nsUri,type,reader);
                              }

                  }

                }

                // Note all attributes that were handled. Used to differ normal attributes
                // from anyAttributes.
                java.util.Vector handledAttributes = new java.util.Vector();

                    reader.next();

                                    while (!reader.isStartElement() && !reader.isEndElement()) reader.next();

                                    if (reader.isStartElement() && new javax.xml.namespace.QName("http://ec2.amazonaws.com/doc/2010-11-15/","bytesConverted").equals(reader.getName())){

                                    java.lang.String content = reader.getElementText();

                                              object.setBytesConverted(
                                                    org.apache.axis2.databinding.utils.ConverterUtil.convertToLong(content));

                                        reader.next();

                              }  // End of if for expected property start element

                                else{
                                    // A start element we are not expecting indicates an invalid parameter was passed
                                    throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName());
                                }

                                    while (!reader.isStartElement() && !reader.isEndElement()) reader.next();

                                    if (reader.isStartElement() && new javax.xml.namespace.QName("http://ec2.amazonaws.com/doc/2010-11-15/","availabilityZone").equals(reader.getName())){

                                    java.lang.String content = reader.getElementText();

                                              object.setAvailabilityZone(
                                                    org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content));

                                        reader.next();

                              }  // End of if for expected property start element

                                else{
                                    // A start element we are not expecting indicates an invalid parameter was passed
                                    throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName());
                                }

                                    while (!reader.isStartElement() && !reader.isEndElement()) reader.next();

                                    if (reader.isStartElement() && new javax.xml.namespace.QName("http://ec2.amazonaws.com/doc/2010-11-15/","image").equals(reader.getName())){

                                                object.setImage(com.amazon.ec2.DiskImageDescriptionType.Factory.parse(reader));

                                        reader.next();

                              }  // End of if for expected property start element

                                else{
                                    // A start element we are not expecting indicates an invalid parameter was passed
                                    throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName());
                                }

                                    while (!reader.isStartElement() && !reader.isEndElement()) reader.next();

                                    if (reader.isStartElement() && new javax.xml.namespace.QName("http://ec2.amazonaws.com/doc/2010-11-15/","description").equals(reader.getName())){

                                    java.lang.String content = reader.getElementText();

                                              object.setDescription(
                                                    org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content));

                                        reader.next();

                              }  // End of if for expected property start element

                                    else {

                                    }

                                    while (!reader.isStartElement() && !reader.isEndElement()) reader.next();

                                    if (reader.isStartElement() && new javax.xml.namespace.QName("http://ec2.amazonaws.com/doc/2010-11-15/","volume").equals(reader.getName())){

                                                object.setVolume(com.amazon.ec2.DiskImageVolumeDescriptionType.Factory.parse(reader));

                                        reader.next();

                              }  // End of if for expected property start element

                                else{
                                    // A start element we are not expecting indicates an invalid parameter was passed
                                    throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName());
                                }

                                    while (!reader.isStartElement() && !reader.isEndElement()) reader.next();

                                    if (reader.isStartElement() && new javax.xml.namespace.QName("http://ec2.amazonaws.com/doc/2010-11-15/","status").equals(reader.getName())){

                                    java.lang.String content = reader.getElementText();

                                              object.setStatus(
                                                    org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content));

                                        reader.next();

                              }  // End of if for expected property start element

                                else{
                                    // A start element we are not expecting indicates an invalid parameter was passed
                                    throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName());
                                }

                                    while (!reader.isStartElement() && !reader.isEndElement()) reader.next();

                                    if (reader.isStartElement() && new javax.xml.namespace.QName("http://ec2.amazonaws.com/doc/2010-11-15/","statusMessage").equals(reader.getName())){

                                    java.lang.String content = reader.getElementText();

                                              object.setStatusMessage(
                                                    org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content));

                                        reader.next();

                              }  // End of if for expected property start element

                                    else {

                                    }

                            while (!reader.isStartElement() && !reader.isEndElement())
                                reader.next();

                                if (reader.isStartElement())
                                // A start element we are not expecting indicates a trailing invalid property
                                throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName());

            } catch (javax.xml.stream.XMLStreamException e) {
                throw new java.lang.Exception(e);
            }

            return object;
        }

        }//end of factory class

        }


text:
/* global before, describe, it, request, expect, blueprint_client, mqtt_client, after */
var randomString = require('random-string');

// Wait for BlueprintClient initialization
before(function (done) {
  blueprint_client.ready
    .then(function () {
      mqtt_client.startListener();
      console.log('Blueprint Client ready');
      done();
    });
});

var deviceId;

describe('Devices', function () {
  var associationCode;

  it('should save a new device and return an association code', function () {
    var serialNumber = randomString({
      length: 8,
      numeric: true,
      letters: true,
      special: false
    }).toUpperCase();

    return request
      .post('/devices')
      .send({
        serial: serialNumber
      })
      .expect(201)
      .then(function (res) {
        var body = res.body;

        expect(body).to.have.property('device');

        var device = res.body.device;

        expect(device).to.have.property('id');
        expect(device).to.have.property('associationCode');
        expect(device).to.have.property('serialNumber', serialNumber);
        expect(device).to.have.property('provisioningState', 'activated');
        expect(device).to.have.property('password');
        expect(device).to.have.property('consumedShots');

        // Verifying channels creation
        expect(device.channels).to.have.length(1);

        var status_report = device.channels[0];
        expect(status_report).to.have.property('channelTemplateName', 'STATUS_REPORT');

        deviceId = device.id;
        associationCode = device.associationCode;
      });
  });

  it('should associate the device', function () {
    var data = {
      device: {
        associationCode: associationCode,
        name: 'Device Name',
        totalShots: 100,
        notifyRefillAt: 20,
        email: 'user@domain.com'
      }
    };

    return request
      .put('/devices/' + deviceId + '/associate')
      .send(data)
      .expect(200)
      .then(function (res) {
        var body = res.body;

        expect(body).to.have.property('device');

        var device = res.body.device;

        expect(device).to.have.property('id', deviceId);
        expect(device).to.have.property('name', device.name);
        expect(device).to.have.property('totalShots', device.totalShots);
        expect(device).to.have.property('notifyRefillAt', device.notifyRefillAt);
        expect(device).to.have.property('email', device.email);
        expect(device).to.have.property('provisioningState', 'activated');
      });
  });

  it('should disassociate the device', function () {
    return request
      .put('/devices/' + deviceId + '/disassociate')
      .expect(200)
      .then(function (res) {
        var body = res.body;

        expect(body).to.have.property('device');

        var device = res.body.device;

        expect(device).to.have.property('id', deviceId);
        expect(device).to.have.property('provisioningState');
      });
  });
});

// Remove the device after finish the tests
after(function (done) {
  mqtt_client.stopListener();

  blueprint_client.apis.devices.byId({
    id: deviceId
  })
    .then(function (response) {
      var device = response.obj.device;

      blueprint_client.apis.devices.delete({
        id: deviceId,
        etag: device.version
      })
        .then(function () {
          done();
        }, done);
    }, done);
});

redpajama_set_name: RedPajamaGithub


text:
module Capybara
  module Node
    ##
    #
    # A {Capybara::Node::Base} represents either an element on a page through the subclass
    # {Capybara::Node::Element} or a document through {Capybara::Node::Document}.
    #
    # Both types of Node share the same methods, used for interacting with the
    # elements on the page. These methods are divided into three categories,
    # finders, actions and matchers. These are found in the modules
    # {Capybara::Node::Finders}, {Capybara::Node::Actions} and {Capybara::Node::Matchers}
    # respectively.
    #
    # A {Capybara::Session} exposes all methods from {Capybara::Node::Document} directly:
    #
    #     session = Capybara::Session.new(:rack_test, my_app)
    #     session.visit('/')
    #     session.fill_in('Foo', with: 'Bar')    # from Capybara::Node::Actions
    #     bar = session.find('#bar')                # from Capybara::Node::Finders
    #     bar.select('Baz', from: 'Quox')        # from Capybara::Node::Actions
    #     session.has_css?('#foobar')               # from Capybara::Node::Matchers
    #
    class Base
      attr_reader :session, :base, :query_scope

      include Capybara::Node::Finders
      include Capybara::Node::Actions
      include Capybara::Node::Matchers

      def initialize(session, base)
        @session = session
        @base = base
      end

      # overridden in subclasses, e.g. Capybara::Node::Element
      def reload
        self
      end

      ##
      #
      # This method is Capybara's primary defence against asynchronicity
      # problems. It works by attempting to run a given block of code until it
      # succeeds. The exact behaviour of this method depends on a number of
      # factors. Basically there are certain exceptions which, when raised
      # from the block, instead of bubbling up, are caught, and the block is
      # re-run.
      #
      # Certain drivers, such as RackTest, have no support for asynchronous
      # processes, these drivers run the block, and any error raised bubbles up
      # immediately. This allows faster turn around in the case where an
      # expectation fails.
      #
      # Only exceptions that are {Capybara::ElementNotFound} or any subclass
      # thereof cause the block to be rerun. Drivers may specify additional
      # exceptions which also cause reruns. This usually occurs when a node is
      # manipulated which no longer exists on the page. For example, the
      # Selenium driver specifies
      # `Selenium::WebDriver::Error::ObsoleteElementError`.
      #
      # As long as any of these exceptions are thrown, the block is re-run,
      # until a certain amount of time passes. The amount of time defaults to
      # {Capybara.default_max_wait_time} and can be overridden through the `seconds`
      # argument. This time is compared with the system time to see how much
      # time has passed. On rubies/platforms which don't support access to a monotonic process clock
      # if the return value of `Time.now` is stubbed out, Capybara will raise `Capybara::FrozenInTime`.
      #
      # @param  [Integer] seconds  (current sessions default_max_wait_time) Maximum number of seconds to retry this block
      # @param  [Array<Exception>] errors (driver.invalid_element_errors +
      #   [Capybara::ElementNotFound]) exception types that cause the block to be rerun
      # @return [Object]                  The result of the given block
      # @raise  [Capybara::FrozenInTime]  If the return value of `Time.now` appears stuck
      #
      def synchronize(seconds = nil, errors: nil)
        return yield if session.synchronized

        seconds = session_options.default_max_wait_time if [nil, true].include? seconds
        interval = session_options.default_retry_interval
        session.synchronized = true
        timer = Capybara::Helpers.timer(expire_in: seconds)
        begin
          yield
        rescue StandardError => e
          session.raise_server_error!
          raise e unless catch_error?(e, errors)

          if driver.wait?
            raise e if timer.expired?

            sleep interval
            reload if session_options.automatic_reload
          else
            old_base = @base
            reload if session_options.automatic_reload
            raise e if old_base == @base
          end
          retry
        ensure
          session.synchronized = false
        end
      end

      # @api private
      def find_css(css, **options)
        if base.method(:find_css).arity == 1
          base.find_css(css)
        else
          base.find_css(css, **options)
        end
      end

      # @api private
      def find_xpath(xpath, **options)
        if base.method(:find_xpath).arity == 1
          base.find_xpath(xpath)
        else
          base.find_xpath(xpath, **options)
        end
      end

      # @api private
      def session_options
        session.config
      end

      def to_capybara_node
        self
      end

    protected

      def catch_error?(error, errors = nil)
        errors ||= (driver.invalid_element_errors + [Capybara::ElementNotFound])
        errors.any? { |type| error.is_a?(type) }
      end

      def driver
        session.driver
      end
    end
  end
end


text:
CREATE TABLE "player" (
    "id"  SERIAL NOT NULL ,
    "nick" VARCHAR(20) UNIQUE NOT NULL ,
    "reg_date" TIMESTAMP DEFAULT NOW(),
    "pas_hash" VARCHAR(20) NOT NULL ,
    "online" BOOLEAN DEFAULT TRUE,
        PRIMARY KEY ("id")
);

CREATE TABLE "piece" (
    "id"  SERIAL NOT NULL ,
    "name" VARCHAR(20) NOT NULL ,
        PRIMARY KEY ("id")
);

CREATE TABLE "games" (
    "id"  SERIAL NOT NULL ,
    "player_1" INTEGER NOT NULL ,
    "player_2" INTEGER NOT NULL ,
    "move" BOOLEAN DEFAULT TRUE ,
    "complete" BOOLEAN DEFAULT FALSE ,
    "start_time" TIMESTAMP DEFAULT NOW(),
        PRIMARY KEY ("id")
);

CREATE TABLE "message" (
    "id_game" INTEGER NOT NULL ,
    "id_player" INTEGER NOT NULL ,
    "time" TIMESTAMP NOT NULL ,
    "text" CHAR(200) NOT NULL ,
        PRIMARY KEY ("id_game", "id_player", "time")
);

CREATE TABLE "piece_turn" (
    "id"  SERIAL ,
    "piece" INTEGER NOT NULL ,
    "a-h" SMALLINT NOT NULL ,
    "1_8" SMALLINT NOT NULL ,
    "move" BOOLEAN , -- ограничение на ход
    "chop" BOOLEAN, -- ограничение на срубание
        PRIMARY KEY ("id")
);

CREATE TABLE "game_turn" (
    "id_game" INTEGER NOT NULL ,
    "player_id" INTEGER NOT NULL, --НЕ СВЯЗААННО С PLAYER !!!! TODO
    "id_piece" INTEGER ,
	"prev_piece_position_ah" SMALLINT NOT NULL,
	"prev_piece_position_18" SMALLINT NOT NULL ,
    "id_turn" INTEGER ,
    "time" TIMESTAMP DEFAULT NOW(),
        PRIMARY KEY ("id_game", "time")
);

CREATE TABLE "state" (
	"id" SERIAL NOT NULL,
    "id_game" INTEGER NOT NULL ,
    "id_piece" INTEGER ,
    "cell_ah" SMALLINT NOT NULL ,
    "cell_18" SMALLINT NOT NULL ,
    "isExist" BOOLEAN DEFAULT TRUE ,
        PRIMARY KEY ("id")
);

ALTER TABLE "games" ADD FOREIGN KEY ("player_1") REFERENCES "player" ("id");
ALTER TABLE "games" ADD FOREIGN KEY ("player_2") REFERENCES "player" ("id");
ALTER TABLE "message" ADD FOREIGN KEY ("id_game") REFERENCES "games" ("id");
ALTER TABLE "piece_turn" ADD FOREIGN KEY ("piece") REFERENCES "piece" ("id");
ALTER TABLE "game_turn" ADD FOREIGN KEY ("id_game") REFERENCES "games" ("id");
ALTER TABLE "game_turn" ADD FOREIGN KEY ("id_turn") REFERENCES "piece_turn" ("id");
ALTER TABLE "game_turn" ADD FOREIGN KEY ("id_piece") REFERENCES "piece" ("id");
ALTER TABLE "state" ADD FOREIGN KEY ("id_game") REFERENCES "games" ("id");
ALTER TABLE "state" ADD FOREIGN KEY ("id_piece") REFERENCES "piece" ("id");


text:
using static STULib.Types.Generic.Common;

namespace STULib.Types.Dump {
    [STU(0xE90FB891)]
    public class STU_E90FB891 : STU_1482DDBB {
        [STUField(0xA83C2C26, "m_entity", EmbeddedInstance = true)]
        public STULib.Types.STUConfigVar Entity;

        [STUField(0xDE0CEEAC, EmbeddedInstance = true)]
        public STULib.Types.STUConfigVar m_DE0CEEAC;
    }
}


text:
This repository is a basic macro manager that works globally sitting on a daemon.

It was done as a learning exercise so it only supports the most basic features, but it's easy to extend.

To check how it works, see test.py inside src.


text:
package org.edumo;

import org.edumo.content.BaseApp;
import org.edumo.gui.ActionEvent;
import org.edumo.gui.GUIComponent;
import org.edumo.gui.MTGuiP5PApplet;
import org.edumo.gui.Window;

import processing.core.PApplet;
import processing.core.PVector;

public class MainDraggableResizableImage extends MTGuiP5PApplet {

	public void setup() {
		smooth(4);
		mtContext = new BaseApp(this, g);
		frameRate(60);
		initGUI();
		mtContext.ignoreMouseIfTUIO = true;
	}

	private void initGUI() {

		window = new Window(mtContext);

		GUIComponent dragableImage = window.getWindowManager().addButton("", width / 2, height / 2, "keyblank.jpg",
				"keyblank.jpg", PApplet.CENTER);
		dragableImage.setResizeOnDraw(new PVector(200, 200));

		window.getWindowManager().addDraggable(dragableImage);
		window.getWindowManager().addResizable(dragableImage);
	}

	public void draw() {

		background(0);
		mtContext.drawDebugPointers(g);
		window.drawUndecorated(g);

	}

	protected void doAction(ActionEvent action) {
		if (action != null)
			println("action " + action.getAction());
	}

	@Override
	public void settings() {
		size(1024, 768, P3D);
	}

	static public void main(String[] passedArgs) {

		String[] appletArgs = new String[] { "org.edumo.MainDraggableResizableImage" };
		if (passedArgs != null) {
			PApplet.main(concat(appletArgs, passedArgs));
		} else {
			PApplet.main(appletArgs);
		}
	}
}


text:
<?xml version="1.0" encoding="utf-8"?>
<nine-patch
	xmlns:android="http://schemas.android.com/apk/res/android"
	android:src="@drawable/scrollbarpanel_background" />


text:
using System;
using System.Runtime.Serialization;

namespace AspxCommerce.Core
{
    [DataContract]
    [Serializable]
    public class OrderStatusListInfo
    {
        public OrderStatusListInfo()
        {
        }

        [DataMember(Name = "_rowTotal", Order = 0)]
        private System.Nullable<int> _rowTotal;

        [DataMember(Name = "OrderStatusID", Order = 1)]
		private int _orderStatusID;

        [DataMember(Name = "OrderStatusAliasName", Order = 2)]
        private string _orderStatusAliasName;

        [DataMember(Name = "AliasToolTip", Order = 3)]
		private string _aliasToolTip;

        [DataMember(Name = "AliasHelp", Order = 4)]
		private string _aliasHelp;

        [DataMember(Name = "AddedOn", Order = 5)]
        private System.Nullable<System.DateTime> _addedOn;

        [DataMember(Name = "_isSystemUsed", Order = 6)]
        private System.Nullable<bool> _isSystemUsed;

        [DataMember(Name = "IsActive", Order = 7)]
        private System.Nullable<bool> _isActive;
        [DataMember(Name = "IsReduceInQuantity", Order = 8)]
        private System.Nullable<bool> _isReduceInQuantity;

		public System.Nullable<int> RowTotal
		{
			get
			{
				return this._rowTotal;
			}
			set
			{
				if ((this._rowTotal != value))
				{
					this._rowTotal = value;
				}
			}
		}

		public int OrderStatusID
		{
			get
			{
				return this._orderStatusID;
			}
			set
			{
				if ((this._orderStatusID != value))
				{
					this._orderStatusID = value;
				}
			}
		}

        public string OrderStatusAliasName
        {
            get
            {
                return this._orderStatusAliasName;
            }
            set
            {
                if ((this._orderStatusAliasName != value))
                {
                    this._orderStatusAliasName = value;
                }
            }
        }

        public string AliasToolTip
        {
            get
            {
                return this._aliasToolTip;
            }
            set
            {
                if ((this._aliasToolTip != value))
                {
                    this._aliasToolTip = value;
                }
            }
        }

        public string AliasHelp
        {
            get
            {
                return this._aliasHelp;
            }
            set
            {
                if ((this._aliasHelp != value))
                {
                    this._aliasHelp = value;
                }
            }
        }

		public System.Nullable<System.DateTime> AddedOn
		{
			get
			{
				return this._addedOn;
			}
			set
			{
				if ((this._addedOn != value))
				{
					this._addedOn = value;
				}
			}
		}

        public System.Nullable<bool> IsSystemUsed
        {
            get
            {
                return this._isSystemUsed;
            }
            set
            {
                if ((this._isSystemUsed != value))
                {
                    this._isSystemUsed = value;
                }
            }
        }

		public System.Nullable<bool> IsActive
		{
			get
			{
				return this._isActive;
			}
			set
			{
				if ((this._isActive != value))
				{
					this._isActive = value;
				}
			}
		}
        public System.Nullable<bool> IsReduceInQuantity
        {
            get
            {
                return this._isReduceInQuantity;
            }
            set
            {
                if ((this._isReduceInQuantity != value))
                {
                    this._isReduceInQuantity = value;
                }
            }
        }
    }
    public class SaveOrderStatusInfo
    {
        public int OrderStatusID { get; set; }
        public string OrderStatusAliasName { get; set; }
        public string AliasToolTip { get; set; }
        public string AliasHelp { get; set; }
        public bool IsSystemUsed { get; set; }
        public bool IsActive { get; set; }
        public bool IsReduceInQuantity { get; set; }

    }

}


text:
import constants from '../constants/constants';

const textInputEditedAction = function (inTextInputType, inText) {
  if (inTextInputType === constants.kInputText_Api) {
    return {
      type: constants.kAction_EditApiURL,
      text: inText
    };
  } else if (inTextInputType === constants.kInputText_Xpath) {
    return {
      type: constants.kAction_EditXPath,
      text: inText
    };
  }
}

export default textInputEditedAction;


text:
/*
To change this license header, choose License Headers in Project Properties.
To change this template file, choose Tools | Templates
and open the template in the editor.
*/
/*
    Created on : 13-Jun-2017, 07:20:32
    Author     : arsalanc-v2
*/
.menu-button > .arrow-button {
    -fx-padding: 0;
}

.menu-button > .arrow-button > .arrow {
    -fx-padding: 0;
}


text:
import functools
import pprint
import six

import alembic
import alembic.autogenerate
import alembic.migration
from alembic import script as alembic_script
import mock
from oslo_config import cfg
from oslo_config import fixture as config_fixture
from oslo_db.sqlalchemy import test_base
from oslo_db.sqlalchemy import test_migrations
import sqlalchemy
from sqlalchemy import event

from neutron.db.migration.alembic_migrations import external
from neutron.db.migration import cli as migration
from neutron.db.migration.models import head as head_models
from neutron.tests.common import base

cfg.CONF.import_opt('core_plugin', 'neutron.common.config')

CORE_PLUGIN = 'neutron.plugins.ml2.plugin.Ml2Plugin'

class _TestModelsMigrations(test_migrations.ModelsMigrationsSync):
    '''Test for checking of equality models state and migrations.

    For the opportunistic testing you need to set up a db named
    'openstack_citest' with user 'openstack_citest' and password
    'openstack_citest' on localhost.
    The test will then use that db and user/password combo to run the tests.

    For PostgreSQL on Ubuntu this can be done with the following commands::

        sudo -u postgres psql
        postgres=# create user openstack_citest with createdb login password
                  'openstack_citest';
        postgres=# create database openstack_citest with owner
                   openstack_citest;

    For MySQL on Ubuntu this can be done with the following commands::

        mysql -u root
        >create database openstack_citest;
        >grant all privileges on openstack_citest.* to
         openstack_citest@localhost identified by 'openstack_citest';

    Output is a list that contains information about differences between db and
    models. Output example::

       [('add_table',
         Table('bat', MetaData(bind=None),
               Column('info', String(), table=<bat>), schema=None)),
        ('remove_table',
         Table(u'bar', MetaData(bind=None),
               Column(u'data', VARCHAR(), table=<bar>), schema=None)),
        ('add_column',
         None,
         'foo',
         Column('data', Integer(), table=<foo>)),
        ('remove_column',
         None,
         'foo',
         Column(u'old_data', VARCHAR(), table=None)),
        [('modify_nullable',
          None,
          'foo',
          u'x',
          {'existing_server_default': None,
          'existing_type': INTEGER()},
          True,
          False)]]

    * ``remove_*`` means that there is extra table/column/constraint in db;

    * ``add_*`` means that it is missing in db;

    * ``modify_*`` means that on column in db is set wrong
      type/nullable/server_default. Element contains information:

        - what should be modified,
        - schema,
        - table,
        - column,
        - existing correct column parameters,
        - right value,
        - wrong value.
    '''

    def setUp(self):
        patch = mock.patch.dict('sys.modules', {
            'heleosapi': mock.MagicMock(),
        })
        patch.start()
        self.addCleanup(patch.stop)
        super(_TestModelsMigrations, self).setUp()
        self.cfg = self.useFixture(config_fixture.Config())
        self.cfg.config(core_plugin=CORE_PLUGIN)
        self.alembic_config = migration.get_neutron_config()
        self.alembic_config.neutron_config = cfg.CONF

    def db_sync(self, engine):
        cfg.CONF.set_override('connection', engine.url, group='database')
        migration.do_alembic_command(self.alembic_config, 'upgrade', 'heads')

    def get_engine(self):
        return self.engine

    def get_metadata(self):
        return head_models.get_metadata()

    def include_object(self, object_, name, type_, reflected, compare_to):
        if type_ == 'table' and (name == 'alembic_version'
                                 or name in external.TABLES):
                return False

        return super(_TestModelsMigrations, self).include_object(
            object_, name, type_, reflected, compare_to)

    def test_models_sync(self):
        # drop all tables after a test run
        self.addCleanup(functools.partial(self.db.backend.drop_all_objects,
                                          self.get_engine()))

        # run migration scripts
        self.db_sync(self.get_engine())

        with self.get_engine().connect() as conn:
            opts = {
                'include_object': self.include_object,
                'compare_type': self.compare_type,
                'compare_server_default': self.compare_server_default,
            }
            mc = alembic.migration.MigrationContext.configure(conn, opts=opts)

            # compare schemas and fail with diff, if it's not empty
            diff = alembic.autogenerate.compare_metadata(mc,
                                                         self.get_metadata())
            insp = sqlalchemy.engine.reflection.Inspector.from_engine(
                self.get_engine())
            dialect = self.get_engine().dialect.name
            self.check_mysql_engine(dialect, insp)

        result = filter(self.remove_unrelated_errors, diff)
        if result:
            msg = pprint.pformat(result, indent=2, width=20)

            self.fail("Models and migration scripts aren't in sync:\n%s" % msg)

    def check_mysql_engine(self, dialect, insp):
        if dialect != 'mysql':
            return

        # Test that table creation on mysql only builds InnoDB tables
        tables = insp.get_table_names()
        self.assertTrue(len(tables) > 0,
                        "No tables found. Wrong schema?")
        noninnodb = [table for table in tables if
                     insp.get_table_options(table)['mysql_engine'] != 'InnoDB'
                     and table != 'alembic_version']
        self.assertEqual(0, len(noninnodb), "%s non InnoDB tables created" %
                                            noninnodb)

    # Remove some difference that are not mistakes just specific of
        # dialects, etc
    def remove_unrelated_errors(self, element):
        insp = sqlalchemy.engine.reflection.Inspector.from_engine(
            self.get_engine())
        dialect = self.get_engine().dialect.name
        if isinstance(element, tuple):
            if dialect == 'mysql' and element[0] == 'remove_index':
                table_name = element[1].table.name
                for fk in insp.get_foreign_keys(table_name):
                    if fk['name'] == element[1].name:
                        return False
                cols = [c.name for c in element[1].expressions]
                for col in cols:
                    if col in insp.get_pk_constraint(
                            table_name)['constrained_columns']:
                        return False
        else:
            for modified, _, table, column, _, _, new in element:
                if modified == 'modify_default' and dialect == 'mysql':
                    constrained = insp.get_pk_constraint(table)
                    if column in constrained['constrained_columns']:
                        return False
        return True

class TestModelsMigrationsMysql(_TestModelsMigrations,
                                base.MySQLTestCase):

    # There is no use to run this against both dialects, so add this test just
    # for MySQL tests
    def test_external_tables_not_changed(self):

        def block_external_tables(conn, clauseelement, multiparams, params):
            if isinstance(clauseelement, sqlalchemy.sql.selectable.Select):
                return

            if (isinstance(clauseelement, six.string_types) and
                    any(name in clauseelement for name in external.TABLES)):
                self.fail("External table referenced by neutron core "
                          "migration.")

            if hasattr(clauseelement, 'element'):
                if (clauseelement.element.name in external.TABLES or
                        (hasattr(clauseelement, 'table') and
                         clauseelement.element.table.name in external.TABLES)):
                    self.fail("External table referenced by neutron core "
                              "migration.")

        engine = self.get_engine()
        cfg.CONF.set_override('connection', engine.url, group='database')
        migration.do_alembic_command(self.alembic_config, 'upgrade', 'kilo')

        event.listen(engine, 'before_execute', block_external_tables)
        migration.do_alembic_command(self.alembic_config, 'upgrade', 'heads')

        event.remove(engine, 'before_execute', block_external_tables)

class TestModelsMigrationsPsql(_TestModelsMigrations,
                               base.PostgreSQLTestCase):
    pass

class TestSanityCheck(test_base.DbTestCase):

    def setUp(self):
        super(TestSanityCheck, self).setUp()
        self.alembic_config = migration.get_neutron_config()
        self.alembic_config.neutron_config = cfg.CONF

    def test_check_sanity_14be42f3d0a5(self):
        SecurityGroup = sqlalchemy.Table(
            'securitygroups', sqlalchemy.MetaData(),
            sqlalchemy.Column('id', sqlalchemy.String(length=36),
                              nullable=False),
            sqlalchemy.Column('name', sqlalchemy.String(255)),
            sqlalchemy.Column('tenant_id', sqlalchemy.String(255)))

        with self.engine.connect() as conn:
            SecurityGroup.create(conn)
            conn.execute(SecurityGroup.insert(), [
                {'id': '123d4s', 'tenant_id': 'sssda1', 'name': 'default'},
                {'id': '123d4', 'tenant_id': 'sssda1', 'name': 'default'}
            ])
            script_dir = alembic_script.ScriptDirectory.from_config(
                self.alembic_config)
            script = script_dir.get_revision("14be42f3d0a5").module
            self.assertRaises(script.DuplicateSecurityGroupsNamedDefault,
                              script.check_sanity, conn)

class TestWalkMigrations(test_base.DbTestCase):

    def setUp(self):
        super(TestWalkMigrations, self).setUp()
        self.alembic_config = migration.get_neutron_config()
        self.alembic_config.neutron_config = cfg.CONF

    def test_no_downgrade(self):
        script_dir = alembic_script.ScriptDirectory.from_config(
            self.alembic_config)
        versions = [v for v in script_dir.walk_revisions(base='base',
                                                         head='heads')]
        failed_revisions = []
        for version in versions:
            if hasattr(version.module, 'downgrade'):
                failed_revisions.append(version.revision)

        if failed_revisions:
            self.fail('Migrations %s have downgrade' % failed_revisions)


text:
/**
 * (c) 2013 SAP AG or an SAP affiliate company.  All rights reserved.
 *
 * No part of this publication may be reproduced or transmitted in any form or for any purpose
 * without the express permission of SAP AG.  The information contained herein may be changed
 * without prior notice.
 */
package com.sap.mobile.platform.server.sample.persistence.jpa.eclipselink.dao.impl;

import java.util.List;

import javax.persistence.EntityManager;
import javax.persistence.NoResultException;
import javax.persistence.TypedQuery;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.sap.mobile.platform.server.sample.persistence.jpa.dao.api.EmployeeDao;
import com.sap.mobile.platform.server.sample.persistence.jpa.model.Employee;

public class EmployeeDaoImpl extends BaseDaoImpl<Employee, Long> implements
		EmployeeDao {

	static final Logger log = LoggerFactory.getLogger(EmployeeDaoImpl.class);

	/**
	 * Default constructor
	 */
	public EmployeeDaoImpl() {
		super();
	}

	@Override
	public Class<Employee> getEntityClass() {
		return Employee.class;
	}

	@Override
	public Employee getById(Long id) {
		Employee result = null;
		EntityManager em = getEntityManager();
		try {
			TypedQuery<Employee> query = em
					.createQuery("SELECT e from Employee e WHERE e.id = :id",
							Employee.class);
			query.setParameter("id", id);
			result = (Employee) query.getSingleResult();
		} catch (NoResultException nre) {
			// just return null result
		} finally {
			if (em != null) {
				em.close();
			}
		}

		return result;
	}

	/**
     */
	@Override
	public List<Employee> getAll() {
		EntityManager em = getEntityManager();
		try {
			return em.createQuery("SELECT e from Employee e", Employee.class)
					.getResultList();
		} finally {
			if (em != null) {
				em.close();
			}
		}
	}

	/**
     */
	public List<Employee> getByLastName(final String name) {
		EntityManager em = getEntityManager();
		try {
			TypedQuery<Employee> query = em.createQuery(
					"SELECT e FROM Employee e WHERE e.lastName = :lastName",
					Employee.class);
			query.setParameter("lastName", name);
			return query.getResultList();
		} finally {
			if (em != null) {
				em.close();
			}
		}
	}
}


text:
#ifndef BABYLON_PROCEDURAL_TEXTURES_LIBRARY_FIRE_FIRE_PROCEDURAL_TEXTURE_H
#define BABYLON_PROCEDURAL_TEXTURES_LIBRARY_FIRE_FIRE_PROCEDURAL_TEXTURE_H

#include <babylon/babylon_api.h>
#include <babylon/materials/textures/procedurals/procedural_texture.h>
#include <babylon/maths/color3.h>
#include <babylon/maths/vector2.h>

namespace BABYLON {
namespace ProceduralTexturesLibrary {

class FireProceduralTexture;
using FireProceduralTexturePtr = std::shared_ptr<FireProceduralTexture>;

class BABYLON_SHARED_EXPORT FireProceduralTexture : public ProceduralTexture {

public:
  template <typename... Ts>
  static FireProceduralTexturePtr New(Ts&&... args)
  {
    auto texture = std::shared_ptr<FireProceduralTexture>(
      new FireProceduralTexture(std::forward<Ts>(args)...));
    texture->addToScene(texture);

    return texture;
  }
  ~FireProceduralTexture() override; // = default

  void updateShaderUniforms();

  void render(bool useCameraPostProcess) override;
  static std::vector<Color3> PurpleFireColors();
  static std::vector<Color3> GreenFireColors();
  static std::vector<Color3> RedFireColors();
  static std::vector<Color3> BlueFireColors();

  /**
   * @brief Serializes this fire procedural texture.
   * @returns a serialized fire procedural texture object
   */
  json serialize() const;

  /**
   * @brief Creates a Fire Procedural Texture from parsed fire procedural
   * texture data.
   * @param parsedTexture defines parsed texture data
   * @param scene defines the current scene
   * @param rootUrl defines the root URL containing fire procedural texture
   * information
   * @returns a parsed Fire Procedural Texture
   */
  static std::unique_ptr<FireProceduralTexture> Parse(const json& parsedTexture, Scene* scene,
                                                      const std::string& rootUrl);

protected:
  FireProceduralTexture(const std::string& name, const RenderTargetTextureSize& size, Scene* scene,
                        Texture* fallbackTexture = nullptr, bool generateMipMaps = false);

  bool get_autoGenerateTime() const;
  void set_autoGenerateTime(bool value);
  std::vector<Color3>& get_fireColors();
  void set_fireColors(const std::vector<Color3>& value);
  float get_time() const;
  void set_time(float value);
  Vector2& get_speed();
  void set_speed(const Vector2& value);
  float get_alphaThreshold() const;
  void set_alphaThreshold(float value);

public:
  Property<FireProceduralTexture, bool> autoGenerateTime;
  Property<FireProceduralTexture, std::vector<Color3>> fireColors;
  Property<FireProceduralTexture, float> time;
  Property<FireProceduralTexture, Vector2> speed;
  Property<FireProceduralTexture, float> alphaThreshold;

private:
  float _time;
  Vector2 _speed;
  bool _autoGenerateTime;
  std::vector<Color3> _fireColors;
  float _alphaThreshold;

}; // end of class FireProceduralTexture

} // end of namespace ProceduralTexturesLibrary
} // end of namespace BABYLON

#endif // end of
       // BABYLON_PROCEDURAL_TEXTURES_LIBRARY_FIRE_FIRE_PROCEDURAL_TEXTURE_H