Inject all preset data to Panel and Render a Home Page
968506
async def get(self):
        
        shepherd = self.request.app.vmshepherd
        data = {'presets': {}, 'config': shepherd.config}
        presets = await shepherd.preset_manager.list_presets()
        runtime = shepherd.runtime_manager
        for name in presets:
            preset = shepherd.preset_manager.get_preset(name)
            data['presets'][name] = {
                'preset': preset,
                'vms': preset.vms,
                'runtime': await runtime.get_preset_data(name),
                'vmshepherd_id': shepherd.instance_id,
                'now': time.time()
            }
        return data
279295
function() {

		 // Render the help panel
	    this.renderHelpPanel();

	    /**
	     * @property layout
	     * @type {YAHOO.widget.Layout}
	     */
	    this.layout = new widget.Layout(this.el, this.options.layoutOptions);
	    this.layout.render();

		 // Right accordion
	    this.renderPropertiesAccordion();

	    // Render buttons
	    this.renderButtons();

	 	 // Saved status
		 this.renderSavedStatus();

	    // Properties Form
	    this.renderPropertiesForm();

  }
472036
function renderPage(uri, req, res, hrStart) {
  const locals = res.locals,
    extension = getExtension(req),
    renderer = findRenderer(extension);

  // Add request route params, request query params
  // and the request extension to the locals object
  locals.params = req.params;
  locals.query = req.query;
  locals.extension = extension;

  // look up page alias' component instance
  return getDBObject(uri)
    .then(formDataFromLayout(locals, uri))
    .then(data => {
      logTime(hrStart, uri);
      return data;
    })
    .then(({ data, options }) => renderer.render(data, options, res))
    .catch(responses.handleError(res));
}
484109
private DefaultPanel createTopPanel() {
		DefaultPanel top = new DefaultPanel();
		top.setLayout(new BoxLayout(top, BoxLayout.X_AXIS));
		top.setAlignmentX(Component.LEFT_ALIGNMENT);
		top.setPreferredSize(new Dimension(Short.MAX_VALUE, 40));

		top.add(Box.createRigidArea(new Dimension(5, 0)));

		// property label
		JLabel propLabel = new JLabel("Property");
		propLabel.setBounds(10, 20, 40, 20);
		propLabel.setForeground(COLOR_LABEL);
		top.add(propLabel);
		top.add(Box.createRigidArea(new Dimension(5, 0)));

		// add properties combobox
		properties = new JComboBox();
		properties.setMaximumSize(new Dimension(100, 20));
		properties.setMinimumSize(new Dimension(100, 20));
		properties.setPreferredSize(new Dimension(100, 20));
		properties.addItemListener(new ItemListener() {
			public void itemStateChanged(ItemEvent event) {
				String item = (String) event.getItem();
				LinearInterpolator currentValue = (LinearInterpolator) values
						.get(item);
				panel.setInterpolator(currentValue);
			}
		});
		top.add(properties);
		top.add(Box.createRigidArea(new Dimension(10, 0)));

		// min label
		JLabel minLabel = new JLabel("Min");
		minLabel.setMaximumSize(new Dimension(100, 20));
		minLabel.setForeground(COLOR_LABEL);
		top.add(minLabel);
		top.add(Box.createRigidArea(new Dimension(5, 0)));

		// min spinner
		minSpinner = new JSpinner(new SpinnerNumberModel(0, -1000, 1000, 1));
		minSpinner.setMaximumSize(new Dimension(100, 20));
		minSpinner.addChangeListener(new ChangeListener() {
			public void stateChanged(ChangeEvent e) {
				fireUpdated(e.getSource());
			}
		});
		top.add(minSpinner);
		top.add(Box.createRigidArea(new Dimension(5, 0)));

		// max label
		JLabel maxLabel = new JLabel("Max");
		maxLabel.setMaximumSize(new Dimension(100, 20));
		maxLabel.setForeground(COLOR_LABEL);
		top.add(maxLabel);
		top.add(Box.createRigidArea(new Dimension(5, 0)));

		// max spinner
		maxSpinner = new JSpinner(new SpinnerNumberModel(255, -1000, 1000, 1));
		maxSpinner.setMaximumSize(new Dimension(100, 20));
		maxSpinner.addChangeListener(new ChangeListener() {
			public void stateChanged(ChangeEvent e) {
				fireUpdated(e.getSource());
			}
		});
		top.add(maxSpinner);
		top.add(Box.createRigidArea(new Dimension(5, 0)));

		// spacer
		top.add(Box.createHorizontalGlue());

		// value x label
		valueXLabel = new JLabel(TEXT_CURRENT_X);
		valueXLabel.setMaximumSize(new Dimension(100, 20));
		valueXLabel.setForeground(COLOR_LABEL);
		top.add(valueXLabel);
		top.add(Box.createRigidArea(new Dimension(10, 0)));

		// value y label
		valueYLabel = new JLabel(TEXT_CURRENT_Y);
		valueYLabel.setMaximumSize(new Dimension(100, 20));
		valueYLabel.setForeground(COLOR_LABEL);
		top.add(valueYLabel);
		top.add(Box.createRigidArea(new Dimension(10, 0)));

		return top;
	}
507973
function generatePage(output, page) {
    var book = output.getBook();
    var engine = createTemplateEngine(output);

    return timing.measure(
        'page.generate',
        Promise(page)
        .then(function(resultPage) {
            var file = resultPage.getFile();
            var filePath = file.getPath();
            var parser = file.getParser();
            var context = JSONUtils.encodeOutputWithPage(output, resultPage);

            if (!parser) {
                return Promise.reject(error.FileNotParsableError({
                    filename: filePath
                }));
            }

            // Call hook "page:before"
            return callPageHook('page:before', output, resultPage)

            // Escape code blocks with raw tags
            .then(function(currentPage) {
                return parser.preparePage(currentPage.getContent());
            })

            // Render templating syntax
            .then(function(content) {
                var absoluteFilePath = path.join(book.getContentRoot(), filePath);
                return Templating.render(engine, absoluteFilePath, content, context);
            })

            .then(function(output) {
                var content = output.getContent();

                return parser.parsePage(content)
                .then(function(result) {
                    return output.setContent(result.content);
                });
            })

            // Post processing for templating syntax
            .then(function(output) {
                return Templating.postRender(engine, output);
            })

            // Return new page
            .then(function(content) {
                return resultPage.set('content', content);
            })

            // Call final hook
            .then(function(currentPage) {
                return callPageHook('page', output, currentPage);
            });
        })
    );
}
650157
public function render()
    {
        $this->setupDefaultOptions();

        if (!empty($this->value)) {
            $this->attribute('data-initial-preview', $this->preview());
            $this->attribute('data-initial-caption', $this->initialCaption($this->value));

            $this->setupPreviewOptions();
        }

        $this->options(['overwriteInitial' => true]);

        $options = json_encode($this->options);

        $this->script = <<<EOT

$("input{$this->getElementClassSelector()}").fileinput({$options});

EOT;

        return parent::render();
    }
1078293
private void addMainPanelHoverHandlers(Panel panel) {

        final CmsStyleVariable hoverPanel = new CmsStyleVariable(panel);
        hoverPanel.setValue(I_CmsLayoutBundle.INSTANCE.globalWidgetCss().openerNoHover());
        panel.addDomHandler(new MouseOverHandler() {

            public void onMouseOver(MouseOverEvent event) {

                hoverPanel.setValue(I_CmsLayoutBundle.INSTANCE.globalWidgetCss().openerHover());

            }
        }, MouseOverEvent.getType());
        panel.addDomHandler(new MouseOutHandler() {

            public void onMouseOut(MouseOutEvent event) {

                hoverPanel.setValue(I_CmsLayoutBundle.INSTANCE.globalWidgetCss().openerNoHover());

            }
        }, MouseOutEvent.getType());
    }
1229112
public function renderDataRow()
    {
        $this->formatRow();

        $this->template->appendHTML(
            $this->container_tag,
            $this->rowRender($this->row_t)
        );
    }
600794
def render(self):
        """"""
        context = GLOBAL_TEMPLATE_CONTEXT.copy()
        context['tag'] = self
        entries = list(self.entries)
        entries.sort(key=operator.attrgetter('date'), reverse=True)
        context['entries'] = entries

        # render html page
        render_to = os.path.join(CONFIG['output_to'], 'tags', self.slug)
        if not os.path.exists(render_to):  # pragma: no coverage
            os.makedirs(render_to)
        _render(context, 'tag_index.html', os.path.join(render_to, 'index.html'))  # noqa

        # render atom.xml
        context['entries'] = context['entries'][:10]
        context['last_build'] = datetime.datetime.now().strftime("%Y-%m-%dT%H:%M:%SZ")  # noqa

        _render(context, 'atom.xml', os.path.join(render_to, 'atom.xml'))
        return True
108295
function(panels, patternData, iframePassback, switchText) {

    // count how many panels have rendered content
    var panelContentCount = 0;
    for (var i = 0; i < panels.length; ++i) {
      if (panels[i].content !== undefined) {
        panelContentCount++;
      }
    }

    // see if the count of panels with content matches number of panels
    if (panelContentCount === Panels.count()) {
      panelsViewer.renderPanels(panels, patternData, iframePassback, switchText);
    }

  }
1017598
public function render()
    {
        $script[] = $this->_getJavascriptTemplateBlockBegin();

        $trackingUserId = (null === $this->userId)
            ? ''
            : sprintf(", {'userId': '%s'}", $this->userId);

        if ($this->debug) {
            $script[] = "ga('create', '{$this->trackingId}', { 'cookieDomain': 'none' }, '{$this->trackerName}'{$trackingUserId});";
        } else {
            $script[] = "ga('create', '{$this->trackingId}', '{$this->trackingDomain}', '{$this->trackerName}'{$trackingUserId});";
        }

        if ($this->ecommerceTracking) {
            $script[] = "ga('require', 'ecommerce');";
        }

        if ($this->displayFeatures) {
            $script[] = "ga('require', 'displayfeatures');";
        }

        if ($this->anonymizeIp) {
            $script[] = "ga('set', 'anonymizeIp', true);";
        }

        if ($this->nonInteraction) {
            $script[] = "ga('set', 'nonInteraction', true);";
        }

        if ($this->campaign instanceof Campaign) {
            $script[] = (new CampaignRenderer($this->campaign))->render();
        }

        $trackingStack = $this->trackingBag->get();
        if (count($trackingStack)) {
            $script[] = implode("\n", $trackingStack);
        }

        if ($this->autoTrack) {
            $script[] = "ga('send', 'pageview');";
        }

        if ($this->ecommerceTracking) {
            $script[] = "ga('ecommerce:send');";
        }

        $script[] = $this->_getJavascriptTemplateBlockEnd();

        return implode('', $script);
    }
582642
function openPanel(preset, opt_config) {
    // TODO(ErinCoughlan): Investigate why panelRef.open() doesn't return
    // panelRef.
    var openPromise;

    if (panelRef) {
      openPromise = panelRef.open();
    } else {
      openPromise = $mdPanel.open(preset, opt_config);
    }

    openPromise.then(function(createdPanelRef) {
      panelRef = createdPanelRef;
      return panelRef;
    });

    flushPanel();
  }
23661
function () {
        var self = this, layout = self._layout, tabsHtml = '', prefix = self.classPrefix;

        self.preRender();
        layout.preRender(self);

        self.items().each(function (ctrl, i) {
          var id = self._id + '-t' + i;

          ctrl.aria('role', 'tabpanel');
          ctrl.aria('labelledby', id);

          tabsHtml += (
            '<div id="' + id + '" class="' + prefix + 'tab" ' +
            'unselectable="on" role="tab" aria-controls="' + ctrl._id + '" aria-selected="false" tabIndex="-1">' +
            self.encode(ctrl.settings.title) +
            '</div>'
          );
        });

        return (
          '<div id="' + self._id + '" class="' + self.classes + '" hidefocus="1" tabindex="-1">' +
          '<div id="' + self._id + '-head" class="' + prefix + 'tabs" role="tablist">' +
          tabsHtml +
          '</div>' +
          '<div id="' + self._id + '-body" class="' + self.bodyClasses + '">' +
          layout.renderHtml(self) +
          '</div>' +
          '</div>'
        );
      }
1096808
def homepage():
    """"""
    if current_user.is_authenticated():
        if not login_fresh():
            logging.debug('User needs a fresh token')
            abort(login.needs_refresh())

        auth.claim_invitations(current_user)

    build_list = operations.UserOps(current_user.get_id()).get_builds()
    return render_template(
        'home.html',
        build_list=build_list,
        show_video_and_promo_text=app.config['SHOW_VIDEO_AND_PROMO_TEXT'])
546752
function Multipanel( canvas, width, height, left, top ) {
		var multipanel,
			data = [],
			edges,
			xValue = function( d ) { return d[ 0 ]; },
			yValue = function( d ) { return d[ 1 ]; },
			yMax = 0, _yMax,
			graphs, histogram,
			annotations, title, text;

		// [1] Instantiate a new multipanel generator and configure:
		multipanel = xfig.multipanel( canvas )
			.width( width )
			.height( height )
			.position({
				'left': left,
				'top': top
			});

		// Get data:
		d3.json( 'data/multipanel.data.json', function ( error, json ) {

			// [2] For each panel dataset, instantiate a new data generator and configure:
			for ( var i = 0; i < json.length; i++ ) {

				data.push(
					xfig.data( json[ i ] )
						.accessors( 'x', xValue )
						.accessors( 'y', yValue )
				);

				// Create edges to define our histogram bins:
				edges = xfig.vector.linspace( -0.025, 1.025, 0.05 );
			
				// Format the data and histogram the data:
				data[ i ].format( [ 'x', 'y' ] )
					.histc( yValue, edges );

				// Compute the yMax:
				_yMax = data[ i ].max( yValue );
				yMax = ( yMax < _yMax ) ? _yMax : yMax;

			} // end FOR i

			// Bind the data instance to the multipanel:
			multipanel.data( data )
				.rows( 3 )
				.cols( 1 )
				.xMin( 0 )
				.xMax( 1 )
				.yMin( 0 )
				.yMax( yMax )
				.yLabel( 'counts' );

			// Create the multipanel:
			multipanel.create();

			// [3] Instantiate a new annotations generator and configure:
			annotations = xfig.annotations( multipanel );

			// Create the annotations element:
			annotations.create();

			// [3.1] Instantiate a new title instance and configure:
			title = annotations.title()
				.top( -30 )
				.left( 250 );

			// Add a (sub)title:
			title.create( 'Subtitle' );

			// [4] For each panel graph, instantiate a new histogram generator and configure:
			graphs = multipanel.children().graph;
			for ( var j = 0; j < graphs.length; j++ ) {

				histogram = xfig.histogram( graphs[ j ] )
					.labels( [ 'data ' + j ] );

				// Create the histogram:
				histogram.create();

				// Instantiate a new annotations generator and configure:
				annotations = xfig.annotations( graphs[ j ] );

				// Create the annotations element:
				annotations.create();

				// Instantiate a new text instance and configure:
				text = annotations.text()
					.width( 200 )
					.height( 100 )
					.top( 50 )
					.left( 310 );

				// Add a text annotation:
				text.create( 'This is a description of <span class="italic">condition ' + (j+1) + '</span>.' );

			} // end FOR j

		});

	}
322612
function() {
		/**
	     * @property helpPanel
	     * @type {YAHOO.widget.Panel}
	     */
	    this.helpPanel = new widget.Panel('helpPanel', {
	        fixedcenter: true,
	        draggable: true,
	        visible: false,
	        modal: true
	     });
	     this.helpPanel.render();
	}
1300303
def setup_page(self):
        """"""
        settings_group = QGroupBox(_("Settings"))
        hist_spin = self.create_spinbox(
                            _("History depth: "), _(" entries"),
                            'max_entries', min_=10, max_=10000, step=10,
                            tip=_("Set maximum line count"))

        sourcecode_group = QGroupBox(_("Source code"))
        wrap_mode_box = self.create_checkbox(_("Wrap lines"), 'wrap')
        linenumbers_mode_box = self.create_checkbox(_("Show line numbers"),
                                                    'line_numbers')
        go_to_eof_box = self.create_checkbox(
                        _("Scroll automatically to last entry"), 'go_to_eof')

        settings_layout = QVBoxLayout()
        settings_layout.addWidget(hist_spin)
        settings_group.setLayout(settings_layout)

        sourcecode_layout = QVBoxLayout()
        sourcecode_layout.addWidget(wrap_mode_box)
        sourcecode_layout.addWidget(linenumbers_mode_box)
        sourcecode_layout.addWidget(go_to_eof_box)
        sourcecode_group.setLayout(sourcecode_layout)

        vlayout = QVBoxLayout()
        vlayout.addWidget(settings_group)
        vlayout.addWidget(sourcecode_group)
        vlayout.addStretch(1)
        self.setLayout(vlayout)