<commit_before>package com.tinkerpop.gremlin.process.graph.step.sideEffect;

import com.tinkerpop.gremlin.process.Traversal;
import com.tinkerpop.gremlin.process.Traverser;
import com.tinkerpop.gremlin.process.graph.marker.Reversible;
import com.tinkerpop.gremlin.process.util.AbstractStep;
import com.tinkerpop.gremlin.process.util.TraversalHelper;

import java.util.Iterator;
import java.util.stream.Stream;

/**
 * @author <NAME> (http://markorodriguez.com)
 */
public class StartStep<S> extends AbstractStep<S, S> implements Reversible {

    protected Object start;
    protected boolean first = true;

    public StartStep(final Traversal traversal, final Object start) {
        super(traversal);
        this.start = start;
    }

    public StartStep(final Traversal traversal) {
        this(traversal, null);
    }

    public <T> T getStart() {
        return (T) this.start;
    }

    public void setStart(final Object start) {
        this.start = start;
    }

    public boolean startAssignableTo(final Class... assignableClasses) {
        return Stream.of(assignableClasses).filter(check -> check.isAssignableFrom(this.start.getClass())).findAny().isPresent();
    }

    public String toString() {
        return TraversalHelper.makeStepString(this, this.start);
    }

    @Override
    protected Traverser<S> processNextStart() {
        if (this.first) {
            if (null != this.start) {
                if (this.start instanceof Iterator)
                    this.starts.add(this.getTraversal().asAdmin().getTraverserGenerator().generateIterator((Iterator<S>) this.start, this, 1l));
                else<commit_msg>got rid of an old method in StartStep.<commit_after>package com.tinkerpop.gremlin.process.graph.step.sideEffect;

import com.tinkerpop.gremlin.process.Traversal;
import com.tinkerpop.gremlin.process.Traverser;
import com.tinkerpop.gremlin.process.graph.marker.Reversible;
import com.tinkerpop.gremlin.process.util.AbstractStep;
import com.tinkerpop.gremlin.process.util.TraversalHelper;

import java.util.Iterator;
import java.util.stream.Stream;

/**
 * @author <NAME> (http://markorodriguez.com)
 */
public class StartStep<S> extends AbstractStep<S, S> implements Reversible {

    protected Object start;
    protected boolean first = true;

    public StartStep(final Traversal traversal, final Object start) {
        super(traversal);
        this.start = start;
    }

    public StartStep(final Traversal traversal) {
        this(traversal, null);
    }

    public <T> T getStart() {
        return (T) this.start;
    }

    public boolean startAssignableTo(final Class... assignableClasses) {
        return Stream.of(assignableClasses).filter(check -> check.isAssignableFrom(this.start.getClass())).findAny().isPresent();
    }

    public String toString() {
        return TraversalHelper.makeStepString(this, this.start);
    }

    @Override
    protected Traverser<S> processNextStart() {
        if (this.first) {
            if (null != this.start) {
                if (this.start instanceof Iterator)
                    this.starts.add(this.getTraversal().asAdmin().getTraverserGenerator().generateIterator((Iterator<S>) this.start, this, 1l));
                else
{'fraction_non_alphanumeric': 0.11444478812248686, 'fraction_numerical': 0.0006186204763377668, 'mean_word_length': 3.249671484888305, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 17, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1570831', 'n_tokens_mistral': 1005, 'n_tokens_neox': 939, 'n_words': 191}