renders an selection by looking at its type and selecting the transform from the list
493832
function transformer (selection) {
    const type = quantum.isSelection(selection) ? selection.type() : undefined
    const entityTransform = transformMap[type] || defaultTransform
    return entityTransform(selection, transformer, meta) // bootstrap to itself to  make the transformer accessible to children
  }
1292005
function renderList() {
        var recentProjects = getRecentProjects(),
            currentProject = FileUtils.stripTrailingSlash(ProjectManager.getProjectRoot().fullPath),
            templateVars   = {
                projectList : [],
                Strings     : Strings
            };

        recentProjects.forEach(function (root) {
            if (root !== currentProject) {
                templateVars.projectList.push(parsePath(root));
            }
        });

        return Mustache.render(ProjectsMenuTemplate, templateVars);
    }
769874
function render(element, opts) {
    opts = opts || {};

    var prepend = opts.prepend;
    var model = opts.model || {};
    var indentLevel = opts.indentLevel || 0;
    var isPretty = opts.isPretty;
    var jtPrintIndent = isPretty ? '\t' : '';
    var jtPrintNewline = isPretty ? '\n' : '';
    var indent = '', i, len, prop;
    var p = [];  // p is going to be our concatenator for the HTML string

    // if no element, then no HTML so return empty string
    if (!element) { return ''; }

    // if already a string, just return it
    if (utils.isString(element)) { return element; }

    // if an array, wrap it
    if (utils.isArray(element)) { element = naked(element, null); }

    // set the indentation level to the current indent
    if (isPretty && indentLevel) {
        for (i = 0; i < indentLevel; i++) {
            indent += jtPrintIndent;
        }
    }

    // if we are prepending some string, add it first
    if (prepend) {
        p.push(indent, prepend, jtPrintNewline);
    }

    // starting tag open
    if (element.tag) {
        p.push(indent, '<', element.tag);
    }

    // all tag attributes
    if (element.attributes) {
        for (prop in element.attributes) {
            if (element.attributes.hasOwnProperty(prop)) {

                if (element.attributes[prop] === null) {
                    p.push(' ', prop);
                }
                else {
                    p.push(' ', prop, '="', element.attributes[prop], '"');
                }
            }
        }
    }

    // if no children or text, then close the tag
    if (element.tag && !element.children && (element.text === undefined || element.text === null)) {

        // for self closing we just close it, else we add the end tag
        if (selfClosing.indexOf(element.tag) > -1) {
            p.push('/>', jtPrintNewline);
        }
        else {
            p.push('></', element.tag, '>', jtPrintNewline);
        }
    }
    // else we need to add children or the inner text
    else {

        // if a tag (i.e. not just a string literal) put end bracket
        if (element.tag) { p.push('>'); }

        // if children, we will need to recurse
        if (element.children) {
            if (element.tag) { p.push(jtPrintNewline); }

            // recurse down for each child
            for (i = 0, len = element.children.length; i < len; ++i) {
                p.push(render(element.children[i], {
                    indentLevel:    element.tag ? indentLevel + 1 : indentLevel,
                    isPretty:       isPretty,
                    model:          model
                }));
            }

            if (element.tag) { p.push(indent); }
        }

        // if text, simply add it
        if (element.text !== null && element.text !== undefined) { p.push(element.text); }

        // finally if a tag, add close tag
        if (element.tag) {
            p.push('</', element.tag, '>', jtPrintNewline);
        }
    }

    return p.join('');
}
1293570
private <T> Collection<Integer> transformSelect(SelectTransformation<T> select) {
		StreamTransformation<T> input = select.getInput();
		Collection<Integer> resultIds = transform(input);

		// the recursive transform might have already transformed this
		if (alreadyTransformed.containsKey(select)) {
			return alreadyTransformed.get(select);
		}

		List<Integer> virtualResultIds = new ArrayList<>();

		for (int inputId : resultIds) {
			int virtualId = StreamTransformation.getNewNodeId();
			streamGraph.addVirtualSelectNode(inputId, virtualId, select.getSelectedNames());
			virtualResultIds.add(virtualId);
		}
		return virtualResultIds;
	}
875552
function renderList (
  val,
  render
) {
  var ret, i, l, keys, key;
  if (Array.isArray(val) || typeof val === 'string') {
    ret = new Array(val.length);
    for (i = 0, l = val.length; i < l; i++) {
      ret[i] = render(val[i], i);
    }
  } else if (typeof val === 'number') {
    ret = new Array(val);
    for (i = 0; i < val; i++) {
      ret[i] = render(i + 1, i);
    }
  } else if (isObject(val)) {
    if (hasSymbol && val[Symbol.iterator]) {
      ret = [];
      var iterator = val[Symbol.iterator]();
      var result = iterator.next();
      while (!result.done) {
        ret.push(render(result.value, ret.length));
        result = iterator.next();
      }
    } else {
      keys = Object.keys(val);
      ret = new Array(keys.length);
      for (i = 0, l = keys.length; i < l; i++) {
        key = keys[i];
        ret[i] = render(val[key], key, i);
      }
    }
  }
  if (!isDef(ret)) {
    ret = [];
  }
  (ret)._isVList = true;
  return ret
}
570385
function render() {
  var content = $($.parseHTML(template));
  var compiler = Handlebars.compile(content.filter("#layout").html());

  Handlebars.registerPartial({
    leftPanel: content.filter("#left-panel").html(),
    rightPanel: content.filter("#right-panel").html(),
    transactionList: content.filter("#transaction-list").html(),
    transactionDetails: content.filter("#transaction-details").html(),
    transactionOther: content.filter("#transaction-other").html(),
  });

  // Adds selected class to selected transaction item.
  Handlebars.registerHelper('isSelected', function(options) {
    var resp =
      (this.business === dataView.selectedTransaction.business) ?
      "selected" : "";
    return options.fn(resp);
  });

  // Returns fake detail monthly total.
  Handlebars.registerHelper('monthlyTotal', function(options) {
    var total = toCurrency(parseFloat(this.selectedTransaction.amount) * 12);
    return options.fn(total);
  });

  // Returns fake detail yearly total.
  Handlebars.registerHelper('yearlyTotal', function(options) {
    var total = toCurrency(parseFloat(this.selectedTransaction.amount) * 40);
    return options.fn(total);
  });

  var html = compiler(dataView);
  $("#demo-app").html(html);

  addClickHandler();
}
361883
function selectItem(editor, model, getItemRange) {
	editor.transact(() => {
		const selections = editor.getSelectedBufferRanges()
		.map(anchor => getItemRange(model, anchor) || anchor);

		editor.setSelectedBufferRanges(selections);
	});
}
580225
function ListView_updateSelection() {
                    var indices = this._selection.getIndices(),
                        selectAll = this._selection.isEverything(),
                        selectionMap = {};

                    if (!selectAll) {
                        for (var i = 0, len = indices.length ; i < len; i++) {
                            var index = indices[i];
                            selectionMap[index] = true;
                        }
                    }

                    this._view.items.each(function (index, element, itemData) {
                        if (itemData.itemBox) {
                            var selected = selectAll || !!selectionMap[index];
                            _ItemEventsHandler._ItemEventsHandler.renderSelection(itemData.itemBox, element, selected, true);
                            if (itemData.container) {
                                _ElementUtilities[selected ? "addClass" : "removeClass"](itemData.container, _Constants._selectedClass);
                            }
                        }
                    });
                }
748976
def render(self, context, nodelist, box_type):
        "  "
        if not self.target:
            if self.target_ct:
                # broken Generic FK:
                log.warning('Broken target for position with pk %r', self.pk)
                return ''
            try:
                return Template(self.text, name="position-%s" % self.name).render(context)
            except TemplateSyntaxError:
                log.error('Broken definition for position with pk %r', self.pk)
                return ''

        if self.box_type:
            box_type = self.box_type
        if self.text:
            nodelist = Template('%s\n%s' % (nodelist.render({}), self.text),
                name="position-%s" % self.name).nodelist

        b = self.box_class(self, box_type, nodelist)
        return b.render(context)
96438
function () {
    var draw = this.el.components.draw;
    var selector = this.data.asset;
    var width = draw.data.width;
    var height = draw.data.height;

    if (this.rendering) {
      return;
    }

    this.rendering = true;

    var node = document.querySelector(selector);

    if (!node) {
      console.error('Could not find html element with selector "' + selector + '"');
      return;
    }

    if (!this.observer) {
      this.observer = new MutationObserver(function (mutations) {
        queueRender(node, width, height, function (canvas) {
          renderedCanvas = canvas;
          draw.render();
        });
      });

      var config = { attributes: true, childList: true, characterData: true, subtree: true };
      this.observer.observe(node, config);
    }

    queueRender(node, width, height, function (canvas) {
      renderedCanvas = canvas;
      draw.render();
    });
  }
1285400
function renderComponent() {
    d3.select('svg')
      .datum(svgData)
      .call(crosshairSvg)
      .on('mousemove', function() {
          var point = d3.mouse(this);
          svgData[0] = { x: point[0], y: point[1] };
          render();
      });

    var canvas = d3.select('canvas').node();
    var ctx = canvas.getContext('2d');
    ctx.clearRect(0, 0, canvas.width, canvas.height);
    crosshairCanvas.context(ctx)(canvasData);
    canvas.onmousemove = function({ offsetX, offsetY }) {
        canvasData[0] = { x: offsetX, y: offsetY };
        render();
    };
}
131773
private static <T> List<T> filterSelection(Class<T> clazz,
      IStructuredSelection selection) {
    List<T> list = new ArrayList<T>();
    for (Object obj : selection.toList()) {
      if (clazz.isAssignableFrom(obj.getClass())) {
        list.add((T) obj);
      }
    }
    return list;
  }
881195
def select(self, html, stype, expression):
        """"""
        etree = html5lib.parse(html,
                               treebuilder='lxml',
                               namespaceHTMLElements=False)
        if stype == 'css':
            selector = lxml.cssselect.CSSSelector(expression)
            frag = list(selector(etree))
        else:
            frag = etree.xpath(expression)
        if not frag:
            raise RuntimeError("Nothing found for: %s" % expression)
        return "".join([lxml.etree.tostring(x) for x in frag])
432634
def render( self, tag, single, between, kwargs ):
        """"""

        out = "<%s" % tag
        for key, value in list( kwargs.items( ) ):
            if value is not None:               # when value is None that means stuff like <... checked>
                key = key.strip('_')            # strip this so class_ will mean class, etc.
                if key == 'http_equiv':         # special cases, maybe change _ to - overall?
                    key = 'http-equiv'
                elif key == 'accept_charset':
                    key = 'accept-charset'
                out = "%s %s=\"%s\"" % ( out, key, escape( value ) )
            else:
                out = "%s %s" % ( out, key )
        if between is not None:
            out = "%s>%s</%s>" % ( out, between, tag )
        else:
            if single:
                out = "%s />" % out
            else:
                out = "%s>" % out
        if self.parent is not None:
            self.parent.content.append( out )
        else:
            return out
320588
protected void renderOptions(FacesContext context, ResponseWriter rw, SelectOneMenu menu) throws IOException {
		Converter converter = menu.getConverter();
		List<SelectItemAndComponent> items = SelectItemUtils.collectOptions(context, menu, converter);
		
		SelectItemAndComponent selection = determineSelectedItem(context, menu, items, converter);

		for (int index = 0; index < items.size(); index++) {
			SelectItemAndComponent option = items.get(index);

			if (option.getSelectItem().isNoSelectionOption() && 
					menu.isHideNoSelectionOption() && selection != null)
				continue;
			
			renderOption(context, menu, rw, (option.getSelectItem()), index, option.getComponent(), 
					option == selection || (selection == null && option.getSelectItem().isNoSelectionOption()));
		}
	}
156110
def draw_widget(self, item):
        """"""
        if item:
            self.filter_remove(remember=True)
            selected_id = self.treedata[item]['id']
            item = self.get_toplevel_parent(item)
            widget_id = self.treedata[item]['id']
            wclass = self.treedata[item]['class']
            xmlnode = self.tree_node_to_xml('', item)
            self.previewer.draw(item, widget_id, xmlnode, wclass)
            self.previewer.show_selected(item, selected_id)
            self.filter_restore()
359244
def _render(self):
        
        # hide the list in case that there is no `keyword` to be displayed
        if self.keywords:
            self.whole_el.style.display = "block"
            self.all_lists_el.style.display = "block"
        else:
            self.whole_el.style.display = "none"
            if "<li>" not in self.all_lists_el.html:
                self.all_lists_el.style.display = "none"

        # construct the HTML code for each keyword
        html_lines = (
            "<li class='kw_enum'>{0} {1}</li>\n".format(
                keyword,
                (self._remover % cnt)
            )
            for cnt, keyword in enumerate(self.keywords)
        )

        # put the keywords into the HTML code of the page
        self.el.innerHTML = "<ol>\n%s\n</ol>\n" % "\n".join(html_lines)

        # this function is used to bind the ✖ to function for removing the
        # keyword
        def keyword_remover(keyword):
            def remover(ev):
                self.remove_keyword(keyword)

            return remover

        # go thru all the keywords and bind them to keyword_remover()
        for cnt, keyword in enumerate(self.keywords):
            uid = "kw_remover_id_%d" % cnt
            el = document[uid]
            el.bind("click", keyword_remover(keyword))