def parse_warning_code(warning_code, quiet=False, return_dict=False):
    """Parses warning code from `check_all_diagnostics()` into
    individual failures and prints results.

    Parameters
    ----------
    warning_code : int
        When converted to binary, each digit in the code stands for
        whether or not a test passed. A digit of zero indicates the test
        passed. The ordering of the tests goes:
            ESS
            r_hat
            divergences
            tree depth
            E-BFMI
        For example, a warning code of 12 has a binary representation
        of 01100, which means that R-hat and divergences tests failed.
    quiet : bool, default False
        If True, suppress print results to the screen.
    return_dict : bool, default False
        If True, return a dictionary of containing test passage info.

    Returns
    -------
    output : dict
        If `return_dict` is True, returns a dictionary where each entry
        is True is the respective diagnostic check was passed and False
        if it was not.
    """
    if quiet and not return_dict:
        raise RuntimeError('`quiet` is True and `return_dict` is False, ' +
            'so there is nothing to do.')
    passed_tests = dict(neff=True, rhat=True, divergence=True, treedepth=
        True, energy=True)
    if warning_code & 1 << 0:
        passed_tests['neff'] = False
        if not quiet:
            print('ESS warning')
    if warning_code & 1 << 1:
        passed_tests['rhat'] = False
        if not quiet:
            print('Rhat warning')
    if warning_code & 1 << 2:
        passed_tests['divergence'] = False
        if not quiet:
            print('divergence warning')
    if warning_code & 1 << 3:
        passed_tests['treedepth'] = False
        if not quiet:
            print('treedepth warning')
    if warning_code & 1 << 4:
        passed_tests['energy'] = False
        if not quiet:
            print('energy warning')
    if warning_code == 0:
        if not quiet:
            print('No diagnostic warnings')
    if return_dict:
        return passed_tests
