def filter_kwargs(keys, kwargs):
for k in keys:<EOL><INDENT>if k in kwargs:<EOL><INDENT>yield (k, kwargs[k])<EOL><DEDENT><DEDENT>
:param keys: A iterable key names to select items
:param kwargs: A dict or dict-like object reprensents keyword args

>>> list(filter_kwargs(("a", "b"), dict(a=1, b=2, c=3, d=4)))
[('a', 1), ('b', 2)]