from typing import List


def bytes_to_bitarray(the_bytes: bytes, num_bits: int) -> List[int]:
    """Convert input bytes into an array of bits.

    Args:
        the_bytes: Bytes to be converted.
        num_bits: Number of bits to return.

    Returns:
        An array of bits.
    """
    return [(the_bytes[i >> 3] >> (i & 7)) & 1 for i in range(num_bits)]