# Path: cutplace/_compat.py
# def text_repr(text):
# def token_io_readline(text):
# def csv_reader(source_text_stream, dialect=csv.excel, **keywords):
# def csv_writer(target_text_stream, dialect=csv.excel, **keywords):
# 
# Path: cutplace/_tools.py
# LOG_LEVEL_NAME_TO_LEVEL_MAP = {
#     "debug": logging.DEBUG,
#     "info": logging.INFO,
#     "warning": logging.WARNING,
#     "error": logging.ERROR,
#     "critical": logging.CRITICAL,
# }
# def mkdirs(folder):
# def validated_python_name(name, value):
# def generated_tokens(text):
# def human_readable_list(items, final_separator="or"):
# def tokenize_without_space(text):
# def token_text(toky):
# def is_newline_token(some_token):
# def is_eof_token(some_token):
# def is_comma_token(some_token):
# def with_suffix(path, suffix=""):
# def length_of_int(int_value):
# 
# Path: cutplace/errors.py
# NAME_TO_ASCII_CODE_MAP = {"cr": 13, "ff": 12, "lf": 10, "tab": 9, "vt": 11}
# class Location(object):
# class CutplaceError(Exception):
# class DataError(CutplaceError):
# class InterfaceError(CutplaceError):
# class RangeValueError(DataError):
# class DataFormatError(DataError):
# class FieldValueError(DataError):
# class CheckError(DataError):
#     def __init__(self, file_path, has_column=False, has_cell=False, has_sheet=False):
#     def __copy__(self):
#     def advance_column(self, amount=1):
#     def advance_cell(self, amount=1):
#     def set_cell(self, new_cell):
#     def advance_line(self, amount=1):
#     def advance_sheet(self):
#     def cell(self):
#     def column(self):
#     def line(self):
#     def _get_sheet(self):
#     def _set_sheet(self, new_sheet):
#     def __str__(self):
#     def __repr__(self):
#     def __lt__(self, other):
#     def __eq__(self, other):
# def create_caller_location(modules_to_ignore=None, has_column=False, has_cell=False, has_sheet=False):
#     def __init__(self, message, location=None, see_also_message=None, see_also_location=None, cause=None):
#     def location(self):
#     def message(self):
#     def see_also_message(self):
#     def see_also_location(self):
#     def cause(self):
#     def prepend_message(self, prefix, new_location):
#     def __str__(self):
# 
# Path: cutplace/ranges.py
# ELLIPSIS = "\u2026"
# MAX_INTEGER = 2 ** 31 - 1
# MIN_INTEGER = -(2 ** 31)
# DEFAULT_INTEGER_RANGE_TEXT = "%d...%d" % (MIN_INTEGER, MAX_INTEGER)
# MAX_DECIMAL_TEXT = "9999999999999999999.999999999999"
# MIN_DECIMAL_TEXT = "-" + MAX_DECIMAL_TEXT
# DEFAULT_DECIMAL_RANGE_TEXT = "%s...%s" % (MIN_DECIMAL_TEXT, MAX_DECIMAL_TEXT)
# DEFAULT_PRECISION = len(MAX_DECIMAL_TEXT.split(".")[1])
# DEFAULT_SCALE = len(MAX_DECIMAL_TEXT) - 1
# def code_for_number_token(name, value, location):
# def code_for_symbolic_token(name, value, location):
# def code_for_string_token(name, value, location):
# def create_range_from_length(length_range):
# def _decimal_as_text(decimal_value, precision=DEFAULT_PRECISION):
#     def __init__(self, description, default=None):
#     def description(self):
#     def items(self):
#     def lower_limit(self):
#     def upper_limit(self):
#     def _repr_item(self, item):
#     def __repr__(self):
#     def __str__(self):
#     def _items_overlap(self, some, other):
#     def _item_contains(self, item, value):
#     def validate(self, name, value, location=None):
#     def __init__(self, description, default=None, location=None):
#     def precision(self):
#     def scale(self):
#     def __repr__(self):
#     def __str__(self):
#     def _repr_item(self, item):
#     def validate(self, name, value, location=None):
# class Range(object):
# class DecimalRange(Range):
# 
# Path: cutplace/_tools.py
# def generated_tokens(text):
#     toky = list(tokenize.generate_tokens(_compat.token_io_readline(text)))
#     if len(toky) >= 2 and is_newline_token(toky[-2]) and is_eof_token(toky[-1]):
#         # HACK: Remove newline that generated_tokens() adds starting with Python 3.x but not before.
#         del toky[-2]
#     for result in toky:
#         yield result


import codecs
import string
import token
import tokenize
from cutplace import _compat, _tools, errors, ranges
from cutplace._tools import generated_tokens
                    line_delimiter_text
                    for line_delimiter, line_delimiter_text in LINE_DELIMITER_TO_TEXT_MAP.items()
                    if (line_delimiter is not None) or (self.format == FORMAT_FIXED)
                ]
            )

    @property
    def format(self):
        return self._format

    @property
    def encoding(self):
        return self._encoding

    @encoding.setter
    def encoding(self, encoding):
        assert encoding is not None
        try:
            codecs.lookup(encoding)
        except LookupError:
            assert False, "encoding=%r" % encoding

        self._encoding = encoding

    @property
    def allowed_characters(self):
        return self._allowed_characters

    @allowed_characters.setter
    def allowed_characters(self, new_allowed_characters):

# Path: cutplace/_compat.py
# def text_repr(text):
# def token_io_readline(text):
# def csv_reader(source_text_stream, dialect=csv.excel, **keywords):
# def csv_writer(target_text_stream, dialect=csv.excel, **keywords):
# 
# Path: cutplace/_tools.py
# LOG_LEVEL_NAME_TO_LEVEL_MAP = {
#     "debug": logging.DEBUG,
#     "info": logging.INFO,
#     "warning": logging.WARNING,
#     "error": logging.ERROR,
#     "critical": logging.CRITICAL,
# }
# def mkdirs(folder):
# def validated_python_name(name, value):
# def generated_tokens(text):
# def human_readable_list(items, final_separator="or"):
# def tokenize_without_space(text):
# def token_text(toky):
# def is_newline_token(some_token):
# def is_eof_token(some_token):
# def is_comma_token(some_token):
# def with_suffix(path, suffix=""):
# def length_of_int(int_value):
# 
# Path: cutplace/errors.py
# NAME_TO_ASCII_CODE_MAP = {"cr": 13, "ff": 12, "lf": 10, "tab": 9, "vt": 11}
# class Location(object):
# class CutplaceError(Exception):
# class DataError(CutplaceError):
# class InterfaceError(CutplaceError):
# class RangeValueError(DataError):
# class DataFormatError(DataError):
# class FieldValueError(DataError):
# class CheckError(DataError):
#     def __init__(self, file_path, has_column=False, has_cell=False, has_sheet=False):
#     def __copy__(self):
#     def advance_column(self, amount=1):
#     def advance_cell(self, amount=1):
#     def set_cell(self, new_cell):
#     def advance_line(self, amount=1):
#     def advance_sheet(self):
#     def cell(self):
#     def column(self):
#     def line(self):
#     def _get_sheet(self):
#     def _set_sheet(self, new_sheet):
#     def __str__(self):
#     def __repr__(self):
#     def __lt__(self, other):
#     def __eq__(self, other):
# def create_caller_location(modules_to_ignore=None, has_column=False, has_cell=False, has_sheet=False):
#     def __init__(self, message, location=None, see_also_message=None, see_also_location=None, cause=None):
#     def location(self):
#     def message(self):
#     def see_also_message(self):
#     def see_also_location(self):
#     def cause(self):
#     def prepend_message(self, prefix, new_location):
#     def __str__(self):
# 
# Path: cutplace/ranges.py
# ELLIPSIS = "\u2026"
# MAX_INTEGER = 2 ** 31 - 1
# MIN_INTEGER = -(2 ** 31)
# DEFAULT_INTEGER_RANGE_TEXT = "%d...%d" % (MIN_INTEGER, MAX_INTEGER)
# MAX_DECIMAL_TEXT = "9999999999999999999.999999999999"
# MIN_DECIMAL_TEXT = "-" + MAX_DECIMAL_TEXT
# DEFAULT_DECIMAL_RANGE_TEXT = "%s...%s" % (MIN_DECIMAL_TEXT, MAX_DECIMAL_TEXT)
# DEFAULT_PRECISION = len(MAX_DECIMAL_TEXT.split(".")[1])
# DEFAULT_SCALE = len(MAX_DECIMAL_TEXT) - 1
# def code_for_number_token(name, value, location):
# def code_for_symbolic_token(name, value, location):
# def code_for_string_token(name, value, location):
# def create_range_from_length(length_range):
# def _decimal_as_text(decimal_value, precision=DEFAULT_PRECISION):
#     def __init__(self, description, default=None):
#     def description(self):
#     def items(self):
#     def lower_limit(self):
#     def upper_limit(self):
#     def _repr_item(self, item):
#     def __repr__(self):
#     def __str__(self):
#     def _items_overlap(self, some, other):
#     def _item_contains(self, item, value):
#     def validate(self, name, value, location=None):
#     def __init__(self, description, default=None, location=None):
#     def precision(self):
#     def scale(self):
#     def __repr__(self):
#     def __str__(self):
#     def _repr_item(self, item):
#     def validate(self, name, value, location=None):
# class Range(object):
# class DecimalRange(Range):
# 
# Path: cutplace/_tools.py
# def generated_tokens(text):
#     toky = list(tokenize.generate_tokens(_compat.token_io_readline(text)))
#     if len(toky) >= 2 and is_newline_token(toky[-2]) and is_eof_token(toky[-1]):
#         # HACK: Remove newline that generated_tokens() adds starting with Python 3.x but not before.
#         del toky[-2]
#     for result in toky:
#         yield result


# Path: cutplace/data.py
import codecs
import string
import token
import tokenize
from cutplace import _compat, _tools, errors, ranges
from cutplace._tools import generated_tokens

                    line_delimiter_text
                    for line_delimiter, line_delimiter_text in LINE_DELIMITER_TO_TEXT_MAP.items()
                    if (line_delimiter is not None) or (self.format == FORMAT_FIXED)
                ]
            )

    @property
    def format(self):
        return self._format

    @property
    def encoding(self):
        return self._encoding

    @encoding.setter
    def encoding(self, encoding):
        assert encoding is not None
        try:
            codecs.lookup(encoding)
        except LookupError:
            assert False, "encoding=%r" % encoding

        self._encoding = encoding

    @property
    def allowed_characters(self):
        return self._allowed_characters

    @allowed_characters.setter
    def allowed_characters(self, new_allowed_characters):

        assert (new_allowed_characters is None) or isinstance(new_allowed_characters, ranges.Range)