def get_yaml_version(fd, token):
    """
    A YAML token is found, so see if the YAML version can be parsed.

    Parameters
    ----------
    fd : GenericFile
    token : bytes
        The YAML token

    Return
    ------
    yaml_version: tuple
    """
    offset = fd.tell()
    while True:
        c = fd.read(1)
        token += c
        if b"\n" == c:
            break
    fd.seek(offset)

    # Expects a string looking like '%YAML X.X'
    yaml_version = None
    line = token.decode("utf-8").strip()
    sl = line.split(" ")
    if len(sl) == 2:
        yaml_version = tuple([int(x) for x in sl[1].split(".")])

    return yaml_version