Internal interface to the flat page view.
324985
def render_flatpage(request, f):
    
    # If registration is required for accessing this page, and the user isn't
    # logged in, redirect to the login page.
    if f.registration_required and not request.user.is_authenticated():
        from django.contrib.auth.views import redirect_to_login
        return redirect_to_login(request.path)
    if f.template_name:
        t = loader.select_template((f.template_name, DEFAULT_TEMPLATE))
    else:
        t = loader.get_template(DEFAULT_TEMPLATE)

    # To avoid having to always use the "|safe" filter in flatpage templates,
    # mark the title and content as already safe (since they are raw HTML
    # content in the first place).
    f.title = mark_safe(f.title)
    f.content = mark_safe(f.content)

    response = HttpResponse(t.render({
        'flatpage': f
    }, request))

    try:
        from django.core.xheaders import populate_xheaders
        populate_xheaders(request, response, FlatPage_i18n, f.id)
    except ImportError:
        pass
    return response
1040312
public void setHasTitlePage() {
        if(this.mode == MODE_SINGLE) {
            this.mode = MODE_MULTIPLE;
            headerFirst = new RtfHeaderFooter(this.document, headerAll, RtfHeaderFooter.DISPLAY_FIRST_PAGE);
            headerFirst.setType(this.type);
        }
    }
1019869
private void showGridView() {
        gridView = contentContainer.findViewById(R.id.bottom_sheet_grid_view);

        if (gridView != null) {
            contentContainer.setVisibility(View.VISIBLE);

            if (getStyle() == Style.GRID) {
                int horizontalPadding = getContext().getResources()
                        .getDimensionPixelSize(R.dimen.bottom_sheet_grid_item_horizontal_padding);
                int paddingBottom = getContext().getResources()
                        .getDimensionPixelSize(R.dimen.bottom_sheet_grid_padding_bottom);
                gridView.setPadding(horizontalPadding, 0, horizontalPadding, paddingBottom);
                gridView.setNumColumns(GridView.AUTO_FIT);
                gridView.setColumnWidth(getContext().getResources()
                        .getDimensionPixelSize(R.dimen.bottom_sheet_grid_item_size));
            } else {
                int paddingBottom = getContext().getResources()
                        .getDimensionPixelSize(R.dimen.bottom_sheet_list_padding_bottom);
                gridView.setPadding(0, 0, 0, paddingBottom);
                gridView.setNumColumns(getStyle() == Style.LIST_COLUMNS &&
                        (getDeviceType(getContext()) == DisplayUtil.DeviceType.TABLET ||
                                getOrientation(getContext()) == DisplayUtil.Orientation.LANDSCAPE) ?
                        2 : 1);
            }

            gridView.setOnItemClickListener(createItemClickListener());
            gridView.setOnItemLongClickListener(createItemLongClickListener());
            gridView.setAdapter(adapter);
        }
    }
11493
def interact_plain(header=UP_LINE, local_ns=None,
                   module=None, dummy=None,
                   stack_depth=1, global_ns=None):
    
    frame = sys._getframe(stack_depth)

    variables = {}

    if local_ns is not None:
        variables.update(local_ns)
    else:
        variables.update(frame.f_locals)

    if global_ns is not None:
        variables.update(local_ns)
    else:
        variables.update(frame.f_globals)

    shell = code.InteractiveConsole(variables)
    return shell.interact(banner=header)
1022751
function OutputView(outputData, outputTerminal) {
  this.outputData = outputData;
  this.outputTerminal = outputTerminal;

  this.url = util.createUrlLookup(module);

  // Elements attached to this by template().
  this.elems = {
    rowin: null,
    rowout: null,
    hide: null,
    show: null,
    duration: null,
    throb: null,
    prompt: null
  };

  var template = this.outputTerminal.template.cloneNode(true);
  domtemplate.template(template, this, this.outputTerminal.templateOptions);

  this.outputTerminal.element.appendChild(this.elems.rowin);
  this.outputTerminal.element.appendChild(this.elems.rowout);

  this.outputData.onClose.add(this.closed, this);
  this.outputData.onChange.add(this.changed, this);
}
321580
public void navigateHandlerView() {
        // if endpoint tab
        if (tabLayoutpanel.getSelectedIndex() == 1) {
            if (endpointHandlerPages.getPage() == 0)
                endpointHandlerPages.showPage(1);
        // else the client tab
        } else if (tabLayoutpanel.getSelectedIndex() == 2) {
            if (clientHandlerPages.getPage() == 0)
                clientHandlerPages.showPage(1);
        }
    }
1193605
function staticViews (router, options) {
  if (!options) {
    return
  }

  Object.keys(options).filter(urlPath => options[urlPath]).forEach((urlPath) => {
    const filePath = options[urlPath]

    router.get(urlPath, (req, res) => {
      res.render(filePath)
    })
  })
}
835676
function View(bytes, elementType) {
    if (!(this instanceof View))
        return new View(bytes, elementType);
    this.bytes = bytes;
    this.elementType = elementType;
}
124820
public function View ()
	{
		
		// If there is no view then use basic by default
		
		if (!$this->view)
		{
			$this->view		= new View\Basic;
		}
		
		// If there is no template then set default
		
		if (!$this->template)
		{
			$this->template	= $this->view->defaultTemplate ($this->module, $this->controller, $this->action);
		}

		// Assign controller reference

		$this->view->assign ('controller', $this);

		// Display view
		
		$this->view->display ($this->template);
		
	}
772945
def pretty_view(graph, oriented=False, construction=False,
                graphviz_prog=DEFAULT_GRAPHVIZ_PROG):
    """"""
    layout = create_layout(graph, graphviz_prog=graphviz_prog)
    matrix_view = defaultdict(lambda: ' ')

    # Add the edge to the view

    # print('GRAPH EDGES:', tuple(graph.edges()))
    # print('LAYOUT:', layout)

    edges = ((layout[source], layout[target])
             for source, target in graph.edges())
    # print('EDGES:', tuple(edges))

    for source, target in edges:
        previous_edge_char = None
        previous_position = source
        while source != target:
            for is_dir, transform, edge_char in DIRECTIONS:
                first_loop = previous_edge_char is None
                if is_dir(source, target):
                    previous_source = source
                    source = transform(source)
                    if not first_loop:  # first loop: no previous char
                        char = CHARACTER[previous_edge_char, edge_char]
                        if not isinstance(char, str):
                            char = char.value
                        matrix_view[previous_source] = char
                        if construction:
                            old = defaultdict(lambda: ' ', matrix_view)
                            yield view.build(matrix_view)
                        assert isinstance(matrix_view[previous_source], str)
                    if source != target:
                        previous_edge_char = edge_char
                    previous_position = previous_source
                    break  # for loop ; don't test the remain directions

        if oriented:
            matrix_view[previous_position] = ORIENTATION[previous_edge_char, edge_char]
        if construction:
            yield view.build(matrix_view)

    # mark the place where nodes labels will be added
    # for node, coords in layout.items():
        # matrix_view[coords] = node[0]
    # Add the node labels to the view
    # matrix_view = view.clean(matrix_view)
    for node, (x, y) in layout.items():
        if len(node) == 1:
            matrix_view[x, y] = node
            continue
        row_min, row_max = (view.previous_unwrittable_on_row(matrix_view, (x, y)),
                            view.next_unwrittable_on_row(matrix_view, (x, y)))
        col_min, col_max = (view.previous_unwrittable_on_col(matrix_view, (x, y)),
                              view.next_unwrittable_on_col(matrix_view, (x, y)))
        # print('NODE ' + node + ':',
              # '→row: [{};{}]'.format(row_min, row_max).ljust(20),
              # '↓col: [{};{}]'.format(col_min, col_max))
        print_coords = [itertools.count(x), itertools.cycle((y,))]
        if row_min is None:  # write left to right, end at (x, y)
            if row_max is None or row_max > (x + len(node) / 2):  # enough space at the right
                factor = 2
            else:
                factor = 1
            print_coords[0] = tuple(
                x - (len(node) // factor) + offset + 1
                for offset in range(len(node))
            )
            # print('DEBUG 1:', y, len(node), print_coords[0])
        elif row_max is None:  # write left to right, beginning at (x, y)
            if row_min < (x - len(node) / 2):  # enough space at the left
                factor = 1
            else:
                factor = 0
            print_coords[0] = tuple(
                x + offset - (len(node) // 2) * factor
                for offset in range(len(node))
            )
            # print('DEBUG 2:', print_coords[0])
        elif (row_max - row_min) > len(node) + 1:  # write left to right, if enough place
            print_coords[0] = tuple(
                x + offset
                for offset in range(len(node))
            )
            # print('DEBUG 3:', print_coords[0])

        elif col_min is None:  # write up to down, end at (x, y)
            if col_max is None or col_max > (x + len(node) / 2):  # enough space at the right
                factor = 2
            else:
                factor = 1
            print_coords = (itertools.cycle((x,)), tuple(
                y - (len(node) // factor) + offset + 1
                for offset in range(len(node))
            ))
            # print('DEBUG 4:', y, len(node), print_coords[1])
        elif col_max is None:  # write up to down, beginning at (x, y)
            if col_min < (x - len(node) / 2):  # enough space at the left
                factor = 1
            else:
                factor = 0
            print_coords = (itertools.cycle((x,)), tuple(
                y + offset - (len(node) // 2) * factor
                for offset in range(len(node))
            ))
            # print('DEBUG 5:', print_coords[1])
        elif (col_max - col_min) > len(node) + 1:  # write up to down, if enough place
            print_coords = (itertools.cycle((x,)), tuple(
                y + offset
                for offset in range(len(node))
            ))
            # print('DEBUG 6:', print_coords[1])
        else:  # not enough space
            if (row_max - row_min) > (col_max - col_min):
                # more space on Y axis
                node = node[:row_max - row_min]  # cut the node
                print_coords = (itertools.cycle((x,)), tuple(
                    x + offset
                    for offset in range(len(node))
                ))
                # print('DEBUG 7:', print_coords[1])
            else:
                # more space on X axis
                node = node[:col_max - col_min]  # cut the node
                print_coords[0] = tuple(
                    x + offset
                    for offset in range(len(node))
                )
                # print('DEBUG 8:', print_coords[0])

        for letter, i, j in zip(node, *print_coords):
            matrix_view[i, j] = letter




    if construction:
        yield view.build(matrix_view)
    else:
        yield from view.build(matrix_view)
463528
def aspage(self):
        """"""
        if self.offset is None:
            raise ValueError('cannot return virtual frame as page.')
        self.parent.filehandle.seek(self.offset)
        return TiffPage(self.parent, index=self.index)
694522
public static void addViewToFrame(final JInternalFrame internalFrame, final View<?, ?> view)
	{
		internalFrame.add(view.getComponent(), BorderLayout.CENTER);
		internalFrame.pack();
	}
1017360
public void init(IPageBookViewPage page, IConsole console)
	{
		fPage = page;
		fConsole = (VdmDebugConsole) console;

		// fRemoveTerminated = new ConsoleRemoveLaunchAction(fConsole.getProcess().getLaunch());
		// fRemoveAllTerminated = new ConsoleRemoveAllTerminatedAction();
		fTerminate = new ConsoleTerminateAction(page.getSite().getWorkbenchWindow(), fConsole);
		// fStdOut = new ShowStandardOutAction();
		// fStdErr = new ShowStandardErrorAction();

		fView = (IConsoleView) fPage.getSite().getPage().findView(IConsoleConstants.ID_CONSOLE_VIEW);

		DebugPlugin.getDefault().addDebugEventListener(this);
		DebugUITools.getDebugContextManager().getContextService(fPage.getSite().getWorkbenchWindow()).addDebugContextListener(this);

		// contribute to toolbar
		IActionBars actionBars = fPage.getSite().getActionBars();
		configureToolBar(actionBars.getToolBarManager());

		// create handler and submissions for EOF
		fEOFHandler = new EOFHandler();
	}
979319
def user_view_prj(self, ):
        
        i = self.user_prj_tablev.currentIndex()
        item = i.internalPointer()
        if item:
            prj = item.internal_data()
            self.view_prj(prj)
1222105
public function showStylesheetView()
    {
        $this->subMenu['stylesheet']['active'] = true;

        Session::flash('redirect_to', $this->subMenu['stylesheet']['url']);

        return View::make('dashboard.settings.stylesheet')
            ->withPageTitle(trans('dashboard.settings.stylesheet.stylesheet').' - '.trans('dashboard.dashboard'))
            ->withSubMenu($this->subMenu);
    }
1014665
public void displayPage (final int page, boolean forceRefresh)
    {
        if (_page == page && !forceRefresh) {
            return; // NOOP!
        }

        // Display the now loading widget, if necessary.
        configureLoadingNavi(_controls, 0, _infoCol);

        _page = Math.max(page, 0);

        final boolean overQuery = (_model.getItemCount() < 0);
        final int count = _resultsPerPage;
        final int start = _resultsPerPage * page;
        _model.doFetchRows(start, overQuery ? (count + 1) : count, new AsyncCallback<List<T>>() {
            public void onSuccess (List<T> result) {
                if (overQuery) {
                    // if we requested 1 item too many, see if we got it
                    if (result.size() < (count + 1)) {
                        // no: this is the last batch of items, woohoo
                        _lastItem = start + result.size();
                    } else {
                        // yes: strip it before anybody else gets to see it
                        result.remove(count);
                        _lastItem = -1;
                    }
                } else {
                    // a valid item count should be available at this point
                    _lastItem = _model.getItemCount();
                }
                displayResults(start, count, result);
            }
            public void onFailure (Throwable caught) {
                reportFailure(caught);
            }
        });
    }
971522
function(view) {
    if (view.options.layoutApplied) {
      return view;
    }

    // handle pre-layout middleware
    this.handle('preLayout', view);

    var opts = {};
    lazy.extend(opts, this.options);
    lazy.extend(opts, view.options);
    lazy.extend(opts, view.context());

    // get the layout stack
    var stack = {};
    var alias = this.viewTypes.layout;
    var len = alias.length, i = 0;

    while (len--) {
      var views = this.views[alias[i++]];
      for (var key in views) {
        var val = views[key];
        if (views.hasOwnProperty(key) && typeof val !== 'function' && val.path) {
          stack[key] = val;
        }
      }
    }

    // get the name of the first layout
    var name = view.layout;
    var str = view.content;
    var self = this;

    if (!name) return view;

    // Handle each layout before it's applied to a view
    function handleLayout(layoutObj) {
      view.currentLayout = layoutObj.layout;
      self.handle('onLayout', view);
      delete view.currentLayout;
    }

    // actually apply the layout
    var res = lazy.layouts(str, name, stack, opts, handleLayout);

    view.option('layoutStack', res.history);
    view.option('layoutApplied', true);
    view.content = res.result;

    // handle post-layout middleware
    this.handle('postLayout', view);
    return view;
  }