def to_jd(dt: datetime, fmt: str = '<STR_LIT>') -> float:
a = math.floor((<NUM_LIT>-dt.month)/<NUM_LIT:12>)<EOL>y = dt.year + <NUM_LIT> - a<EOL>m = dt.month + <NUM_LIT:12>*a - <NUM_LIT:3><EOL>jdn = dt.day + math.floor((<NUM_LIT>*m + <NUM_LIT:2>)/<NUM_LIT:5>) + <NUM_LIT>*y + math.floor(y/<NUM_LIT:4>) - math.floor(y/<NUM_LIT:100>) + math.floor(y/<NUM_LIT>) - <NUM_LIT><EOL>jd = jdn + (dt.hour - <NUM_LIT:12>) / <NUM_LIT> + dt.minute / <NUM_LIT> + dt.second / <NUM_LIT> + dt.microsecond / <NUM_LIT><EOL>return __to_format(jd, fmt)<EOL>
Converts a given datetime object to Julian date.
Algorithm is copied from https://en.wikipedia.org/wiki/Julian_day
All variable names are consistent with the notation on the wiki page.

Parameters
----------
fmt
dt: datetime
    Datetime object to convert to MJD

Returns
-------
jd: float