How to fix TypeError: function() got an unexpected keyword argument 'arg' in Python | DevErrors