Add array index to options.
559591
function idOptions (id, options) {
  const _key = options._key == null
    ? '[' + id + ']'
    : options._key + '[' + id + ']'
  return Object.assign({}, options, { _key: _key })
}
1300871
def options(cls):
        """"""
        return sorted((value, name) for (name, value) in cls.__dict__.items() if not name.startswith('__'))
208861
function initArrays(optlist, parsedOptions){
	Object.keys(optlist).forEach(function(key) {
		if (optlist[key].type === Array && !(key in parsedOptions)) {
			parsedOptions[key] = [];
		}
	});
}
1236440
def extend(self, values):
        """"""
        self.database.run_script(
            'array_extend',
            keys=[self.key],
            args=values)
294520
public function addOptions(array $options)
    {
        foreach ($options as $name => $value) {
            $this->addOption($name, $value);
        }

        return $this;
    }
942475
def _add_to_index(index, obj):
    """"""
    id_set = index.value_map.setdefault(indexed_value(index, obj), set())
    if index.unique:
        if len(id_set) > 0:
            raise UniqueConstraintError()
    id_set.add(obj.id)
853240
function(models, options) {
      if (_.isArray(models)) {
        for (var i = 0, l = models.length; i < l; i++) {
          this._add(models[i], options);
        }
      } else {
        this._add(models, options);
      }
      return this;
    }
693497
public function fromArray($options)
    {
        if (isset($options['Index'])) {
            Validate::isInteger($options['Index'], 'options[Index]');
            $this->_index = (int) $options['Index'];
        }
    }
804022
function modifyOption( combo, index, title, value )
	{
		combo = getSelect( combo );
		if ( index < 0 )
			return false;
		var child = combo.getChild( index );
		child.setText( title );
		child.setValue( value );
		return child;
	}
576750
def p_array_index(self, p):
        ''''''
        if len(p) == 3:
            p[0] = slice(0, -1, -1)
        elif len(p) == 1 or p[1] == ':':
            p[0] = slice(0, -1, 1)
        else:
            p[0] = slice(0, int(p[1]), 1)
1168603
public function addOptions(array $options)
    {
        $existingOptions = $this->getOptions();
        $newOptions = empty($existingOptions) ? $options : array_merge((array)$existingOptions, $options);
        $this->setOptions($newOptions);
        return $this;
    }
1162058
public function addIndex($indexName) {
    if (is_array($indexName)) {
      $this->indexes = $indexName;
    } else {
      $this->indexes[] = $indexName;
    }
    $this->indexes = array_unique($this->indexes);
  }
1279814
def add_list_opt(self, opt, values):
        
        self.add_opt(opt)
        for val in values:
            self.add_opt(val)
908431
public function setOptions(array $options)
    {
        foreach ($options as $index=>$val) {
            if (property_exists($this, $index)) {
                $this->{$index} = $val;
            }
        }
        return $this;
    }
755047
public function addOption($option, $value = null)
    {
        if (is_array($option)) {
            $this->options = $option + $this->options;
        } else {
            $this->options[$option] = $value;
        }
    }
1225954
public function addOptions($options)
    {
        if (is_array($this->options)) {
            $this->options = array_merge($this->options, $options);
        } else {
            $this->options = $options;
        }

        return $this;
    }
1277325
function insert(arr, index, values) {
  [].splice.apply(arr, [index, 0].concat(values));
}