code: def _save_single_attr(self, entity, value=None, schema=None,
                            create_nulls=False, extra={}):
          
          # If schema is not many-to-one, the value is saved to the corresponding
          # Attr instance (which is created or updated).
  
          schema = schema or self
          lookups = dict(get_entity_lookups(entity), schema=schema, **extra)
          try:
              attr = self.attrs.get(**lookups)
          except self.attrs.model.DoesNotExist:
              attr = self.attrs.model(**lookups)
          if create_nulls or value != attr.value:
              attr.value = value
              for k,v in extra.items():
                  setattr(attr, k, v)
              attr.save()
docs: Creates or updates an EAV attribute for given entity with given value.
  
          :param schema: schema for attribute. Default it current schema instance.
          :param create_nulls: boolean: if True, even attributes with value=None
              are created (by default they are skipped).
          :param extra: dict: additional data for Attr instance (e.g. title).