# Path: ipuz/structures/direction.py
# def validate_direction(direction):
#     splitted = direction.split(':')
#     if len(splitted) > 2:
#         return False
#     direction_name = direction
#     if len(splitted) <= 2:
#         direction_name = splitted[0]
#     return direction_name in (
#         "Across",
#         "Down",
#         "Diagonal",
#         "Diagonal Up",
#         "Diagonal Down Left",
#         "Diagonal Up Left",
#         "Zones",
#         "Clues",
#     )
# 
# Path: ipuz/structures/stylespec.py
# def validate_stylespec_value(value):
#     try:
#         validate_stylespec(value)
#     except IPUZException:
#         return False
#     return True
# 
# Path: ipuz/validators.py
# 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)


from .direction import validate_direction
from .stylespec import validate_stylespec_value
from ipuz.validators import validate_list_of_lists


def validate_crosswordvalue(field_data):
    if (field_data is not None and
            type(field_data) not in [int, list, dict] and
            not isinstance(field_data, str)):
        return False
    if type(field_data) is int and field_data != 0:

# Path: ipuz/structures/direction.py
# def validate_direction(direction):
#     splitted = direction.split(':')
#     if len(splitted) > 2:
#         return False
#     direction_name = direction
#     if len(splitted) <= 2:
#         direction_name = splitted[0]
#     return direction_name in (
#         "Across",
#         "Down",
#         "Diagonal",
#         "Diagonal Up",
#         "Diagonal Down Left",
#         "Diagonal Up Left",
#         "Zones",
#         "Clues",
#     )
# 
# Path: ipuz/structures/stylespec.py
# def validate_stylespec_value(value):
#     try:
#         validate_stylespec(value)
#     except IPUZException:
#         return False
#     return True
# 
# Path: ipuz/validators.py
# 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)


# Path: ipuz/structures/crosswordvalue.py
from .direction import validate_direction
from .stylespec import validate_stylespec_value
from ipuz.validators import validate_list_of_lists



def validate_crosswordvalue(field_data):
    if (field_data is not None and
            type(field_data) not in [int, list, dict] and
            not isinstance(field_data, str)):
        return False
    if type(field_data) is int and field_data != 0:

        return False