def byte_tuple_to_int(in_tuple: tuple) -> int:
    """
    Converts two element byte tuple (highest first) to integer.
    :param in_tuple: the integer to convert
    :return: the integer value
    """
    if ((len(in_tuple) != 2) or not all(isinstance(x, int) for x in in_tuple) or not all(0 <= x <= 255 for x in in_tuple)):
        raise ValueError(f'in_tuple must be a two byte tuple! value was {in_tuple}')
    return int((in_tuple[0] << 8) + in_tuple[1])