nmeta2dpae_datasets/iscx_2012_ddos_fold_1.py
def _etree_to_dict(self, xml_etree):
        """Convert an XML etree into a list of dicts.

        This method only takes care of elements, not attributes!

        :param xml_etree: Etree object to process
        :return: Data as a list of dict.
        """
        root = xml_etree.getroot()
        data = []
        labels = []
        for flow in root:
            flow_data = {}
            for i in range(len(flow)):
                if flow[i].tag != "Tag":
                    flow_data[flow[i].tag] = flow[i].text
                else:
                    if flow[i].text == "Normal":
                        labels.append(TagValue.Normal)
                    else:
                        labels.append(TagValue.Attack)
            data.append(flow_data)
        return data, labels
Convert an XML etree into a list of dicts.

        This method only takes care of elements, not attributes!

        :param xml_etree: Etree object to process
        :return: Data as a list of dict.
        
Convert an XML etree into a list of dicts.
This method only takes care of elements, not attributes!
Convert an XML etree into a list of dicts . This method only takes care of elements not attributes!
def _etree_to_dict(self, xml_etree):
        root = xml_etree.getroot()
        data = []
        labels = []
        for flow in root:
            flow_data = {}
            for i in range(len(flow)):
                if flow[i].tag != "Tag":
                    flow_data[flow[i].tag] = flow[i].text
                else:
                    if flow[i].text == "Normal":
                        labels.append(TagValue.Normal)
                    else:
                        labels.append(TagValue.Attack)
            data.append(flow_data)
        return data, labels
def _etree_to_dict ( self , xml_etree ) : root = xml_etree . getroot ( ) data = [ ] labels = [ ] for flow in root : flow_data = { } for i in range ( len ( flow ) ) : if flow [ i ] . tag != "Tag" : flow_data [ flow [ i ] . tag ] = flow [ i ] . text else : if flow [ i ] . text == "Normal" : labels . append ( TagValue . Normal ) else : labels . append ( TagValue . Attack ) data . append ( flow_data ) return data , labels
Convert an XML etree into a list of dicts.
Convert an XML etree into a list of dicts .
"""Convert an XML etree into a list of dicts.

        This method only takes care of elements, not attributes!

        :param xml_etree: Etree object to process
        :return: Data as a list of dict.
        """
Data as a list of dict.
Data as a list of dict .
self
xml_etree
Etree object to process
Etree object to process