Code Duplication    Length = 10-10 lines in 2 locations

opcua/ua/uaprotocol_auto.py 2 locations

@@ 6448-6457 (lines=10) @@
6445
        ('IncludeSubtypes', 'Boolean'),
6446
        ('TargetName', 'QualifiedName'),
6447
               ]
6448
6449
    def __init__(self):
6450
        self.ReferenceTypeId = NodeId()
6451
        self.IsInverse = True
6452
        self.IncludeSubtypes = True
6453
        self.TargetName = QualifiedName()
6454
        self._freeze = True
6455
6456
    def to_binary(self):
6457
        packet = []
6458
        packet.append(self.ReferenceTypeId.to_binary())
6459
        packet.append(uabin.Primitives.Boolean.pack(self.IsInverse))
6460
        packet.append(uabin.Primitives.Boolean.pack(self.IncludeSubtypes))
@@ 5286-5295 (lines=10) @@
5283
        packet.append(self.RequestHeader.to_binary())
5284
        packet.append(self.Parameters.to_binary())
5285
        return b''.join(packet)
5286
5287
    @staticmethod
5288
    def from_binary(data):
5289
        obj = AddReferencesRequest()
5290
        obj.TypeId = NodeId.from_binary(data)
5291
        obj.RequestHeader = RequestHeader.from_binary(data)
5292
        obj.Parameters = AddReferencesParameters.from_binary(data)
5293
        return obj
5294
5295
    def __str__(self):
5296
        return 'AddReferencesRequest(' + 'TypeId:' + str(self.TypeId) + ', ' + \
5297
               'RequestHeader:' + str(self.RequestHeader) + ', ' + \
5298
               'Parameters:' + str(self.Parameters) + ')'