original_docstring: will give predicting details for lunar eclipses
docstring: will give predicting details for lunar eclipses
docstring_tokens: will give predicting details for lunar eclipses
code: def date_lunar_eclipse():
      import ephem
      from datetime import datetime, timedelta
      '''will give predicting details for lunar eclipses'''
      currenttime = datetime(2020,1,1,0,0,0)
      endtime=datetime(2100,12,31,23,59,59)
      moon=ephem.Moon()
      sun=ephem.Sun()
      observer=ephem.Observer()
      observer.elevation= -6371000
      observer.pressure = 0
      while currenttime <= endtime:
          observer.date=currenttime
          moon.compute(observer)
          sun.compute(observer)
          sep = abs((float(ephem.separation(moon, sun))
                     / 0.01745329252) - 180)
          if sep < 0.9:
              print(currenttime.strftime('%Y/%m/%d %H:%M:%S'), sep)
              currenttime += timedelta(days = 1)
          else:
              currenttime += timedelta(hours = 1)
code_tokens: def date_lunar_eclipse ( ) : import ephem from datetime import datetime , timedelta currenttime = datetime ( 2020 , 1 , 1 , 0 , 0 , 0 ) endtime = datetime ( 2100 , 12 , 31 , 23 , 59 , 59 ) moon = ephem . Moon ( ) sun = ephem . Sun ( ) observer = ephem . Observer ( ) observer . elevation = - 6371000 observer . pressure = 0 while currenttime <= endtime : observer . date = currenttime moon . compute ( observer ) sun . compute ( observer ) sep = abs ( ( float ( ephem . separation ( moon , sun ) ) / 0.01745329252 ) - 180 ) if sep < 0.9 : print ( currenttime . strftime ( '%Y/%m/%d %H:%M:%S' ) , sep ) currenttime += timedelta ( days = 1 ) else : currenttime += timedelta ( hours = 1 )
short_docstring: will give predicting details for lunar eclipses
short_docstring_tokens: will give predicting details for lunar eclipses
comment: '''will give predicting details for lunar eclipses'''