def get_devices(self, dom, type):
        devices = []

        # Create a XML tree from the domain XML description.
        tree = ElementTree.fromstring(dom.XMLDesc(0))

        for target in tree.findall("devices/%s/target" % type):
            dev = target.get("dev")
            if dev not in devices:
                devices.append(dev)

        return devices
dataset/ETHPy150Open python-diamond/Diamond/src/collectors/libvirtkvm/libvirtkvm.py/LibvirtKVMCollector.get_devices/original