code: def ReadFileObject(self, file_object):
      
      # TODO: add try, except?
      yaml_generator = yaml.safe_load_all(file_object)
  
      last_artifact_definition = None
      for yaml_definition in yaml_generator:
        try:
          artifact_definition = self.ReadArtifactDefinitionValues(yaml_definition)
        except errors.FormatError as exception:
          error_location = 'At start'
          if last_artifact_definition:
            error_location = 'After: {0:s}'.format(last_artifact_definition.name)
  
          raise errors.FormatError(
              '{0:s} {1!s}'.format(error_location, exception))
  
        yield artifact_definition
        last_artifact_definition = artifact_definition
docs: Reads artifact definitions from a file-like object.
  
      Args:
        file_object (file): file-like object to read from.
  
      Yields:
        ArtifactDefinition: an artifact definition.
  
      Raises:
        FormatError: if the format of the YAML artifact definition is not set
            or incorrect.