Code Duplication    Length = 13-15 lines in 2 locations

opcua/ua/uaprotocol_auto.py 2 locations

@@ 11661-11675 (lines=15) @@
11658
11659
    __repr__ = __str__
11660
11661
11662
class CreateSubscriptionResult(FrozenClass):
11663
    '''
11664
    :ivar SubscriptionId:
11665
    :vartype SubscriptionId: UInt32
11666
    :ivar RevisedPublishingInterval:
11667
    :vartype RevisedPublishingInterval: Double
11668
    :ivar RevisedLifetimeCount:
11669
    :vartype RevisedLifetimeCount: UInt32
11670
    :ivar RevisedMaxKeepAliveCount:
11671
    :vartype RevisedMaxKeepAliveCount: UInt32
11672
    '''
11673
11674
    ua_types = [
11675
        ('SubscriptionId', 'UInt32'),
11676
        ('RevisedPublishingInterval', 'Double'),
11677
        ('RevisedLifetimeCount', 'UInt32'),
11678
        ('RevisedMaxKeepAliveCount', 'UInt32'),
@@ 10186-10198 (lines=13) @@
10183
        ('PercentDataBad', 'Byte'),
10184
        ('PercentDataGood', 'Byte'),
10185
        ('UseSlopedExtrapolation', 'Boolean'),
10186
               ]
10187
10188
    def __init__(self):
10189
        self.UseServerCapabilitiesDefaults = True
10190
        self.TreatUncertainAsBad = True
10191
        self.PercentDataBad = 0
10192
        self.PercentDataGood = 0
10193
        self.UseSlopedExtrapolation = True
10194
        self._freeze = True
10195
10196
    def to_binary(self):
10197
        packet = []
10198
        packet.append(uabin.Primitives.Boolean.pack(self.UseServerCapabilitiesDefaults))
10199
        packet.append(uabin.Primitives.Boolean.pack(self.TreatUncertainAsBad))
10200
        packet.append(uabin.Primitives.Byte.pack(self.PercentDataBad))
10201
        packet.append(uabin.Primitives.Byte.pack(self.PercentDataGood))