code: def assert_angle(name, q):
      
      if isinstance(q, u.Quantity):
          if q.unit.physical_type == 'angle':
              pass
          else:
              raise ValueError("{0} should have angular units".format(name))
      else:
          raise TypeError("{0} should be a Quantity instance".format(name))
docs: Check that ``q`` is an angular `~astropy.units.Quantity`.