def assignIfExists(opts, default=None, **kwargs):
for opt in opts:<EOL><INDENT>if(opt in kwargs):<EOL><INDENT>return kwargs[opt]<EOL><DEDENT><DEDENT>return default<EOL>
Helper for assigning object attributes from API responses.