# Path: patacrep/errors.py
# class SongbookError(Exception):
# class SchemaError(SongbookError):
# class TemplateError(SongbookError):
# class ExecutableNotFound(SongbookError):
# class StepError(SongbookError):
# class LatexCompilationError(StepError):
# class StepCommandError(StepError):
# class CleaningError(SongbookError):
# class UnknownStep(StepError):
# class ParsingError(SongbookError):
# class SharedError(SongbookError):
#     def __init__(self, message=None):
#     def __str__(self):
#     def __init__(self, message='', rx_exception=None):
#     def __str__(self):
#     def __init__(self, original, message=None):
#     def __str__(self):
#     def __init__(self, executable):
#     def __init__(self, basename):
#     def __init__(self, command, code):
#     def __init__(self, filename, exception):
#     def __str__(self):
#     def __init__(self, step):
#     def __str__(self):
#     def __dict__(self):
# def notfound(filename, paths, message=None):
# 
# Path: patacrep/Rx.py
# class SchemaError(Exception):
# class SchemaMismatch(Exception):
# class TypeMismatch(SchemaMismatch):
# class ValueMismatch(SchemaMismatch):
# class RangeMismatch(SchemaMismatch):
# class LengthRangeMismatch(SchemaMismatch):
# class MissingFieldMismatch(SchemaMismatch):
# class UnknownFieldMismatch(SchemaMismatch):
# class SeqLengthMismatch(SchemaMismatch):
# class TreeMismatch(SchemaMismatch):
# class Range(object):
# class Factory(object):
# class _CoreType(object):
# class AllType(_CoreType):
# class AnyType(_CoreType):
# class ArrType(_CoreType):
# class BoolType(_CoreType):
# class DefType(_CoreType):
# class FailType(_CoreType):
# class IntType(_CoreType):
# class MapType(_CoreType):
# class NilType(_CoreType):
# class NumType(_CoreType):
# class OneType(_CoreType):
# class RecType(_CoreType):
# class SeqType(_CoreType):
# class StrType(_CoreType):
#   def __init__(self, message, schema, error=None):
#   def __init__(self, schema, data):
#   def __init__(self, schema, data):
#   def __init__(self, schema, data):
#   def __init__(self, schema, data):
#   def __init__(self, schema, fields):
#   def __init__(self, schema, fields):
#   def __init__(self, schema, data):
#   def __init__(self, schema, errors=[], child_errors={}, message=None):
# def _createTreeMismatch(schema, errors=[], child_errors={}, message=None):
#   def __init__(self, opt):
#   def __call__(self, value):
#   def __str__(self):
# def _indent(text, level=1, whitespace='  '):
#   def __init__(self, register_core_types=True):
#   def _default_prefixes(): pass
#   def expand_uri(self, type_name):
#   def add_prefix(self, name, base):
#   def register_type(self, t):
#   def learn_type(self, uri, schema):
#   def make_schema(self, schema):
# def make_schema(schema):
#   def uri(self):
#   def __init__(self, schema, rx):
#   def check(self, value):
#   def validate(self, value):
#   def subname(): return 'all'
#   def __init__(self, schema, rx):
#   def validate(self, value):
#   def subname(): return 'any'
#   def __init__(self, schema, rx):
#   def validate(self, value):
#   def subname(): return 'arr'
#   def __init__(self, schema, rx):
#   def validate(self, value):
#   def subname(): return 'bool'
#   def validate(self, value,):
#   def subname(): return 'def'
#   def validate(self, value):
#   def subname(): return 'fail'
#   def check(self, value): return False
#   def validate(self, value):
#   def subname(): return 'int'
#   def __init__(self, schema, rx):
#   def validate(self, value):
#   def subname(): return 'map'
#   def __init__(self, schema, rx):
#   def validate(self, value):
#   def subname(): return 'nil'
#   def check(self, value): return value is None
#   def validate(self, value):
#   def subname(): return 'num'
#   def __init__(self, schema, rx):
#   def validate(self, value):
#   def subname(): return 'one'
#   def validate(self, value):
#   def subname(): return 'rec'
#   def __init__(self, schema, rx):
#   def validate(self, value):
#   def subname(): return 'seq'
#   def __init__(self, schema, rx):
#   def validate(self, value):
#   def subname(): return 'str'
#   def __init__(self, schema, rx):
#   def validate(self, value):
#     INF = float('inf')


from collections import UserDict
from patacrep import errors, Rx
import unidecode
                left[key] = right[key]

def yesno(string):
    """Interpret string argument as a boolean.

    May raise `ValueError` if argument cannot be interpreted.
    """
    yes_strings = ["y", "yes", "true", "1"]
    no_strings = ["n", "no", "false", "0"]
    if string.lower() in yes_strings:
        return True
    if string.lower() in no_strings:
        return False
    raise ValueError("'{}' is supposed to be one of {}.".format(
        string,
        ", ".join(["'{}'".format(string) for string in yes_strings + no_strings]),
        ))

def validate_yaml_schema(data, schema):
    """Check that the data respects the schema

    Will raise `SchemaError` if the schema is not respected.
    """
    schema = Rx.make_schema(schema)

    if isinstance(data, DictOfDict):
        data = dict(data)

    try:
        schema.validate(data)

# Path: patacrep/errors.py
# class SongbookError(Exception):
# class SchemaError(SongbookError):
# class TemplateError(SongbookError):
# class ExecutableNotFound(SongbookError):
# class StepError(SongbookError):
# class LatexCompilationError(StepError):
# class StepCommandError(StepError):
# class CleaningError(SongbookError):
# class UnknownStep(StepError):
# class ParsingError(SongbookError):
# class SharedError(SongbookError):
#     def __init__(self, message=None):
#     def __str__(self):
#     def __init__(self, message='', rx_exception=None):
#     def __str__(self):
#     def __init__(self, original, message=None):
#     def __str__(self):
#     def __init__(self, executable):
#     def __init__(self, basename):
#     def __init__(self, command, code):
#     def __init__(self, filename, exception):
#     def __str__(self):
#     def __init__(self, step):
#     def __str__(self):
#     def __dict__(self):
# def notfound(filename, paths, message=None):
# 
# Path: patacrep/Rx.py
# class SchemaError(Exception):
# class SchemaMismatch(Exception):
# class TypeMismatch(SchemaMismatch):
# class ValueMismatch(SchemaMismatch):
# class RangeMismatch(SchemaMismatch):
# class LengthRangeMismatch(SchemaMismatch):
# class MissingFieldMismatch(SchemaMismatch):
# class UnknownFieldMismatch(SchemaMismatch):
# class SeqLengthMismatch(SchemaMismatch):
# class TreeMismatch(SchemaMismatch):
# class Range(object):
# class Factory(object):
# class _CoreType(object):
# class AllType(_CoreType):
# class AnyType(_CoreType):
# class ArrType(_CoreType):
# class BoolType(_CoreType):
# class DefType(_CoreType):
# class FailType(_CoreType):
# class IntType(_CoreType):
# class MapType(_CoreType):
# class NilType(_CoreType):
# class NumType(_CoreType):
# class OneType(_CoreType):
# class RecType(_CoreType):
# class SeqType(_CoreType):
# class StrType(_CoreType):
#   def __init__(self, message, schema, error=None):
#   def __init__(self, schema, data):
#   def __init__(self, schema, data):
#   def __init__(self, schema, data):
#   def __init__(self, schema, data):
#   def __init__(self, schema, fields):
#   def __init__(self, schema, fields):
#   def __init__(self, schema, data):
#   def __init__(self, schema, errors=[], child_errors={}, message=None):
# def _createTreeMismatch(schema, errors=[], child_errors={}, message=None):
#   def __init__(self, opt):
#   def __call__(self, value):
#   def __str__(self):
# def _indent(text, level=1, whitespace='  '):
#   def __init__(self, register_core_types=True):
#   def _default_prefixes(): pass
#   def expand_uri(self, type_name):
#   def add_prefix(self, name, base):
#   def register_type(self, t):
#   def learn_type(self, uri, schema):
#   def make_schema(self, schema):
# def make_schema(schema):
#   def uri(self):
#   def __init__(self, schema, rx):
#   def check(self, value):
#   def validate(self, value):
#   def subname(): return 'all'
#   def __init__(self, schema, rx):
#   def validate(self, value):
#   def subname(): return 'any'
#   def __init__(self, schema, rx):
#   def validate(self, value):
#   def subname(): return 'arr'
#   def __init__(self, schema, rx):
#   def validate(self, value):
#   def subname(): return 'bool'
#   def validate(self, value,):
#   def subname(): return 'def'
#   def validate(self, value):
#   def subname(): return 'fail'
#   def check(self, value): return False
#   def validate(self, value):
#   def subname(): return 'int'
#   def __init__(self, schema, rx):
#   def validate(self, value):
#   def subname(): return 'map'
#   def __init__(self, schema, rx):
#   def validate(self, value):
#   def subname(): return 'nil'
#   def check(self, value): return value is None
#   def validate(self, value):
#   def subname(): return 'num'
#   def __init__(self, schema, rx):
#   def validate(self, value):
#   def subname(): return 'one'
#   def validate(self, value):
#   def subname(): return 'rec'
#   def __init__(self, schema, rx):
#   def validate(self, value):
#   def subname(): return 'seq'
#   def __init__(self, schema, rx):
#   def validate(self, value):
#   def subname(): return 'str'
#   def __init__(self, schema, rx):
#   def validate(self, value):
#     INF = float('inf')


# Path: patacrep/utils.py
from collections import UserDict
from patacrep import errors, Rx
import unidecode

                left[key] = right[key]

def yesno(string):
    """Interpret string argument as a boolean.

    May raise `ValueError` if argument cannot be interpreted.
    """
    yes_strings = ["y", "yes", "true", "1"]
    no_strings = ["n", "no", "false", "0"]
    if string.lower() in yes_strings:
        return True
    if string.lower() in no_strings:
        return False
    raise ValueError("'{}' is supposed to be one of {}.".format(
        string,
        ", ".join(["'{}'".format(string) for string in yes_strings + no_strings]),
        ))

def validate_yaml_schema(data, schema):
    """Check that the data respects the schema

    Will raise `SchemaError` if the schema is not respected.
    """
    schema = Rx.make_schema(schema)

    if isinstance(data, DictOfDict):
        data = dict(data)

    try:
        schema.validate(data)

    except Rx.SchemaMismatch as exception: