`caller = kwargs.pop('caller')` ?  I think there must be some errors in lines 140, 141?  Or should there at least be a check that `caller` is defined?