def METHOD_NAME(generator, x: int, is_even: bool) -> Tuple[int, Any]:
    curve = generator.curve()
    p = curve.p()
    alpha = (pow(x, 3, p) + curve.a() * x + curve.b()) % p
    beta = ecdsa.numbertheory.square_root_mod_prime(alpha, p)
    if is_even == bool(beta & 1):
        return (x, p - beta)
    return (x, beta)