Parse a trigger condition
        :param element: The XML Element object
        :type  element: etree._Element
192221
def _parse_condition(self, element):
        
        self._log.info('Parsing new Condition')
        condition = Condition(self, element, self.file_path)
        for statement in condition.statements:
            for response in statement.contents:
                self._responses.add(response, condition)

        if condition.else_statement:
            self._responses.add(condition.else_statement[0], condition)
327102
def parseelement(elem):
    '''
    
    '''
    xml = '<%(tag)s>%(content)s</%(tag)s>' % {'tag' : elem.tag, 'content' : elem.text}
    et = etree.fromstring(xml)
    replaceelement(elem, et)
835416
def check_element(self, elem, check_children=False, next_to_elem=None):
        
        self.__add_element('eid', elem.attribs, self.__element_ids, elem, next_to_elem)
        self.__add_element('aid', elem.attribs, self.__attrib_ids, elem, next_to_elem)
        self.__add_element('rid', elem.attribs, self.__repeat_ids, elem, next_to_elem)
        if check_children and elem.children:
            for child in elem.children:
                self.check_element(child, True, next_to_elem)
334763
def get_element_attributes(parent_to_parse, element_path=None):
    

    element = get_element(parent_to_parse, element_path)

    return {} if element is None else element.attrib
482680
def parse_xml_node(self, node):
        '''

        '''
        self._targets = []
        for c in node.getElementsByTagNameNS(RTS_NS, 'targets'):
            if c.getElementsByTagNameNS(RTS_NS, 'WaitTime'):
                new_target = WaitTime()
            elif c.getElementsByTagNameNS(RTS_NS, 'Preceding'):
                new_target = Preceding()
            else:
                new_target = Condition()
            new_target.parse_xml_node(c)
            self._targets.append(new_target)
        return self
492171
def get_element(text_or_tree_or_element):
    
    if isinstance(text_or_tree_or_element, ET.Element):
        return text_or_tree_or_element
    elif isinstance(text_or_tree_or_element, ET.ElementTree):
        return text_or_tree_or_element.getroot()
    elif isinstance(text_or_tree_or_element, (unicode, bytes)):
        return ET.fromstring(text_or_tree_or_element)
    else:
        return ET.parse(text_or_tree_or_element).getroot()
582139
def parse_root(raw):
    ""
    if sys.version < '3':
        fp = StringIO(raw)
    else:
        fp = BytesIO(raw.encode('UTF-8'))
    for event, element in etree.iterparse(fp, events=('start',)):
        return (element.tag, element.attrib)
475563
def _parse_attribute(
            self,
            element,  # type: ET.Element
            attribute,  # type: Text
            state  # type: _ProcessorState
    ):
        # type: (...) -> Any
        """"""
        parsed_value = self._default
        attribute_value = element.get(attribute, None)

        if attribute_value is not None:
            parsed_value = self._parser_func(attribute_value, state)
        elif self.required:
            state.raise_error(
                MissingValue, 'Missing required attribute "{}" on element "{}"'.format(
                    self._attribute, element.tag
                )
            )

        return parsed_value
796557
def post(self, element):
        

        try:

            if self.disabled is True:
                element.clear_samples()
                logging.error('Posting has been disabled. '
                              'See previous errors for details.')
                return(False)

            if element.id is None:
                raise Exception('element id is not set')

            element.merge_metrics()
            payload = json.dumps(
                [element], default=lambda o: o.__dict__, sort_keys=True)
            logging.debug(payload)

            headers = {'Content-Type': 'application/json',
                       'User-Agent': self.agent}
            request = urllib2.Request(
                self.dataurl, data=payload, headers=headers)
            resp = urllib2.urlopen(request)
            logging.debug("Response code: %d", resp.getcode())

            resp.close()

            self.post_error_count = 0

            return(True)

        except urllib2.HTTPError as e:
            logging.debug("Response code: %d", e.code)

            if e.code in self.kill_codes:
                self.disabled = True

                logging.exception('Posting has been disabled.'
                                  'See previous errors for details.')
            else:
                self.post_error_count += 1
                if self.post_error_count > self.max_post_errors:
                    element.clear_samples()

                logging.exception(
                    'error posting payload to api ingest endpoint (%s): %s',
                    self.dataurl, e)

        except Exception as e:
            self.post_error_count += 1
            if self.post_error_count > self.max_post_errors:
                element.clear_samples()  # pragma: no cover

            logging.exception(
                'error posting payload to api ingest endpoint (%s): %s',
                self.dataurl, e)
982782
private If parseIf(Node node) {
        return new If(
                nodeAttribute(node, TAG_VAR_ATTR_NAME, Variable.DEFAULT_NAME),
                parseTemplateElements(node)
        );
    }
1246159
def _parse_template(self, element):
        
        # If the response element has no tags, just store the raw text as the only response
        if not len(element):
            self._response = (newlines_to_spaces(element.text),)
            self._log.info('Assigning text only response')
            return

        # Otherwise, parse the tags now
        self._response = tuple(self.agentml.parse_tags(element, self.trigger))
764319
private void triggerEvents(WebElement element, WebDriver driver) {
		if ("input".equalsIgnoreCase(element.getTagName())) {
			driver.findElement(By.tagName("body")).click();
		}
	}
427740
def parse_xml_node(self, node):
        '''

        '''
        self.group_id = node.getAttributeNS(RTS_NS, 'groupId')
        self._members = []
        for c in node.getElementsByTagNameNS(RTS_NS, 'Members'):
            self._members.append(TargetComponent().parse_xml_node(c))
        return self
588801
def parse_at_element(
            self,
            element,  # type: ET.Element
            state  # type: _ProcessorState
    ):
        # type: (...) -> Any
        """"""
        if self._attribute:
            parsed_value = self._parse_attribute(element, self._attribute, state)
        else:
            parsed_value = self._parser_func(element.text, state)

        return _hooks_apply_after_parse(self._hooks, state, parsed_value)
1205791
protected void parseRootElement() {

    JobExecutorXmlImpl jobExecutor = new JobExecutorXmlImpl();
    List<ProcessEngineXml> processEngines = new ArrayList<ProcessEngineXml>();

    for (Element element : rootElement.elements()) {

      if(JOB_EXECUTOR.equals(element.getTagName())) {
        parseJobExecutor(element, jobExecutor);

      } else if(PROCESS_ENGINE.equals(element.getTagName())) {
        parseProcessEngine(element, processEngines);

      }

    }

    bpmPlatformXml = new BpmPlatformXmlImpl(jobExecutor, processEngines);
  }
395366
def element_to_extension_element(element):
    

    exel = ExtensionElement(element.c_tag, element.c_namespace,
                            text=element.text)

    exel.attributes.update(element.extension_attributes)
    exel.children.extend(element.extension_elements)

    for xml_attribute, (member_name, typ, req) in \
            iter(element.c_attributes.items()):
        member_value = getattr(element, member_name)
        if member_value is not None:
            exel.attributes[xml_attribute] = member_value

    exel.children.extend([element_to_extension_element(c) for c in
                          element.children_with_values()])

    return exel
1083131
def parse_Element(self, node):
        
        name = node.tagName
        ignores = self.ignores
        if name in ignores:
            return
        attr = "do_%s" % name
        if hasattr(self, attr):
            handlerMethod = getattr(self, attr)
            handlerMethod(node)
        else:
            self.generic_parse(node)