# Path: diffprivlib/mechanisms/base.py
# class DPMachine(abc.ABC):
#     """
#     Parent class for :class:`.DPMechanism` and :class:`.DPTransformer`, providing and specifying basic functionality.
# 
#     """
#     @abc.abstractmethod
#     def randomise(self, value):
#         """Randomise `value` with the mechanism.
# 
#         Parameters
#         ----------
#         value : int or float or str or method
#             The value to be randomised.
# 
#         Returns
#         -------
#         int or float or str or method
#             The randomised value, same type as `value`.
# 
#         """
# 
#     def copy(self):
#         """Produces a copy of the class.
# 
#         Returns
#         -------
#         self : class
#             Returns the copy.
# 
#         """
#         return copy(self)


from diffprivlib.mechanisms.base import DPMachine
#
# Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
# documentation files (the "Software"), to deal in the Software without restriction, including without limitation the
# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit
# persons to whom the Software is furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all copies or substantial portions of the
# Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
"""
Core utilities for DP transformers.
"""


class DPTransformer(DPMachine):
    """
    Base class for DP transformers.  DP Transformers are simple wrappers for DP Mechanisms to allow mechanisms to be
    used with data types and structures outside their scope.

    A :class:`.DPTransformer` must be initiated with a :class:`.DPMachine` (either another :class:`.DPTransformer`, or a
    :class:`.DPMechanism`).  This allows many instances of :class:`.DPTransformer` to be chained together, but the chain
    must terminate with a :class:`.DPMechanism`.

    """
    def __init__(self, parent):

# Path: diffprivlib/mechanisms/base.py
# class DPMachine(abc.ABC):
#     """
#     Parent class for :class:`.DPMechanism` and :class:`.DPTransformer`, providing and specifying basic functionality.
# 
#     """
#     @abc.abstractmethod
#     def randomise(self, value):
#         """Randomise `value` with the mechanism.
# 
#         Parameters
#         ----------
#         value : int or float or str or method
#             The value to be randomised.
# 
#         Returns
#         -------
#         int or float or str or method
#             The randomised value, same type as `value`.
# 
#         """
# 
#     def copy(self):
#         """Produces a copy of the class.
# 
#         Returns
#         -------
#         self : class
#             Returns the copy.
# 
#         """
#         return copy(self)


# Path: diffprivlib/mechanisms/transforms/base.py
from diffprivlib.mechanisms.base import DPMachine

#
# Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
# documentation files (the "Software"), to deal in the Software without restriction, including without limitation the
# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit
# persons to whom the Software is furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all copies or substantial portions of the
# Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
"""
Core utilities for DP transformers.
"""


class DPTransformer(DPMachine):
    """
    Base class for DP transformers.  DP Transformers are simple wrappers for DP Mechanisms to allow mechanisms to be
    used with data types and structures outside their scope.

    A :class:`.DPTransformer` must be initiated with a :class:`.DPMachine` (either another :class:`.DPTransformer`, or a
    :class:`.DPMechanism`).  This allows many instances of :class:`.DPTransformer` to be chained together, but the chain
    must terminate with a :class:`.DPMechanism`.

    """
    def __init__(self, parent):

        if not isinstance(parent, DPMachine):