def set_extra_fields(self, **kwargs):
        """
        Only updates the fields that are passed as kwargs, and leaves
        the rest untouched.
        """
        result = self.get_extra_fields()
        for k, v in kwargs.iteritems():
            if k not in self.get_available_extra_fields():
                raise Exception("Field %s is not an available extra field for %s"
                    % (k, self.__class__.__name__))
            result[k] = v

        self.extra_fields = result
dataset/ETHPy150Open dimagi/commcare-hq/corehq/apps/sms/models.py/SQLMobileBackend.set_extra_fields/original