# Path: ipuz/exceptions.py
# class IPUZException(Exception):
#     pass
# 
# Path: ipuz/structures/stylespec.py
# 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(
#                     "StyleSpec has an invalid {} value".format(key)
#                 )


from ipuz.exceptions import IPUZException
from .stylespec import validate_stylespec


def validate_styledcell(field_data):
    if (field_data is not None and
            type(field_data) not in [int, dict] and
            not isinstance(field_data, str)):
        return False
    if isinstance(field_data, dict):
        if not field_data:
            return False
        if not all(key in ("cell", "style") for key in field_data):
            return False
        if ("cell" in field_data and
                field_data["cell"] is not None and
                type(field_data["cell"]) is not int and

# Path: ipuz/exceptions.py
# class IPUZException(Exception):
#     pass
# 
# Path: ipuz/structures/stylespec.py
# 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(
#                     "StyleSpec has an invalid {} value".format(key)
#                 )


# Path: ipuz/structures/styledcell.py
from ipuz.exceptions import IPUZException
from .stylespec import validate_stylespec



def validate_styledcell(field_data):
    if (field_data is not None and
            type(field_data) not in [int, dict] and
            not isinstance(field_data, str)):
        return False
    if isinstance(field_data, dict):
        if not field_data:
            return False
        if not all(key in ("cell", "style") for key in field_data):
            return False
        if ("cell" in field_data and
                field_data["cell"] is not None and
                type(field_data["cell"]) is not int and

                not isinstance(field_data["cell"], str)):