# Path: ipuz/exceptions.py
# class IPUZException(Exception):
#     pass
# 
# Path: ipuz/validators.py
# def validate_string(field_name, field_data):
#     if not isinstance(field_data, str):
#         raise IPUZException("Invalid {} value found".format(field_name))


import string
from ipuz.exceptions import IPUZException
from ipuz.validators import validate_string
    "divided": validate_stylespec_divided,
    "label": validate_stylespec_string,
    "mark": validate_stylespec_mark,
    "imagebg": validate_stylespec_string,
    "image": validate_stylespec_string,
    "slice": validate_stylespec_slice,
    "barred": validate_stylespec_side,
    "dotted": validate_stylespec_side,
    "dashed": validate_stylespec_side,
    "lessthan": validate_stylespec_side,
    "greaterthan": validate_stylespec_side,
    "equal": validate_stylespec_side,
    "color": validate_stylespec_color,
    "colortext": validate_stylespec_color,
    "colorborder": validate_stylespec_color,
    "colorbar": validate_stylespec_color,
}


def validate_stylespec(style_spec):
    if (style_spec is not None and
            not isinstance(style_spec, (dict, str))):
        raise IPUZException("StyleSpec is not a name, dictionary or None")
    if isinstance(style_spec, dict):
        for key, value in style_spec.items():
            if key not in IPUZ_STYLESPEC_VALIDATORS:
                raise IPUZException(
                    "StyleSpec contains invalid specifier: {}".format(key)
                )
            if not IPUZ_STYLESPEC_VALIDATORS[key](value):

# Path: ipuz/exceptions.py
# class IPUZException(Exception):
#     pass
# 
# Path: ipuz/validators.py
# def validate_string(field_name, field_data):
#     if not isinstance(field_data, str):
#         raise IPUZException("Invalid {} value found".format(field_name))


# Path: ipuz/structures/stylespec.py
import string
from ipuz.exceptions import IPUZException
from ipuz.validators import validate_string

    "divided": validate_stylespec_divided,
    "label": validate_stylespec_string,
    "mark": validate_stylespec_mark,
    "imagebg": validate_stylespec_string,
    "image": validate_stylespec_string,
    "slice": validate_stylespec_slice,
    "barred": validate_stylespec_side,
    "dotted": validate_stylespec_side,
    "dashed": validate_stylespec_side,
    "lessthan": validate_stylespec_side,
    "greaterthan": validate_stylespec_side,
    "equal": validate_stylespec_side,
    "color": validate_stylespec_color,
    "colortext": validate_stylespec_color,
    "colorborder": validate_stylespec_color,
    "colorbar": validate_stylespec_color,
}


def validate_stylespec(style_spec):
    if (style_spec is not None and
            not isinstance(style_spec, (dict, str))):
        raise IPUZException("StyleSpec is not a name, dictionary or None")
    if isinstance(style_spec, dict):
        for key, value in style_spec.items():
            if key not in IPUZ_STYLESPEC_VALIDATORS:
                raise IPUZException(
                    "StyleSpec contains invalid specifier: {}".format(key)
                )
            if not IPUZ_STYLESPEC_VALIDATORS[key](value):

                raise IPUZException(