def check_complexity(check_bytes: bytes, complexity: int) -> bool:
    """Check the complexity of a bystream to see if it has the proper amount of leading 0 bits
    Args:
        bytes: byte stream to check for complexity bits
        complexity: number of leading bits that must be 0 in order to pass complexity
    Returns:
        Boolean true if passing complexity and false if not
    """
    # First check full bytes
    num_bytes = complexity // 8
    for i in range(num_bytes):
        if check_bytes[i] != 0:
            return False
    complex_remainder = complexity % 8
    # If complexity is a factor of 8 (full byte) no remaining bit checking is needed
    if complex_remainder == 0:
        return True
    return check_bytes[num_bytes] < 2 ** (8 - (complex_remainder))