Code Duplication    Length = 10-10 lines in 2 locations

opcua/ua/uaprotocol_auto.py 2 locations

@@ 2005-2014 (lines=10) @@
2002
        self.ProfileUris = []
2003
        self._freeze = True
2004
2005
    def to_binary(self):
2006
        packet = []
2007
        packet.append(uabin.Primitives.String.pack(self.EndpointUrl))
2008
        packet.append(uabin.Primitives.Int32.pack(len(self.LocaleIds)))
2009
        for fieldname in self.LocaleIds:
2010
            packet.append(uabin.Primitives.String.pack(fieldname))
2011
        packet.append(uabin.Primitives.Int32.pack(len(self.ProfileUris)))
2012
        for fieldname in self.ProfileUris:
2013
            packet.append(uabin.Primitives.String.pack(fieldname))
2014
        return b''.join(packet)
2015
2016
    @staticmethod
2017
    def from_binary(data):
@@ 1469-1478 (lines=10) @@
1466
        self.ServerUris = []
1467
        self._freeze = True
1468
1469
    def to_binary(self):
1470
        packet = []
1471
        packet.append(uabin.Primitives.String.pack(self.EndpointUrl))
1472
        packet.append(uabin.Primitives.Int32.pack(len(self.LocaleIds)))
1473
        for fieldname in self.LocaleIds:
1474
            packet.append(uabin.Primitives.String.pack(fieldname))
1475
        packet.append(uabin.Primitives.Int32.pack(len(self.ServerUris)))
1476
        for fieldname in self.ServerUris:
1477
            packet.append(uabin.Primitives.String.pack(fieldname))
1478
        return b''.join(packet)
1479
1480
    @staticmethod
1481
    def from_binary(data):