def register_distribution(name, ndim=None):
    """
    Class decorator with arguments to register a class for use in distribution_factory
    One must specify the name of the distribution to register under and the number of
    dimensions the input argument must be (if there is a requirement).

    This will add the attributes is_registered_distribution, registered_name, and registered_ndim to the class

    Names will be case insensitive.

    Examples:
        To register a function, simply use this as a decorator before any class to be registered

        @register(name='clayton', ndim=2)
        class ClaytonCopula(CopulaBase):
            ...

    Args:
        name (str): The name the distribution will be registered under
        ndim (:obj: `int`, optional): The required dimensionality of input. Defaults to None signaling no requirement

    Returns:
        A class decorator to register a class as a distribution
    """

    def class_decorator(cls):
        cls.is_registered_distribution = True
        cls.registered_name = name.lower()
        cls.registered_ndim = ndim
        return cls

    return class_decorator