Populate combobox with given list.
510860
def _set_combobox(self, attrname, vals, default=0):
        """"""
        combobox = getattr(self.w, attrname)
        for val in vals:
            combobox.append_text(val)
        if default > len(vals):
            default = 0
        val = vals[default]
        combobox.show_text(val)
        return val
617762
public void populate() throws Exception {
        for (int i = 0, cnt = _partition.getIdCount(); i < cnt; i++) {
            int memberId = _partition.getIdStart() + i;
            _partition.set(memberId, createDataForMember(memberId), System.nanoTime());
        }
        _partition.sync();
    }
323804
def populate_tree(self, master, parent, element,from_file=False):
        """"""

        data = WidgetDescr(None, None)
        data.from_xml_node(element)
        cname = data.get_class()
        uniqueid = self.get_unique_id(cname, data.get_id())
        data.set_property('id', uniqueid)

        if cname in builder.CLASS_MAP:
            pwidget = self._insert_item(master, data,from_file=from_file)
            xpath = "./child"
            children = element.findall(xpath)
            for child in children:
                child_object = child.find('./object')
                cwidget = self.populate_tree(pwidget, child, child_object,from_file=from_file)

            return pwidget
        else:
            raise Exception('Class "{0}" not mapped'.format(cname))
1206043
def populate_data(self, data):
        """"""
        sch = MockItemSchema()
        return Result(**{
            "callname": self.context.get("callname"),
            "result": sch.dump(data),
        })
201337
public void populate() throws Exception {
        for (int i = 0; i < _initialCapacity; i++) {
            String str = "key." + i;
            byte[] key = str.getBytes();
            byte[] value = createDataForKey(str);
            _store.put(key, value);
        }
        _store.sync();
    }
152957
def _populate(self, fields):
        
        schema = self.schema
        for k, v in fields.items():
            fields[k] = schema.fields[k].iget(self, v)

        self.modify(fields)
        self.reset_modified()
355100
def namedlist(objname, fieldnames):
    ''
    class NamedListTemplate(list):
        __name__ = objname
        _fields = fieldnames

        def __init__(self, L=None, **kwargs):
            if L is None:
                L = [None]*len(fieldnames)
            super().__init__(L)
            for k, v in kwargs.items():
                setattr(self, k, v)

        @classmethod
        def length(cls):
            return len(cls._fields)

    for i, attrname in enumerate(fieldnames):
        # create property getter/setter for each field
        setattr(NamedListTemplate, attrname, property(operator.itemgetter(i), itemsetter(i)))

    return NamedListTemplate
588106
def populate(self, **values):
        """"""
        values = values.copy()
        fields = list(self.iterate_with_name())
        for _, structure_name, field in fields:
            if structure_name in values:
                field.__set__(self, values.pop(structure_name))
        for name, _, field in fields:
            if name in values:
                field.__set__(self, values.pop(name))
1085937
def _populateComboBoxes(self, row):
        
        logger.debug("_populateComboBoxes")
        for comboBox in self._comboBoxes:
            comboBox.clear()

        if not self.rtiIsSliceable:
            # Add an empty item to the combo boxes so that resize to contents works.
            for comboBoxNr, comboBox in enumerate(self._comboBoxes):
                comboBox.addItem('', userData=None)
                comboBox.setEnabled(False)
            return

        nDims = self._rti.nDims
        nCombos = len(self._comboBoxes)

        for comboBoxNr, comboBox in enumerate(self._comboBoxes):
            # Add a fake dimension of length 1
            comboBox.addItem(FAKE_DIM_NAME, userData = FAKE_DIM_OFFSET + comboBoxNr)

            for dimNr in range(nDims):
                comboBox.addItem(self._rti.dimensionNames[dimNr], userData=dimNr)

            # Set combobox current index
            if nDims >= nCombos:
                # We set the nth combo-box index to the last item - n. This because the
                # NetCDF-CF conventions have the preferred dimension order of T, Z, Y, X.
                # The +1 below is from the fake dimension.
                curIdx = nDims + 1 - nCombos + comboBoxNr
            else:
                # If there are less dimensions in the RTI than the inspector can show, we fill
                # the comboboxes starting at the leftmost and set the remaining comboboxes to the
                # fake dimension. This means that a table inspector fill have one column and many
                # rows, which is the most convenient.
                curIdx = comboBoxNr + 1 if comboBoxNr < nDims else 0

            assert 0 <= curIdx <= nDims + 1, \
                "curIdx should be <= {}, got {}".format(nDims + 1, curIdx)

            comboBox.setCurrentIndex(curIdx)
            comboBox.setEnabled(True)
557341
def combobox_activated(self):
        """"""
        sender = self.sender()
        data = sender.itemData(sender.currentIndex())

        if isinstance(data, FoldScopeHelper):
            self.editor.go_to_line(data.line + 1)
833513
def populate_items(self, request):
        ''''''
        self._items = self.get_items(request)
        return self.items
217065
function insert (getValue, item, list) {
    var index = binaryIndexBy(getValue, getValue(item), list);

    list.splice(index, 0, item);
    return item;
  }
1341797
@Api
	public void initializeList(Collection<SearchWidget> searchWidgets) {
		LinkedHashMap<String, String> values = new LinkedHashMap<String, String>();
		for (SearchWidget searchWidget : searchWidgets) {
			values.put(searchWidget.getSearchWidgetId(), searchWidget.getName());
		}
		selectSearch.setValueMap(values);
		this.searchWidgets.addAll(searchWidgets);
	}
1163823
def append(self, element):
        """"""
        super(ObservableList, self).append(element)
        self._notify_add_at(len(self) - 1)
443121
def add(self, value):
        """"""
        if value not in self._set:
            self._set.add(value)
            self._list.add(value)
57107
def insert(self, index, item):
        """"""
        super(ObservableList, self).insert(index, item)
        length = len(self)
        if index >= length:
            index = length - 1
        elif index < 0:
            index += length - 1
            if index < 0:
                index = 0
        self._notify_add_at(index)
706055
def from_list(cls, database, key, data, clear=False):
        
        arr = cls(database, key)
        if clear:
            arr.clear()
        arr.extend(data)
        return arr