Get chain by index
@param {String}  id
@param {Array}   sequence
170479
function getChainIndexById(id, sequence){
    return sequence.map(function(el){
      return el._id;
    }).indexOf(id);
  }
1160655
def list(self, id, seq): # pylint: disable=invalid-name,redefined-builtin
        
        schema = CaptureSchema(exclude=('id', 'seq'))
        resp = self.service.list(self._base(id, seq))
        return self.service.decode(schema, resp, many=True)
153787
def recover_chain_id(storage: SQLiteStorage) -> ChainID:
    
    action_init_chain = json.loads(storage.get_state_changes(limit=1, offset=0)[0])

    assert action_init_chain['_type'] == 'raiden.transfer.state_change.ActionInitChain'
    return action_init_chain['chain_id']
530681
def get_seq_number_from_id(id, id_template, prefix, **kw):
    
    separator = kw.get("separator", "-")
    postfix = id.replace(prefix, "").strip(separator)
    postfix_segments = postfix.split(separator)
    seq_number = 0
    possible_seq_nums = filter(lambda n: n.isalnum(), postfix_segments)
    if possible_seq_nums:
        seq_number = possible_seq_nums[-1]

    # Check if this id has to be expressed as an alphanumeric number
    seq_number = get_alpha_or_number(seq_number, id_template)
    seq_number = to_int(seq_number)
    return seq_number
1079404
def chunk_sequence(sequence, chunk_length):
    """"""
    for index in range(0, len(sequence), chunk_length):
        yield sequence[index:index + chunk_length]
702556
private OperationResult sequenceCommand(long index, long sequence, RaftSession session) {
    OperationResult result = session.getResult(sequence);
    if (result == null) {
      log.debug("Missing command result at index {}", index);
    }
    return result;
  }
253026
function get(id) {
		var i,
			j,
			data;

		// search axes
		for (i = 0; i < axes.length; i++) {
			if (axes[i].options.id === id) {
				return axes[i];
			}
		}

		// search series
		for (i = 0; i < series.length; i++) {
			if (series[i].options.id === id) {
				return series[i];
			}
		}

		// search points
		for (i = 0; i < series.length; i++) {
			data = series[i].data;
			for (j = 0; j < data.length; j++) {
				if (data[j].id === id) {
					return data[j];
				}
			}
		}
		return null;
	}
994595
@Override
	public AbstractSequence<AminoAcidCompound> getSequence(String sequence,
			long index) throws CompoundNotFoundException {
		AbstractSequence<AminoAcidCompound> seq = super.getSequence(sequence.toUpperCase(Locale.ENGLISH), index);
		seq.setUserCollection(getStringCase(sequence));
		return seq;
	}
1352424
public Integer getPreviousIDSeq(final String id) {
        Validate.notNull(id, "ID cannot be null");
        final Integer count = this.idCounts.get(id);
        if (count == null) {
            throw new TemplateProcessingException(
                    "Cannot obtain previous ID count for ID \"" + id + "\"");
        }
        return Integer.valueOf(count.intValue() - 1);
    }
927331
private Long getSequence(String sequenceName)
    {
        Long result = null;
        // now lookup the sequence map for calling DB
        Map mapForDB = (Map) sequencesDBMap.get(getBrokerForClass()
                .serviceConnectionManager().getConnectionDescriptor().getJcdAlias());
        if(mapForDB != null)
        {
            result = (Long) mapForDB.get(sequenceName);
        }
        return result;
    }
272048
function lastChain (first, sequence) {
    var index = getIndexOfNextEnvAppearance(first, PromisePipe.env, sequence);
    return index === -1 ? (sequence.length - 1) : (index - 1);
  }
49455
function sequence() {
    var funcs = arguments;
    var funcCount = funcs.length;
    return function() {
      var args = arguments;
      for (var i = 0; i < funcCount; i++) {
        args[0] = funcs[i].apply(this, args);
      }
      return args[0];
    };
  }
664177
function _getIndexOfId(id) {
	return _.indexOf(goblin.ambush, _.find(goblin.ambush, {id}))
}
495231
def including(self, sequence) -> Generator:
        """"""
        return (element for element in sequence
                if self.indexer(element) in self.predicates)
808185
function findById(a, id) {
      for (var i = 0; i < a.length; i++) {
        if (a[i].id == id) return a[i];
      }
      return null;
    }
1230215
public int firstIndexOf(CqlIdentifier id) {
    Integer index = byId.get(id);
    return (index == null) ? -1 : index;
  }
720155
function getIndexOfNextEnvAppearance(fromIndex, env, sequence){
    return sequence.map(function(el){
      return el._env;
    }).indexOf(env, fromIndex);
  }