# Path: ipuz/structures/calcspec.py
# def validate_calcspec(field_data):
#     def validate_value_key(value):
#         return type(value) is int
# 
#     def validate_operator_key(value):
#         return value in ["+", "-", "*", "/"]
# 
#     return validate_dict(field_data, {
#         "rect": validate_rect,
#         "cells": validate_cells,
#         "value": validate_value_key,
#         "operator": validate_operator_key,
#         "style": validate_stylespec_value,
#     })
# 
# Path: ipuz/structures/groupspec.py
# def validate_groupspec(field_data):
#     return validate_dict(field_data, {
#         "rect": validate_rect,
#         "cells": validate_cells,
#         "style": validate_stylespec_value,
#     })
# 
# Path: ipuz/structures/sudokugiven.py
# def validate_sudokugiven(field_data):
#     def validate_given(given):
#         if (given is not None and
#                 type(given) is not int and
#                 not isinstance(given, str)):
#             return False
#         return True
# 
#     if (field_data is not None and
#             type(field_data) is not int and
#             not isinstance(field_data, str)):
#         return False
#     if isinstance(field_data, dict):
#         return validate_dict(field_data, {
#             "given": validate_given,
#             "style": validate_stylespec_value,
#         })
#     return True
# 
# Path: ipuz/structures/sudokuguess.py
# def validate_sudokuguess(field_data):
#     if (type(field_data) not in [int, list] and
#             not isinstance(field_data, str)):
#         return False
#     return True
# 
# Path: ipuz/structures/sudokuvalue.py
# def validate_sudokuvalue(field_data):
#     def validate_value(value):
#         if (value is not None and
#                 type(value) is not int and
#                 not isinstance(value, str)):
#             return False
#         return True
# 
#     if (field_data is not None and
#             type(field_data) is not int and
#             not isinstance(field_data, str)):
#         return False
#     if isinstance(field_data, dict):
#         return validate_dict(field_data, {
#             "value": validate_value,
#             "style": validate_stylespec_value,
#         })
#     return True
# 
# Path: ipuz/validators.py
# def validate_bool(field_name, field_data):
#     if not isinstance(field_data, bool):
#         raise IPUZException("Invalid {} value found".format(field_name))
# 
# def validate_elements(field_name, field_data, elements):
#     if field_data not in elements:
#         raise IPUZException("Invalid {} value found".format(field_name))
# 
# def validate_list(field_name, field_data, element_name, validate_element):
#     if not isinstance(field_data, list):
#         raise IPUZException("Invalid {} value found".format(field_name))
#     for element in field_data:
#         if not validate_element(element):
#             message = "Invalid {} in {} element found".format(
#                 element_name, field_name
#             )
#             raise IPUZException(message)
# 
# def validate_list_of_lists(
#     field_name, field_data, element_name, validate_element
# ):
#     if (not isinstance(field_data, list) or
#             any(not isinstance(e, list) for e in field_data)):
#         raise IPUZException("Invalid {} value found".format(field_name))
#     for line in field_data:
#         for element in line:
#             if not validate_element(element):
#                 message = "Invalid {} in {} element found".format(
#                     element_name, field_name
#                 )
#                 raise IPUZException(message)
# 
# def validate_string(field_name, field_data):
#     if not isinstance(field_data, str):
#         raise IPUZException("Invalid {} value found".format(field_name))


from ipuz.structures import (
    validate_calcspec,
    validate_groupspec,
    validate_sudokugiven,
    validate_sudokuguess,
    validate_sudokuvalue,
)
from ipuz.validators import (
    validate_bool,
    validate_elements,
    validate_list,
    validate_list_of_lists,
    validate_string,
)


IPUZ_SUDOKU_VALIDATORS = {
    "charset": validate_string,
    "displaycharset": validate_bool,

# Path: ipuz/structures/calcspec.py
# def validate_calcspec(field_data):
#     def validate_value_key(value):
#         return type(value) is int
# 
#     def validate_operator_key(value):
#         return value in ["+", "-", "*", "/"]
# 
#     return validate_dict(field_data, {
#         "rect": validate_rect,
#         "cells": validate_cells,
#         "value": validate_value_key,
#         "operator": validate_operator_key,
#         "style": validate_stylespec_value,
#     })
# 
# Path: ipuz/structures/groupspec.py
# def validate_groupspec(field_data):
#     return validate_dict(field_data, {
#         "rect": validate_rect,
#         "cells": validate_cells,
#         "style": validate_stylespec_value,
#     })
# 
# Path: ipuz/structures/sudokugiven.py
# def validate_sudokugiven(field_data):
#     def validate_given(given):
#         if (given is not None and
#                 type(given) is not int and
#                 not isinstance(given, str)):
#             return False
#         return True
# 
#     if (field_data is not None and
#             type(field_data) is not int and
#             not isinstance(field_data, str)):
#         return False
#     if isinstance(field_data, dict):
#         return validate_dict(field_data, {
#             "given": validate_given,
#             "style": validate_stylespec_value,
#         })
#     return True
# 
# Path: ipuz/structures/sudokuguess.py
# def validate_sudokuguess(field_data):
#     if (type(field_data) not in [int, list] and
#             not isinstance(field_data, str)):
#         return False
#     return True
# 
# Path: ipuz/structures/sudokuvalue.py
# def validate_sudokuvalue(field_data):
#     def validate_value(value):
#         if (value is not None and
#                 type(value) is not int and
#                 not isinstance(value, str)):
#             return False
#         return True
# 
#     if (field_data is not None and
#             type(field_data) is not int and
#             not isinstance(field_data, str)):
#         return False
#     if isinstance(field_data, dict):
#         return validate_dict(field_data, {
#             "value": validate_value,
#             "style": validate_stylespec_value,
#         })
#     return True
# 
# Path: ipuz/validators.py
# def validate_bool(field_name, field_data):
#     if not isinstance(field_data, bool):
#         raise IPUZException("Invalid {} value found".format(field_name))
# 
# def validate_elements(field_name, field_data, elements):
#     if field_data not in elements:
#         raise IPUZException("Invalid {} value found".format(field_name))
# 
# def validate_list(field_name, field_data, element_name, validate_element):
#     if not isinstance(field_data, list):
#         raise IPUZException("Invalid {} value found".format(field_name))
#     for element in field_data:
#         if not validate_element(element):
#             message = "Invalid {} in {} element found".format(
#                 element_name, field_name
#             )
#             raise IPUZException(message)
# 
# def validate_list_of_lists(
#     field_name, field_data, element_name, validate_element
# ):
#     if (not isinstance(field_data, list) or
#             any(not isinstance(e, list) for e in field_data)):
#         raise IPUZException("Invalid {} value found".format(field_name))
#     for line in field_data:
#         for element in line:
#             if not validate_element(element):
#                 message = "Invalid {} in {} element found".format(
#                     element_name, field_name
#                 )
#                 raise IPUZException(message)
# 
# def validate_string(field_name, field_data):
#     if not isinstance(field_data, str):
#         raise IPUZException("Invalid {} value found".format(field_name))


# Path: ipuz/puzzlekinds/sudoku.py
from ipuz.structures import (
    validate_calcspec,
    validate_groupspec,
    validate_sudokugiven,
    validate_sudokuguess,
    validate_sudokuvalue,
)
from ipuz.validators import (
    validate_bool,
    validate_elements,
    validate_list,
    validate_list_of_lists,
    validate_string,
)



IPUZ_SUDOKU_VALIDATORS = {
    "charset": validate_string,
    "displaycharset": validate_bool,

    "boxes": validate_bool,