code: def _ReadSources(self, artifact_definition_values, artifact_definition, name):
      
      sources = artifact_definition_values.get('sources')
      if not sources:
        raise errors.FormatError(
            'Invalid artifact definition: {0:s} missing sources.'.format(name))
  
      for source in sources:
        type_indicator = source.get('type', None)
        if not type_indicator:
          raise errors.FormatError(
              'Invalid artifact definition: {0:s} source type.'.format(name))
  
        attributes = source.get('attributes', None)
  
        try:
          source_type = artifact_definition.AppendSource(
              type_indicator, attributes)
        except errors.FormatError as exception:
          raise errors.FormatError(
              'Invalid artifact definition: {0:s}, with error: {1!s}'.format(
                  name, exception))
  
        # TODO: deprecate these left overs from the collector definition.
        if source_type:
          if source.get('returned_types', None):
            raise errors.FormatError((
                'Invalid artifact definition: {0:s} returned_types no longer '
                'supported.').format(name))
  
          source_type.conditions = source.get('conditions', [])
          self._ReadSupportedOS(source, source_type, name)
          if set(source_type.supported_os) - set(
              artifact_definition.supported_os):
            raise errors.FormatError((
                'Invalid artifact definition: {0:s} missing '
                'supported_os.').format(name))
docs: Reads the artifact definition sources.
  
      Args:
        artifact_definition_values (dict[str, object]): artifact definition
            values.
        artifact_definition (ArtifactDefinition): an artifact definition.
        name (str): name of the artifact definition.
  
      Raises:
        FormatError: if the type indicator is not set or unsupported,
            or if required attributes are missing.