Code Duplication    Length = 13-14 lines in 2 locations

opcua/ua/uatypes.py 1 location

@@ 958-971 (lines=14) @@
955
        ('ServerPicoseconds', 'UInt16'),
956
               )
957
958
    def __init__(self, variant=None, status=None):
959
        self.Encoding = 0
960
        if not isinstance(variant, Variant):
961
            variant = Variant(variant)
962
        self.Value = variant
963
        if status is None:
964
            self.StatusCode = StatusCode()
965
        else:
966
            self.StatusCode = status
967
        self.SourceTimestamp = None  # DateTime()
968
        self.SourcePicoseconds = None
969
        self.ServerTimestamp = None  # DateTime()
970
        self.ServerPicoseconds = None
971
        self._freeze = True
972
973
    def to_binary(self):
974
        packet = []

opcua/ua/uaprotocol_auto.py 1 location

@@ 1002-1014 (lines=13) @@
999
        ('ServerPicoseconds', 'UInt16'),
1000
               )
1001
1002
    def __init__(self, binary=None):
1003
        if binary is not None:
1004
            self._binary_init(binary)
1005
            self._freeze = True
1006
            return
1007
        self.Encoding = 0
1008
        self.Value = Variant()
1009
        self.StatusCode = StatusCode()
1010
        self.SourceTimestamp = datetime.utcnow()
1011
        self.SourcePicoseconds = 0
1012
        self.ServerTimestamp = datetime.utcnow()
1013
        self.ServerPicoseconds = 0
1014
        self._freeze = True
1015
1016
    def to_binary(self):
1017
        packet = []