def g(**kwargs):
    a = kwargs.pop('a', None)
b = kwargs.pop('b', None)
print((a, b))

def f(**kwargs):
    a = kwargs.pop('a', None)
print(a)
g(**kwargs)
kwargs = {'a': 1, 'b': 2}
f(**kwargs)
Pass kwargs with invalid key=value pairs to function