A decorator used for register custom check.

    :param name: name of check
    :type: str
    :param _callable: check class or a function which return check instance
    :return: _callable or a decorator

def register(name, _callable=None):
    """A decorator used for register custom check.

    :param name: name of check
    :type: str
    :param _callable: check class or a function which return check instance
    :return: _callable or a decorator
    """
    def wrapper(_callable):
        registered_checks[name] = _callable
        return _callable

    # If function or class is given, do the registeration
    if _callable:
        return wrapper(_callable)

    return wrapper