def intersect_trust_region(x, s, Delta):
    a = np.dot(s, s)
    if a == 0:
        raise ValueError("`s` is zero.")

    b = np.dot(x, s)

    c = np.dot(x, x) - Delta**2
    if c > 0:
        raise ValueError("`x` is not within the trust region.")

    d = np.sqrt(b*b - a*c)  # Root from one fourth of the discriminant.

    # Computations below avoid loss of significance, see "Numerical Recipes".
    q = -(b + copysign(d, b))
    t1 = q / a
    t2 = c / q

    if t1 < t2:
        return t1, t2
    else:
        return t2, t1
should raise Http404 if user is banned and you don't have perms.
dataset/ETHPy150Open scipy/scipy/scipy/optimize/_lsq/common.py/intersect_trust_region--crossover with--dataset/ETHPy150Open ofa/connect/open_connect/accounts/tests/test_views.py/UserDetailViewTest.test_get_object_user_is_banned_no_permission_to_view_profile