Code Duplication    Length = 29-29 lines in 2 locations

opcua/ua/uaprotocol_auto.py 2 locations

@@ 8752-8780 (lines=29) @@
8749
8750
    __repr__ = __str__
8751
8752
8753
class HistoryUpdateDetails(FrozenClass):
8754
    '''
8755
    :ivar NodeId:
8756
    :vartype NodeId: NodeId
8757
    '''
8758
    def __init__(self, binary=None):
8759
        if binary is not None:
8760
            self._binary_init(binary)
8761
            self._freeze = True
8762
            return
8763
        self.NodeId = NodeId()
8764
        self._freeze = True
8765
8766
    def to_binary(self):
8767
        packet = []
8768
        packet.append(self.NodeId.to_binary())
8769
        return b''.join(packet)
8770
8771
    @staticmethod
8772
    def from_binary(data):
8773
        return HistoryUpdateDetails(data)
8774
8775
    def _binary_init(self, data):
8776
        self.NodeId = NodeId.from_binary(data)
8777
8778
    def __str__(self):
8779
        return 'HistoryUpdateDetails(' + 'NodeId:' + str(self.NodeId) + ')'
8780
8781
    __repr__ = __str__
8782
8783
@@ 7000-7028 (lines=29) @@
6997
6998
    __repr__ = __str__
6999
7000
7001
class LiteralOperand(FrozenClass):
7002
    '''
7003
    :ivar Value:
7004
    :vartype Value: Variant
7005
    '''
7006
    def __init__(self, binary=None):
7007
        if binary is not None:
7008
            self._binary_init(binary)
7009
            self._freeze = True
7010
            return
7011
        self.Value = Variant()
7012
        self._freeze = True
7013
7014
    def to_binary(self):
7015
        packet = []
7016
        packet.append(self.Value.to_binary())
7017
        return b''.join(packet)
7018
7019
    @staticmethod
7020
    def from_binary(data):
7021
        return LiteralOperand(data)
7022
7023
    def _binary_init(self, data):
7024
        self.Value = Variant.from_binary(data)
7025
7026
    def __str__(self):
7027
        return 'LiteralOperand(' + 'Value:' + str(self.Value) + ')'
7028
7029
    __repr__ = __str__
7030
7031