Fills the XML file with the required fields.

     * name
     * uuid
     * bridge
     * ip
     ** dhcp
511380
def network_xml(identifier, xml, address=None):
    
    netname = identifier[:8]
    network = etree.fromstring(xml)

    subelement(network, './/name', 'name', identifier)
    subelement(network, './/uuid', 'uuid', identifier)
    subelement(network, './/bridge', 'bridge', None, name='virbr-%s' % netname)

    if address is not None:
        set_address(network, address)

    return etree.tostring(network).decode('utf-8')
197576
public void load( ServletContext servletContext )
    {
        _urlTemplates = new URLTemplates();
        InputStream xmlInputStream = null;
        InputStream xsdInputStream = null;

        try
        {
            xmlInputStream = servletContext.getResourceAsStream( _configFilePath );
            if ( xmlInputStream != null ) {
                /* load the XSD input stream */
                xsdInputStream = SCHEMA_RESOLVER.getInputStream();

                final String W3C_XML_SCHEMA = "http://www.w3.org/2001/XMLSchema";
                final String JAXP_SCHEMA_LANGUAGE = "http://java.sun.com/xml/jaxp/properties/schemaLanguage";
                final String JAXP_SCHEMA_SOURCE = "http://java.sun.com/xml/jaxp/properties/schemaSource";

                DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
                dbf.setValidating(true);
                dbf.setNamespaceAware(true);
                dbf.setAttribute(JAXP_SCHEMA_LANGUAGE, W3C_XML_SCHEMA);
                dbf.setAttribute(JAXP_SCHEMA_SOURCE, xsdInputStream);

                DocumentBuilder db = dbf.newDocumentBuilder();

                /* add an ErrorHandler that just logs validation problems */
                db.setErrorHandler(new ErrorHandler() {
                    public void warning(SAXParseException exception) {
                        _log.info("Validation warning validating config file \"" + _configFilePath + "\" against XML Schema \"" + SCHEMA_RESOLVER.getResourcePath());
                    }

                    public void error(SAXParseException exception) {
                        _log.error("Validation errors occurred parsing the config file \"" + _configFilePath + "\".  Cause: " + exception, exception);
                    }

                    public void fatalError(SAXParseException exception) {
                        _log.error("Validation errors occurred parsing the config file \"" + _configFilePath + "\".  Cause: " + exception, exception);
                    }
                });

                db.setEntityResolver(new EntityResolver() {
                    public InputSource resolveEntity(String publicId, String systemId) {
                        if(systemId.endsWith("/url-template-config.xsd")) {
                            InputStream inputStream = DefaultURLTemplatesFactory.class.getClassLoader().getResourceAsStream(CONFIG_SCHEMA);
                            return new InputSource(inputStream);
                        }
                        else return null;
                    }
                });

                Document document = db.parse(xmlInputStream);
                Element root = document.getDocumentElement();
                loadTemplates( root );
                loadTemplateRefGroups( root );
       }
       else
       {
           if ( _log.isInfoEnabled() )
               _log.info( "Running without URL template descriptor, " + _configFilePath );
       }
   }
   catch ( ParserConfigurationException pce )
   {
       _log.error( "Problem loading URL template descriptor file " + _configFilePath, pce );
   }
   catch ( SAXException se )
   {
       _log.error( "Problem parsing URL template descriptor in " + _configFilePath, se );
   }
   catch ( IOException ioe )
   {
       _log.error( "Problem reading URL template descriptor file " + _configFilePath, ioe );
   }
   finally
   {
       // Close the streams
       try { if ( xmlInputStream != null ) xmlInputStream.close(); } catch ( Exception ignore ) {}
       try { if ( xsdInputStream != null ) xsdInputStream.close(); } catch( IOException ignore ) {}
   }
}
1072227
void generateAntIvyXml(Definition def, String outputDir)
   {
      try
      {
         FileWriter antfw = Utils.createFile("build.xml", outputDir);
         BuildIvyXmlGen bxGen = new BuildIvyXmlGen();
         bxGen.generate(def, antfw);
         antfw.close();

         FileWriter ivyfw = Utils.createFile("ivy.xml", outputDir);
         IvyXmlGen ixGen = new IvyXmlGen();
         ixGen.generate(def, ivyfw);
         ivyfw.close();

         FileWriter ivySettingsfw = Utils.createFile("ivy.settings.xml", outputDir);
         IvySettingsXmlGen isxGen = new IvySettingsXmlGen();
         isxGen.generate(def, ivySettingsfw);
         ivySettingsfw.close();
      }
      catch (IOException ioe)
      {
         ioe.printStackTrace();
      }
   }
166806
public XML fillMappedField(Class<?> configuredClass, MappedField configuredField) {
		
		Attribute attribute = getGlobalAttribute(configuredField, configuredClass);
		
		if(isNull(attribute))
			attribute = getAttribute(configuredField, configuredClass);
		
		if(!isNull(attribute)){
			if(isEmpty(configuredField.getMethod()))
				configuredField.getMethod(attribute.getGet());
			if(isEmpty(configuredField.setMethod()))
				configuredField.setMethod(attribute.getSet());
		}
		return this;
	}
589697
def import_xml(self, xml_gzipped_file_path, taxids=None, silent=False):
        
        version = self.session.query(models.Version).filter(models.Version.knowledgebase == 'Swiss-Prot').first()
        version.import_start_date = datetime.now()

        entry_xml = '<entries>'
        number_of_entries = 0
        interval = 1000
        start = False

        if sys.platform in ('linux', 'linux2', 'darwin'):
            log.info('Load gzipped XML from {}'.format(xml_gzipped_file_path))

            zcat_command = 'gzcat' if sys.platform == 'darwin' else 'zcat'

            number_of_lines = int(getoutput("{} {} | wc -l".format(zcat_command, xml_gzipped_file_path)))

            tqdm_desc = 'Import {} lines'.format(number_of_lines)

        else:
            print('bin was anderes')
            number_of_lines = None
            tqdm_desc = None

        with gzip.open(xml_gzipped_file_path) as fd:

            for line in tqdm(fd, desc=tqdm_desc, total=number_of_lines, mininterval=1, disable=silent):

                end_of_file = line.startswith(b"</uniprot>")

                if line.startswith(b"<entry "):
                    start = True

                elif end_of_file:
                    start = False

                if start:
                    entry_xml += line.decode("utf-8")

                if line.startswith(b"</entry>") or end_of_file:
                    number_of_entries += 1
                    start = False

                    if number_of_entries == interval or end_of_file:

                        entry_xml += "</entries>"
                        self.insert_entries(entry_xml, taxids)

                        if end_of_file:
                            break

                        else:
                            entry_xml = "<entries>"
                            number_of_entries = 0

        version.import_completed_date = datetime.now()
        self.session.commit()
17682
public void setupFields()
    {
        FieldInfo field = null;
        field = new FieldInfo(this, ID, Constants.DEFAULT_FIELD_LENGTH, null, null);
        field.setDataClass(Integer.class);
        field.setHidden(true);
        field = new FieldInfo(this, LAST_CHANGED, Constants.DEFAULT_FIELD_LENGTH, null, null);
        field.setDataClass(Date.class);
        field.setHidden(true);
        field = new FieldInfo(this, DELETED, 10, null, new Boolean(false));
        field.setDataClass(Boolean.class);
        field.setHidden(true);
        field = new FieldInfo(this, DESCRIPTION, 60, null, null);
        field = new FieldInfo(this, SEQUENCE, 10, null, null);
        field.setDataClass(Integer.class);
        field = new FieldInfo(this, KIND, 10, null, null);
        field = new FieldInfo(this, PART_TYPE, Constants.DEFAULT_FIELD_LENGTH, null, null);
        field = new FieldInfo(this, JNLP_FILE_ID, Constants.DEFAULT_FIELD_LENGTH, null, null);
        field.setDataClass(Integer.class);
        field = new FieldInfo(this, PATH, 128, null, null);
    }
499636
public void setupFields()
    {
        FieldInfo field = null;
        field = new FieldInfo(this, ID, Constants.DEFAULT_FIELD_LENGTH, null, null);
        field.setDataClass(Integer.class);
        field.setHidden(true);
        field = new FieldInfo(this, LAST_CHANGED, Constants.DEFAULT_FIELD_LENGTH, null, null);
        field.setDataClass(Date.class);
        field.setHidden(true);
        field = new FieldInfo(this, DELETED, 10, null, new Boolean(false));
        field.setDataClass(Boolean.class);
        field.setHidden(true);
        field = new FieldInfo(this, CODE, 250, null, null);
        field = new FieldInfo(this, DESCRIPTION, 40, null, null);
        field = new FieldInfo(this, LOCATION, 128, null, null);
        field = new FieldInfo(this, TYPE, 20, null, null);
        field = new FieldInfo(this, BASE_RESOURCE_ID, Constants.DEFAULT_FIELD_LENGTH, null, null);
        field.setDataClass(Integer.class);
        field = new FieldInfo(this, CLASS_PROJECT_ID, Constants.DEFAULT_FIELD_LENGTH, null, null);
        field.setDataClass(Integer.class);
    }
683758
public void setupFields()
    {
        FieldInfo field = null;
        field = new FieldInfo(this, ID, Constants.DEFAULT_FIELD_LENGTH, null, null);
        field.setDataClass(Integer.class);
        field.setHidden(true);
        field = new FieldInfo(this, LAST_CHANGED, Constants.DEFAULT_FIELD_LENGTH, null, null);
        field.setDataClass(Date.class);
        field.setHidden(true);
        field = new FieldInfo(this, DELETED, 10, null, new Boolean(false));
        field.setDataClass(Boolean.class);
        field.setHidden(true);
        field = new FieldInfo(this, CODE, 30, null, null);
        field = new FieldInfo(this, DESCRIPTION, 50, null, null);
        field = new FieldInfo(this, QUEUE_NAME_ID, Constants.DEFAULT_FIELD_LENGTH, null, null);
        field.setDataClass(Integer.class);
        field = new FieldInfo(this, REPLY_MESSAGE_PROCESS_INFO_ID, Constants.DEFAULT_FIELD_LENGTH, null, null);
        field.setDataClass(Integer.class);
        field = new FieldInfo(this, LOCAL_MESSAGE_PROCESS_INFO_ID, Constants.DEFAULT_FIELD_LENGTH, null, null);
        field.setDataClass(Integer.class);
        field = new FieldInfo(this, MESSAGE_INFO_ID, Constants.DEFAULT_FIELD_LENGTH, null, null);
        field.setDataClass(Integer.class);
        field = new FieldInfo(this, MESSAGE_TYPE_ID, Constants.DEFAULT_FIELD_LENGTH, null, null);
        field.setDataClass(Integer.class);
        field = new FieldInfo(this, PROCESS_TYPE_ID, Constants.DEFAULT_FIELD_LENGTH, null, null);
        field.setDataClass(Integer.class);
        field = new FieldInfo(this, PROCESSOR_CLASS, 127, null, null);
        field = new FieldInfo(this, PROPERTIES, Constants.DEFAULT_FIELD_LENGTH, null, null);
        field = new FieldInfo(this, DEFAULT_MESSAGE_TRANSPORT_ID, Constants.DEFAULT_FIELD_LENGTH, null, null);
        field.setDataClass(Integer.class);
        field = new FieldInfo(this, INITIAL_MESSAGE_STATUS_ID, Constants.DEFAULT_FIELD_LENGTH, null, null);
        field.setDataClass(Integer.class);
    }
595519
public void setupFields()
    {
        FieldInfo field = null;
        field = new FieldInfo(this, ID, Constants.DEFAULT_FIELD_LENGTH, null, null);
        field.setDataClass(Integer.class);
        field.setHidden(true);
        field = new FieldInfo(this, LAST_CHANGED, Constants.DEFAULT_FIELD_LENGTH, null, null);
        field.setDataClass(Date.class);
        field.setHidden(true);
        field = new FieldInfo(this, DELETED, 10, null, new Boolean(false));
        field.setDataClass(Boolean.class);
        field.setHidden(true);
        field = new FieldInfo(this, DESCRIPTION, 30, null, null);
        field = new FieldInfo(this, CODE, 20, null, null);
        field = new FieldInfo(this, NAMESPACE, 128, null, null);
        field = new FieldInfo(this, SCHEMA_LOCATION, Constants.DEFAULT_FIELD_LENGTH, null, null);
        field = new FieldInfo(this, NUMERIC_VERSION, 20, null, null);
        field = new FieldInfo(this, VERSION_ID, 20, null, null);
        field = new FieldInfo(this, PROPERTIES, Constants.DEFAULT_FIELD_LENGTH, null, null);
    }
762139
def Build(self):
    """"""
    if all((self.client_type, self.client_id, self.client_secret,
            self.auth_uri, self.token_uri)):
      client_config = {
          self.client_type: {
              'client_id': self.client_id,
              'client_secret': self.client_secret,
              'auth_uri': self.auth_uri,
              'token_uri': self.token_uri
          }
      }
    else:
      raise ValueError('Required field is missing.')

    return client_config
68454
public void setupFields()
    {
        FieldInfo field = null;
        field = new FieldInfo(this, ID, Constants.DEFAULT_FIELD_LENGTH, null, null);
        field.setDataClass(Integer.class);
        field.setHidden(true);
        field = new FieldInfo(this, LAST_CHANGED, Constants.DEFAULT_FIELD_LENGTH, null, null);
        field.setDataClass(Date.class);
        field.setHidden(true);
        field = new FieldInfo(this, DELETED, 10, null, new Boolean(false));
        field.setDataClass(Boolean.class);
        field.setHidden(true);
        field = new FieldInfo(this, FIELD_NAME, 40, null, null);
        field = new FieldInfo(this, FIELD_CLASS, 40, null, null);
        field = new FieldInfo(this, BASE_FIELD_NAME, 40, null, null);
        field = new FieldInfo(this, DEPENDENT_FIELD_NAME, 40, null, null);
        field = new FieldInfo(this, MINIMUM_LENGTH, 4, null, null);
        field.setDataClass(Short.class);
        field = new FieldInfo(this, MAXIMUM_LENGTH, 5, null, null);
        field.setDataClass(Short.class);
        field = new FieldInfo(this, DEFAULT_VALUE, 50, null, null);
        field = new FieldInfo(this, INITIAL_VALUE, 50, null, null);
        field = new FieldInfo(this, FIELD_DESCRIPTION, 100, null, null);
        field = new FieldInfo(this, FIELD_DESC_VERTICAL, 14, null, null);
        field = new FieldInfo(this, FIELD_TYPE, 1, null, null);
        field = new FieldInfo(this, FIELD_DIMENSION, 3, null, null);
        field.setDataClass(Short.class);
        field = new FieldInfo(this, FIELD_FILE_NAME, 40, null, null);
        field = new FieldInfo(this, FIELD_SEQ_NO, 4, null, null);
        field.setDataClass(Short.class);
        field = new FieldInfo(this, FIELD_NOT_NULL, 1, null, null);
        field.setDataClass(Boolean.class);
        //field = new FieldInfo(this, DATA_CLASS, 20, null, null);
        field = new FieldInfo(this, HIDDEN, 10, null, null);
        field.setDataClass(Boolean.class);
        field = new FieldInfo(this, INCLUDE_SCOPE, 10, null, new Integer(0x004));
        field.setDataClass(Integer.class);
    }
874500
def fill_response_property(xml_root, name=None, value=None):
    """"""
    name, value = generate_response_property(name, value)
    response_property = None

    if xml_root.tag == "testsuites":
        response_property = _fill_testsuites_response_property(xml_root, name, value)
    elif xml_root.tag in ("testcases", "requirements"):
        response_property = _fill_non_testsuites_response_property(xml_root, name, value)
    else:
        raise Dump2PolarionException(_NOT_EXPECTED_FORMAT_MSG)

    return response_property
240600
public void setupFields()
    {
        FieldInfo field = null;
        field = new FieldInfo(this, ID, Constants.DEFAULT_FIELD_LENGTH, null, null);
        field.setDataClass(Integer.class);
        field.setHidden(true);
        field = new FieldInfo(this, LAST_CHANGED, Constants.DEFAULT_FIELD_LENGTH, null, null);
        field.setDataClass(Date.class);
        field.setHidden(true);
        field = new FieldInfo(this, DELETED, 10, null, new Boolean(false));
        field.setDataClass(Boolean.class);
        field.setHidden(true);
        field = new FieldInfo(this, USER_GROUP_ID, Constants.DEFAULT_FIELD_LENGTH, null, null);
        field.setDataClass(Integer.class);
        field = new FieldInfo(this, USER_RESOURCE_ID, Constants.DEFAULT_FIELD_LENGTH, null, null);
        field.setDataClass(Integer.class);
        field = new FieldInfo(this, LOGIN_LEVEL, Constants.DEFAULT_FIELD_LENGTH, null, null);
        field = new FieldInfo(this, ACCESS_LEVEL, Constants.DEFAULT_FIELD_LENGTH, null, null);
    }
206373
private void addCustomFields(MpxjTreeNode parentNode, ProjectFile file)
   {
      for (CustomField field : file.getCustomFields())
      {
         final CustomField c = field;
         MpxjTreeNode childNode = new MpxjTreeNode(field)
         {
            @Override public String toString()
            {
               FieldType type = c.getFieldType();
               
               return type == null ? "(unknown)" : type.getFieldTypeClass() + "." + type.toString();
            }
         };
         parentNode.add(childNode);
      }
   }
870886
public void setupFields()
    {
        FieldInfo field = null;
        field = new FieldInfo(this, ID, Constants.DEFAULT_FIELD_LENGTH, null, null);
        field.setDataClass(Integer.class);
        field.setHidden(true);
        field = new FieldInfo(this, LAST_CHANGED, Constants.DEFAULT_FIELD_LENGTH, null, null);
        field.setDataClass(Date.class);
        field.setHidden(true);
        field = new FieldInfo(this, DELETED, 10, null, new Boolean(false));
        field.setDataClass(Boolean.class);
        field.setHidden(true);
        field = new FieldInfo(this, START_DATE_TIME, 25, null, null);
        field.setDataClass(Date.class);
        field = new FieldInfo(this, END_DATE_TIME, 25, null, null);
        field.setDataClass(Date.class);
        field = new FieldInfo(this, DESCRIPTION, 60, null, null);
        field = new FieldInfo(this, REPEAT_INTERVAL_ID, Constants.DEFAULT_FIELD_LENGTH, null, null);
        field.setDataClass(Integer.class);
        field = new FieldInfo(this, REPEAT_COUNT, 5, null, null);
        field.setDataClass(Short.class);
        field = new FieldInfo(this, CALENDAR_CATEGORY_ID, Constants.DEFAULT_FIELD_LENGTH, null, null);
        field.setDataClass(Integer.class);
        field = new FieldInfo(this, HIDDEN, 10, null, new Boolean(false));
        field.setDataClass(Boolean.class);
        field = new FieldInfo(this, PROPERTIES, Constants.DEFAULT_FIELD_LENGTH, null, null);
    }
1306134
public void setupFields()
    {
        FieldInfo field = null;
        field = new FieldInfo(this, ID, Constants.DEFAULT_FIELD_LENGTH, null, null);
        field.setDataClass(Integer.class);
        field.setHidden(true);
        field = new FieldInfo(this, LAST_CHANGED, Constants.DEFAULT_FIELD_LENGTH, null, null);
        field.setDataClass(Date.class);
        field.setHidden(true);
        field = new FieldInfo(this, DELETED, 10, null, new Boolean(false));
        field.setDataClass(Boolean.class);
        field.setHidden(true);
        field = new FieldInfo(this, NAME, 30, null, null);
        field = new FieldInfo(this, DESCRIPTION, 30, null, null);
        field = new FieldInfo(this, VERSION, 20, null, null);
        field = new FieldInfo(this, START_ID, 10, null, null);
        field.setDataClass(Integer.class);
        field = new FieldInfo(this, END_ID, 10, null, null);
        field.setDataClass(Integer.class);
        field = new FieldInfo(this, BASE_DATABASE, 30, null, null);
        field = new FieldInfo(this, PROPERTIES, Constants.DEFAULT_FIELD_LENGTH, null, null);
    }
13243
def fill_fields(self, **kwargs):
        """"""
        for name, value in kwargs.items():
            field = getattr(self, name)
            field.send_keys(value)