from typing import Sequence


def format_hex(in_bytes: bytes) -> Sequence[str]:
    """
    format an input sequence of bytes into a ordered form with lines of
    8 hex-formatted bytes prefixed by the address of the first byte in the line.

    :param in_bytes: the bytes to format
    :return: a list of formatted lines

    Example:
    >>> print('\n'.join(eepro.format_hex(b'0123456789ABCDEF')))

    0x0000:    30 31 32 33  34 35 36 37
    0x0008:    38 39 41 42  43 44 45 46

    """
    chunk_size = 8
    byte = "{:02X} "
    address = "0x{:04X}:    "
    formatted_str = ""

    for i, in_byte in enumerate(in_bytes):
        if i % (chunk_size) == 0:
            formatted_str += "\n" + address.format(i)
        elif i % (chunk_size // 2) == 0:
            formatted_str += " "
        formatted_str += byte.format(in_byte)

    return formatted_str.split("\n")