# Path: djedi/templatetags/template.py
# def lazy_tag(self, func=None, takes_context=None, name=None, node_class=None):
#     def dec(func):
#             def __init__(self, takes_context, args, kwargs):
#             def get_resolved_arguments(self, context):
#             def render(self, context):
#         class SimpleNode(Node):
# 
# Path: djedi/compat.py
# def parse_bits(parser, bits, params, varargs, varkw, defaults,
#                takes_context, name):
#     from django.template import library
#     return library.parse_bits(
#         parser=parser, bits=bits, params=params, varargs=varargs,
#         varkw=varkw, defaults=defaults, kwonly=(), kwonly_defaults=(),
#         takes_context=takes_context, name=name)


import cio
import six
import textwrap
from django import template
from django.template import TemplateSyntaxError
from .template import register
from ..compat import parse_bits
        # Resolve uri variable
        uri = args[0].resolve({})

        # Parse tag body (default content)
        tokens = parser.parse(('endblocknode',))
        parser.delete_first_token()  # Remove endblocknode tag

        # Render default content tokens and dedent common leading whitespace
        default = u''.join((token.render({}) for token in tokens))
        default = default.strip('\n\r')
        default = textwrap.dedent(default)

        # Get node for uri, lacks context variable lookup due to lazy loading.
        node = cio.get(uri, default)

        return cls(tokens, node, kwargs)

    def __init__(self, tokens, node, kwargs):
        self.tokens = tokens
        self.node = node
        self.kwargs = kwargs

    def render(self, context):
        # Resolve tag kwargs against context
        resolved_kwargs = dict((key, value.resolve(context)) for key, value in six.iteritems(self.kwargs))
        edit = resolved_kwargs.pop('edit', True)

        return render_node(self.node, context=resolved_kwargs, edit=edit)



# Path: djedi/templatetags/template.py
# def lazy_tag(self, func=None, takes_context=None, name=None, node_class=None):
#     def dec(func):
#             def __init__(self, takes_context, args, kwargs):
#             def get_resolved_arguments(self, context):
#             def render(self, context):
#         class SimpleNode(Node):
# 
# Path: djedi/compat.py
# def parse_bits(parser, bits, params, varargs, varkw, defaults,
#                takes_context, name):
#     from django.template import library
#     return library.parse_bits(
#         parser=parser, bits=bits, params=params, varargs=varargs,
#         varkw=varkw, defaults=defaults, kwonly=(), kwonly_defaults=(),
#         takes_context=takes_context, name=name)


# Path: djedi/templatetags/djedi_tags.py
import cio
import six
import textwrap
from django import template
from django.template import TemplateSyntaxError
from .template import register
from ..compat import parse_bits

        # Resolve uri variable
        uri = args[0].resolve({})

        # Parse tag body (default content)
        tokens = parser.parse(('endblocknode',))
        parser.delete_first_token()  # Remove endblocknode tag

        # Render default content tokens and dedent common leading whitespace
        default = u''.join((token.render({}) for token in tokens))
        default = default.strip('\n\r')
        default = textwrap.dedent(default)

        # Get node for uri, lacks context variable lookup due to lazy loading.
        node = cio.get(uri, default)

        return cls(tokens, node, kwargs)

    def __init__(self, tokens, node, kwargs):
        self.tokens = tokens
        self.node = node
        self.kwargs = kwargs

    def render(self, context):
        # Resolve tag kwargs against context
        resolved_kwargs = dict((key, value.resolve(context)) for key, value in six.iteritems(self.kwargs))
        edit = resolved_kwargs.pop('edit', True)

        return render_node(self.node, context=resolved_kwargs, edit=edit)



register.tag('blocknode', BlockNode.tag)