def enableDebug(globals_dict):
    templates = dict(globals_dict)

    class TemplateWrapper:
        """ Wrapper around templates.

            To better trace and control template usage.

        """
        def __init__(self, name, value):
            self.name = name
            self.value = value

        def __str__(self):
            return self.value

        def __mod__(self, other):
            assert type(other) is dict, self.name

            for key in other.keys():
                if "%%(%s)" % key not in self.value:
                    from logging import warning

                    warning(
                        "Extra value '%s' provided to template '%s'.",
                        key,
                        self.name
                    )

            try:
                return self.value % other
            except __HOLE__ as e:
                raise KeyError(self.name, *e.args)

        def split(self, sep):
            return self.value.split(sep)

    for template_name, template_value in iterItems(templates):
        # Ignore internal attribute like "__name__" that the module will also
        # have of course.
        if template_name.startswith('_'):
            continue

        if type(template_value) is str:
            globals_dict[template_name] = TemplateWrapper(
                template_name,
                template_value
            )
dataset/ETHPy150Open kayhayen/Nuitka/nuitka/codegen/templates/TemplateDebugWrapper.py/enableDebug