Start the tools module with a template context to inspect
483978
function () {
                if (!aria.tools.ToolsBridge || !aria.tools.ToolsBridge.isOpen) {
                    Aria.load({
                        classes : ['aria.tools.ToolsBridge'],
                        oncomplete : function () {
                            aria.tools.ToolsBridge.open();
                            aria.tools.contextual.ContextualMenu.close();
                        }
                    });
                }
            }
861882
def render_template_file(template, context=None):
    
    assert isinstance(context, Mapping)
    template = get_template(template)
    return template.render(context)
1311796
public void start() {
		try {
			this.monitor.start();

		} catch( final Exception e ) {
			this.logger.warning("Cannot start template watcher");
			Utils.logException(this.logger, e);
		}
	}
53794
def get_templates(self, context, template_name=None):
        "  "
        if not template_name:
            template_name = self.template_name

        kw = {}
        if 'object' in context:
            o = context['object']
            kw['slug'] = o.slug

        if context.get('content_type', False):
            ct = context['content_type']
            kw['app_label'] = ct.app_label
            kw['model_label'] = ct.model

        return get_templates(template_name, category=context['category'], **kw)
87452
def generate_template(template_name, **context):
    """"""
    context.update(href=href, format_datetime=format_datetime)
    return template_loader.load(template_name).generate(**context)
719231
def template_string(context, template):
    ''
    if not isinstance(context, Context):
        context = Context(context)
    return Template(template).render(context)
1060439
def update_context(app, pagename, templatename, context, doctree):
    
    if doctree is None:
        return
    visitor = _FindTabsDirectiveVisitor(doctree)
    doctree.walk(visitor)
    if not visitor.found_tabs_directive:
        paths = [posixpath.join('_static', 'sphinx_tabs/' + f) for f in FILES]
        if 'css_files' in context:
            context['css_files'] = context['css_files'][:]
            for path in paths:
                if path.endswith('.css'):
                    context['css_files'].remove(path)
        if 'script_files' in context:
            context['script_files'] = context['script_files'][:]
            for path in paths:
                if path.endswith('.js'):
                    context['script_files'].remove(path)
273191
def _parse_template(self, has_content):
        """"""
        reset = self._head
        context = contexts.TEMPLATE_NAME
        if has_content:
            context |= contexts.HAS_TEMPLATE
        try:
            template = self._parse(context)
        except BadRoute:
            self._head = reset
            raise
        self._emit_first(tokens.TemplateOpen())
        self._emit_all(template)
        self._emit(tokens.TemplateClose())
845082
def toil_make_tool(toolpath_object, loading_context):
    

    if isinstance(toolpath_object, Mapping) \
            and toolpath_object.get("class") == "CommandLineTool":
        return ToilCommandLineTool(toolpath_object, loading_context)
    return cwltool.workflow.default_make_tool(toolpath_object, loading_context)
565361
function template(tmpl, context) {
			return tmpl.replace(/\{([^\}]+)\}/g, function(m, key) {
				return context[key];
			});
		}
842009
def visit_Include(self, node, frame):
        """"""
        if node.ignore_missing:
            self.writeline('try:')
            self.indent()

        func_name = 'get_or_select_template'
        if isinstance(node.template, nodes.Const):
            if isinstance(node.template.value, string_types):
                func_name = 'get_template'
            elif isinstance(node.template.value, (tuple, list)):
                func_name = 'select_template'
        elif isinstance(node.template, (nodes.Tuple, nodes.List)):
            func_name = 'select_template'

        self.writeline('template = environment.%s(' % func_name, node)
        self.visit(node.template, frame)
        self.write(', %r)' % self.name)
        if node.ignore_missing:
            self.outdent()
            self.writeline('except TemplateNotFound:')
            self.indent()
            self.writeline('pass')
            self.outdent()
            self.writeline('else:')
            self.indent()

        skip_event_yield = False
        if node.with_context:
            loop = self.environment.is_async and 'async for' or 'for'
            self.writeline('%s event in template.root_render_func('
                           'template.new_context(context.get_all(), True, '
                           '%s)):' % (loop, self.dump_local_context(frame)))
        elif self.environment.is_async:
            self.writeline('for event in (await '
                           'template._get_default_module_async())'
                           '._body_stream:')
        else:
            if supports_yield_from:
                self.writeline('yield from template._get_default_module()'
                               '._body_stream')
                skip_event_yield = True
            else:
                self.writeline('for event in template._get_default_module()'
                               '._body_stream:')

        if not skip_event_yield:
            self.indent()
            self.simple_write('event', frame)
            self.outdent()

        if node.ignore_missing:
            self.outdent()
12147
def main():
    

    print_head()
    puts("Welcome to the will project generator.")
    puts("")

    if args.config_dist_only:
        print("Generating config.py.dist...")

    else:
        print("\nGenerating will scaffold...")

    current_dir = os.getcwd()
    plugins_dir = os.path.join(current_dir, "plugins")
    templates_dir = os.path.join(current_dir, "templates")

    if not args.config_dist_only:
        print("  /plugins")
        # Set up the directories
        if not os.path.exists(plugins_dir):
            os.makedirs(plugins_dir)

        print("     __init__.py")
        # Create the plugins __init__.py
        with open(os.path.join(plugins_dir, "__init__.py"), 'w+') as f:
            pass

        print("     morning.py")
        # Create the morning plugin
        morning_file_path = os.path.join(plugins_dir, "morning.py")
        if not os.path.exists(morning_file_path):
            with open(morning_file_path, 'w+') as f:
                f.write("""from will.plugin import WillPlugin
from will.decorators import respond_to, periodic, hear, randomly, route, rendered_template, require_settings


class MorningPlugin(WillPlugin):

    @respond_to("^good morning")
    def good_morning(self, message):
        self.reply("oh, g'morning!")
""")

        print("  /templates")
        if not os.path.exists(templates_dir):
            os.makedirs(templates_dir)

        print("     blank.html")
        # Create the plugins __init__.py
        with open(os.path.join(templates_dir, "blank.html"), 'w+') as f:
            pass

        print("  .gitignore")
        # Create .gitignore, or at least add shelf.db
        gitignore_path = os.path.join(current_dir, ".gitignore")
        if not os.path.exists(gitignore_path):
            with open(gitignore_path, 'w+') as f:
                f.write("""*.py[cod]
pip-log.txt
shelf.db
        """)
        else:
            append_ignore = False
            with open(gitignore_path, "r+") as f:
                if "shelf.db" not in f.read():
                    append_ignore = True
            if append_ignore:
                with open(gitignore_path, "a") as f:
                    f.write("\nshelf.db\n")

        # Create run_will.py
        print("  run_will.py")
        run_will_path = os.path.join(current_dir, "run_will.py")
        if not os.path.exists(run_will_path):
            with open(run_will_path, 'w+') as f:
                f.write("""#!/usr/bin/env python
from will.main import WillBot

if __name__ == '__main__':
    bot = WillBot()
    bot.bootstrap()
""")
        # And make it executable
        st = os.stat('run_will.py')
        os.chmod("run_will.py", st.st_mode | stat.S_IXUSR | stat.S_IXGRP | stat.S_IXOTH)

    # Create config.py
        print("  config.py.dist")

    config_path = os.path.join(current_dir, "config.py.dist")
    if not os.path.exists(config_path) or ask_user("! config.py.dist exists.  Overwrite it?"):
        with open(os.path.join(PROJECT_ROOT, "config.py.dist"), "r") as source_f:
            source = source_f.read()
            if args.backends:
                for backend in SERVICE_BACKENDS:
                    if backend in args.backends:
                        _enable_service(backend, source)
                    else:
                        __disable_service(backend, source)
            else:
                # Ask user thru cmd line what backends to enable
                print("\nWill supports a few different service backends.  Let's set up the ones you want:\n")
                source = enable_disable_service("Slack", source)
                source = enable_disable_service("HipChat", source)
                source = enable_disable_service("Rocket.Chat", source)
                source = enable_disable_service("Shell", source)

            with open(config_path, "w+") as f:
                config = source
                f.write(config)

    if not args.config_dist_only:
        print("  requirements.txt")
        # Create requirements.txt
        requirements_path = os.path.join(current_dir, "requirements.txt")
        if not os.path.exists(requirements_path) or ask_user("! requirements.txt exists.  Overwrite it?"):
            with open(requirements_path, 'w+') as f:
                f.write(requirements_txt)

        print("  Procfile")
        # Create Procfile
        requirements_path = os.path.join(current_dir, "Procfile")
        if not os.path.exists(requirements_path):
            with open(requirements_path, 'w+') as f:
                f.write("web: python run_will.py")

        print("  README.md")
        # Create the readme
        readme_path = os.path.join(current_dir, "README.md")
        if not os.path.exists(readme_path):
            with open(readme_path, 'w+') as f:
                f.write("""
This is our bot, a [will](https://github.com/skoczen/will) bot.
    """)

        print("\nDone.")

        print("\n Your will is now ready to go. Run ./run_will.py to get started!")
    else:
        print("\nCreated a config.py.dist.  Open it up to see what's new!\n")
805368
def _iter_templates():
    

    # pylint: disable=W0406
    # needed for introspection
    import javatools.cheetah
    from Cheetah.Template import Template

    for _, name, _ in iter_modules(__path__):
        __import__("javatools.cheetah." + name)
        found = getattr(getattr(javatools.cheetah, name), name)
        if issubclass(found, Template):
            yield found
772273
function(context, descriptor, args) {
		var path = args[0],
			values = (typeof path === 'string') ? context.get(path) : path;
		if (values && values.length) {
			var template = args[1];
			for (var i = 0, len = values.length; i < len; ++i)
				template.toHTMLString(new Context(values[i], context), descriptor);
		} else if (args[2])
			args[2].toHTMLString(context, descriptor);
	}
1115226
def main():
    
    p = OptionParser(main.__doc__)
    p.add_option("-g", "--graphic", default=False, action="store_true",
            help="Create boilerplate for a graphic script")

    opts, args = p.parse_args()
    if len(args) != 1:
        sys.exit(not p.print_help())

    script, = args
    imports = graphic_imports if opts.graphic else default_imports
    app = graphic_app if opts.graphic else default_app
    template = default_template.format(imports, app)
    write_file(script, template)

    message = "template writes to `{0}`".format(script)
    if opts.graphic:
        message = "graphic " + message
    message = message[0].upper() + message[1:]
    logging.debug(message)
1175374
function(context, args, stack) {
		var path = args[0],
			template = args[1],
			pathIsString = typeof path === 'string';
		ctx = new Context(pathIsString ? context.get(path) : path, context, pathIsString ? path : null);
		stack.push(ctx);
		firstPass(template, ctx, stack);
	}
504638
def tool_builder(component, key, tool_map, *args):
    """"""
    # pylint: disable=protected-access
    tool_name = component.get(key)
    if tool_name:
        tool_fn = tool_map.get(tool_name)
        if tool_fn:
            return tool_fn[0](*args)
        raise Exception("Unknown {} '{}' for {}".format(key, tool_name, component.name))
    raise MissingToolKey(key, component)