# Path: thejoker/logging.py
# class JokerHandler(StreamHandler):
# class JokerLogger(logging.getLoggerClass()):
#     def emit(self, record):
#     def _set_defaults(self):
# 
# Path: thejoker/data_helpers.py
# def guess_time_format(time_val):
#     """Guess the `astropy.time.Time` format from the input value(s).
# 
#     Parameters
#     ----------
#     time_val : float, array_like
#         The value or values to guess the format from.
# 
#     Returns
#     -------
#     format : str
#         The `astropy.time.Time` format string, guessed from the value.
# 
#     """
#     arr = np.array(time_val)
# 
#     # Only support float or int times
#     if arr.dtype.char not in ['f', 'd', 'i', 'l']:
#         raise NotImplementedError("We can only try to guess "
#                                   "the time format with a numeric "
#                                   "time value. Sorry about that!")
# 
#     # HACK: magic number!
#     dt_thresh = 50*u.year
# 
#     jd_check = np.abs(arr - Time('2010-01-01').jd) * u.day < dt_thresh
#     jd_check = np.all(jd_check)
# 
#     mjd_check = np.abs(arr - Time('2010-01-01').mjd) * u.day < dt_thresh
#     mjd_check = np.all(mjd_check)
# 
#     err_msg = ("Unable to guess time format! Initialize with an "
#                "explicit astropy.time.Time() object instead.")
#     if jd_check and mjd_check:
#         raise ValueError(err_msg)
# 
#     elif jd_check:
#         return 'jd'
# 
#     elif mjd_check:
#         return 'mjd'
# 
#     else:
#         raise ValueError(err_msg)
# 
# Path: thejoker/exceptions.py
# class TheJokerDeprecationWarning(Warning):
#     """Because standard deprecation warnings are ignored!"""
#     pass


import warnings
import astropy.units as u
import numpy as np
            import matplotlib.pyplot as plt
from astropy.table import Table
from astropy.time import Time
from astropy.utils.decorators import deprecated_renamed_argument
from .logging import logger
from .data_helpers import guess_time_format
from .exceptions import TheJokerDeprecationWarning
                from fuzzywuzzy import process
        from astropy.timeseries import TimeSeries
        from astropy.timeseries import TimeSeries

        # First check for any of the valid astropy Time format names:
        # FUTURETODO: right now we only support jd and mjd (and b-preceding)
        for fmt in ['jd', 'mjd']:
            if fmt in lwr_cols:
                time_kwargs['format'] = time_kwargs.get('format', fmt)
                time_data = tbl[lwr_to_col[fmt]]
                break

            elif f'b{fmt}' in lwr_cols:
                time_kwargs['format'] = time_kwargs.get('format', fmt)
                time_kwargs['scale'] = time_kwargs.get('scale', 'tcb')
                time_data = tbl[lwr_to_col[f'b{fmt}']]
                _scale_specified = True
                break

        time_info_msg = ("Assuming time scale is '{}' because it was not "
                         "specified. To change this, pass in: "
                         "time_kwargs=dict(scale='...') with whatever time "
                         "scale your data are in.")
        _fmt_specified = 'format' in time_kwargs
        _scale_specified = 'scale' in time_kwargs

        # check colnames for "t" or "time"
        for name in ['t', 'time']:
            if name in lwr_cols:
                time_data = tbl[lwr_to_col[name]]
                time_kwargs['format'] = time_kwargs.get(
                    'format', guess_time_format(tbl[lwr_to_col[name]]))
                if not _fmt_specified:

# Path: thejoker/logging.py
# class JokerHandler(StreamHandler):
# class JokerLogger(logging.getLoggerClass()):
#     def emit(self, record):
#     def _set_defaults(self):
# 
# Path: thejoker/data_helpers.py
# def guess_time_format(time_val):
#     """Guess the `astropy.time.Time` format from the input value(s).
# 
#     Parameters
#     ----------
#     time_val : float, array_like
#         The value or values to guess the format from.
# 
#     Returns
#     -------
#     format : str
#         The `astropy.time.Time` format string, guessed from the value.
# 
#     """
#     arr = np.array(time_val)
# 
#     # Only support float or int times
#     if arr.dtype.char not in ['f', 'd', 'i', 'l']:
#         raise NotImplementedError("We can only try to guess "
#                                   "the time format with a numeric "
#                                   "time value. Sorry about that!")
# 
#     # HACK: magic number!
#     dt_thresh = 50*u.year
# 
#     jd_check = np.abs(arr - Time('2010-01-01').jd) * u.day < dt_thresh
#     jd_check = np.all(jd_check)
# 
#     mjd_check = np.abs(arr - Time('2010-01-01').mjd) * u.day < dt_thresh
#     mjd_check = np.all(mjd_check)
# 
#     err_msg = ("Unable to guess time format! Initialize with an "
#                "explicit astropy.time.Time() object instead.")
#     if jd_check and mjd_check:
#         raise ValueError(err_msg)
# 
#     elif jd_check:
#         return 'jd'
# 
#     elif mjd_check:
#         return 'mjd'
# 
#     else:
#         raise ValueError(err_msg)
# 
# Path: thejoker/exceptions.py
# class TheJokerDeprecationWarning(Warning):
#     """Because standard deprecation warnings are ignored!"""
#     pass


# Path: thejoker/data.py
import warnings
import astropy.units as u
import numpy as np
            import matplotlib.pyplot as plt
from astropy.table import Table
from astropy.time import Time
from astropy.utils.decorators import deprecated_renamed_argument
from .logging import logger
from .data_helpers import guess_time_format
from .exceptions import TheJokerDeprecationWarning
                from fuzzywuzzy import process
        from astropy.timeseries import TimeSeries
        from astropy.timeseries import TimeSeries


        # First check for any of the valid astropy Time format names:
        # FUTURETODO: right now we only support jd and mjd (and b-preceding)
        for fmt in ['jd', 'mjd']:
            if fmt in lwr_cols:
                time_kwargs['format'] = time_kwargs.get('format', fmt)
                time_data = tbl[lwr_to_col[fmt]]
                break

            elif f'b{fmt}' in lwr_cols:
                time_kwargs['format'] = time_kwargs.get('format', fmt)
                time_kwargs['scale'] = time_kwargs.get('scale', 'tcb')
                time_data = tbl[lwr_to_col[f'b{fmt}']]
                _scale_specified = True
                break

        time_info_msg = ("Assuming time scale is '{}' because it was not "
                         "specified. To change this, pass in: "
                         "time_kwargs=dict(scale='...') with whatever time "
                         "scale your data are in.")
        _fmt_specified = 'format' in time_kwargs
        _scale_specified = 'scale' in time_kwargs

        # check colnames for "t" or "time"
        for name in ['t', 'time']:
            if name in lwr_cols:
                time_data = tbl[lwr_to_col[name]]
                time_kwargs['format'] = time_kwargs.get(
                    'format', guess_time_format(tbl[lwr_to_col[name]]))
                if not _fmt_specified:

                    logger.info("Guessed time format: '{}'. If this is "