def METHOD_NAME(s: BinaryIO, tag: Tag, isConstruct: bool) -> int:
    """
    Unpack contextual tag and return the tag length.
    :param s: stream
    :param tag: BER tag
    :param isConstruct: True if a construct is expected
    """
    byte = Uint8.unpack(s.read(1))
    if byte != ((Class.BER_CLASS_CTXT | berPC(isConstruct)) | (Tag.BER_TAG_MASK & tag)):
        raise ValueError("Unexpected contextual tag")
    return readLength(s)