/*
Sequence comp needs no treatment it uses only a bind
550714
@Override
	public void caseASetCompSetExp(ASetCompSetExp node) throws AnalysisException
	{
		if (!proceed(node))
		{
			return;
		}

		handleMultipleBindConstruct(node, node.getBindings(), node.getFirst(), node.getPredicate());
	}
474199
def workaround_type_coercions_in_recursions(match_query):
    """"""
    # This step is required to work around an OrientDB bug that causes queries with both
    # "while:" and "class:" in the same query location to fail to parse correctly.
    #
    # This bug is reported upstream: https://github.com/orientechnologies/orientdb/issues/8129
    #
    # Instead of "class:", we use "INSTANCEOF" in the "where:" clause to get correct behavior.
    # However, we don't want to switch all coercions to this format, since the "class:" clause
    # provides valuable info to the MATCH query scheduler about how to schedule efficiently.
    new_match_traversals = []

    for current_traversal in match_query.match_traversals:
        new_traversal = []

        for match_step in current_traversal:
            new_match_step = match_step

            has_coerce_type = match_step.coerce_type_block is not None
            has_recurse_root = isinstance(match_step.root_block, Recurse)

            if has_coerce_type and has_recurse_root:
                new_where_block = convert_coerce_type_and_add_to_where_block(
                    match_step.coerce_type_block, match_step.where_block)
                new_match_step = match_step._replace(coerce_type_block=None,
                                                     where_block=new_where_block)

            new_traversal.append(new_match_step)

        new_match_traversals.append(new_traversal)

    return match_query._replace(match_traversals=new_match_traversals)
266956
static Matcher sequenceWithStuffAfterEndIsFalse(Matcher matcher) {
    if (matcher instanceof SeqMatcher) {
      boolean end = false;
      for (Matcher m : matcher.<SeqMatcher>as().matchers()) {
        if (m instanceof EndMatcher) {
          end = true;
        } else if (end && !m.alwaysMatches()) {
          return FalseMatcher.INSTANCE;
        }
      }
    }
    return matcher;
  }
1057098
function sequence(tasks /* Any Arguments */) {
    const args = Array.prototype.slice.call(arguments, 1);

    return Promise.reduce(tasks, function (results, task) {
        const response = task.apply(this, args);

        if (response && response.then) {
            return response.then(function (result) {
                results.push(result);
                return results;
            });
        } else {
            return Promise.resolve().then(() => {
                results.push(response);
                return results;
            });
        }
    }, []);
}
1168701
function Sequence(iterable) {
    this.sequence = null;
    this._size = 0;
    this.nodeMap = new rMap();
    if (iterable) {
      if (typeof iterable.length === 'number') {
        for (var i = 0; i < iterable.length; i++) {
          this.add.apply(this, iterable[i]);
        }
      } else if (typeof iterable.entries === 'function') {
        var it = iterable.entries();
        while (!it.done) {
          var tmp = it.next();
          this.add.apply(this, tmp);//it.next());
        }
      }
    }
  }
300214
function sequencer() {
        var args = arguments;
        return {
          then: function (done) {
            var counter = 0;
            for (var i = 0; i < args.length; i++) {
              args[i](callme);
            }

            function callme() {
              counter++;
              if (counter === args.length) {
                done();
              }
            }
          }
        };
      }
691820
public void sequence(FA seq) {
        int idx;
        int relocation;

        relocation = append(seq);

        if (seq.start != -1) {
            for (idx = ends.first(); idx != -1; idx = ends.next(idx)) {
                states[idx].add(relocation + seq.start, null);
            }
        }

        ends.clear();
        for (idx = seq.ends.first(); idx != -1; idx = seq.ends.next(idx)) {
            ends.add(idx + relocation);
        }
    }
343362
@SuppressWarnings("unchecked")
	protected <C extends Compound> Sequence<C> reverseSequence(Sequence<C> sequence) {
		if(getStrand() != Strand.NEGATIVE) {
			return sequence;
		}

		Sequence<C> reversed = new ReversedSequenceView<C>(sequence);
		// "safe" operation as we have tried to check this
		if(canComplement(sequence)) {
			Sequence<ComplementCompound> casted = (Sequence<ComplementCompound>) reversed;
			ComplementSequenceView<ComplementCompound> complement =
					new ComplementSequenceView<ComplementCompound>(casted);
			return (Sequence<C>)complement;
		}
		return reversed;
	}
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];
    };
  }
1066556
public void dispose(int sequence) {
        int index = toIndex(sequence);
        checkSequence(index, sequence);
        if (isTask[index]) {
            callableCounter--;
        }
        ringItems[index] = null;
        isTask[index] = false;
    }
320482
function promise_executor(resolve, reject) {
	var worker = this[0], order = this[1]
	Promise.resolve(promise_static_member(worker, order) || order)
		.catch(kickTaskOrder.bind(this)) // yes, the <this> is prebind array
		.then(resolve, reject)
}
255236
private static function sequence($ms)
    {
        return FP::reduce(
            function (Generator $acc, Generator $elem) {
                return $acc->bindGen(function ($xs) use ($elem) {
                    return $elem->bindGen(function ($y) use ($xs) {
                        return self::pureGen(FP::push($xs, $y));
                    });
                });
            },
            $ms,
            self::pureGen([])
        );
    }
868908
function seq() {
  var parsers = [].slice.call(arguments);
  var numParsers = parsers.length;
  for (var j = 0; j < numParsers; j += 1) {
    assertParser(parsers[j]);
  }
  return Parsimmon(function(input, i) {
    var result;
    var accum = new Array(numParsers);
    for (var j = 0; j < numParsers; j += 1) {
      result = mergeReplies(parsers[j]._(input, i), result);
      if (!result.status) {
        return result;
      }
      accum[j] = result.value;
      i = result.index;
    }
    return mergeReplies(makeSuccess(i, accum), result);
  });
}
35648
function(options) {
    options =  options || {};
    var fns = [
      _.bind(this.preDelete, this, _.clone(options)),
      _.bind(PromisedModel.prototype.destroy, this, options),
      _.bind(this.afterDelete, this, options)
    ];
    return sequence(fns)
      .then(function(results) {
        return results[1];
      }, _.bind(failWithError, null, options));
  }
912983
function(options) {
    var self = this;

    options = options || {};

    var error = options.error;

    var fns = [
      _.bind(self.preFetch, self, options),
      _.bind(PromisedModel.prototype.fetch, self, options),
      _.bind(self.afterFetch, self, options)
    ];
    return sequence(fns).then(function () {
      self.fetchStatus = 'fetched';
      return self;
    }, function (err) {
      if (error) error.call(options, self, err);
      return failWithError(options, err);
    });
  }
972203
function sequence ( map, components, results, missing, recursive, nest ) {
  components.forEach( component => {
    if ( results.indexOf( component ) !== -1 ) {
      return; // de-dup results
    }

    const deps = map.get( component );

    if ( ! deps ) {
      missing.push( component );
    } else if ( nest.indexOf( component ) > -1 ) {
      nest.push( component );
      recursive.push( nest.slice(0) );
      nest.pop( component );
    } else if ( deps.length ) {
      nest.push( component );
      sequence( map, deps, results, missing, recursive, nest ); // recurse
      nest.pop( component );
    }
    results.push( component );
  });
}
1229237
function (seq) {
    if (!seq) {
      return [];
    } else if (seq instanceof Array) {
      return seq;
    } else if (isStoreCursor(seq)) {
      return seq.fetch();
    } else {
      throw badSequenceError();
    }
  }