# Path: jinja2schema/core.py
# def parse(template, jinja2_env=None):
# def _ignore_constants(var):
# def infer_from_ast(ast, ignore_constants=True, config=Config()):
# def infer(template, config=Config()):
#     def encode_common_attrs(self, var):
#     def encode(self, var):
#     def encode(self, var):
# def to_json_schema(var, jsonschema_encoder=JSONSchemaDraft4Encoder):
# class JSONSchemaDraft4Encoder(object):
# class StringJSONSchemaDraft4Encoder(JSONSchemaDraft4Encoder):
# 
# Path: jinja2schema/model.py
# class Dictionary(Variable):
#     """A dictionary.
# 
#     Implements some methods of Python :class:`dict`.
# 
#     .. automethod:: __setitem__
#     .. automethod:: __getitem__
#     .. automethod:: __delitem__
#     .. automethod:: get
#     .. automethod:: items
#     .. automethod:: iteritems
#     .. automethod:: keys
#     .. automethod:: iterkeys
#     .. automethod:: pop
#     """
# 
#     def __init__(self, data=None, **kwargs):
#         self.data = data or {}
#         super(Dictionary, self).__init__(**kwargs)
# 
#     def __eq__(self, other):
#         return super(Dictionary, self).__eq__(other) and self.data == other.data
# 
#     def __repr__(self):
#         return pprint.pformat(self.data)
# 
#     def clone(self):
#         rv = super(Dictionary, self).clone()
#         rv.data = {}
#         for k, v in _compat.iteritems(self.data):
#             rv.data[k] = v.clone()
#         return rv
# 
#     @classmethod
#     def from_ast(cls, ast, data=None, **kwargs):
#         kwargs = dict(cls._get_kwargs_from_ast(ast), **kwargs)
#         return cls(data, **kwargs)
# 
#     def __setitem__(self, key, value):
#         self.data[key] = value
# 
#     def __getitem__(self, key):
#         return self.data[key]
# 
#     def __delitem__(self, key):
#         del self.data[key]
# 
#     def __contains__(self, key):
#         return key in self.data
# 
#     def get(self, name, default=None):
#         if name in self:
#             return self[name]
#         else:
#             return default
# 
#     def items(self):
#         return self.data.items()
# 
#     def iteritems(self):
#         return _compat.iteritems(self.data)
# 
#     def keys(self):
#         return self.data.keys()
# 
#     def iterkeys(self):
#         return _compat.iterkeys(self.data)
# 
#     def pop(self, key, default=None):
#         return self.data.pop(key, default)
# 
# class Scalar(Variable):
#     """A scalar. Either string, number, boolean or ``None``."""
#     def __repr__(self):
#         return '<scalar>'
# 
# class List(Variable):
#     """A list which items are of the same type.
# 
#     .. attribute:: item
# 
#         A structure of list items, subclass of :class:`Variable`.
#     """
#     def __init__(self, item, **kwargs):
#         self.item = item
#         super(List, self).__init__(**kwargs)
# 
#     def __eq__(self, other):
#         return super(List, self).__eq__(other) and self.item == other.item
# 
#     def __repr__(self):
#         return pprint.pformat([self.item])
# 
#     def clone(self):
#         rv = super(List, self).clone()
#         rv.item = self.item.clone()
#         return rv
# 
#     @classmethod
#     def from_ast(cls, ast, item, **kwargs):
#         kwargs = dict(cls._get_kwargs_from_ast(ast), **kwargs)
#         return cls(item, **kwargs)
# 
# class Unknown(Variable):
#     """A variable which type is unknown."""
#     def __repr__(self):
#         return '<unknown>'
# 
# class Tuple(Variable):
#     """A tuple.
# 
#     .. attribute:: items
# 
#         A :class:`tuple` of :class:`Variable` instances or ``None`` if the tuple items are unknown.
# 
#     .. attribute:: items
# 
#         Whether new elements can be added to the tuple in the process of merge or not.
#     """
#     def __init__(self, items, **kwargs):
#         self.items = tuple(items) if items is not None else None
#         self.may_be_extended = kwargs.pop('may_be_extended', False)
#         super(Tuple, self).__init__(**kwargs)
# 
#     def __eq__(self, other):
#         return super(Tuple, self).__eq__(other) and self.items == other.items
# 
#     def __repr__(self):
#         return pprint.pformat(self.items)
# 
#     def clone(self):
#         rv = super(Tuple, self).clone()
#         rv.items = self.items and tuple(s.clone() for s in self.items)
#         return rv
# 
#     @classmethod
#     def from_ast(cls, ast, items, **kwargs):
#         kwargs = dict(cls._get_kwargs_from_ast(ast), **kwargs)
#         return cls(items, **kwargs)
# 
# class Number(Scalar):
#     """A number."""
#     def __repr__(self):
#         return '<number>'
# 
# class Boolean(Scalar):
#     """A boolean."""
#     def __repr__(self):
#         return '<boolean>'
# 
# class String(Scalar):
#     """A string."""
#     def __repr__(self):
#         return '<string>'


from jinja2schema import core
from jinja2schema.model import Dictionary, Scalar, List, Unknown, Tuple, Number, Boolean, String
# coding: utf-8


def test_to_json_schema():
    struct = Dictionary({
        'list': List(
            Tuple((
                Dictionary({
                    'field': Scalar(label='field', linenos=[3]),
                }, label='a', linenos=[3]),

# Path: jinja2schema/core.py
# def parse(template, jinja2_env=None):
# def _ignore_constants(var):
# def infer_from_ast(ast, ignore_constants=True, config=Config()):
# def infer(template, config=Config()):
#     def encode_common_attrs(self, var):
#     def encode(self, var):
#     def encode(self, var):
# def to_json_schema(var, jsonschema_encoder=JSONSchemaDraft4Encoder):
# class JSONSchemaDraft4Encoder(object):
# class StringJSONSchemaDraft4Encoder(JSONSchemaDraft4Encoder):
# 
# Path: jinja2schema/model.py
# class Dictionary(Variable):
#     """A dictionary.
# 
#     Implements some methods of Python :class:`dict`.
# 
#     .. automethod:: __setitem__
#     .. automethod:: __getitem__
#     .. automethod:: __delitem__
#     .. automethod:: get
#     .. automethod:: items
#     .. automethod:: iteritems
#     .. automethod:: keys
#     .. automethod:: iterkeys
#     .. automethod:: pop
#     """
# 
#     def __init__(self, data=None, **kwargs):
#         self.data = data or {}
#         super(Dictionary, self).__init__(**kwargs)
# 
#     def __eq__(self, other):
#         return super(Dictionary, self).__eq__(other) and self.data == other.data
# 
#     def __repr__(self):
#         return pprint.pformat(self.data)
# 
#     def clone(self):
#         rv = super(Dictionary, self).clone()
#         rv.data = {}
#         for k, v in _compat.iteritems(self.data):
#             rv.data[k] = v.clone()
#         return rv
# 
#     @classmethod
#     def from_ast(cls, ast, data=None, **kwargs):
#         kwargs = dict(cls._get_kwargs_from_ast(ast), **kwargs)
#         return cls(data, **kwargs)
# 
#     def __setitem__(self, key, value):
#         self.data[key] = value
# 
#     def __getitem__(self, key):
#         return self.data[key]
# 
#     def __delitem__(self, key):
#         del self.data[key]
# 
#     def __contains__(self, key):
#         return key in self.data
# 
#     def get(self, name, default=None):
#         if name in self:
#             return self[name]
#         else:
#             return default
# 
#     def items(self):
#         return self.data.items()
# 
#     def iteritems(self):
#         return _compat.iteritems(self.data)
# 
#     def keys(self):
#         return self.data.keys()
# 
#     def iterkeys(self):
#         return _compat.iterkeys(self.data)
# 
#     def pop(self, key, default=None):
#         return self.data.pop(key, default)
# 
# class Scalar(Variable):
#     """A scalar. Either string, number, boolean or ``None``."""
#     def __repr__(self):
#         return '<scalar>'
# 
# class List(Variable):
#     """A list which items are of the same type.
# 
#     .. attribute:: item
# 
#         A structure of list items, subclass of :class:`Variable`.
#     """
#     def __init__(self, item, **kwargs):
#         self.item = item
#         super(List, self).__init__(**kwargs)
# 
#     def __eq__(self, other):
#         return super(List, self).__eq__(other) and self.item == other.item
# 
#     def __repr__(self):
#         return pprint.pformat([self.item])
# 
#     def clone(self):
#         rv = super(List, self).clone()
#         rv.item = self.item.clone()
#         return rv
# 
#     @classmethod
#     def from_ast(cls, ast, item, **kwargs):
#         kwargs = dict(cls._get_kwargs_from_ast(ast), **kwargs)
#         return cls(item, **kwargs)
# 
# class Unknown(Variable):
#     """A variable which type is unknown."""
#     def __repr__(self):
#         return '<unknown>'
# 
# class Tuple(Variable):
#     """A tuple.
# 
#     .. attribute:: items
# 
#         A :class:`tuple` of :class:`Variable` instances or ``None`` if the tuple items are unknown.
# 
#     .. attribute:: items
# 
#         Whether new elements can be added to the tuple in the process of merge or not.
#     """
#     def __init__(self, items, **kwargs):
#         self.items = tuple(items) if items is not None else None
#         self.may_be_extended = kwargs.pop('may_be_extended', False)
#         super(Tuple, self).__init__(**kwargs)
# 
#     def __eq__(self, other):
#         return super(Tuple, self).__eq__(other) and self.items == other.items
# 
#     def __repr__(self):
#         return pprint.pformat(self.items)
# 
#     def clone(self):
#         rv = super(Tuple, self).clone()
#         rv.items = self.items and tuple(s.clone() for s in self.items)
#         return rv
# 
#     @classmethod
#     def from_ast(cls, ast, items, **kwargs):
#         kwargs = dict(cls._get_kwargs_from_ast(ast), **kwargs)
#         return cls(items, **kwargs)
# 
# class Number(Scalar):
#     """A number."""
#     def __repr__(self):
#         return '<number>'
# 
# class Boolean(Scalar):
#     """A boolean."""
#     def __repr__(self):
#         return '<boolean>'
# 
# class String(Scalar):
#     """A string."""
#     def __repr__(self):
#         return '<string>'


# Path: tests/unit_tests/test_model.py
from jinja2schema import core
from jinja2schema.model import Dictionary, Scalar, List, Unknown, Tuple, Number, Boolean, String

# coding: utf-8


def test_to_json_schema():
    struct = Dictionary({
        'list': List(
            Tuple((
                Dictionary({
                    'field': Scalar(label='field', linenos=[3]),
                }, label='a', linenos=[3]),

                Scalar(label='b', linenos=[4])