code: def sunrise_sunset(ephemeris, topos):
  
      
      sun = ephemeris['sun']
      topos_at = (ephemeris['earth'] + topos).at
  
      def is_sun_up_at(t):
          """Return `True` if the sun has risen by time `t`."""
          t._nutation_angles = iau2000b(t.tt)
          return topos_at(t).observe(sun).apparent().altaz()[0].degrees > -0.8333
  
      is_sun_up_at.rough_period = 0.5  # twice a day
      return is_sun_up_at
docs: Build a function of time that returns whether the sun is up.
  
      The function that this returns will expect a single argument that is
      a :class:`~skyfield.timelib.Time` and will return ``True`` if the
      sun is up, else ``False``.