def _nis (atleast=False, atmost=False, exactly=False):
    """
    Returns a `callable` which returns `True` if ``n`` is ``>=``
    `atleast`, ``<=`` `atmost`, or ``==`` `exactly`. See
    :func:`_nargs`, :func:`_nkw`, etc., for example use.

    The signature of the returned `callable` is:

    .. function:: fn (n:number) -> bool

    `atleast` and `atmost` may be combined, but `exactly` must stand
    alone.
    """
    if (atleast < 0) or (atmost < 0) or (exactly < 0):
        raise ValueError("arg limits cannot be negative")

    if not exactly is False:
        if not ((atleast is False) and (atmost is False)):
            raise ValueError(
                "cannot mix 'exactly' and 'atleast' or 'atmost'")
        def _nis_exactly (n):
            return n == exactly
        return _nis_exactly

    if atleast is False and atmost is False:
        raise ValueError(
            "must specify 'exactly' or one or both of 'atleast' and 'atmost'")

    if atleast is False:
        atleast = 0

    if atmost is False:
        atmost = float('inf')

    def _nis_between (n):
        return (atleast <= n <= atmost)
    return _nis_between