run this file through our templating engine
342920
private function render() {
        $parsed_data = Parser::parse($this->input_path);

        if ($parsed_data['frontmatter'] !== false && !$this->should_ignore()) {
            return Template::render($parsed_data['content'], $parsed_data['frontmatter']);
        }

        return $parsed_data['content'];
    }
874990
public function run()
    {
 
        
        $sample = file_get_contents($this->parameters['tpl']);
        $target = $this->parameters['target'];
        
        $serverName = $this->parameters['serverName'];
        $documentRoot = $this->parameters['documentRoot'];
        $directory = array();
        
        $it = new RecursiveDirectoryIterator($documentRoot);

        foreach (new RecursiveIteratorIterator($it) as $file) {
            if($file->getFileName() == '.htaccess' 
                && strpos($file->getPath(), 'install/checks/testRewrite') ===false){
              
          
               $pathName = $file->getPathname();
               $path = $file->getPath();
               
               $directory[$path] = "\t<Directory ". $path . ">\n";
               $htaccess = file_get_contents($pathName);
               $directory[$path] .= $htaccess;
               $directory[$path] .= "\n\t</Directory>\n";
               
            }
        }
        
        $directoryContent = implode("\n",array_values($directory));
    
        $maps = array(
        	'{ServerName}' => $serverName,
            '{DocumentRoot}' => $documentRoot,
            '{Directory}' => $directoryContent
        );
        
        $finalContent = str_replace(array_keys($maps), array_values($maps), $sample);
        file_put_contents($target, $finalContent);
    }
522040
function run(cb) {
  // check if template is local
  if (/^[./]|(\w:)/.test(template)) {
    var templatePath = template.charAt(0) === '/' || /^\w:/.test(template)
      ? template
      : path.normalize(path.join(process.cwd(), template))
    if (exists(templatePath)) {
      generate(name, templatePath, to, cb)
    } else {
      logger.fatal('Local template "%s" not found.', template)
    }
  } else {
    checkVersion(function () {
      if (!hasSlash) {
        // use official templates
        var officialTemplate = 'vuejs-templates/' + template
        if (template.indexOf('#') !== -1) {
          downloadAndGenerate(officialTemplate, cb)
        } else {
          if (template.indexOf('-2.0') !== -1) {
            warnings.v2SuffixTemplatesDeprecated(template, inPlace ? '' : name)
            return
          }

          warnings.v2BranchIsNowDefault(template, inPlace ? '' : name)
          downloadAndGenerate(officialTemplate, cb)
        }
      } else {
        downloadAndGenerate(template, cb)
      }
    })
  }
}
863080
def render_template(template_in, file_out, context):
    
    renderer = pystache.Renderer()
    result = renderer.render_path(template_in, context)
    with open(file_out, 'w') as handle:
        LOGGER.info('Rendering: {} to {}'.format(template_in, file_out))
        handle.write(result)
    shutil.copymode(template_in, file_out)
266465
def main(argv=None):
    """"""
    arguments = cli_common(__doc__, argv=argv)
    plugin = 'benchmark' if arguments['benchmark'] else None

    if arguments['-g']:
        template.generate_config(plugin, arguments['<FILE>'])
    else:
        with open(arguments['<FILE>']) as istr:
            context = json.load(istr)
        kwargs = dict(no_input=True, extra_context=context)
        if arguments['--output-dir']:
            kwargs.update(output_dir=arguments['--output-dir'])
        if arguments['--interactive']:
            kwargs.update(no_input=False)
        logging.info(
            'generating template in directory ' + kwargs.get('output_dir', os.getcwd())
        )
        template.generate_template(plugin, **kwargs)
1234752
function run () {
  if (argv.file) {
    const models = require(argv.file)
    return validate(models)
  }

  const json = argv.model || argv.references
  if (json) {
    return validate(JSON.parse(json))
  }

  printUsage()
  process.exit(1)
}
230527
def script_template(state, host, template_filename, chdir=None, **data):
    '''
    
    '''

    temp_file = state.get_temp_filename(template_filename)
    yield files.template(state, host, template_filename, temp_file, **data)

    yield chmod(temp_file, '+x')

    if chdir:
        yield 'cd {0} && {1}'.format(chdir, temp_file)
    else:
        yield temp_file
804413
public function run() {
		
		$this->registerClientScript();
		$buttons=$this->createPageButtons();
		if(empty($buttons))
			return;
		echo CHtml::openTag($this->containerTag, $this->containerHtmlOptions);
		echo $this->header;
		echo CHtml::tag('ul',$this->htmlOptions,implode("\n",$buttons));
		echo '<div style="clear: both;"></div>';
		echo $this->footer;
		echo CHtml::closeTag($this->containerTag);
	}
1091791
public function run()
    {
        $table = \Input::get('table');
        $field = \Input::get('field');
        $name  = \Input::get('name');
        $rowId = \Input::get('id');

        $dataContainer = $this->initializeDataContainer($table, $field);
        $this->loadRow($table, $rowId, $dataContainer);

        $template = $this->prepareTemplate();

        $template->table = $table;
        $template->field = $field;
        $template->name  = $name;
        $template->icon  = $dataContainer->activeRecord->$field;
        $template->icons = $this->generateIcons($field);

        $template->output();
    }
1123004
def render_template(template_file, template_vars):
    """"""
    # Load our Jinja templates
    template_dir = "{0}/templates".format(
        os.path.dirname(os.path.abspath(__file__))
    )
    jinja_env = jinja2.Environment(
        loader=jinja2.FileSystemLoader(template_dir),
        trim_blocks=True
    )
    rendered = jinja_env.get_template(template_file).render(template_vars)

    return rendered
1070041
public function run()
    {
        $this->registerClientScript();

        if ($this->hasModel()) {
            $input = Html::activeHiddenInput($this->model, $this->attribute, $this->options);
        } else {
            $input = Html::hiddenInput($this->name, $this->value, $this->options);
        }

        echo strtr($this->template, [
            '{input}' => $input,
            '{jstree}' => Html::tag('div', '', ['id' => $this->getJsTreeId()]),
        ]);
    }
62983
public function run()
    {
        $this->run_called = true;
        $this->hook('beforeRender');
        $this->is_rendering = true;

        // if no App layout set
        if (!isset($this->html)) {
            throw new Exception(['App layout should be set.']);
        }

        $this->html->template->set('title', $this->title);
        $this->html->renderAll();
        $this->html->template->appendHTML('HEAD', $this->html->getJS());
        $this->is_rendering = false;
        $this->hook('beforeOutput');

        if (isset($_GET['__atk_callback']) && $this->catch_runaway_callbacks) {
            $this->terminate('!! Callback requested, but never reached. You may be missing some arguments in '.$_SERVER['REQUEST_URI']);
        }

        echo $this->html->template->render();
    }
800119
def run_script_with_context(script_path, cwd, context):
    
    _, extension = os.path.splitext(script_path)

    contents = io.open(script_path, 'r', encoding='utf-8').read()

    with tempfile.NamedTemporaryFile(
        delete=False,
        mode='wb',
        suffix=extension
    ) as temp:
        env = StrictEnvironment(
            context=context,
            keep_trailing_newline=True,
        )
        template = env.from_string(contents)
        output = template.render(**context)
        temp.write(output.encode('utf-8'))

    run_script(temp.name, cwd)
1307910
public function run()
	{
		$templates=array();
		foreach($this->model->getTemplates() as $i=>$template)
			$templates[$i]=basename($template).' ('.$template.')';

		$this->renderFile(Yii::getPathOfAlias('gii.views.common.generator').'.php',array(
			'model'=>$this->model,
			'templates'=>$templates,
		));

		parent::run();

		echo "</div>";
	}
130466
public function run()
	{
		$script = '';
		$script = $script.'KindEditor.ready(function(K){var editor=K.create("textarea[id='.$this->options['id'].']", {'.$this->renderItems($this->items).'})});';
		$this->getView()->registerJs($script);
		KindEditorAsset::register($this->getView());
	}
1155062
public function run()
    {
        // Prepare data
        $view = $this->getView();

        // Render input for results
        if ($this->_renderInput) {
            if ($this->hasModel()) {
                echo Html::activeHiddenInput($this->model, $this->attribute, $this->options);
            } else {
                echo Html::hiddenInput($this->name, $this->value, $this->options);
            }
        }

        // Render editor container
        $containerOptions = $this->containerOptions;
        $tag              = ArrayHelper::remove($containerOptions, 'tag', 'div');
        echo Html::tag($tag, '', $containerOptions);

        // Prepare client options
        $clientOptions           = $this->clientOptions;
        $clientOptions['schema'] = $this->schema;

        try {
            $parsedValue = Json::decode($this->value);
        } catch (\Exception $e) {
            $parsedValue = null;
            \Yii::error($e->getMessage(), __METHOD__);
        }

        if (!empty($parsedValue)) {
            $clientOptions['startval'] = $parsedValue;
        }

        $clientOptions = Json::encode($clientOptions);

        // Prepare element IDs
        $widgetId    = $this->id;
        $inputId     = $this->inputId;
        $containerId = $this->containerOptions['id'];

        // Add the "JSONEditor" instance to the global window object, otherwise the instance is only available in "ready()" function scope
        $widgetJs = "window.{$widgetId} = new JSONEditor(document.getElementById('{$containerId}'), {$clientOptions});\n";
        // Add the "JSONEditor" instance to the global window.jsonEditors array.
        $widgetJs .= "if (!window.jsonEditors) { window.jsonEditors = []; } window.jsonEditors.push(window.{$widgetId});";

        $readyFunction = '';
        $readyFunction .= "{$widgetId}.on('change', function() { document.getElementById('{$inputId}').value = JSON.stringify({$widgetId}.getValue()); });\n";

        $widgetJs .= "{$widgetId}.on('ready', function() {\n{$readyFunction}\n});";

        // Register js code
        $view->registerJs($widgetJs, $view::POS_READY);

        parent::run();
    }
1091348
def _run():
    """"""

    args = parse_args()

    # parse custom parameters
    custom_meta = None
    if args.custom_meta:
        print "Adding custom parameters:"
        custom_meta = {}
        try:
            for item in args.custom_meta.split(','):
                key, value = item.split(':')
                custom_meta[key] = value
                print 'key: %s, value: %s' % (key, value)
        except Exception as e:
            sys.stderr.write("ERROR: Can not parse custom meta tags! %s\n" % (str(e)))

    # we need to store some persistent info, so check if a config file
    # exists (default location is ~/.centinel/config.ini). If the file
    # does not exist, then create a new one at run time
    configuration = centinel.config.Configuration()
    if args.config:
        configuration.parse_config(args.config)
    else:
        # if the file does not exist, then the default config file
        # will be used
        new_configuration = None
        if os.path.exists(DEFAULT_CONFIG_FILE):
            configuration.parse_config(DEFAULT_CONFIG_FILE)
        else:
            print 'Configuration file does not exist. Creating a new one.'
            new_configuration = centinel.config.Configuration()

        if not ('version' in configuration.params and
                configuration.params['version']['version'] == centinel.__version__):
            if not args.update_config:
                print ('WARNING: configuration file is from '
                       'a different version (%s) of '
                       'Centinel. Run with --update-config to update '
                       'it.' % (configuration.params['version']['version']))
            else:
                new_configuration = centinel.config.Configuration()
                backup_path = DEFAULT_CONFIG_FILE + ".old"
                new_configuration.update(configuration, backup_path)

        if new_configuration is not None:
            configuration = new_configuration
            configuration.write_out_config(DEFAULT_CONFIG_FILE)
            print 'New configuration written to %s' % (DEFAULT_CONFIG_FILE)
            if args.update_config:
                sys.exit(0)

    if args.verbose:
        if 'log' not in configuration.params:
            configuration.params['log'] = dict()
        configuration.params['log']['log_level'] = logging.DEBUG

    # add custom meta values from CLI
    if custom_meta is not None:
        if 'custom_meta' in configuration.params:
            configuration.params['custom_meta'].update(custom_meta)
        else:
            configuration.params['custom_meta'] = custom_meta

    centinel.conf = configuration.params
    client = centinel.client.Client(configuration.params)
    client.setup_logging()
    # disable cert verification if the flag is set
    if args.no_verify:
        configuration.params['server']['verify'] = False

    user = centinel.backend.User(configuration.params)
    # Note: because we have mutually exclusive arguments, we don't
    # have to worry about multiple arguments being called
    if args.sync:
        centinel.backend.sync(configuration.params)
    elif args.consent:
        user.informed_consent()
    elif args.daemonize:
        # if we don't have a valid binary location, then exit
        if not os.path.exists(args.binary):
            print "Error: no binary found to daemonize"
            exit(1)
        centinel.daemonize.daemonize(args.auto_update, args.binary,
            args.user)
    else:
        client.run()