def find_mosaicml_logger(
    loggers: list[LoggerDestination],
) -> Optional[MosaicMLLogger]:
    """Returns the first MosaicMLLogger from a list, and None otherwise."""
    return next(
        (logger for logger in loggers if isinstance(logger, MosaicMLLogger)),
        None,
    )
Returns the first MosaicMLLogger from a list, and None otherwise.
llmfoundry/utils/mosaicml_logger_utils.py