'Check if all angle(s) satisfy ``lower <= angle < upper``
If ``lower`` is not specified (or `None`) then no lower bounds check is
performed.  Likewise ``upper`` can be left unspecified.  For example::
>>> from astropy.coordinates import Angle
>>> import astropy.units as u
>>> a = Angle([-20, 150, 350] * u.deg)
>>> a.is_within_bounds(\'0d\', \'360d\')
False
>>> a.is_within_bounds(None, \'360d\')
True
>>> a.is_within_bounds(-30 * u.deg, None)
True
Parameters
lower : str, `Angle`, angular `~astropy.units.Quantity`, `None`
Specifies lower bound for checking.  This can be any object
that can initialize an `Angle` object, e.g. ``\'180d\'``,
``180 * u.deg``, or ``Angle(180, unit=u.deg)``.
upper : str, `Angle`, angular `~astropy.units.Quantity`, `None`
Specifies upper bound for checking.  This can be any object
that can initialize an `Angle` object, e.g. ``\'180d\'``,
``180 * u.deg``, or ``Angle(180, unit=u.deg)``.
Returns
is_within_bounds : bool
`True` if all angles satisfy ``lower <= angle < upper``'

def is_within_bounds(self, lower=None, upper=None):

    ok = True
    if (lower is not None):
        ok &= np.all((Angle(lower) <= self))
    if (ok and (upper is not None)):
        ok &= np.all((self < Angle(upper)))
    return bool(ok)
