def METHOD_NAME(p):
    r"""
    Return the smallest positive integer quadratic non-residue in `\ZZ/p\ZZ` for primes `p>2`.
    EXAMPLES::
        sage: least_quadratic_nonresidue(5)
        2
        sage: [least_quadratic_nonresidue(p) for p in prime_range(3, 100)]              # needs sage.libs.pari
        [2, 2, 3, 2, 2, 3, 2, 5, 2, 3, 2, 3, 2, 5, 2, 2, 2, 2, 7, 5, 3, 2, 3, 5]
    TESTS:
    This raises an error if input is a positive composite integer. ::
        sage: least_quadratic_nonresidue(20)
        Traceback (most recent call last):
        ...
        ValueError: p must be a prime number > 2
    This raises an error if input is 2. This is because every integer is a
    quadratic residue modulo 2. ::
        sage: least_quadratic_nonresidue(2)
        Traceback (most recent call last):
        ...
        ValueError: there are no quadratic non-residues in Z/2Z
    """
    p1 = abs(p)
    # Deal with the prime p = 2 and |p| <= 1.
    if p1 == 2:
        raise ValueError("there are no quadratic non-residues in Z/2Z")
    if p1 < 2:
        raise ValueError("p must be a prime number > 2")
    # Find the smallest non-residue mod p
    # For 7/8 of primes the answer is 2, 3 or 5:
    if p % 8 in (3, 5):
        return ZZ(2)
    if p % 12 in (5, 7):
        return ZZ(3)
    if p % 5 in (2, 3):
        return ZZ(5)
    # default case (first needed for p=71):
    if not p.is_prime():
        raise ValueError("p must be a prime number > 2")
    from sage.arith.srange import xsrange
    for r in xsrange(7, p):
        if legendre_symbol(r, p) == -1:
            return ZZ(r)