def make_keyword_extractor(method):
    """
    Removes all keyword parameters required by 'method' from
    dictionary 'keys' and returns them in a separate dictionary.
    """

    args, _1, _2, defs = inspect.getargspec(method)
    key_args = args[-len(defs or []):]
    def extractor(keys):
        new = {}
        for a in key_args:
            if a in keys:
                new[a] = keys[a]
                del keys[a]
        return new
    return extractor
def make_keyword_extractor ( method ) : args , _1 , _2 , defs = inspect . getargspec ( method ) key_args = args [ - len ( defs or [ ] ) : ] def extractor ( keys ) : new = { } for a in key_args : if a in keys : new [ a ] = keys [ a ] del keys [ a ] return new return extractor
Removes all keyword parameters required by 'method' from
    dictionary 'keys' and returns them in a separate dictionary.