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._ReadArtifactDefinition(yaml_definition)
      except errors.FormatError as exception:
        error_location = u'At start'
        if last_artifact_definition:
          error_location = u'After: {0}'.format(last_artifact_definition.name)

        raise errors.FormatError(u'{0} {1}'.format(error_location, exception))

      yield artifact_definition
      last_artifact_definition = artifact_definition
Reads artifact definitions from a file-like object.
dataset/ETHPy150Open ForensicArtifacts/artifacts/artifacts/reader.py/YamlArtifactsReader.ReadFileObject