<commit_before>/******************************************************************************
 *                                                                             *
 *  Copyright: (c) Syncleus, Inc.                                              *
 *                                                                             *
 *  You may redistribute and modify this source code under the terms and       *
 *  conditions of the Open Source Community License - Type C version 1.0       *
 *  or any later version as published by Syncleus, Inc. at www.syncleus.com.   *
 *  There should be a copy of the license included with this file. If a copy   *
 *  of the license is not included you are granted no right to distribute or   *
 *  otherwise use this file except through a legal and valid license. You      *
 *  should also contact Syncleus, Inc. at the information below if you cannot  *
 *  find a license:                                                            *
 *                                                                             *
 *  Syncleus, Inc.                                                             *
 *  2604 South 12th Street                                                     *
 *  Philadelphia, PA 19148                                                     *
 *                                                                             *
 ******************************************************************************/

/*
 * Part or all of this source file was forked from a third-party project, the details of which are listed below.
 *
 * Source Project: Totorom
 * Source URL: https://github.com/BrynCooke/totorom
 * Source License: Apache Public License v2.0
 * When: November, 20th 2014
 */
package com.syncleus.ferma;

import java.util.*;

import com.tinkerpop.blueprints.Graph;
import com.tinkerpop.gremlin.Tokens;
import com.tinkerpop.gremlin.java.GremlinPipeline;
import com.tinkerpop.pipes.transform.TransformPipe;
import com.tinkerpop.pipes.util.structures.Pair;
import com.tinkerpop.pipes.util.structures.Row;
import com.tinkerpop.pipes.util.structures.Table;
import com.tinkerpop.pipes.util.structures.Tree;

/**
 * The root traversal class. Wraps a Tinkerpop {@link GremlinPipeline}
 *
 * @param <T> The type of the objects coming off the pipe.
 * @param <C> The cap of the current pipe.
 * @param <S> The SideEffect of the current pipe.
 * @param <M> The current mark'ed type for the current pipe.
 */
public interface Traversal<T, C, S, M> extends Iterator<T>, Iterable<T> {

    /**
     * Traverse over all the vertices in the graph.
     * 
     * @return The traversal representing all vertices in the graph.
     */
    VertexTraversal<?, ?, M> v();

    /**
     * Traverse over all the edges in the graph.
     * 
     * @return The traversal representing all the edges in the graph.
     */
    EdgeTraversal<?, ?, M> e();

    /**
     * Traversal over a list of vertices in the graph.
     * 
     * @param ids
     *            The ids of the vertices.
     * @return The traversal.
     */
    VertexTraversal<?, ?, M> v(Object... ids);

    /**
     * Traversal over a list of vertices in the graph.
     * 
     * @param ids
     *            The ids of the vertices.
     * @return The traversal.
     */
    VertexTraversal<?, ?, M> v(Collection<?> ids);

    /**
     * Traverse over all the vertices in the graph that have the specified key
     * and value.
     *
     * @param key The property key to filter for.
     * @param value The property value to filter for.
     * @return the traversal
     */
    VertexTraversal<?, ?, M> v(String key, Object value);

    /**
     * Traversal over a list of edges in the graph.
     * 
     * @param ids
     *            The ids of the edges.
     * @return The traversal.
     */
    EdgeTraversal<?, ?, M> e(Object... ids);

    /**
     * Traversal over a list of edges in the graph.
     * 
     * @param ids
     *            The ids of the edges.
     * @return The traversal.
     */
    EdgeTraversal<?, ?, M> e(Collection<?> ids);

    /**
     * Completely drain the pipeline of its objects. Useful when a sideEffect of
     * the pipeline is desired.
     */
    void iterate();

    /**
     * Emit the properties of the incoming element as a java.util.Map.
     *
     * @param keys
     *            the keys to get from the element (if none provided, all keys
     *            retrieved)
     * @return the extended Pipeline
     */
    Traversal<Map<String, Object>, ?, ?, M> map(String... keys);

    /**
     * Will only emit the object if it has not been seen before.
     *
     * @return the extended Pipeline
     */
    Traversal<T, ?, ?, M> dedup();

    /**
     * Will only emit the object if the object generated by its function hasn't
     * been seen before.
     *<commit_msg>Minor javadoc edits.<commit_after>/******************************************************************************
 *                                                                             *
 *  Copyright: (c) Syncleus, Inc.                                              *
 *                                                                             *
 *  You may redistribute and modify this source code under the terms and       *
 *  conditions of the Open Source Community License - Type C version 1.0       *
 *  or any later version as published by Syncleus, Inc. at www.syncleus.com.   *
 *  There should be a copy of the license included with this file. If a copy   *
 *  of the license is not included you are granted no right to distribute or   *
 *  otherwise use this file except through a legal and valid license. You      *
 *  should also contact Syncleus, Inc. at the information below if you cannot  *
 *  find a license:                                                            *
 *                                                                             *
 *  Syncleus, Inc.                                                             *
 *  2604 South 12th Street                                                     *
 *  Philadelphia, PA 19148                                                     *
 *                                                                             *
 ******************************************************************************/

/*
 * Part or all of this source file was forked from a third-party project, the details of which are listed below.
 *
 * Source Project: Totorom
 * Source URL: https://github.com/BrynCooke/totorom
 * Source License: Apache Public License v2.0
 * When: November, 20th 2014
 */
package com.syncleus.ferma;

import java.util.*;

import com.tinkerpop.blueprints.Graph;
import com.tinkerpop.gremlin.Tokens;
import com.tinkerpop.gremlin.java.GremlinPipeline;
import com.tinkerpop.pipes.transform.TransformPipe;
import com.tinkerpop.pipes.util.structures.Pair;
import com.tinkerpop.pipes.util.structures.Row;
import com.tinkerpop.pipes.util.structures.Table;
import com.tinkerpop.pipes.util.structures.Tree;

/**
 * The root traversal class. Wraps a Tinkerpop {@link GremlinPipeline}
 *
 * @param <T> The type of the objects coming off the pipe.
 * @param <C> The cap of the current pipe.
 * @param <S> The SideEffect of the current pipe.
 * @param <M> The current marked type for the current pipe.
 */
public interface Traversal<T, C, S, M> extends Iterator<T>, Iterable<T> {

    /**
     * Traverse over all the vertices in the graph.
     * 
     * @return The traversal representing all vertices in the graph.
     */
    VertexTraversal<?, ?, M> v();

    /**
     * Traverse over all the edges in the graph.
     * 
     * @return The traversal representing all the edges in the graph.
     */
    EdgeTraversal<?, ?, M> e();

    /**
     * Traversal over a list of vertices in the graph.
     * 
     * @param ids
     *            The ids of the vertices.
     * @return The traversal.
     */
    VertexTraversal<?, ?, M> v(Object... ids);

    /**
     * Traversal over a list of vertices in the graph.
     * 
     * @param ids
     *            The IDs of the vertices.
     * @return The traversal.
     */
    VertexTraversal<?, ?, M> v(Collection<?> ids);

    /**
     * Traverse over all the vertices in the graph that have the specified key
     * and value.
     *
     * @param key The property key to filter for.
     * @param value The property value to filter for.
     * @return the traversal
     */
    VertexTraversal<?, ?, M> v(String key, Object value);

    /**
     * Traversal over a list of edges in the graph.
     * 
     * @param ids
     *            The IDs of the edges.
     * @return The traversal.
     */
    EdgeTraversal<?, ?, M> e(Object... ids);

    /**
     * Traversal over a list of edges in the graph.
     * 
     * @param ids
     *            The IDs of the edges.
     * @return The traversal.
     */
    EdgeTraversal<?, ?, M> e(Collection<?> ids);

    /**
     * Completely drain the pipeline of its objects. Useful when a sideEffect of
     * the pipeline is desired.
     */
    void iterate();

    /**
     * Emit the properties of the incoming element as a java.util.Map.
     *
     * @param keys
     *            the keys to get from the element (if none provided, all keys
     *            retrieved)
     * @return the extended Pipeline
     */
    Traversal<Map<String, Object>, ?, ?, M> map(String... keys);

    /**
     * Will only emit the object if it has not been seen before.
     *
     * @return the extended Pipeline
     */
    Traversal<T, ?, ?, M> dedup();

    /**
     * Will only emit the object if the object generated by its function hasn't
     * been seen before.
     *
{'fraction_non_alphanumeric': 0.11966164637920364, 'fraction_numerical': 0.004332576851660821, 'mean_word_length': 1.664925783397471, 'pattern_counts': {'":': 0, '<': 41, '<?xml version=': 0, '>': 41, 'https://': 2, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 44, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2266595', 'n_tokens_mistral': 2609, 'n_tokens_neox': 2461, 'n_words': 954}