Gives an array of indices indicating where the attributes of this record gets its
 values from in the comma separated string which the instance is created from.

 @param [Integer] length the number of elements to create in the indices array
3602
def import_indices(length)
      # Note that this method is defined in the parent Record class, where it is
      # used for most record types. However, because this record has two attributes
      # which contain an array of values, we use a custom import_indices method.
      #
      # Furthermore, as of Mosaiq version 2.64, the RTP ControlPoint record includes
      # 3 new attributes: iso_pos_x/y/z. Since these (unfortunately) are not placed
      # at the end of the record (which is the norm), but rather inserted before the
      # MLC leaf positions, we have to take special care here to make sure that this
      # gets right for records where these are included or excluded.
      #
      # Override length:
      applied_length = 235
      ind = Array.new(applied_length - NR_SURPLUS_ATTRIBUTES) { |i| [i] }
      # Override indices for mlc_pl_a and mlc_lp_b:
      # Allocation here is dependent on the RTP file version:
      # For 2.62 and earlier, where length is 232, we dont have the 3 iso_pos_x/y/z values preceeding the mlc arrays leaf position arrays.
      # For 2.64 (and later), where length is 235, we have the 3 iso_pos_x/y/z values preceeding the mlc leaf position arrays.
      if length == 232
        ind[32] = nil
        ind[33] = nil
        ind[34] = nil
        ind[35] = (32..131).to_a
        ind[36] = (132..231).to_a
      else # (length = 235)
        ind[35] = (35..134).to_a
        ind[36] = (135..234).to_a
      end
      ind
    end
932219
function getArrayOfHoles(length) {
  var holyLen = HOLY_ARRAY.length;
  if (length > holyLen) {
    HOLY_ARRAY.length = length;
    for (var i = holyLen; i < length; ++i) {
      HOLY_ARRAY[i] = ARRAY_HOLE_INDEX;
    }
  }

  return HOLY_ARRAY.slice(0, length);
}
1022242
def attributes
      attrs = {}
      attribute_names.each { |name| attrs[name] = read_attribute(name) }
      attrs
    end
600046
private static int[] createOrderArray(final int start, final int length) {
    final int[] order = new int[length];
    for (int i = 0; i < length; i++) {
      order[i] = start + i;
    }
    return order;
  }
768613
function List(length) {
        if (arguments.length === 0) {
            length = 0;
        }

        // in this case we create a list with a given length
        if (arguments.length <= 1 && typeof length === 'number') {
            if (this instanceof List) {
                this.length = length;
            }
            else {
                return new List(length);
            }
        }
        else {
            //here we create a list with initial values
            if (!(this instanceof List)) {
                return List.fromArray(arrSlice(arguments));
            }
            else {
                for (var i = 0, l = arguments.length ; i < l ; i++) {
                    this[i] = arguments[i];
                }
                this.length = arguments.length;
            }
        }
    }
363970
def extract_attribute_array(self, data_array, var_name):
        
        if var_name not in self.attributes.keys():
            self.attributes[var_name] = []
        for t in range(self.times.size):
            self.attributes[var_name].append(data_array[self.i[t], self.j[t]])
1023018
function getTokenParameters(index) {
    let stringLength;
    let indexWithOffset;

    indexWithOffset = index;
    for (stringLength = startLength; stringLength <= endLength; stringLength += 1) {
      const offsetCount = variants.length ** stringLength;
      if (indexWithOffset < offsetCount) {
        break;
      } else {
        indexWithOffset -= offsetCount;
      }
    }

    return {
      indexWithOffset,
      stringLength,
    };
  }
737883
function getWithLength(length) {
  var arrays = pool[length];
  var array;
  var i;

  // Create the first array for the specified length
  if (!arrays) {
    array = create(length);
  }

  // Find an unused array among the created arrays for the specified length
  if (!array) {
    for (i = arrays.length; i--;) {
      if (!arrays[i].inUse) {
        array = arrays[i];
        break;
      }
    }

    // If no array was found, create a new one
    if (!array) {
      array = create(length);
    }
  }

  array.inUse = true;
  return array;
}
1069319
function create(length) {
  var array = new Array(length);

  // Create a non-enumerable property as a flag to know if the array is in use
  Object.defineProperties(array, {
    inUse: {
      enumerable: false,
      writable: true,
      value: false
    },
    originalLength: {
      enumerable: false,
      value: length
    }
  });

  if (!pool[length]) pool[length] = [];
  pool[length].push(array);

  return array;
}
73980
def assign_attributes(new_attributes)
      if !new_attributes.respond_to?(:stringify_keys)
        raise ArgumentError, "When assigning attributes, you must pass a hash as an argument."
      end
      return if new_attributes.empty?

      # stringify keys just like https://github.com/rails/rails/blob/4f99a2186479d5f77460622f2c0f37708b3ec1bc/activemodel/lib/active_model/attribute_assignment.rb#L34
      new_attributes.stringify_keys.each do |k, v|
        setter = :"#{k}="
        if respond_to?(setter)
          public_send(setter, v)
        else
          _attr_json_write_unknown_attribute(k, v)
        end
      end
    end
95310
def [](i)
      if @elements.size <= i && ! @eseq.empty?
        while true
          @eseq = @eseq.skip_whitespace
          if @eseq.first == 93 # ']'.ord
            @eseq = @eseq.skip_byte(93).skip_whitespace # ']'.ord
            break
          end
          new_value = read_value_and_consume
          @elements << new_value
          break if @elements.size > i
        end
      end
      @elements[i]
    end
657934
def []=(key, value)
      key = key.to_s

      if has_key?(key)
        @lines[ @indicies[key] ] = value
      else
        @lines << value
        @indicies[key] = @lines.length - 1
      end
    end
494650
def set_attributes(values)
      import_indices([values.length - 1, @max_elements - 1].min).each_with_index do |indices, i|
        param = nil
        if indices
          param = values.values_at(*indices)
          param = param[0] if param.length == 1
        end
        self.send("#{@attributes[i]}=", param)
      end
      @crc = values[-1]
    end
988289
def get_attrs(self):
        
        if self.action != 'Create':
            return []
        index = self.extra['index']
        ret = [index.hash_key]
        if index.range_key is not None:
            ret.append(index.range_key)
        return ret
848817
def []( *indices )
      if indices.empty?
        force
      else
        if indices.last.is_a? Range
          view = slice indices.last.min, indices.last.size
        else
          view = element indices.last
        end
        view[ *indices[ 0 ... -1 ] ]
      end
    end
1042522
def index(idx)
      unless (0...length).cover? idx
        raise IndexError, "Index #{idx} outside of bounds 0..#{length - 1}"
      end

      ptr = GirFFI::InOutPointer.new element_type, data_ptr + idx * element_size
      ptr.to_ruby_value
    end
292377
private String joinElements(int length)
   {
      StringBuilder sb = new StringBuilder();
      for (int index = 0; index < length; index++)
      {
         sb.append(m_elements.get(index));
      }
      return sb.toString();
   }