def _deepcopy(self, data):
        """
        Deep copies the given object

        :param data: Data to copy
        :return: A copy of the data, if supported, else the data itself
        """
        if isinstance(data, dict):
            # Copy dictionary values
            return {key: self._deepcopy(value) for key, value in data.items()}
        elif isinstance(data, (list, tuple, set, frozenset)):
            # Copy sequence types values
            return type(data)(self._deepcopy(value) for value in data)

        try:
            # Try to use a copy() method, if any
            return data.copy()
        except AttributeError:
            # Can't copy the data, return it as is
            return data
Deep copies the given object

        :param data: Data to copy
        :return: A copy of the data, if supported, else the data itself