# 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 list(float) ibu: The lower and upper IBU
        :param list(float) color: The lower and upper color (in SRM)
        """
        self.category = category
        self.subcategory = subcategory
        self.style = style
        self.og = self._validate_input_list(og, float, u"Original Gravity")
        self.fg = self._validate_input_list(fg, float, u"Final Gravity")
        self.abv = self._validate_input_list(abv, (int, float), u"ABV")
        self.ibu = self._validate_input_list(ibu, (int, float), u"IBU")
        self.color = self._validate_input_list(color, (int, float), u"Color")

    @classmethod
    def _validate_input_list(cls, value_list, value_type, name):
        """
        Private class to validate inputs for class parameters

        :param list value_list: A list of values to validate
        :param str name: The name of the value_list being validated
        :raises StyleException: If value_list for item is empty
        :raises StyleException: If value_list is not a list or tuple
        :raises StyleException: If two values are not provided
        :raises StyleException: If either value of wrong type
        :raises StyleException: If value_list is out of order
        """
        if not value_list:
            raise StyleException(u"Must provide value_list for {}".format(name))
        if not isinstance(value_list, (list, tuple)):
            raise StyleException(u"{} must be a list".format(name))
        if len(value_list) != 2:

# 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 list(float) ibu: The lower and upper IBU
        :param list(float) color: The lower and upper color (in SRM)
        """
        self.category = category
        self.subcategory = subcategory
        self.style = style
        self.og = self._validate_input_list(og, float, u"Original Gravity")
        self.fg = self._validate_input_list(fg, float, u"Final Gravity")
        self.abv = self._validate_input_list(abv, (int, float), u"ABV")
        self.ibu = self._validate_input_list(ibu, (int, float), u"IBU")
        self.color = self._validate_input_list(color, (int, float), u"Color")

    @classmethod
    def _validate_input_list(cls, value_list, value_type, name):
        """
        Private class to validate inputs for class parameters

        :param list value_list: A list of values to validate
        :param str name: The name of the value_list being validated
        :raises StyleException: If value_list for item is empty
        :raises StyleException: If value_list is not a list or tuple
        :raises StyleException: If two values are not provided
        :raises StyleException: If either value of wrong type
        :raises StyleException: If value_list is out of order
        """
        if not value_list:
            raise StyleException(u"Must provide value_list for {}".format(name))
        if not isinstance(value_list, (list, tuple)):
            raise StyleException(u"{} must be a list".format(name))
        if len(value_list) != 2:

            raise StyleException(u"{} must contain two values".format(name))