Code Duplication    Length = 7-10 lines in 2 locations

opcua/common/event.py 2 locations

@@ 120-129 (lines=10) @@
117
                    curr_node = parents[0]
118
119
                self._freeze = True
120
121
    return CustomEvent()
122
123
124
def get_event_properties_from_type_node(node):
125
    properties = []
126
    curr_node = node
127
128
    while True:
129
        properties.extend(curr_node.get_properties())
130
131
        if curr_node.nodeid.Identifier == ua.ObjectIds.BaseEventType:
132
            break
@@ 101-107 (lines=7) @@
98
        return ua.uaevents_auto.IMPLEMENTED_EVENTS[node.nodeid.Identifier]()
99
    else:
100
        parent_identifier, parent_eventtype = _find_parent_eventtype(node)
101
        if not parent_eventtype:
102
            return None
103
104
        class CustomEvent(parent_eventtype):
105
106
            def __init__(self):
107
                super(CustomEvent, self).__init__(extended=True)
108
                self.EventType = node.nodeid
109
                curr_node = node
110