<commit_before><?php

namespace jvwp;

use singleton\Singleton;

if(class_exists('Twig_Environment')) {

    class Templates extends Singleton
    {

        private $twigLoader;
        private $twigEnvironment;

        function __construct()
        {
            $this->twigLoader = new \Twig_Loader_Filesystem(array());
            $this->twigEnvironment = new \Twig_Environment($this->twigLoader);
        }

        /**
         * @param string $path
         * @param string $namespace
         * @throws \Twig_Error_Loader
         */
        public static function addPath($path, $namespace = \Twig_Loader_Filesystem::MAIN_NAMESPACE)
        {
            self::getInstance()->twigLoader->addPath($path, $namespace);
        }

        /**
         * @return \Twig_Environment;
         */
        public function getTwigEnvironment()
        {
            return $this->twigEnvironment;
        }

    }

    Templates::setInstance(new Templates());

}<commit_msg>add static getTemplate accessibility method<commit_after><?php

namespace jvwp;

use singleton\Singleton;

if(class_exists('Twig_Environment')) {

    class Templates extends Singleton
    {

        private $twigLoader;
        private $twigEnvironment;

        function __construct()
        {
            $this->twigLoader = new \Twig_Loader_Filesystem(array());
            $this->twigEnvironment = new \Twig_Environment($this->twigLoader);
        }

        /**
         * @param string $path
         * @param string $namespace
         * @throws \Twig_Error_Loader
         */
        public static function addPath($path, $namespace = \Twig_Loader_Filesystem::MAIN_NAMESPACE)
        {
            self::getInstance()->twigLoader->addPath($path, $namespace);
        }

        /**
         * @param string $name
         *
         * @return \Twig_TemplateInterface
         */
        public static function getTemplate($name) {
            return self::getInstance()->getTwigEnvironment()->loadTemplate($name);
        }

        /**
         * @return \Twig_Environment;
         */
        public function getTwigEnvironment()
        {
            return $this->twigEnvironment;
        }

    }

    Templates::setInstance(new Templates());

}
{'fraction_non_alphanumeric': 0.11230425055928411, 'fraction_numerical': 0.0, 'mean_word_length': 2.050477489768076, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 17, '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': '5585860', 'n_tokens_mistral': 613, 'n_tokens_neox': 597, 'n_words': 109}