Set a new index array for this series
352082
def _set_index(self, key, index):
        
        axis = key[0]
        origin = "{}0".format(axis)
        delta = "d{}".format(axis)
        if index is None:
            return delattr(self, key)
        if not isinstance(index, Index):
            try:
                unit = index.unit
            except AttributeError:
                unit = getattr(self, "_default_{}unit".format(axis))
            index = Index(index, unit=unit, copy=False)
        setattr(self, origin, index[0])
        if index.regular:
            setattr(self, delta, index[1] - index[0])
        else:
            delattr(self, delta)
        setattr(self, "_{}".format(key), index)
1334291
function(start_index, values, names) {

		if (start_index >= this._count) Lava.t("Index is out of range");

		var i = 0,
			count = values.length,
			added_uids = [],
			added_names = [];

		if (names) {

			if (count != names.length) Lava.t("If names array is provided, it must be equal length with values array.");
			added_names = names;

		} else {

			for (; i < count; i++) {

				added_names.push(null);

			}

		}

		for (; i < count; i++) {

			added_uids.push(this._uid++);

		}

		if (start_index == 0) {

			// prepend to beginning
			this._data_uids = added_uids.concat(this._data_uids);
			this._data_values = values.concat(this._data_values);
			this._data_names = added_names.concat(this._data_names);

		} else if (start_index == this._count - 1) {

			// append to the end
			this._data_uids = this._data_uids.concat(added_uids);
			this._data_values = this._data_values.concat(values);
			this._data_names = this._data_names.concat(added_names);

		} else {

			this._data_uids = this._data_uids.slice(0, start_index).concat(added_uids).concat(this._data_uids.slice(start_index));
			this._data_values = this._data_values.slice(0, start_index).concat(values).concat(this._data_values.slice(start_index));
			this._data_names = this._data_names.slice(0, start_index).concat(added_names).concat(this._data_names.slice(start_index));

		}

		this._setLength(this._count + count);

		this._fire('items_added', {
			uids: added_uids,
			values: values,
			names: added_names
		});

		this._fire('collection_changed');

	}
1002427
public void set(int[] indexes, int[] offsets, int[] lengths) {
        m_size = indexes.length;
        m_valuesCount = offsets.length;
        m_offsets = offsets;
        m_lengths = lengths;
        m_prefixes = new int[offsets.length];
        m_suffixes = new int[offsets.length];
        m_indexes = indexes;
    }
681759
public Arguments set(final int index,
                         final ByteBuffer array) {
        final wl_array wlArray = new wl_array();

        wlArray.setData(wrap(array));
        wlArray.setAlloc(array.capacity());
        wlArray.setSize(array.capacity());

        this.argumentRefs.add(wlArray);
        this.pointer.get(index)
                    .setA(ref(wlArray));
        return this;
    }
1371761
def build_index(self, idx_name, _type='default'):
        ""
        indexes = {}
        has_non_string_values = False
        for key, item in self.data.items():
            if idx_name in item:
                value = item[idx_name]
                # A non-string index value switches it into a lazy one.
                if not isinstance(value, six.string_types):
                    has_non_string_values = True
                if value not in indexes:
                    indexes[value] = set([])
                indexes[value].add(key)
        self.indexes[idx_name] = indexes
        if self._meta.lazy_indexes or has_non_string_values:
            # Every index is lazy
            _type = 'lazy'
        self.index_defs[idx_name] = {'type': _type}
827194
public void set(long index, Slice value)
    {
        updateRetainedSize(index, value);
        array.set(index, value);
    }
1349229
def set_index(self, index):
        
        self.setCurrentIndex(index)
        self.new_root.emit(index)
        self.scrollTo(index)
25298
def set_stack_index(self, index, instance):
        """"""
        if instance == self:
            self.tabwidget.setCurrentIndex(index)
783618
def atIndices(indexable, indices, default=__unique):
    
    """
    if default is __unique:
        return [indexable[i] for i in indices]
    else:
        res = []
        for i in indices:
            try:
                res.append(indexable[i])
            except (IndexError, KeyError):
                res.append(default)
        return res
143913
def create_index(self):
        
        self.reset()
        counter = 0
        pre_time = time.time()
        while True:
            if counter % 1000 == 0:
                cur_time = time.time()
                print('time:', cur_time - pre_time, ' count:', counter)
            pos = self.tell()
            cont = self.read()
            if cont is None:
                break
            key = self.key_type(counter)
            self.fidx.write('%s\t%d\n'%(str(key), pos))
            counter = counter + 1
1255315
def setCurrentIndex(self, index):
        
        if self._currentIndex == index:
            return

        self._currentIndex = index
        self.currentIndexChanged.emit(index)

        for i, item in enumerate(self.items()):
            item.setMenuEnabled(i == index)
        self.repaint()
663657
def from_series(cls, series, offset=0):
        
        return cls(data=series.data, index=series.index, data_name=series.data_name, index_name=series.index_name,
                   sort=series.sort, offset=offset)
1304321
protected void fill(int fromIndex, int endIndex) {
        fromIndex = fromIndex == -1 ? 0 : fromIndex;
        endIndex = endIndex == -1 || endIndex > this.timeSeries.length ? this.timeSeries.length : endIndex;

        final T val;
        if (applyZero()) {
            val = zero();
        } else {
            val = null;
        }

        // set the values
        for (int i = fromIndex; i < endIndex; i++) {
            set(i, val);
        }
    }
1026425
@Override
    public void setArray(int parameterIndex, Array x) throws SQLException
    {
        checkParameterBounds(parameterIndex);
        throw SQLError.noSupport();
    }
1097162
function(series) {
    if (series === undefined || series === null) return;

    for (var key in series) {
      // Convert key from string into array of numbers
      var serDimIdx = key.split(KEY_SEPARATOR).map(Number);
      // Update series and obs keys
      serDimIdx.forEach(updateSeriesAndObsKeys);

      var value = series[key];
      var serAttrIdx = [];

      if (Array.isArray(value.attributes)) {
        serAttrIdx = value.attributes;
      }

      processObservations(
        value.observations,
        seriesKey.join(KEY_SEPARATOR),
        dsDimIdx.concat(serDimIdx),
        dsAttrIdx.concat(serAttrIdx)
      );
    }
  }
477756
function (idx, arr) {
        var indices = this.indices;
        indices[idx * 3] = arr[0];
        indices[idx * 3 + 1] = arr[1];
        indices[idx * 3 + 2] = arr[2];
    }
484490
def format_index_array_attrs(series):
    
    attrs = {}
    # loop through named axes
    for i, axis in zip(range(series.ndim), ('x', 'y')):
        # find property names
        unit = '{}unit'.format(axis)
        origin = '{}0'.format(axis)
        delta = 'd{}'.format(axis)

        # store attributes
        aunit = getattr(series, unit)
        attrs.update({
            unit: str(aunit),
            origin: getattr(series, origin).to(aunit).value,
            delta: getattr(series, delta).to(aunit).value,
        })
    return attrs