'Extracts a handler and handler\'s arguments that can be provided
as list or dictionary. If arguments are provided as list, they are
considered to have this sequence: (handler, memoize, timeout)
Examples:
event += handler
event += (handler, True, 1.5)
event += {\'handler\':handler, \'memoize\':True, \'timeout\':1.5}'

def _extract(self, queue_item):

    assert queue_item, 'Invalid    list    of    arguments'
    handler = None
    memoize = False
    timeout = 0
    if (not isinstance(queue_item, (list, tuple, dict))):
        handler = queue_item
    elif isinstance(queue_item, (list, tuple)):
        if (len(queue_item) == 3):
            (handler, memoize, timeout) = queue_item
        elif (len(queue_item) == 2):
            (handler, memoize) = queue_item
        elif (len(queue_item) == 1):
            handler = queue_item
    elif isinstance(queue_item, dict):
        handler = queue_item.get('handler')
        memoize = queue_item.get('memoize', False)
        timeout = queue_item.get('timeout', 0)
    return (handler, bool(memoize), float(timeout))
