<commit_before>package com.tinkerpop.gremlin.compiler.operations.util;

import com.tinkerpop.gremlin.compiler.Atom;
import com.tinkerpop.gremlin.compiler.GremlinEvaluator;
import com.tinkerpop.gremlin.compiler.Tokens;
import com.tinkerpop.gremlin.compiler.operations.Operation;
import com.tinkerpop.gremlin.compiler.types.DynamicEntity;

/**
 * @author <NAME>
 */
public class DeclareVariable implements Operation {

    private final String name;
    private final Operation valueOperation;

    public DeclareVariable(final String name, final Operation valueOp) {
        this.name = name;
        this.valueOperation = valueOp;
    }

    public Atom compute() {
        Atom atom = this.valueOperation.compute();

        if (!(atom instanceof DynamicEntity)) {
            GremlinEvaluator.declareVariable(this.name, atom);
        } else {
            GremlinEvaluator.declareVariable(this.name, new Atom<Object>(atom.getValue()));
        }

        return atom;
    }

    public static void decalareWithInit(String var, Atom value) {
        //GremlinEvaluator.declareVariable(var, makeAtomValue(var, value));
        GremlinEvaluator.declareVariable(var, value);
    }

    /*
    public static void declareEmpty(String var) {
        decalareWithInit(var, new Atom(null));
    }


    public static Atom makeAtomValue(String name, Atom value) {
        value.setPersistent(false);
        value.setVariableName(name);

        return value;
    }


    protected static Atom makeAtomValue(String name, Operation operation) {
        Atom value = operation.compute();
        return makeAtomValue(name, value);
    }
    */
    
    public Type getType() {
        return Type.STATEMENT;
    }

}
<commit_msg>deplicated methods removed from comments in DeclareVariable.<commit_after>package com.tinkerpop.gremlin.compiler.operations.util;

import com.tinkerpop.gremlin.compiler.Atom;
import com.tinkerpop.gremlin.compiler.GremlinEvaluator;
import com.tinkerpop.gremlin.compiler.Tokens;
import com.tinkerpop.gremlin.compiler.operations.Operation;
import com.tinkerpop.gremlin.compiler.types.DynamicEntity;

/**
 * @author <NAME>
 */
public class DeclareVariable implements Operation {

    private final String name;
    private final Operation valueOperation;

    public DeclareVariable(final String name, final Operation valueOp) {
        this.name = name;
        this.valueOperation = valueOp;
    }

    public Atom compute() {
        Atom atom = this.valueOperation.compute();

        if (!(atom instanceof DynamicEntity)) {
            GremlinEvaluator.declareVariable(this.name, atom);
        } else {
            GremlinEvaluator.declareVariable(this.name, new Atom<Object>(atom.getValue()));
        }

        return atom;
    }

    public static void decalareWithInit(String var, Atom value) {
        GremlinEvaluator.declareVariable(var, value);
    }
    
    public Type getType() {
        return Type.STATEMENT;
    }

}

{'fraction_non_alphanumeric': 0.0958023019634394, 'fraction_numerical': 0.0, 'mean_word_length': 3.115598885793872, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, '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': '20685', 'n_tokens_mistral': 890, 'n_tokens_neox': 831, 'n_words': 181}