# 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):


import decimal
import token
from cutplace import _compat, _tools, errors
    """
    assert name is not None
    assert value is not None

    try:
        # Note: base 0 automatically handles prefixes like 0x.
        result = int(value, 0)
    except ValueError:
        raise errors.InterfaceError(
            "numeric value for %s must be an integer number but is: %s" % (name, _compat.text_repr(value)), location
        )
    return result


def code_for_symbolic_token(name, value, location):
    """
    The numeric code for text representing an a symbolic name in ``value``,
    which has to be one of the values in
    :py:const:`cutplace.errors.NAME_TO_ASCII_CODE_MAP`.

    :param str name: the name of the value as it is known to the end user
    :param str value: the text that represents a symbolic name
    :param cutplace.errors.Location location: the location of ``value`` or ``None``
    """
    assert name is not None
    assert value is not None

    try:
        result = errors.NAME_TO_ASCII_CODE_MAP[value.lower()]
    except KeyError:

# 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
import decimal
import token
from cutplace import _compat, _tools, errors

    """
    assert name is not None
    assert value is not None

    try:
        # Note: base 0 automatically handles prefixes like 0x.
        result = int(value, 0)
    except ValueError:
        raise errors.InterfaceError(
            "numeric value for %s must be an integer number but is: %s" % (name, _compat.text_repr(value)), location
        )
    return result


def code_for_symbolic_token(name, value, location):
    """
    The numeric code for text representing an a symbolic name in ``value``,
    which has to be one of the values in
    :py:const:`cutplace.errors.NAME_TO_ASCII_CODE_MAP`.

    :param str name: the name of the value as it is known to the end user
    :param str value: the text that represents a symbolic name
    :param cutplace.errors.Location location: the location of ``value`` or ``None``
    """
    assert name is not None
    assert value is not None

    try:
        result = errors.NAME_TO_ASCII_CODE_MAP[value.lower()]
    except KeyError:

        valid_symbols = _tools.human_readable_list(sorted(errors.NAME_TO_ASCII_CODE_MAP.keys()))