python dict to kwargs code example
Example 1: python dict to kwargs
func(**{'type':'Event'})
# ^ is equivalent to v
func(type='Event')
Example 2: python *args to dict
def func(arg1, arg2, arg3=3, arg4=4):
print(locals())
func(1, 2)
# {'arg3': 3, 'arg4': 4, 'arg1': 1, 'arg2': 2}