Set the array directly.
198750
public function setOrganizations(array $organizations)
    {
        $this->hasOrganizationsProperty();

        $this->organizations = $organizations instanceof ArrayCollection ?
            $organizations :
            new ArrayCollection($organizations);
    }
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;
    }
679651
function set (buffer, offset, value) {
  debug('Array "type" setter for buffer at offset', buffer, offset, value)
  var array = this.get(buffer, offset)
  var isInstance = value instanceof this
  if (isInstance || isArray(value)) {
    for (var i = 0; i < value.length; i++) {
      array[i] = value[i]
    }
  } else {
    throw new Error('not sure how to set into Array: ' + value)
  }
}
297526
public function setArray(array $data)
    {
        foreach ($data as $name => $value) {
            $this->set($name, $value);
        }
        return $this;
    }
697670
private void inc(ArrayList<Integer> array, int index) {
        array.set(index, array.get(index) + 1);
    }
48314
public function set($key, $value = null)
    {
        $keys = is_array($key) ? $key : [$key => $value];

        foreach ($keys as $key => $value) {
            Arr::set($this->items, $key, $value);
        }
    }
787282
public function setFromArray(array $data): void
    {
        foreach ($data as $key => $value) {
            $this->container[$key] = $value;
        }
    }
861567
public void putArrayValues(String name, Set<String> values) {
        arrayValues.put(name, values);
    }
656607
function setToArray$1(set) {
  var index = -1,
      result = Array(set.size);

  set.forEach(function (value) {
    result[++index] = value;
  });
  return result;
}
468499
public function setFromArray($p_array)
    {
        if ($p_array instanceof \stdClass) {
            $p_array = (array)$p_array;
        }
        if (is_array($p_array)) {
            $properties = $this->getProperties();
            $fields     = [];
            foreach ($properties as $key => $prop) {
                $fields[$prop[FFCST::PROPERTY_PRIVATE]] = $key;
            }
            foreach ($p_array as $field => $value) {
                if (array_key_exists($field, $fields)) {
                    $property = $fields[$field];
                    $setter   = 'set' . \FreeFW\Tools\PBXString::toCamelCase($property, true);
                    $this->$setter($value);
                }
            }
        }
    }
1350625
function toSet(arr) {
  const set = {};
  arr.forEach((e) => (set[e] = true));
  return set;
}
327927
function () {
        var data = this.data;
        if (data instanceof Array) {
            data.length = this._len;
            if (hasTypedArray) {
                this.data = new Float32Array(data);
            }
        }
    }
661664
public void set(double[] value) {
        checkIndex(value.length);

        for (int i = 0; i < value.length; ++i) {
            if (value[i] != 0d)
                set(i, value[i]);
        }
    }
1236440
def extend(self, values):
        """"""
        self.database.run_script(
            'array_extend',
            keys=[self.key],
            args=values)
1206834
public function setDataFromArray($data, $index = false)
    {
        if($index !== false)
        {
            $fields = $this->getFields();
            foreach ($fields as $field)
            {
                if (isset($data[$field][$index]))
                {
                    $this->{$field} = $data[$field][$index];
                }
            }
        }
        else
        {
            $this->setData($data);
        }
    }
1249427
public static <T> Set<T> arrayToSet(final T[] array) {
        if (null == array) {
            return Collections.emptySet();
        }

        final Set<T> ret = new HashSet<T>();

        for (int i = 0; i < array.length; i++) {
            final T object = array[i];

            ret.add(object);
        }

        return ret;
    }
1083419
def set(self, header, value=None):
        """"""
        if value is None:
            for k, v in header.items():
                self.headers[k] = v
        else:
            self.headers[header] = value