def get_version(data):
    """
    Parse version from changelog written in RST format.
    """
    def all_same(s):
        return not any(filter(lambda x: x != s[0], s))

    def has_digit(s):
        return any(char.isdigit() for char in s)

    data = data.splitlines()
    return next((
        v
        for v, u in zip(data, data[1:])  # v = version, u = underline
        if len(v) == len(u) and all_same(u) and has_digit(v) and "." in v
    ))