@classmethod
def copy(cls, arr):
    """Creates a new SharedNDArray that is a copy of the given ndarray.

        Args:
            arr: The ndarray to copy.

        Returns:
            A new SharedNDArray object with the given ndarray's shape and data type and a copy of
            its data.

        Raises:
            SharedNDArrayError: if an error occurs.
        """
    new_shm = cls.zeros_like(arr)
    new_shm.array[:] = arr
    return new_shm
