Load attribute values from Plex XML response.
420442
def _loadData(self, data):
        
        self._setValue = None
        self.id = data.attrib.get('id')
        self.label = data.attrib.get('label')
        self.summary = data.attrib.get('summary')
        self.type = data.attrib.get('type')
        self.default = self._cast(data.attrib.get('default'))
        self.value = self._cast(data.attrib.get('value'))
        self.hidden = utils.cast(bool, data.attrib.get('hidden'))
        self.advanced = utils.cast(bool, data.attrib.get('advanced'))
        self.group = data.attrib.get('group')
        self.enumValues = self._getEnumValues(data)
1240094
def get_result_xml(result):
    
    result_xml = Element('result')
    for name, value in [('name', result['name']),
                        ('type', ResultType.get_str(result['type'])),
                        ('severity', result['severity']),
                        ('host', result['host']),
                        ('test_id', result['test_id']),
                        ('port', result['port']),
                        ('qod', result['qod'])]:
        result_xml.set(name, str(value))
    result_xml.text = result['value']
    return result_xml
935443
def _parse_repo(self, xml):
        
        self.name = get_attrib(xml, "name", "repo")
        self.username = get_attrib(xml, "user", "repo")
        self.apikey = get_attrib(xml, "apikey", "repo")
        self.organization = get_attrib(xml, "organization")
        self.staging = get_attrib(xml, "staging", "repo")
1064716
def loadXmlProperty(self, xprop):
        
        if xprop.tag == 'property':
            value = self.dataInterface().fromXml(xprop[0])
            self._xmlData[xprop.get('name', '')] = value
1371006
def _parse(data, obj_name, attr_map):
    """"""
    parsed_xml = minidom.parseString(data)
    parsed_objects = []
    for obj in parsed_xml.getElementsByTagName(obj_name):
        parsed_obj = {}
        for (py_name, xml_name) in attr_map.items():
            parsed_obj[py_name] = _get_minidom_tag_value(obj, xml_name)
        parsed_objects.append(parsed_obj)
    return parsed_objects
306231
def _ParsePropertiesXMLFile(self, xml_data):
    
    xml_root = ElementTree.fromstring(xml_data)

    properties = {}
    for xml_element in xml_root.iter():
      if not xml_element.text:
        continue

      # The property name is formatted as: {URL}name
      # For example: {http://purl.org/dc/terms/}modified
      _, _, name = xml_element.tag.partition('}')

      # Do not including the 'lpstr' attribute because it is very verbose.
      if name == 'lpstr':
        continue

      property_name = self._PROPERTY_NAMES.get(name, None)
      if not property_name:
        property_name = self._FormatPropertyName(name)

      properties[property_name] = xml_element.text

    return properties
1245892
def load(source):
    
    parser = get_xml_parser()
    return etree.parse(source, parser=parser).getroot()
554601
def _load_response(response):
    '''
    
    '''

    try:
        data = salt.utils.json.loads(response.text)
    except ValueError:
        data = response.text

    ret = {'code': response.status_code, 'content': data}

    return ret
107794
private void readAssignmentExtendedAttributes(Project.Assignments.Assignment xml, ResourceAssignment mpx)
   {
      for (Project.Assignments.Assignment.ExtendedAttribute attrib : xml.getExtendedAttribute())
      {
         int xmlFieldID = Integer.parseInt(attrib.getFieldID()) & 0x0000FFFF;
         AssignmentField mpxFieldID = MPPAssignmentField.getInstance(xmlFieldID);
         TimeUnit durationFormat = DatatypeConverter.parseDurationTimeUnits(attrib.getDurationFormat(), null);
         DatatypeConverter.parseExtendedAttribute(m_projectFile, mpx, attrib.getValue(), mpxFieldID, durationFormat);
      }
   }
609254
public static Object loadXMLInfo(String filename) throws JAXBException {
        Object obj = null;
        JAXBContext jaxbContext = JAXBContext.newInstance(CLINVAR_CONTEXT_v53);
        Unmarshaller unmarshaller = jaxbContext.createUnmarshaller();
        obj = unmarshaller.unmarshal(new File(filename));
        return obj;
    }
642554
def load_xml_conf(self, xml_file, id):
        '''
        
        '''

        # converting nutch-site.xml to key:value pairs
        import xml.etree.ElementTree as ET
        tree = ET.parse(xml_file)
        params = {}
        for prop in tree.getroot().findall(".//property"):
            params[prop.find('./name').text.strip()] = prop.find('./value').text.strip()
        return self.proxy.Configs().create(id, configData=params)
1166727
def _load(self, graph, source):
        """"""
        try:
            return graph.load(source)
        except:
            pass
        try:
            return graph.load(source, format='n3')
        except:
            pass
        try:
            return graph.load(source, format='nt')
        except:
            raise Exception("Could not load {} as either RDF/XML, N3 or NTriples".format(source))
1296040
def _load_int(self):
        """"""
        values = numpy.fromfile(self.filepath_int)
        if self.NDIM > 0:
            values = values.reshape(self.seriesshape)
        return values
1365220
def load_xml_db(self):
    """"""

    import urllib.request
    xmlfile = urllib.request.urlopen('http://' + self._host + '/DbXmlInfo.xml')
    xml_db = xmlfile.read()
    xmlfile.close()
    _LOGGER.info("Loaded xml db")

    parser = LutronXmlDbParser(lutron=self, xml_db_str=xml_db)
    assert(parser.parse())     # throw our own exception
    self._areas = parser.areas
    self._name = parser.project_name

    _LOGGER.info('Found Lutron project: %s, %d areas' % (
        self._name, len(self.areas)))

    return True
293277
def _parseAttrs(self, attrsStr):
        
        attributes = dict()
        for attrStr in self.SPLIT_ATTR_COL_RE.split(attrsStr):
            name, vals = self._parseAttrVal(attrStr)
            if name in attributes:
                raise GFF3Exception(
                    "duplicated attribute name: {}".format(name),
                    self.fileName, self.lineNumber)
            attributes[name] = vals
        return attributes
161676
def __read_byte_offset(decl, attrs):
        """"""
        offset = attrs.get(XML_AN_OFFSET, 0)
        # Make sure the size is in bytes instead of bits
        decl.byte_offset = int(offset) / 8
1220519
def parse_fields(attributes):
        """"""
        return tuple(field.bind_name(name)
                     for name, field in six.iteritems(attributes)
                     if isinstance(field, fields.Field))