we default to tsx# as an index if the user doesn't specify one
183191
public String getNextIndex() {
        String newIndex;

        do {
            newIndex = "tsx" + String.valueOf(lastIndexIndex);
            lastIndexIndex++;
        }
        while (exists(newIndex) == true);

        addIndex(newIndex);

        return newIndex;
    }
55671
def set_default_account_by_index(self, index: int):
        
        if index >= len(self.accounts):
            raise SDKException(ErrorCode.param_error)
        for acct in self.accounts:
            acct.is_default = False
        self.accounts[index].is_default = True
        self.default_account_address = self.accounts[index].b58_address
654462
function getSuperCallAtGivenIndex(ctor, index) {
                if (!ctor.body) {
                    return undefined;
                }
                var statements = ctor.body.statements;
                if (!statements || index >= statements.length) {
                    return undefined;
                }
                var statement = statements[index];
                if (statement.kind === 202 /* ExpressionStatement */) {
                    return ts.isSuperCallExpression(statement.expression) ? statement : undefined;
                }
            }
116380
function getNextSuffix(sHash){
			var sPath = sHash ? sHash : "";

			if (isVirtualHash(sPath)) {
				var iIndex = sPath.lastIndexOf(skipSuffix);
				sPath = sPath.slice(0, iIndex);
			}

			return sPath + skipSuffix + skipIndex++;
		}
1095967
def itemFromIndex(self, index):
        
        sourceIndex = self.mapToSource(index)
        return self.sourceModel().itemFromIndex(sourceIndex)
950197
def set_identifiertext(self, index):
        
        dr = QtCore.Qt.DisplayRole
        t = index.model().index(index.row(), 17, index.parent()).data(dr)
        if t is None:
            t = -1
        else:
            t = t+1
        self.identifier_lb.setText("#%s" % t)
1116566
def _enforceDataType(self, data):
        
        idx = int(data)
        if idx < 0:
            idx += len(self._displayValues)
        assert 0 <= idx < len(self._displayValues), \
            "Index should be >= 0 and < {}. Got {}".format(len(self._displayValues), idx)
        return idx
302095
function (tableName, index) {
            var indexName = this.__quoteIdentifier(index.name || this.__defaultIndexName(tableName,
                index.columns)), t = index.type, using = "";
            var indexType = "";
            if (t === "fullText") {
                indexType = "FULLTEXT ";
            } else if (t === "spatial") {
                indexType = "SPATIAL ";
            } else {
                indexType = index.unique ? "UNIQUE " : "";
                using = t ? " USING " + t : "";
            }
            return format("CREATE %sINDEX %s%s ON %s %s", indexType, indexName, using,
                this.__quoteSchemaTable(tableName), this.literal(index.columns.map(function (c) {
                    return isString(c) ? sql.identifier(c) : c;
                })));
        }
205479
private String aliasHeader(Object headerObj, int index) {
		if(null == headerObj) {
			return ExcelUtil.indexToColName(index);
		}
		
		final String header = headerObj.toString();
		return ObjectUtil.defaultIfNull(this.headerAlias.get(header), header);
	}
358567
private void initIndex() throws Exception {

        // 0. Add the tasklog template
        GetIndexTemplatesResponse result = elasticSearchClient.admin()
            .indices()
            .prepareGetTemplates("tasklog_template")
            .execute()
            .actionGet();

        if (result.getIndexTemplates().isEmpty()) {
            logger.info("Creating the index template 'tasklog_template'");
            InputStream stream = ElasticSearchDAOV5.class
                .getResourceAsStream("/template_tasklog.json");
            byte[] templateSource = IOUtils.toByteArray(stream);

            try {
                elasticSearchClient.admin()
                    .indices()
                    .preparePutTemplate("tasklog_template")
                    .setSource(templateSource, XContentType.JSON)
                    .execute()
                    .actionGet();
            } catch (Exception e) {
                logger.error("Failed to init tasklog_template", e);
            }
        }
    }
506016
function(queryRunner, options) {
    options = options || {};
    this.queryParser = new QueryParser(options.paramValueRegEx);
    var indexNameBuilder = options.indexNameBuilder || new DefaultIndexNameBuilder();
    this.queryBuilder = new EsQueryBuilder(indexNameBuilder, {
        defaults: options.queryDefaults
    });
    this.queryRunner = queryRunner;
}
261457
function(index) {
        var result = null,
            resultParent = null,
            traverser = new Traverser();

        traverser.traverse(this.ast, {
            enter: function(node, parent) {
                if (node.range[0] <= index && index < node.range[1]) {
                    result = node;
                    resultParent = parent;
                } else {
                    this.skip();
                }
            },
            leave: function(node) {
                if (node === result) {
                    this.break();
                }
            }
        });

        return result ? utils.mixin({parent: resultParent}, result) : null; // ORION
    }
1080975
def get_index(self, index, type, alias=None, typed=None, read_only=True, kwargs=None):
        
        if kwargs.tjson != None:
            Log.error("used `typed` parameter, not `tjson`")
        if read_only:
            # GET EXACT MATCH, OR ALIAS
            aliases = wrap(self.get_aliases())
            if index in aliases.index:
                pass
            elif index in aliases.alias:
                match = [a for a in aliases if a.alias == index][0]
                kwargs.alias = match.alias
                kwargs.index = match.index
            else:
                Log.error("Can not find index {{index_name}}", index_name=kwargs.index)
            return Index(kwargs=kwargs, cluster=self)
        else:
            # GET BEST MATCH, INCLUDING PROTOTYPE
            best = self.get_best_matching_index(index, alias)
            if not best:
                Log.error("Can not find index {{index_name}}", index_name=kwargs.index)

            if best.alias != None:
                kwargs.alias = best.alias
                kwargs.index = best.index
            elif kwargs.alias == None:
                kwargs.alias = kwargs.index
                kwargs.index = best.index

            return Index(kwargs=kwargs, cluster=self)
362669
function index(options) {
  return {
    kronos: {
      position: 'relative',
      display: 'flex',
      color: 'hsl(0, 0%, 50%)',
      '& *': {
        fontFamily: options.font,
        boxSizing: 'border-box',
        userSelect: 'none',
      },
    },
    input: {
      border: '1px solid transparent',
      borderRadius: options.corners,
      borderColor: color(options.color)
        .alpha(0.2)
        .rgbString(),
      fontSize: 16,
      padding: '3px 6px',
      background: 'white',
      '&.outside-range': {
        color: 'white',
        background: '#d0021b',
      },
      '&:hover': {
        cursor: options.inputDisabled ? 'not-allowed' : 'default',
      },
      '&:focus': {
        outline: 'none',
        borderColor: color(options.color)
          .alpha(0.5)
          .rgbString(),
      },
    },
  }
}
1296758
def __wrap_index(self):
        """"""
        if self.current_index < 0:
            self.current_index = len(self.gui_buttons) - 1
        elif self.current_index >= len(self.gui_buttons):
            self.current_index = 0
958479
def setCurrentIndex(self, index):
        
        super(XViewPanel, self).setCurrentIndex(index)
        self.tabBar().setCurrentIndex(index)
152759
def _index_special_tokens(self, unknown_token, special_tokens):
        """"""
        self._idx_to_token = [unknown_token] if unknown_token else []

        if not special_tokens:
            self._reserved_tokens = None
        else:
            self._reserved_tokens = special_tokens[:]
            self._idx_to_token.extend(special_tokens)

        if unknown_token:
            self._token_to_idx = DefaultLookupDict(C.UNK_IDX)
        else:
            self._token_to_idx = {}
        self._token_to_idx.update((token, idx) for idx, token in enumerate(self._idx_to_token))