code: def set_type(self, value):
          
          if value not in self.types_available:
              log = "Sources field 'type' should be in one of %s" % (
                  self.types_available
              )
              raise MalFormattedSource(log)
          self._type = value
docs: Setter for type attribute