def METHOD_NAME(ts, lat, lon) -> bool:
    if isinstance(ts, str):
        d = parse(ts)
    else:
        d = ts
    try:
        obs = ephem.Observer()
        obs.lat = float(lat)
        obs.lon = float(lon)
        obs.date = d.date()
    except Exception:
        return False
    rising_ts = obs.next_rising(ephem.Sun()).datetime()
    next_setting_ts = obs.next_setting(ephem.Sun()).datetime()
    if d >= rising_ts and d < next_setting_ts:
        return True
    else:
        return False