<commit_before><?php defined('SYSPATH') or die('No direct script access.');
/**
 * Mustache templates for Kohana.
 *
 * @package    Kostache
 * @category   Base
 * @author     <NAME> <<EMAIL>>
 * @copyright  (c) 2010-2012 <NAME>
 * @license    MIT
 */
class Kohana_Kostache_Layout extends Kohana_Kostache {

	/**
	 * @var  string  partial name for content
	 */
	const CONTENT_PARTIAL = 'content';

	/**
	 * @var  boolean  render template in layout?
	 */
	public $render_layout = TRUE;

	/**
	 * @var  string  layout path
	 */
	protected $_layout = 'layout';

	public function render($class, $template = NULL)
	{
		if ( ! $this->render_layout)
		{
			return parent::render();
		}

		$this->_engine->setPartials(
			array(
				Kostache_Layout::CONTENT_PARTIAL => parent::render($class, $template)
			)
		);

		return $this->_engine->loadTemplate($this->_layout)->render($class);
	}

}<commit_msg>Pass class and template to parent if render layout is off<commit_after><?php defined('SYSPATH') or die('No direct script access.');
/**
 * Mustache templates for Kohana.
 *
 * @package    Kostache
 * @category   Base
 * @author     <NAME> <<EMAIL>>
 * @copyright  (c) 2010-2012 <NAME>
 * @license    MIT
 */
class Kohana_Kostache_Layout extends Kohana_Kostache {

	/**
	 * @var  string  partial name for content
	 */
	const CONTENT_PARTIAL = 'content';

	/**
	 * @var  boolean  render template in layout?
	 */
	public $render_layout = TRUE;

	/**
	 * @var  string  layout path
	 */
	protected $_layout = 'layout';

	public function render($class, $template = NULL)
	{
		if ( ! $this->render_layout)
		{
			return parent::render($class, $template);
		}

		$this->_engine->setPartials(
			array(
				Kostache_Layout::CONTENT_PARTIAL => parent::render($class, $template)
			)
		);

		return $this->_engine->loadTemplate($this->_layout)->render($class);
	}

}
{'fraction_non_alphanumeric': 0.1508923742563548, 'fraction_numerical': 0.008653326122228232, 'mean_word_length': 3.5121951219512195, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 27, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1667069', 'n_tokens_mistral': 676, 'n_tokens_neox': 598, 'n_words': 149}