def __deepcopy__(self, memo):
    cls = self.__class__
    copied_op = cls.__new__(cls)
    memo[id(self)] = copied_op
    for (attribute, value) in self.__dict__.items():
        if (attribute == 'data'):
            copied_op.data = value.copy()
        else:
            setattr(copied_op, attribute, copy.deepcopy(value, memo))
    return copied_op
def __deepcopy__(self, memo):
    cls = self.__class__
    copied_op = cls.__new__(cls)
    memo[id(self)] = copied_op
    for (attribute, value) in self.__dict__.items():
        if (attribute == 'data'):
            copied_op.data = value.copy()
        else:
            setattr(copied_op, attribute, copy.deepcopy(value, memo))
    return copied_op