# Path: brew/exceptions.py
# class ColorException(BrewdayException):
#     pass
# 
# Path: brew/exceptions.py
# class StyleException(BrewdayException):
#     pass
# 
# Path: brew/validators.py
# def validate_required_fields(data, required_fields):
#     """
#     Validate fields which are required as part of the data.
# 
#     :param dict data: A python dictionary to check for required fields
#     :param list(tuple) required_fields: Values and types to check for in data
#     :raises ValidatorException: Required field is missing from data
#     :raises ValidatorException: Required field is of the wrong type
# 
#     The format is a list of tuples where the first element is a string with
#     a value that should be a key found in the data dict and
#     where the second element is a python type or list/tuple of
#     python types to check the field against.
#     """
#     for field, field_type in required_fields:
#         if field not in data:
#             raise ValidatorException(
#                 u"Required field '{}' missing from data".format(field)  # noqa
#             )
#         if field_type == str:
#             try:
#                 field_type = unicode
#             except NameError:
#                 field_type = str
#         if not isinstance(data[field], field_type):
#             raise ValidatorException(
#                 u"Required field '{}' is not of type '{}'".format(  # noqa
#                     field, field_type
#                 )
#             )


import json
import sys
import textwrap
from .exceptions import ColorException
from .exceptions import StyleException
from .validators import validate_required_fields

        :param Recipe recipe: A Recipe object
        :return: True if recipe matches style, otherwise False
        :rtype: bool
        """
        if (
            self.og_matches(recipe.og)
            and self.fg_matches(recipe.fg)
            and self.abv_matches(recipe.abv)
            and self.ibu_matches(recipe.ibu)
            and self.color_matches(recipe.color)
        ):
            return True
        return False

    def recipe_errors(self, recipe):
        """
        Return list errors if the recipe doesn't match the style

        :param Recipe recipe: A Recipe object
        :return: Errors
        :rtype: list
        """
        errors = []
        errors.extend(self.og_errors(recipe.og))
        errors.extend(self.fg_errors(recipe.fg))
        errors.extend(self.abv_errors(recipe.abv))
        errors.extend(self.ibu_errors(recipe.ibu))
        try:
            errors.extend(self.color_errors(recipe.color))

# Path: brew/exceptions.py
# class ColorException(BrewdayException):
#     pass
# 
# Path: brew/exceptions.py
# class StyleException(BrewdayException):
#     pass
# 
# Path: brew/validators.py
# def validate_required_fields(data, required_fields):
#     """
#     Validate fields which are required as part of the data.
# 
#     :param dict data: A python dictionary to check for required fields
#     :param list(tuple) required_fields: Values and types to check for in data
#     :raises ValidatorException: Required field is missing from data
#     :raises ValidatorException: Required field is of the wrong type
# 
#     The format is a list of tuples where the first element is a string with
#     a value that should be a key found in the data dict and
#     where the second element is a python type or list/tuple of
#     python types to check the field against.
#     """
#     for field, field_type in required_fields:
#         if field not in data:
#             raise ValidatorException(
#                 u"Required field '{}' missing from data".format(field)  # noqa
#             )
#         if field_type == str:
#             try:
#                 field_type = unicode
#             except NameError:
#                 field_type = str
#         if not isinstance(data[field], field_type):
#             raise ValidatorException(
#                 u"Required field '{}' is not of type '{}'".format(  # noqa
#                     field, field_type
#                 )
#             )


# Path: brew/styles.py
import json
import sys
import textwrap
from .exceptions import ColorException
from .exceptions import StyleException
from .validators import validate_required_fields


        :param Recipe recipe: A Recipe object
        :return: True if recipe matches style, otherwise False
        :rtype: bool
        """
        if (
            self.og_matches(recipe.og)
            and self.fg_matches(recipe.fg)
            and self.abv_matches(recipe.abv)
            and self.ibu_matches(recipe.ibu)
            and self.color_matches(recipe.color)
        ):
            return True
        return False

    def recipe_errors(self, recipe):
        """
        Return list errors if the recipe doesn't match the style

        :param Recipe recipe: A Recipe object
        :return: Errors
        :rtype: list
        """
        errors = []
        errors.extend(self.og_errors(recipe.og))
        errors.extend(self.fg_errors(recipe.fg))
        errors.extend(self.abv_errors(recipe.abv))
        errors.extend(self.ibu_errors(recipe.ibu))
        try:
            errors.extend(self.color_errors(recipe.color))

        except ColorException: