def ms_from_timedelta(td):
    """
    Given a timedelta object, returns a float representing milliseconds
    """
    return (td.seconds * 1000) + (td.microseconds / 1000.0)
dataset/ETHPy150Open dimagi/commcare-hq/corehq/ex-submodules/pillowtop/listener.py/ms_from_timedelta/original