Function for rendering list choices
@param  {Number} pointer Position of the pointer
@return {String}         Rendered content
357282
function listRender (choices, pointer) {
  var output = '';
  var separatorOffset = 0;

  choices.forEach(function (choice, i) {
    if (choice.type === 'separator') {
      separatorOffset++;
      output += '  ' + choice + '\n';
      return;
    }

    var isSelected = (i - separatorOffset === pointer);
    var line = (isSelected ? figures.pointer + ' ' : '  ') + choice.name;
    if (isSelected) {
      line = chalk.cyan(line);
    }
    output += line + ' \n';
  });

  return output.replace(/\n$/, '');
}
199742
function printList(serialList) {
  menu = createSelect();
  var title = createElement('option', 'Choose a port:');
  menu.child(title);
  menu.position(10, 10);
  menu.changed(openPort);
  for (var i = 0; i < serialList.length; i++) {
    var thisOption = createElement('option', serialList[i]);
    thisOption.value = serialList[i];
    menu.child(thisOption);
    println(i + " " + serialList[i]);
  }
}
516599
function list(options) {
  return function (req, res) {
    let list,
      listOptions = _.assign({
        prefix: req.uri,
        values: false
      }, options);

    list = db.list(listOptions);

    res.set('Content-Type', 'application/json');
    list.pipe(res);
  };
}
656080
function render() {
  var createNodes = require("./create-nodes");
  var createClusters = require("./create-clusters");
  var createEdgeLabels = require("./create-edge-labels");
  var createEdgePaths = require("./create-edge-paths");
  var positionNodes = require("./position-nodes");
  var positionEdgeLabels = require("./position-edge-labels");
  var positionClusters = require("./position-clusters");
  var shapes = require("./shapes");
  var arrows = require("./arrows");

  var fn = function(svg, g) {
    preProcessGraph(g);

    var outputGroup = createOrSelectGroup(svg, "output");
    var clustersGroup = createOrSelectGroup(outputGroup, "clusters");
    var edgePathsGroup = createOrSelectGroup(outputGroup, "edgePaths");
    var edgeLabels = createEdgeLabels(createOrSelectGroup(outputGroup, "edgeLabels"), g);
    var nodes = createNodes(createOrSelectGroup(outputGroup, "nodes"), g, shapes);

    layout(g);

    positionNodes(nodes, g);
    positionEdgeLabels(edgeLabels, g);
    createEdgePaths(edgePathsGroup, g, arrows);

    var clusters = createClusters(clustersGroup, g);
    positionClusters(clusters, g);

    postProcessGraph(g);
  };

  fn.createNodes = function(value) {
    if (!arguments.length) return createNodes;
    createNodes = value;
    return fn;
  };

  fn.createClusters = function(value) {
    if (!arguments.length) return createClusters;
    createClusters = value;
    return fn;
  };

  fn.createEdgeLabels = function(value) {
    if (!arguments.length) return createEdgeLabels;
    createEdgeLabels = value;
    return fn;
  };

  fn.createEdgePaths = function(value) {
    if (!arguments.length) return createEdgePaths;
    createEdgePaths = value;
    return fn;
  };

  fn.shapes = function(value) {
    if (!arguments.length) return shapes;
    shapes = value;
    return fn;
  };

  fn.arrows = function(value) {
    if (!arguments.length) return arrows;
    arrows = value;
    return fn;
  };

  return fn;
}
1079437
public static Result list(int page, String sortBy, String order, String filter) {
        return ok(
            list.render(
                Computer.page(page, 10, sortBy, order, filter),
                sortBy, order, filter
            )
        );
    }
842819
function _render_select(){

	var buf = new Array();

	//
	buf.push('<select id="');
	buf.push(anchor.mid);
	buf.push('" name="');
	buf.push(anchor.mname);
	buf.push('" multiple size="');
	buf.push(anchor.msize);
	buf.push('">');
	
	buf.push(_render_option());

	//
	buf.push('</select>');

	return buf.join('');
    }
180851
function renderChoices(choices, pointer) {
  var output = '';
  var separatorOffset = 0;

  choices.forEach(function(choice, i) {
    output += '\n  ';

    if (choice.type === 'separator') {
      separatorOffset++;
      output += ' ' + choice;
      return;
    }

    var index = i - separatorOffset;
    var display = (index + 1) + ') ' + choice.name;
    if (index === pointer) {
      display = utils.chalk.cyan(display);
    }
    output += display;
  });

  return output;
}
188861
function render(drizzleData) {
  return Promise.all([
    renderPages(drizzleData),
    renderCollections(drizzleData)
  ]).then(
    allData => {
      return {
        data: drizzleData.data,
        pages: allData[0],
        patterns: allData[1],
        templates: drizzleData.templates,
        options: drizzleData.options,
        tree: drizzleData.tree
      };
    },
    error => DrizzleError.error(error, drizzleData.options.debug)
  );
}
1056296
function renderChoices( pointer ) {
  var output = "";
  var separatorOffset = 0;

  this.choices.forEach(function( choice, i ) {
    if ( choice.type === "separator" ) {
      separatorOffset++;
      output += " " + choice + "\n";
      return;
    }

    if ( choice.disabled ) {
      separatorOffset++;
      output += " - " + choice.name;
      output += " (" + (_.isString(choice.disabled) ? choice.disabled : "Disabled") + ")";
    } else {
      var isSelected = (i - separatorOffset === pointer);
      output += isSelected ? chalk.cyan(utils.getPointer()) : " ";
      output += utils.getCheckbox( choice.checked, choice.name );
    }

    output += "\n";
  }.bind(this));

  return output.replace(/\n$/, "");
}
536564
function drawGameList(games) {
    $(GAMES).empty();
    var thead = "<th>Game Room</th><th>Players</th><th></th>";
    for (var i in games) {
        if (!games.hasOwnProperty(i)) {
            continue;
        }
        var name = games[i].name;
        var numplayers = Object.keys(games[i].players).length;
        var full = "";
        var node = $("<td>" + esc(name) + "</td>")[0];
        if (numplayers < PLAYERLMT) {
            // only allow joining rooms if player limit is not met
            node = $("<td><a href='#game_room'>" + esc(name) + "</a></td>")[0];
            node.onclick = function (name) {
                // nested function to capture name in a closure
                return function() {
                    $.cookie('game', name);
                    clearTimeout(GETGAMESTID);
                    location.reload();
                };
            }(name);
        } else {
            full = " (full)";
        }
        $(GAMES).append(
            "<tr><td>" + numplayers + full + "</td><td></td></tr>");
        $(GAMES+">tbody>tr:last-child").prepend(node);
    }

    if (!$(GAMES+">*").length) {
        $(NOGAMESMSG).show();
        $(GAMESHR).hide();
    } else {
        $(NOGAMESMSG).hide();
        $(GAMESHR).show();
        $(GAMES).prepend(thead);
    }

    function submit() {
        var gamenm = $(ADDGAME+"> input")[0].value;
        if (!NAMERE.test(gamenm)) {
            if(gamenm) {
                alert("Your input text is too long!");
            }
            return false;
        }
        $.post('/games', {name: gamenm},

               /**
                * @param data: {obj} contains potential random game name,
                *     e.g. {name: <game name>}
                */
               function(data) {
                   // post was succesful, so clear input
                   $(ADDGAME+"> input").val('');
                   $(LOBBY).hide();
                   $(LOADINGGAME).show();

                   var tries = 0;
                   function loadgame() {
                       $.getJSON("/games", function(games) {
                           for (var i in games) {
                               if (!games.hasOwnProperty(i)) {
                                   continue;
                               }
                               if (data.name === games[i].name) {
                                   // game is ready
                                   $.cookie('game', data.name);
                                   location.reload();
                                   return;
                               }
                           }
                           if (++tries > 3) {
                               return;
                           }
                       });
                       setTimeout(loadgame, 1000);
                   }
                   setTimeout(loadgame, 1000);
               });
    }

    // TODO: figure out why jquery click and keydown functions screw this up?
    $(ADDGAME+"> button")[0].onclick = submit;
    $(ADDGAME+"> input")[0].onkeydown = function(event) {
        if (event.keyCode === 13) {
            submit();
        }
    };
}
1030108
function renderChoices(choices, pointer) {
  var output = '';
  var separatorOffset = 0;

  choices.forEach(function(choice, i) {
    if (choice.type === 'separator') {
      separatorOffset++;
      output += ' ' + choice + '\n';
      return;
    }

    if (choice.disabled) {
      separatorOffset++;
      output += ' - ' + choice.name;
      output += ' (' + (typeof choice.disabled === 'string' ? choice.disabled : 'Disabled') + ')';
    } else {
      var isSelected = (i - separatorOffset === pointer);
      output += isSelected ? utils.chalk.cyan(utils.figures.pointer) : ' ';
      output += getCheckbox(choice.checked) + ' ' + choice.name;
    }

    output += '\n';
  });

  return output.replace(/\n$/, '');
}
975192
function (params) {
		var pointerEventsSpec = params.pointerEventsSpec || "all", renderer = {};

		_jp.jsPlumbUIComponent.apply(this, params.originalArgs);
		this.canvas = null;
		this.path = null;
		this.svg = null;
		this.bgCanvas = null;

		var clazz = params.cssClass + " " + (params.originalArgs[0].cssClass || ""),
			svgParams = {
				"style": "",
				"width": 0,
				"height": 0,
				"pointer-events": pointerEventsSpec,
				"position": "absolute"
			};

		this.svg = _node("svg", svgParams);

		if (params.useDivWrapper) {
			this.canvas = jsPlumb.createElement("div", { position : "absolute" });
			_ju.sizeElement(this.canvas, 0, 0, 1, 1);
			this.canvas.className = clazz;
		}
		else {
			_attr(this.svg, { "class": clazz });
			this.canvas = this.svg;
		}

		params._jsPlumb.appendElement(this.canvas, params.originalArgs[0].parent);
		if (params.useDivWrapper) this.canvas.appendChild(this.svg);

		var displayElements = [ this.canvas ];
		this.getDisplayElements = function () {
			return displayElements;
		};

		this.appendDisplayElement = function (el) {
			displayElements.push(el);
		};

		this.paint = function (style, anchor, extents) {
			if (style != null) {

				var xy = [ this.x, this.y ], wh = [ this.w, this.h ], p;
				if (extents != null) {
					if (extents.xmin < 0) xy[0] += extents.xmin;
					if (extents.ymin < 0) xy[1] += extents.ymin;
					wh[0] = extents.xmax + ((extents.xmin < 0) ? -extents.xmin : 0);
					wh[1] = extents.ymax + ((extents.ymin < 0) ? -extents.ymin : 0);
				}

				if (params.useDivWrapper) {
					_ju.sizeElement(this.canvas, xy[0], xy[1], wh[0], wh[1]);
					xy[0] = 0;
					xy[1] = 0;
					p = _pos([ 0, 0 ]);
				}
				else
					p = _pos([ xy[0], xy[1] ]);

				renderer.paint.apply(this, arguments);

				_attr(this.svg, {
					"style": p,
					"width": wh[0] || 0,
					"height": wh[1] || 0
				});
			}
		};

		return {
			renderer: renderer
		};
	}
864945
private int renderOptions(StringBuilder sb, Collection<Option> options) {
        String lpad = OptionUtils.createPadding(getLeftPad());
        String dpad = OptionUtils.createPadding(getDescPad());

        // first create list containing only <lpad>-a,--aaa where 
        // -a is opt and --aaa is long opt; in parallel look for 
        // the longest opt string this list will be then used to 
        // sort options ascending
        int leftWidth = 0;
        List<StringBuilder> lineBufList = new ArrayList<>();
        Collection<Option> optList = options;
        if (optList.size() > 1 && getOptionComparator() != null) {
            List<Option> optList2 = new ArrayList<>(optList);
            optList2.sort(getOptionComparator());
            optList = optList2;
        }
        for (Option option : optList) {
            StringBuilder lineBuf = new StringBuilder();
            if (option.getName() == null) {
                lineBuf.append(lpad).append(LONG_OPTION_PREFIX).append(option.getLongName());
            } else {
                lineBuf.append(lpad).append(OPTION_PREFIX).append(option.getName());
                if (option.hasLongName()) {
                    lineBuf.append(", ").append(LONG_OPTION_PREFIX).append(option.getLongName());
                }
            }
            if (option.hasValue()) {
                String argName = option.getValueName();
                if (argName != null && argName.isEmpty()) {
                    // if the option has a blank arg name
                    lineBuf.append(' ');
                } else {
                    lineBuf.append(option.isWithEqualSign() ? '=' : LONG_OPTION_SEPARATOR);
                    lineBuf.append(ARG_BRACKET_OPEN).append(argName != null ? argName : getArgName()).append(ARG_BRACKET_CLOSE);
                }
            }
            lineBufList.add(lineBuf);
            leftWidth = (lineBuf.length() > leftWidth ? lineBuf.length() : leftWidth);
        }

        if (leftWidth > getMaxLeftWidth()) {
            leftWidth = getMaxLeftWidth();
        }

        int x = 0;
        for (Iterator<Option> it = optList.iterator(); it.hasNext();) {
            Option option = it.next();
            StringBuilder lineBuf = lineBufList.get(x++);
            if (lineBuf.length() <= leftWidth) {
                if (lineBuf.length() < leftWidth) {
                    lineBuf.append(OptionUtils.createPadding(leftWidth - lineBuf.length()));
                }
                lineBuf.append(dpad);
                if (option.getDescription() != null) {
                    lineBuf.append(option.getDescription());
                }
                renderWrappedText(sb, getWidth(), leftWidth + getDescPad(), lineBuf.toString());
            } else {
                sb.append(lineBuf).append(NEW_LINE);
                if (option.getDescription() != null) {
                    String line = OptionUtils.createPadding(leftWidth + getDescPad()) + option.getDescription();
                    renderWrappedText(sb, getWidth(), leftWidth + getDescPad(), line);
                }
            }
            if (it.hasNext()) {
                sb.append(NEW_LINE);
            }
        }
        return leftWidth;
    }
62667
def render(self, context, instance, placeholder):
        '''  '''
        context = super(LocationListPlugin,self).render(context,instance,placeholder)
        context['location_list'] = Location.objects.filter(status=Location.StatusChoices.active)
        return context
1220819
function gotList(thelist) {
  console.log("List of Serial Ports:");
  // theList is an array of their names
  for (var i = 0; i < thelist.length; i++) {
    // Display in the console
    console.log(i + " " + thelist[i]);
  }
}
521962
def render
      rendered_items = ''
      swiper_classes = 'swiper-container list-generated-swiper'
      list_items = list.list_items.to_a

      list_items.each do |list_item|
        rendered_items += render_item(list_item)
      end

      if opts[:html_classes].present?
        opts[:html_classes] += " #{swiper_classes}"
      else
        opts[:html_classes] = swiper_classes
      end

      rendered_items = [
        "<div class='swiper-wrapper'>#{rendered_items}</div>",
        "<div class='swiper-button-prev'></div>",
        "<div class='swiper-button-next'></div>",
        "<div class='swiper-pagination'></div>"
      ].join

      content_tag :div, rendered_items, html_options, false
    end
199654
function render(content, store) {
  var type = typeof content;
  var node = content;
  if(type === 'function') node = render(content(), store);
  else if(type === 'string') {
    node = document.createTextNode('');
    bind(content, function(data) {
      node.nodeValue = data;
    }, store);
  } 
  else if(content instanceof Array) node = fragment(content, store);
  return node;
}