def ArtifactsFromYaml(self, yaml_content):
    """Get a list of Artifacts from yaml."""
    try:
      raw_list = list(yaml.safe_load_all(yaml_content))
    except (ValueError, yaml.YAMLError) as e:
      raise ArtifactDefinitionError(
          e % "Invalid YAML for artifact: %s")

    # Try to do the right thing with json/yaml formatted as a list.
    if (isinstance(raw_list, list) and len(raw_list) == 1 and
        isinstance(raw_list[0], list)):
      raw_list = raw_list[0]

    # Convert json into artifact and validate.
    valid_artifacts = []
    for artifact_dict in raw_list:
      # In this case we are feeding parameters directly from potentially
      # untrusted yaml/json to our RDFValue class. However, safe_load ensures
      # these are all primitive types as long as there is no other
      # deserialization involved, and we are passing these into protobuf
      # primitive types.
      try:
        artifact_value = Artifact(**artifact_dict)
        valid_artifacts.append(artifact_value)
      except (TypeError, AttributeError, type_info.TypeValueError) as e:
        raise ArtifactDefinitionError(
            "Invalid artifact definition for %s: %s" %
            (artifact_dict.get("name"), e))

    return valid_artifacts
dataset/ETHPy150Open google/grr/grr/lib/artifact_registry.py/ArtifactRegistry.ArtifactsFromYaml/swapped operands of `%`