Code Duplication    Length = 11-12 lines in 2 locations

opcua/ua/uaprotocol_auto.py 2 locations

@@ 1195-1206 (lines=12) @@
1192
        self.DiscoveryUrls = []
1193
        self._freeze = True
1194
1195
    def to_binary(self):
1196
        packet = []
1197
        packet.append(uabin.Primitives.String.pack(self.ApplicationUri))
1198
        packet.append(uabin.Primitives.String.pack(self.ProductUri))
1199
        packet.append(self.ApplicationName.to_binary())
1200
        packet.append(uabin.Primitives.UInt32.pack(self.ApplicationType.value))
1201
        packet.append(uabin.Primitives.String.pack(self.GatewayServerUri))
1202
        packet.append(uabin.Primitives.String.pack(self.DiscoveryProfileUri))
1203
        packet.append(uabin.Primitives.Int32.pack(len(self.DiscoveryUrls)))
1204
        for fieldname in self.DiscoveryUrls:
1205
            packet.append(uabin.Primitives.String.pack(fieldname))
1206
        return b''.join(packet)
1207
1208
    @staticmethod
1209
    def from_binary(data):
@@ 7471-7481 (lines=11) @@
7468
        self.UnsupportedUnitIds = []
7469
        self._freeze = True
7470
7471
    def to_binary(self):
7472
        packet = []
7473
        packet.append(uabin.Primitives.String.pack(self.OrganizationUri))
7474
        packet.append(uabin.Primitives.String.pack(self.ProfileId))
7475
        packet.append(uabin.Primitives.String.pack(self.ComplianceTool))
7476
        packet.append(uabin.Primitives.DateTime.pack(self.ComplianceDate))
7477
        packet.append(uabin.Primitives.UInt32.pack(self.ComplianceLevel.value))
7478
        packet.append(uabin.Primitives.Int32.pack(len(self.UnsupportedUnitIds)))
7479
        for fieldname in self.UnsupportedUnitIds:
7480
            packet.append(uabin.Primitives.String.pack(fieldname))
7481
        return b''.join(packet)
7482
7483
    @staticmethod
7484
    def from_binary(data):