Returns the n-index form, where index is 1-based.
        the form'll be filled with data if it exists or empty if not
977590
def get_form(self, index):
        
        index = max(1, index)
        if len(self._forms) >= index:
            return self._forms[index - 1]
        return self.get_empty_form(index)
838809
def get( index )
      raise "Only positive indexes, #{index}" if index < 0
      if index >= data_length
        return nil unless next_list
        return next_list.get( index - data_length)
      else
        ret = nil
        if(index < get_length)
          ret = get_internal_word(index + self.class.type_length )
        end
        return ret
      end
    end
301989
def get_first(self, n=1):
        
        rows = []
        # Get values from the partial db first
        if self.tracker.dbcon_master and check_table_exists(self.tracker.dbcon_master, self.name):
            rows.extend(get_first_row(self.tracker.dbcon_master, self.name, n))
        # Then add rows from the master if required
        if len(rows) < n and self.tracker.dbcon_part and check_table_exists(self.tracker.dbcon_part, self.name):
            rows.extend(get_first_row(self.tracker.dbcon_part, self.name, n))
        return rows[:n]
483818
def get_form(self, form_class):
        """"""
        if not hasattr(self, '_form'):
            kwargs = self.get_form_kwargs()
            self._form = form_class(**kwargs)
        return self._form
1372371
int FORM(final List<Integer> forms, int id)
    {
        return ((id != -1) ? (forms.get(id)) : kNilForm);
    }
877459
public String getElement(int elementIndex, Form form) {
		CharSequence element = this.elements.get(elementIndex);
		ElementType type = this.elements.getType(elementIndex);
		if (type.isIndexed()) {
			return element.toString();
		}
		if (form == Form.ORIGINAL) {
			if (type != ElementType.NON_UNIFORM) {
				return element.toString();
			}
			return convertToOriginalForm(element).toString();
		}
		if (form == Form.DASHED) {
			if (type == ElementType.UNIFORM || type == ElementType.DASHED) {
				return element.toString();
			}
			return convertToDashedElement(element).toString();
		}
		CharSequence uniformElement = this.uniformElements[elementIndex];
		if (uniformElement == null) {
			uniformElement = (type != ElementType.UNIFORM)
					? convertToUniformElement(element) : element;
			this.uniformElements[elementIndex] = uniformElement.toString();
		}
		return uniformElement.toString();
	}
360739
def has_index(self, name):
        
        name = self._normalize_identifier(name)

        return name in self._indexes
1318069
def nextindx(self):
        '''
        
        '''
        indx = 0
        with s_lmdbslab.Scan(self.slab, self.db) as curs:
            last_key = curs.last_key()
            if last_key is not None:
                indx = s_common.int64un(last_key) + 1
        return indx
607217
def _BuildIndex(self):
        """"""
        self._index = {}
        for i, k in enumerate(self._keys):
            self._index[k] = i
306771
private int findValueIndicesIndexForSubColumn()
  {
    final DimensionSelector keySelector = getKeySelector();
    final DimensionSelector valueSelector = getValueSelector();

    final IndexedInts keyIndices = keySelector.getRow();
    final IndexedInts valueIndices = valueSelector.getRow();

    final int limit = Math.min(keyIndices.size(), valueIndices.size());

    return IntStream
        .range(0, limit)
        .filter(i -> subColumnName.equals(keySelector.lookupName(keyIndices.get(i)))) // subColumnName is never null
        .findAny()
        .orElse(-1);
  }
44985
def get_value_index(self, indices):
        
        size = self['size'] if self.get('size') else self['dimension']['size']
        ndims = len(size)
        mult = 1
        num = 0
        for idx, dim in enumerate(size):
            mult *= size[ndims - idx] if (idx > 0) else 1
            num += mult * indices[ndims - idx - 1]
        return num
1026415
def _find_new_forms(self, forms, num, data, files, locale, tz):
        
        fullname = self._get_fullname(num)
        while has_data(data, fullname) or has_data(files, fullname):
            f = self._form_class(
                data, files=files, locale=locale, tz=tz,
                prefix=fullname, backref=self._backref
            )
            forms.append(f)
            num += 1
            fullname = self._get_fullname(num)
        return forms
632590
int getIndexIndex(String indexName) {

        Index[] indexes = indexList;

        for (int i = 0; i < indexes.length; i++) {
            if (indexName.equals(indexes[i].getName().name)) {
                return i;
            }
        }

        // no such index
        return -1;
    }
1322200
def smartformset_factory(form, formset=BaseFormSet, extra=1, can_order=False,
                         can_delete=False, min_num=None, max_num=None, validate_min=False, validate_max=False):
    """"""
    if max_num is None:
        max_num = DEFAULT_MAX_NUM
    # hard limit on forms instantiated, to prevent memory-exhaustion attacks
    # limit is simply max_num + DEFAULT_MAX_NUM (which is 2*DEFAULT_MAX_NUM
    # if max_num is None in the first place)
    absolute_max = max_num + DEFAULT_MAX_NUM
    if min_num is None:
        min_num = 0

    attrs = {'form': form, 'extra': extra,
             'can_order': can_order, 'can_delete': can_delete, 'min_num': min_num,
             'max_num': max_num, 'absolute_max': absolute_max, 'validate_min': validate_min,
             'validate_max': validate_max}
    return type(form.__name__ + str('FormSet'), (formset,), attrs)
773733
private int scorerIndex(int n)
   {
      int lo = 0; // search starts array
      int hi = scorers.length - 1; // for first element less

      while (hi >= lo)
      {
         int mid = (lo + hi) >> 1;
         int midValue = starts[mid];
         if (n < midValue)
         {
            hi = mid - 1;
         }
         else if (n > midValue)
         {
            lo = mid + 1;
         }
         else
         { // found a match
            while (mid + 1 < scorers.length && starts[mid + 1] == midValue)
            {
               mid++; // scan to last match
            }
            return mid;
         }
      }
      return hi;
   }
1370140
def index(self, strictindex):
        
        return self._select(self._pointer.index(self.ruamelindex(strictindex)))
400504
def get_forms(self):
        
        forms = {}
        objects = self.get_objects()
        initial = self.get_initial()
        form_kwargs = self.get_form_kwargs()
        for key, form_class in six.iteritems(self.form_classes):
            forms[key] = form_class(instance=objects[key], initial=initial[key], **form_kwargs[key])
        return forms