Code Duplication    Length = 11-12 lines in 2 locations

opcua/ua/uaprotocol_auto.py 2 locations

@@ 1197-1208 (lines=12) @@
1194
        self.DiscoveryUrls = []
1195
        self._freeze = True
1196
1197
    def to_binary(self):
1198
        packet = []
1199
        packet.append(uabin.Primitives.String.pack(self.ApplicationUri))
1200
        packet.append(uabin.Primitives.String.pack(self.ProductUri))
1201
        packet.append(self.ApplicationName.to_binary())
1202
        packet.append(uabin.Primitives.UInt32.pack(self.ApplicationType.value))
1203
        packet.append(uabin.Primitives.String.pack(self.GatewayServerUri))
1204
        packet.append(uabin.Primitives.String.pack(self.DiscoveryProfileUri))
1205
        packet.append(uabin.Primitives.Int32.pack(len(self.DiscoveryUrls)))
1206
        for fieldname in self.DiscoveryUrls:
1207
            packet.append(uabin.Primitives.String.pack(fieldname))
1208
        return b''.join(packet)
1209
1210
    @staticmethod
1211
    def from_binary(data):
@@ 7437-7447 (lines=11) @@
7434
        self.UnsupportedUnitIds = []
7435
        self._freeze = True
7436
7437
    def to_binary(self):
7438
        packet = []
7439
        packet.append(uabin.Primitives.String.pack(self.OrganizationUri))
7440
        packet.append(uabin.Primitives.String.pack(self.ProfileId))
7441
        packet.append(uabin.Primitives.String.pack(self.ComplianceTool))
7442
        packet.append(uabin.Primitives.DateTime.pack(self.ComplianceDate))
7443
        packet.append(uabin.Primitives.UInt32.pack(self.ComplianceLevel.value))
7444
        packet.append(uabin.Primitives.Int32.pack(len(self.UnsupportedUnitIds)))
7445
        for fieldname in self.UnsupportedUnitIds:
7446
            packet.append(uabin.Primitives.String.pack(fieldname))
7447
        return b''.join(packet)
7448
7449
    @staticmethod
7450
    def from_binary(data):