def extract_header(msg_or_header):
    if not msg_or_header:
        return {}
    try:
        # See if msg_or_header is the entire message.
        h = msg_or_header['header']
    except KeyError:
        try:
            # See if msg_or_header is just the header
            h = msg_or_header['msg_id']
        except KeyError:
            raise
        else:
            h = msg_or_header
    if not isinstance(h, dict):
        h = dict(h)
    return h
Return (sign, intpart, fraction, expo) or raise an exception:
dataset/ETHPy150Open jupyter/jupyter_client/jupyter_client/session.py/extract_header--crossover with--dataset/ETHPy150Open babble/babble/include/jython/Lib/fpformat.py/extract