def add_handler_once(logger, handler):
    """A helper to add a handler to a logger, ensuring there are no duplicates.

    Args:
        * logger: logging.logger instance
        * handler: logging.Handler instance to be added. It will not be
            added if an instance of that Handler subclass already exists.

    Returns:
        bool: True if the logging handler was added

    Raises:
        None
    """
    class_name = handler.__class__.__name__
    for myHandler in logger.handlers:
        if myHandler.__class__.__name__ == class_name:
            return False

    logger.addHandler(handler)
    return True