docs: def ingredient_from_validated_dict(ingr_dict, selectable):
      """ Create an ingredient from an dictionary.
  
      This object will be deserialized from yaml """
  
      validator = IngredientValidator(schema=ingr_dict['kind'])
      if not validator.validate(ingr_dict):
          raise Exception(validator.errors)
      ingr_dict = validator.document
  
      kind = ingr_dict.pop('kind', 'Metric')
      IngredientClass = ingredient_class_for_name(kind)
  
      if IngredientClass is None:
          raise BadIngredient('Unknown ingredient kind')
  
      args = []
      for fld in ingr_dict.pop('_fields', []):
          args.append(parse_validated_field(ingr_dict.pop(fld), selectable))
  
      return IngredientClass(*args, **ingr_dict)