Convert to EEML. Optional parameter describes the version of EEML to generate.
 Default (and currently only version implemented) is version 5.
562
def to_eeml(version = nil)
      if version.nil? || version == 5
        # Check that we have some data items
        if size < 1
          raise EEML::NoData.new('EEML requires at least one data item')
        end
        # Create EEML
        eeml = Builder::XmlMarkup.new
        eeml.instruct!
        eeml_options = {:xmlns => "http://www.eeml.org/xsd/005",
                        :'xmlns:xsi' => "http://www.w3.org/2001/XMLSchema-instance",
                        :'xsi:schemaLocation' => "http://www.eeml.org/xsd/005 http://www.eeml.org/xsd/005/005.xsd"}
        eeml_options[:version] = version if version
        eeml.eeml(eeml_options) do
          env_options = {}
          env_options[:updated] = @updated_at.xmlschema if @updated_at
          env_options[:creator] = @creator if @creator
          env_options[:id] = @id if @id
          eeml.environment(env_options) do |env|
            env.title @title if @title
            env.feed @feed if @feed
            env.status @status.to_s if @status
            env.description @description if @description
            env.icon @icon if @icon
            env.website @website if @website
            env.email @email if @email
            if @location
              loc_options = {}
              loc_options[:domain] = @location.domain
              loc_options[:exposure] = @location.exposure if @location.exposure
              loc_options[:disposition] = @location.disposition if @location.disposition
              env.location(loc_options) do |loc|
                loc.name @location.name if @location.name
                loc.lat @location.lat if @location.lat
                loc.lon @location.lon if @location.lon
                loc.ele @location.ele if @location.ele
              end
            end
            @data_items.each_index do |i|
              env.data(:id => @data_items[i].id || i) do |data|
                @data_items[i].tags.each do |tag|
                  data.tag tag
                end
                value_options = {}
                value_options[:maxValue] = @data_items[i].max_value if @data_items[i].max_value
                value_options[:minValue] = @data_items[i].min_value if @data_items[i].min_value
                data.value @data_items[i].value, value_options
                if @data_items[i].unit
                  unit_options = {}
                  unit_options[:symbol] = @data_items[i].unit.symbol if @data_items[i].unit.symbol
                  unit_options[:type] = @data_items[i].unit.type if @data_items[i].unit.type
                  data.unit @data_items[i].unit.name, unit_options
                end
              end
            end
          end
        end
      end
    end
721400
def to_model
      lm = low.try(:to_model)
      hm = high.try(:to_model)
      wm = width.try(:to_model)
      model_type = type
      if @entry.at_xpath('./cda:uncertainRange', HQMF2::Document::NAMESPACES)
        model_type = 'IVL_PQ'
      end

      if generate_any_value?(lm, hm)
        # Generate AnyValue if the only elements in the range are AnyValues.
        HQMF::AnyValue.new
      elsif generate_value?(lm, hm)
        # Generate a singel value if both low and high are the same
        HQMF::Value.new(lm.type, nil, lm.value, lm.inclusive?, lm.derived?, lm.expression)
      else
        HQMF::Range.new(model_type, lm, hm, wm)
      end
    end
874131
def gen_version(do_write=True, txt=None):
    

    if txt is None:
        txt = get_git_describe()

    try:
        info = VersionInfo(txt)
        vstr = info.package_version
    except MalformedGitTag:
        warnings.warn("Malformed input '{0}'".format(txt))
        vstr = '0.0.0'+txt

    if not do_write:
        print(vstr)
        return

    lines = (
        '# This file automatically generated by',
        '#    {0}'.format(__file__),
        '# at',
        '#    {0}'.format(datetime.datetime.now().isoformat(' ')),
        "__version__ = '{0}'".format(vstr)
    )
    with open(VERSION_FILE, "w") as fp:
        fp.write("\n".join(lines))
684357
def generate(self, *args, **kwargs):
        
        xmlstr = str(self)
        filename = args[0]
        with open(filename, 'w') as fil:
            fil.write(xmlstr)

        with open(self.get_latest_filename('junit.xml'), "w") as latest_report:
            latest_report.write(xmlstr)
1239635
def toxml(self):
        

        return '<Property name="{0}"'.format(self.name) +\
          (' dimension="{0}"'.format(self.dimension) if self.dimension else 'none') +\
          (' defaultValue = "{0}"'.format(self.default_value) if self.default_value else '') +\
          '/>'
826921
public com.google.appengine.v1.CreateVersionMethod getCreateVersion() {
    if (methodCase_ == 2) {
       return (com.google.appengine.v1.CreateVersionMethod) method_;
    }
    return com.google.appengine.v1.CreateVersionMethod.getDefaultInstance();
  }
131355
private void initVersion() {

        // initialize version information with static defaults
        m_versionNumber = DEFAULT_VERSION_NUMBER;
        m_versionId = DEFAULT_VERSION_ID;
        m_version = "OpenCms/" + m_versionNumber;
        m_buildInfo = Collections.emptyMap();
        // read the version-informations from properties
        Properties props = new Properties();
        try {
            props.load(this.getClass().getClassLoader().getResourceAsStream("org/opencms/main/version.properties"));
        } catch (Throwable t) {
            // no properties found - we just use the defaults
            return;
        }
        // initialize OpenCms version information from the property values
        m_versionNumber = props.getProperty("version.number", DEFAULT_VERSION_NUMBER);
        m_versionId = props.getProperty("version.id", DEFAULT_VERSION_ID);
        m_version = "OpenCms/" + m_versionNumber;
        m_buildInfo = new TreeMap<String, BuildInfoItem>();

        // iterate the properties and generate the build information from the entries
        for (String key : props.stringPropertyNames()) {
            if (!"version.number".equals(key) && !"version.id".equals(key) && !key.startsWith("nicename")) {
                String value = props.getProperty(key);
                String nicename = props.getProperty("nicename." + key, key);
                m_buildInfo.put(key, new BuildInfoItem(value, nicename, key));
            }
        }
        // make the map unmodifiable
        m_buildInfo = Collections.unmodifiableMap(m_buildInfo);
    }
70240
public void setEmfRuntimeVersion(final String emfRuntimeVersion) {
    this.emfRuntimeVersion = GenRuntimeVersion.get(emfRuntimeVersion);
    if ((this.emfRuntimeVersion == null)) {
      EMFGeneratorFragment2.LOG.warn(("Illegal EMF runtime version: " + emfRuntimeVersion));
    }
  }
1320091
def get_version(self):
        
        if not self.node.version:
            return None
        try:
            version = smart_str('%s' % self.node.version.resolve(self.context))
        except template.VariableDoesNotExist:
            raise template.TemplateSyntaxError('"%s" tag got an unknown variable: %r' %
                                               (self.node.nodename, self.node.version.var))

        return '%s' % version
395390
def fromXml(cls, elem):
        
        if elem is None:
            return None

        addon = cls.byName(elem.tag)
        if not addon:
            raise RuntimeError('{0} is not a supported XML tag'.format(elem.tag))

        return addon.load(elem)
770682
function (module, config) {
            var ret = {
                url: (config.root||'')+module,
                version: (config.ver||_o)[module]
            };
            // convert xxx.html to xxx_ver.html
            if (!!config.mode&&!!ret.version){
                ret.url = ret.url.replace(
                    /(\.[^.\/]*?)$/,
                    '_'+ret.version+'$1'
                );
                ret.version = null;
            }
            return ret;
        }
87296
def as_value(ele):
        
        dtype = ele.datatype()
        # print '%s = %s' % (ele.name(), dtype)
        if dtype in (1, 2, 3, 4, 5, 6, 7, 9, 12):
            # BOOL, CHAR, BYTE, INT32, INT64, FLOAT32, FLOAT64, BYTEARRAY, DECIMAL)
            return ele.getValue()
        elif dtype == 8:  # String
            val = ele.getValue()
            """
            if val:
                # us centric :)
                val = val.encode('ascii', 'replace')
            """
            return str(val)
        elif dtype == 10:  # Date
            if ele.isNull():
                return pd.NaT
            else:
                v = ele.getValue()
                return datetime(year=v.year, month=v.month, day=v.day) if v else pd.NaT
        elif dtype == 11:  # Time
            if ele.isNull():
                return pd.NaT
            else:
                v = ele.getValue()
                now = pd.datetime.now()
                return datetime(year=now.year, month=now.month, day=now.day, hour=v.hour, minute=v.minute, second=v.second).time() if v else np.nan
        elif dtype == 13:  # Datetime
            if ele.isNull():
                return pd.NaT
            else:
                v = ele.getValue()
                return v
        elif dtype == 14:  # Enumeration
            # raise NotImplementedError('ENUMERATION data type needs implemented')
            return str(ele.getValue())
        elif dtype == 16:  # Choice
            raise NotImplementedError('CHOICE data type needs implemented')
        elif dtype == 15:  # SEQUENCE
            return XmlHelper.get_sequence_value(ele)
        else:
            raise NotImplementedError('Unexpected data type %s. Check documentation' % dtype)
777426
def to_xml
      xml = Builder::XmlMarkup.new
      case
      when @self_closing && @content_type == 'container'
        xml.tag!(@name, @attributes)
      when @value.nil?
        xml.tag!(@name, @attributes.merge!("xsi:nil" => "true"))
      when ::Hash === @value
        xml.tag!(@name, @attributes) { xml << XmlFu::Hash.to_xml(@value) }
      when ::Array === @value
        case @content_type
        when "collection"
          xml << XmlFu::Array.to_xml(@value.flatten, {
            :key => (@self_closing ? "#{@name}/" : @name),
            :attributes => @attributes,
            :content_type => "collection"
          })
        when "container"
          xml.tag!(@name, @attributes) { xml << XmlFu::Array.to_xml(@value) }
        else
          # Shouldn't be anything else
        end
      else
        xml.tag!(@name, @attributes) { xml << self.value.to_s }
      end
      xml.target!
    end
227409
String processVersion(String version) {
    if (version == null || version.trim().isEmpty() || version.equals(APPENGINE_CONFIG)) {
      throw new IllegalArgumentException(VERSION_ERROR);
    } else if (version.equals(GCLOUD_CONFIG)) {
      return null;
    }
    return version;
  }
714919
def get_version(version=None):
    """"""
    if version is None:
        version = VERSION
    assert len(version) == 5
    assert version[3] in ('alpha', 'beta', 'rc', 'final')

    # Now build the two parts of the version number:
    # main = X.Y[.Z]
    # sub = .devN - for pre-alpha releases
    #     | {a|b|c}N - for alpha, beta and rc releases

    parts = 2 if version[2] == 0 else 3
    main = '.'.join(str(x) for x in version[:parts])

    sub = ''
    if version[3] == 'alpha' and version[4] == 0:
        # At the toplevel, this would cause an import loop.
        from django.utils.version import get_svn_revision
        svn_revision = get_svn_revision()[4:]
        if svn_revision != 'unknown':
            sub = '.dev%s' % svn_revision

    elif version[3] != 'final':
        mapping = {'alpha': 'a', 'beta': 'b', 'rc': 'c'}
        sub = mapping[version[3]] + str(version[4])

    return main + sub
727378
def generate_version_h(directory, xml):
    ''''''
    f = open(os.path.join(directory, "version.h"), mode='w')
    t.write(f,'''
/** @file
 *	@brief MAVLink comm protocol built from ${basename}.xml
 *	@see http://mavlink.org
 */
#pragma once
 
#ifndef MAVLINK_VERSION_H
#define MAVLINK_VERSION_H

#define MAVLINK_BUILD_DATE "${parse_time}"
#define MAVLINK_WIRE_PROTOCOL_VERSION "${wire_protocol_version}"
#define MAVLINK_MAX_DIALECT_PAYLOAD_SIZE ${largest_payload}
 
#endif // MAVLINK_VERSION_H
''', xml)
    f.close()
222057
def to_xml(options = {})
      xml = options[:builder] ||= Builder::XmlMarkup.new
      xml.instruct! unless options[:skip_instruct]
      xml.osm do
        xml.changeset(attributes) do
          tags.each do |k,v|
            xml.tag(:k => k, :v => v)
          end unless tags.empty?
        end
      end
    end