def __setitem__(self, key, value):
        """Assign the value for a field.
        """
        # Choose where to place the value.
        if key in self._fields:
            source = self._values_fixed
        else:
            source = self._values_flex

        # If the field has a type, filter the value.
        value = self._type(key).normalize(value)

        # Assign value and possibly mark as dirty.
        old_value = source.get(key)
        source[key] = value
        if self._always_dirty or old_value != value:
            self._dirty.add(key)
dataset/ETHPy150Open beetbox/beets/beets/dbcore/db.py/Model.__setitem__/original