def update(self, *args, **kwargs):
        """Updates kwargs onto attributes of self"""
        for k, v in six.iteritems(kwargs):
            if k in self._fields:
                setattr(self, k, v)
            elif k in self._has:  # has an object
                klass = str_to_class(self._handle_pluralize(k))
                if isinstance(v, klass):
                    setattr(self, k, v)
                elif isinstance(v, dict):
                    setattr(self, k, klass(allow_new_fields=self.allow_new_fields, **v))
            elif k in self._contains:  # contains many objects
                klass = str_to_class(self._handle_pluralize(k))
                for _v in v:
                    if isinstance(_v, klass):
                        getattr(self, k).append(_v)
                    elif isinstance(_v, dict):
                        getattr(self, k).append(klass(allow_new_fields=self.allow_new_fields,**_v))
            else:
                self._invalid_field(k)
        self.clean()
dataset/ETHPy150Open activefrequency/pyavatax/pyavatax/base.py/AvalaraBase.update/original