<commit_before>## Generated by pyxsdgen

from xml.etree import ElementTree as ET

# types

class QueryRecursiveResultCriteriaType:
    def __init__(self, version, schedule, serviceType, children):
        self.version = version  # int
        self.schedule = schedule  # ScheduleType
        self.serviceType = serviceType  # string
        self.children = children  # [ ChildRecursiveType ]

    @classmethod
    def build(self, element):
        return QueryRecursiveResultCriteriaType(
                element.get('version'),
                ScheduleType.build(element.find('schedule')) if element.find('schedule') is not None else None,
                element.findtext('serviceType'),
                [ ChildRecursiveType.build(e) for e in element.find('children') ] if element.find('children') is not None else None
               )

    def xml(self, elementName):
        r = ET.Element(elementName, attrib={'version' : str(self.version)})
        r.append(self.schedule.xml('schedule'))
        if self.serviceType:
            ET.SubElement(r, 'serviceType').text = self.serviceType
        if self.children:
            ET.SubElement(r, 'children').extend( [ e.xml('children') for e in self.children ] )
        return r


class QuerySummaryResultCriteriaType:
    def __init__(self, version, schedule, serviceType, children):
        self.version = version  # int
        self.schedule = schedule  # ScheduleType
        self.serviceType = serviceType  # string
        self.children = children  # [ ChildSummaryType ]

    @classmethod
    def build(self, element):
        return QuerySummaryResultCriteriaType(
                element.get('version'),
                ScheduleType.build(element.find('schedule')) if element.find('schedule') is not None else None,
                element.findtext('serviceType'),
                [ ChildSummaryType.build(e) for e in element.find('children') ] if element.find('children') is not None else None
               )

    def xml(self, elementName):
        r = ET.Element(elementName, attrib={'version' : str(self.version)})
        r.append(self.schedule.xml('schedule'))
        if self.serviceType:
            ET.SubElement(r, 'serviceType').text = self.serviceType
        if self.children:
            ET.SubElement(r, 'children').extend( [ e.xml('children') for e in self.children ] )
        return r


class ScheduleType:
    def __init__(self, startTime, endTime):
        self.startTime = startTime  # DateTimeType -> dateTime
        self.endTime = endTime  # DateTimeType -> dateTime

    @classmethod
    def build(self, element):
        return ScheduleType(
                element.findtext('startTime'),
                element.findtext('endTime')
               )

    def xml(self, elementName):
        r = ET.Element(elementName)
        if self.startTime:
            ET.SubElement(r, 'startTime').text = str(self.startTime)
        if self.endTime:
            ET.SubElement(r, 'endTime').text = str(self.endTime)
        return r


class ReserveConfirmedType:
    def __init__(self, connectionId, globalReservationId, description, criteria):
        self.connectionId = connectionId  # ConnectionIdType -> string
        self.globalReservationId = globalReservationId  # GlobalReservationIdType -> anyURI
        self.description = description  # string
        self.criteria = criteria  # ReservationConfirmCriteriaType

    @classmethod
    def build(self, element):
        return ReserveConfirmedType(
                element.findtext('connectionId'),
                element.findtext('globalReservationId'),
                element.findtext('description'),
                ReservationConfirmCriteriaType.build(element.find('criteria')) if element.find('criteria') is not None else None
               )

    def xml(self, elementName):
        r = ET.Element(elementName)
        ET.SubElement(r, 'connectionId').text = self.connectionId
        if self.globalReservationId:
            ET.SubElement(r, 'globalReservationId').text = str(self.globalReservationId)
        if self.description:
            ET.SubElement(r, 'description').text = self.description
        r.append(self.criteria.xml('criteria'))
        return r


class QueryFailedType:
    def __init__(self, serviceException):
        self.serviceException = serviceException  # ServiceExceptionType

    @classmethod
    def build(self, element):
        return QueryFailedType(
                ServiceExceptionType.build(element.find('serviceException')) if element.find('serviceException') is not None else None
               )

    def xml(self, elementName):
        r = ET.Element(elementName)
        r.append(self.serviceException.xml(ET.QName('http://schemas.ogf.org/nsi/2013/07/framework/types', 'serviceException')))
        return r


class ErrorEventType:
    def __init__(self, event, additionalInfo, serviceException, connectionId, notificationId, timeStamp):
        self.event = event  # EventEnumType -> string
        self.additionalInfo = additionalInfo  # [ TypeValuePairType ]
        self.serviceException = serviceException  # ServiceExceptionType
        self.connectionId = connectionId  # ConnectionIdType -> string
        self.notificationId = notificationId  # NotificationIdType -> int
        self.timeStamp = timeStamp  # DateTimeType -> dateTime

    @classmethod
    def build(self, element):
        return ErrorEventType(
                element.findtext('event'),
                [ TypeValuePairType.build(e) for e in element.find('additionalInfo') ] if element.find('additionalInfo') is not None else None,
                ServiceExceptionType.build(element.find('serviceException')) if element.find('serviceException') is not None else None,
                element.findtext('connectionId'),
                int(element.findtext('notificationId')),
                element.findtext('timeStamp')
               )

    def xml(self, elementName):
        r = ET.Element(elementName)
        ET.SubElement(r, 'event').text = self.event
        if self.additionalInfo:
            ET.SubElement(r, 'additionalInfo').extend( [ e.xml(ET.QName('http://schemas.ogf.org/nsi/2013/07/framework/types', 'additionalInfo')) for e in self.additionalInfo ] )
        if self.serviceException:
            r.append(self.serviceException.xml(ET.QName('http://schemas.ogf.org/nsi/2013/07/framework/types', 'serviceException')))
        ET.SubElement(r, 'connectionId').text = self.connectionId
        ET.SubElement(r, 'notificationId').text = str(self.notificationId)
        ET.SubElement(r, 'timeStamp').text = str(self.timeStamp)
        return r


class QuerySummaryResultType:
    def __init__(self, connectionId, globalReservationId, description, criteria, requesterNSA, connectionStates, notificationId):
        self.connectionId = connectionId  # ConnectionIdType -> string
        self.globalReservationId = globalReservationId  # GlobalReservationIdType -> anyURI
        self.description = description  # string
        self.criteria = criteria  # [ QuerySummaryResultCriteriaType ]
        self.requesterNSA = requesterNSA  # NsaIdType -> anyURI
        self.connectionStates = connectionStates  # ConnectionStatesType
        self.notificationId = notificationId  # NotificationIdType -> int

    @classmethod<commit_msg>fix ordering in erroreventype<commit_after>## Generated by pyxsdgen

from xml.etree import ElementTree as ET

# types

class QueryRecursiveResultCriteriaType:
    def __init__(self, version, schedule, serviceType, children):
        self.version = version  # int
        self.schedule = schedule  # ScheduleType
        self.serviceType = serviceType  # string
        self.children = children  # [ ChildRecursiveType ]

    @classmethod
    def build(self, element):
        return QueryRecursiveResultCriteriaType(
                element.get('version'),
                ScheduleType.build(element.find('schedule')) if element.find('schedule') is not None else None,
                element.findtext('serviceType'),
                [ ChildRecursiveType.build(e) for e in element.find('children') ] if element.find('children') is not None else None
               )

    def xml(self, elementName):
        r = ET.Element(elementName, attrib={'version' : str(self.version)})
        r.append(self.schedule.xml('schedule'))
        if self.serviceType:
            ET.SubElement(r, 'serviceType').text = self.serviceType
        if self.children:
            ET.SubElement(r, 'children').extend( [ e.xml('children') for e in self.children ] )
        return r


class QuerySummaryResultCriteriaType:
    def __init__(self, version, schedule, serviceType, children):
        self.version = version  # int
        self.schedule = schedule  # ScheduleType
        self.serviceType = serviceType  # string
        self.children = children  # [ ChildSummaryType ]

    @classmethod
    def build(self, element):
        return QuerySummaryResultCriteriaType(
                element.get('version'),
                ScheduleType.build(element.find('schedule')) if element.find('schedule') is not None else None,
                element.findtext('serviceType'),
                [ ChildSummaryType.build(e) for e in element.find('children') ] if element.find('children') is not None else None
               )

    def xml(self, elementName):
        r = ET.Element(elementName, attrib={'version' : str(self.version)})
        r.append(self.schedule.xml('schedule'))
        if self.serviceType:
            ET.SubElement(r, 'serviceType').text = self.serviceType
        if self.children:
            ET.SubElement(r, 'children').extend( [ e.xml('children') for e in self.children ] )
        return r


class ScheduleType:
    def __init__(self, startTime, endTime):
        self.startTime = startTime  # DateTimeType -> dateTime
        self.endTime = endTime  # DateTimeType -> dateTime

    @classmethod
    def build(self, element):
        return ScheduleType(
                element.findtext('startTime'),
                element.findtext('endTime')
               )

    def xml(self, elementName):
        r = ET.Element(elementName)
        if self.startTime:
            ET.SubElement(r, 'startTime').text = str(self.startTime)
        if self.endTime:
            ET.SubElement(r, 'endTime').text = str(self.endTime)
        return r


class ReserveConfirmedType:
    def __init__(self, connectionId, globalReservationId, description, criteria):
        self.connectionId = connectionId  # ConnectionIdType -> string
        self.globalReservationId = globalReservationId  # GlobalReservationIdType -> anyURI
        self.description = description  # string
        self.criteria = criteria  # ReservationConfirmCriteriaType

    @classmethod
    def build(self, element):
        return ReserveConfirmedType(
                element.findtext('connectionId'),
                element.findtext('globalReservationId'),
                element.findtext('description'),
                ReservationConfirmCriteriaType.build(element.find('criteria')) if element.find('criteria') is not None else None
               )

    def xml(self, elementName):
        r = ET.Element(elementName)
        ET.SubElement(r, 'connectionId').text = self.connectionId
        if self.globalReservationId:
            ET.SubElement(r, 'globalReservationId').text = str(self.globalReservationId)
        if self.description:
            ET.SubElement(r, 'description').text = self.description
        r.append(self.criteria.xml('criteria'))
        return r


class QueryFailedType:
    def __init__(self, serviceException):
        self.serviceException = serviceException  # ServiceExceptionType

    @classmethod
    def build(self, element):
        return QueryFailedType(
                ServiceExceptionType.build(element.find('serviceException')) if element.find('serviceException') is not None else None
               )

    def xml(self, elementName):
        r = ET.Element(elementName)
        r.append(self.serviceException.xml(ET.QName('http://schemas.ogf.org/nsi/2013/07/framework/types', 'serviceException')))
        return r


class ErrorEventType:
    def __init__(self, connectionId, notificationId, timeStamp, event, additionalInfo, serviceException):
        self.connectionId = connectionId  # ConnectionIdType -> string
        self.notificationId = notificationId  # NotificationIdType -> int
        self.timeStamp = timeStamp  # DateTimeType -> dateTime
        self.event = event  # EventEnumType -> string
        self.additionalInfo = additionalInfo  # [ TypeValuePairType ]
        self.serviceException = serviceException  # ServiceExceptionType

    @classmethod
    def build(self, element):
        return ErrorEventType(
                element.findtext('connectionId'),
                int(element.findtext('notificationId')),
                element.findtext('timeStamp'),
                element.findtext('event'),
                [ TypeValuePairType.build(e) for e in element.find('additionalInfo') ] if element.find('additionalInfo') is not None else None,
                ServiceExceptionType.build(element.find('serviceException')) if element.find('serviceException') is not None else None
               )

    def xml(self, elementName):
        r = ET.Element(elementName)
        ET.SubElement(r, 'connectionId').text = self.connectionId
        ET.SubElement(r, 'notificationId').text = str(self.notificationId)
        ET.SubElement(r, 'timeStamp').text = str(self.timeStamp)
        ET.SubElement(r, 'event').text = self.event
        if self.additionalInfo:
            ET.SubElement(r, 'additionalInfo').extend( [ e.xml(ET.QName('http://schemas.ogf.org/nsi/2013/07/framework/types', 'additionalInfo')) for e in self.additionalInfo ] )
        if self.serviceException:
            r.append(self.serviceException.xml(ET.QName('http://schemas.ogf.org/nsi/2013/07/framework/types', 'serviceException')))
        return r


class QuerySummaryResultType:
    def __init__(self, connectionId, globalReservationId, description, criteria, requesterNSA, connectionStates, notificationId):
        self.connectionId = connectionId  # ConnectionIdType -> string
        self.globalReservationId = globalReservationId  # GlobalReservationIdType -> anyURI
        self.description = description  # string
        self.criteria = criteria  # [ QuerySummaryResultCriteriaType ]
        self.requesterNSA = requesterNSA  # NsaIdType -> anyURI
        self.connectionStates = connectionStates  # ConnectionStatesType
        self.notificationId = notificationId  # NotificationIdType -> int

    @classmethod
{'fraction_non_alphanumeric': 0.10315616887552945, 'fraction_numerical': 0.0024593523705424237, 'mean_word_length': 2.7593733949666155, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 27, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 30}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3863673', 'n_tokens_mistral': 3933, 'n_tokens_neox': 3800, 'n_words': 836}