Load the blade template
192512
private static function loadTemplate($array)
    {
        global $wp_styles, $wp_scripts;
        if (!$array || !is_array($array) || count($array) === 0) {
            return;
        }

        if (self::checkTemplatePresence($array[0])) {
            $isadmin = is_admin_bar_showing();
            add_filter('show_admin_bar', '__return_false');
            self::$renderer->render($array[0], []);
            @$wp_styles->done = array();
            @$wp_scripts->done = array(); 
            if ($isadmin) {
                add_filter('show_admin_bar', '__return_true');
            }
            $template = self::$renderer->render($array[0], self::$data);
            
            
            
            $template = str_replace("<html>", "<html " . get_language_attributes() . ">", $template);
            $template = str_replace("<body>", '<body class="' . implode(" ", get_body_class()) . '">', $template);

            echo $template;

            if (!is_admin()) {
                $wp_styles->done = array();
                $wp_scripts->done = array();
            }
        } else {
            self::loadTemplate(array_slice($array, 1));
        }
    }
478486
public function load($name)
    {
        if (!isset($this->templates[$name])) {
            $this->templates[$name] = $this->loadFile($name);
        }

        return $this->templates[$name];
    }
345970
def _loaddata_template(self, stringbuffer, index, name, opts):
        
        context = self._get_dump_item_context(index, name, opts)

        stringbuffer.write(self.loadder_item_template.format(**context))

        return stringbuffer
103995
def render_template(templates_path, template_filename, context):
        """"""
        template_env = Environment(
            autoescape=False, trim_blocks=False,
            loader=FileSystemLoader(str(templates_path)))
        return template_env.get_template(str(template_filename)) \
            .render(context)
585705
function loadTemplatesFiles (dir, files, options, templates) {
    // require files
    if (!Array.isArray(files)) {
        return Promise.resolve()
    }
    // load template for each file
    return Promise.each(files, file => {
        // get absolute file from dir
        var absFile = dir+'/'+file
        // get express template name by stripping off extension
        file = file.replace(GLOBAL.extRegExp, '')
        // if template has already been defined then do not replace so that
        // first incidence of file in multiple paths is used
        if (templates[file]) {
            return
        }
        // load template
        var promise = templates[file] = loadTemplate(absFile, options)
        // once template is loaded replace promise with template
        .then(template => {
            templates[file] = template
        })
        // wait for template to load
        return promise
    })
}
185619
private function load_wordpress_with_template() {

		// WordPress already ran once.
		if ( function_exists( 'add_filter' ) ) {
			return;
		}

		if ( 'stage' === $this->type && true === $this->focus ) {
			$hooks = array();
			foreach ( $this->stage_hooks as $stage_hook ) {
				$hooks = array_merge( $hooks, $stage_hook );
			}
			$this->set_stage_hooks( $hooks );
		}

		if ( 'stage' === $this->type ) {
			if ( 'bootstrap' === $this->focus ) {
				$this->set_stage_hooks( $this->stage_hooks['bootstrap'] );
			} elseif ( ! $this->focus ) {
				$logger = new Logger( array( 'stage' => 'bootstrap' ) );
				$logger->start();
			}
		}
		WP_CLI::get_runner()->load_wordpress();
		if ( $this->running_hook ) {
			$this->loggers[ $this->running_hook ]->stop();
			$this->running_hook = null;
		}
		if ( 'hook' === $this->type && 'wp_loaded:after' === $this->focus ) {
			$this->wp_tick_profile_end();
		}
		if ( 'stage' === $this->type && ! $this->focus ) {
			$logger->stop();
			$this->loggers[] = $logger;
		}

		// Set up main_query main WordPress query.
		if ( 'stage' === $this->type ) {
			if ( 'main_query' === $this->focus ) {
				$this->set_stage_hooks( $this->stage_hooks['main_query'] );
			} elseif ( ! $this->focus ) {
				$logger = new Logger( array( 'stage' => 'main_query' ) );
				$logger->start();
			}
		}
		wp();
		if ( $this->running_hook ) {
			$this->loggers[ $this->running_hook ]->stop();
			$this->running_hook = null;
		}
		if ( 'hook' === $this->type && 'wp:after' === $this->focus ) {
			$this->wp_tick_profile_end();
		}
		if ( 'stage' === $this->type && ! $this->focus ) {
			$logger->stop();
			$this->loggers[] = $logger;
		}

		define( 'WP_USE_THEMES', true );

		// Template is normally loaded in global scope, so we need to replicate
		foreach ( $GLOBALS as $key => $value ) {
			global ${$key}; // phpcs:ignore PHPCompatibility.PHP.ForbiddenGlobalVariableVariable.NonBareVariableFound -- Syntax is updated to compatible with php 5 and 7.
		}

		// Load the theme template.
		if ( 'stage' === $this->type ) {
			if ( 'template' === $this->focus ) {
				$this->set_stage_hooks( $this->stage_hooks['template'] );
			} elseif ( ! $this->focus ) {
				$logger = new Logger( array( 'stage' => 'template' ) );
				$logger->start();
			}
		}
		ob_start();
		require_once( ABSPATH . WPINC . '/template-loader.php' );
		ob_get_clean();
		if ( $this->running_hook ) {
			$this->loggers[ $this->running_hook ]->stop();
			$this->running_hook = null;
		}
		if ( 'hook' === $this->type && 'wp_footer:after' === $this->focus ) {
			$this->wp_tick_profile_end();
		}
		if ( 'stage' === $this->type && ! $this->focus ) {
			$logger->stop();
			$this->loggers[] = $logger;
		}

	}
185743
public function load( $slug, $name = '' )
	{
		if( !empty(( $template = $this->get( $slug, $name )))) {
			DevelopmentFacade::storeTemplatePath( $template );
			load_template( $template, false );
		}
	}
2997
public function render()
    {
        switch ($this->type) {
            case "file":
                if (!is_readable($this->template)) {
                    throw new \Exception("Could not find template file: " . $this->template);
                }

                extract($this->templateData);
                include $this->template;

                break;

            case "callback":
                if (!isset($this->template["callback"]) || !is_callable($this->template["callback"])) {
                    throw new \Exception("View missing callback.");
                }

                echo call_user_func($this->template["callback"]);

                break;

            case "string":
                echo $this->template;

                break;

            default:
                throw new \Exception("Not a valid template type: " . $this->type);
        }
    }
1285040
def load(template):
    

    try:
        data = load_json(template)
        return data, "json"
    except ValueError as e:
        try:
            data = load_yaml(template)
            return data, "yaml"
        except Exception:
            raise e
1188832
def _load_view(self, template_engine_name, template_dir):
        
        file_name = template_engine_name.lower()
        class_name = "{}View".format(template_engine_name.title())
        try:
            view_module = import_module("rails.views.{}".format(file_name))
        except ImportError:
            raise Exception("Template engine '{}' not found in 'rails.views'".format(file_name))
        view_class = getattr(view_module, class_name)
        return view_class(template_dir)
1207222
public function loadController($template)
    {
        $template = basename($template) . '.php';

        do_action('Municipio/blade/before_load_controller');

        if (basename($template) == '404.php') {
            $template = 'e404.php';
        }

        switch ($template) {
            case 'author.php':
                if (!defined('MUNICIPIO_BLOCK_AUTHOR_PAGES') || MUNICIPIO_BLOCK_AUTHOR_PAGES) {
                    $template = 'archive.php';
                }
                break;
        }

        $controller = \Municipio\Helper\Controller::locateController($template);

        if (!$controller) {
            $controller = \Municipio\Helper\Controller::locateController('BaseController');
        }

        $controller = apply_filters('Municipio/blade/controller', $controller);

        require_once $controller;
        $namespace = \Municipio\Helper\Controller::getNamespace($controller);
        $class = '\\' . $namespace . '\\' . basename($controller, '.php');

        do_action('Municipio/blade/after_load_controller');

        return new $class();
    }
1116113
def render_template(view, template, layout_name, locals)
      path = template.identifier

      result = path.match(/(?<=\/)[a-zA-Z0-9_-]+(?=\/app\/views)/)
      result = result.to_s.split('-').first.to_s + '/engine'

      engine = result.classify.safe_constantize

      view.instance_variable_set(:@_rendered_from, engine.root) if engine

      super
    end
194325
public function load()
    {
        if (empty($this->_statements)) {
            parent::load();
        }

        /* @var $template_engine \TemplateEngine\TemplateEngine */
        $template_engine = TemplateEngine::getInstance();

        foreach ($this->getOrganizedStatements() as $type=>$statements) {
            foreach ($statements as $statement) {
                if ('css'===$type) {
                    $template_object = $template_engine->getTemplateObject('CssFile');
                    $css = $statement->getData();
                    if (isset($css['minified']) && true===$css['minified']) {
                        $template_object->addMinified($css['src'], $css['media']);
                    } else {
                        $template_object->add($css['src'], $css['media']);
                    }
                } elseif ('jsfiles_header'===$type) {
                    $template_object = $template_engine->getTemplateObject('JavascriptFile', 'jsfiles_header');
                    $js = $statement->getData();
                    if (
                        (isset($js['minified']) && true===$js['minified']) ||
                        (isset($js['packed']) && true===$js['packed'])
                    ) {
                        $template_object->addMinified($js['src']);
                    } else {
                        $template_object->add($js['src']);
                    }
                } elseif (in_array($type, array('js', 'jsfiles_footer'))) {
                    $template_object = $template_engine->getTemplateObject('JavascriptFile', 'jsfiles_footer');
                    $js = $statement->getData();
                    if (
                        (isset($js['minified']) && true===$js['minified']) ||
                        (isset($js['packed']) && true===$js['packed'])
                    ) {
                        $template_object->addMinified($js['src']);
                    } else {
                        $template_object->add($js['src']);
                    }
                }
            }
        }
    }
87452
def generate_template(template_name, **context):
    """"""
    context.update(href=href, format_datetime=format_datetime)
    return template_loader.load(template_name).generate(**context)
952210
function () {
			this.writeDebug('_loadTemplates');
			var source;
			var _this = this;
			var templateError = '<div class="bh-sl-error">Error: Could not load plugin templates. Check the paths and ensure they have been uploaded. Paths will be wrong if you do not run this from a web server.</div>';
			// Get the KML templates
			if (this.settings.dataType === 'kml' && this.settings.listTemplateID === null && this.settings.infowindowTemplateID === null) {

				// Try loading the external template files
				$.when(
					// KML infowindows
					$.get(this.settings.KMLinfowindowTemplatePath, function (template) {
						source = template;
						infowindowTemplate = Handlebars.compile(source);
					}),

					// KML locations list
					$.get(this.settings.KMLlistTemplatePath, function (template) {
						source = template;
						listTemplate = Handlebars.compile(source);
					})
				).then(function () {
					// Continue to the main script if templates are loaded successfully
					_this.locator();

				}, function () {
					// KML templates not loaded
					$('.' + _this.settings.formContainer).append(templateError);
					throw new Error('Could not load storeLocator plugin templates');
				});
			}
			// Handle script tag template method
			else if (this.settings.listTemplateID !== null && this.settings.infowindowTemplateID !== null) {
				// Infowindows
				infowindowTemplate = Handlebars.compile($('#' + this.settings.infowindowTemplateID).html());

				// Locations list
				listTemplate = Handlebars.compile($('#' + this.settings.listTemplateID).html());

				// Continue to the main script
				_this.locator();
			}
			// Get the JSON/XML templates
			else {
				// Try loading the external template files
				$.when(
					// Infowindows
					$.get(this.settings.infowindowTemplatePath, function (template) {
						source = template;
						infowindowTemplate = Handlebars.compile(source);
					}),

					// Locations list
					$.get(this.settings.listTemplatePath, function (template) {
						source = template;
						listTemplate = Handlebars.compile(source);
					})
				).then(function () {
					// Continue to the main script if templates are loaded successfully
					_this.locator();

				}, function () {
					// JSON/XML templates not loaded
					$('.' + _this.settings.formContainer).append(templateError);
					throw new Error('Could not load storeLocator plugin templates');
				});
			}
		}
341957
def get_template(self, template_name):
        """"""
        try:
            return self.loader.load(template_name, encoding=self.encoding)
        except self.not_found_exception, e:
            # catch the exception raised by Genshi, convert it into a werkzeug
            # exception (for the sake of consistency)
            raise TemplateNotFound(template_name)
722878
public function load($name)
    {
        $this->loadTemplates();

        if (!array_key_exists($name, $this->templates)) {
            throw new Mustache_Exception_UnknownTemplateException($name);
        }

        return $this->templates[$name];
    }