<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def datetime2sidereal(time: datetime, lon_radians: float, usevallado: bool = True) -> float: """ Convert ``datetime`` to sidereal time from D. Vallado "Fundamentals of Astrodynamics and Applications" time : datetime.datetime time to convert lon_radians : float longitude (radians) usevallado : bool, optional use vallado instead of AstroPy (default is Vallado) Results ------- tsr : float Sidereal time """

    usevallado = usevallado or Time is None
    if usevallado:
        jd = juliandate(str2dt(time))
# %% Greenwich Sidereal time RADIANS
        gst = julian2sidereal(jd)
# %% Algorithm 15 p. 188 rotate GST to LOCAL SIDEREAL TIME
        tsr = gst + lon_radians
    else:
        tsr = Time(time).sidereal_time(kind='apparent',
                                       longitude=Longitude(lon_radians, unit=u.radian)).radian

    return tsr