def print_bytes(array: bytearray) -> str:
    """Outputs byte array and formats for pretty print.

    16 bytes are printed per line with additional space between 8 byte groups
    so that they are easier to distinguish.
    Example:
    AA 10 01 1B   00 02 03 14
    00 02 00 00   1F 23 10 0C
    00 00 00 14   03 1B 09 14
    2E CC 01

    Parameters
    ----------
    array : byte array
        The byte array to be pretty printed.

    Returns
    -------
    str
        A pretty string representation of the byte array.
    """
    strings = ["{:02X}".format(byte) for byte in array]
    output = ""
    for index, byte_string in enumerate(strings):
        if index % 8 == 0 and index != 0:
            output += "\n"
        elif index % 8 == 4:
            output += "  "
        output += byte_string + " "
    return output