<commit_before>package io.mediachain

import com.orientechnologies.orient.core.id.ORecordId
import java.util.UUID

import org.apache.tinkerpop.gremlin.process.traversal.step.util.BulkSet
import shapeless.HNil
import scala.collection.JavaConverters._
import gremlin.scala._
import Types._
import core.GraphError
import core.GraphError._
import cats.data.Xor
import shapeless.HList

object Traversals {

  object Implicits {

    implicit class GremlinScalaImplicits[End, Labels <: HList]
    (val gs: GremlinScala[End, Labels]) extends AnyVal
    {
      /**
        * Chain together query pipeline operations.
        *
        * e.g.
        *
        * graph.V ~> personsBlobsWithExactMatch(pablo) ~> getCanonical
        *
        * The right-hand side of the ~> operator must be a function of
        * `GremlinScala[Vertex, InLabels] => GremlinScala[Vertex, OutLabels]`
        *
        * The `InLabels` and `OutLabels` type params may be the same concrete
        * type, or they may differ, depending on the operation.
        *
        * This can be used with partially applied (curried) functions, e.g.:
        *
        * def findTheMcGuffin[Labels <: HList]
        *   (foo: String)(gs: GremlinScala[Vertex, Labels])
        * : GremlinScala[Vertex, Labels] = gs.has('foo', foo)
        *
        * can be chained by partially applying the method:
        * graph.V ~> findTheMcGuffin("bar")
        *
        * Note that to call methods on the resulting pipeline, you'll either
        * need to wrap the chain in parens:
        * (graph.V ~> findKittens).headOption
        *
        * or, you can use the >> operator with an anonymous function:
        * graph.V ~> findKittens >> (_.headOption)
        *
        */
      def ~>[OutEnd, OutLabels <: HList]
      (f: GremlinScala[End, Labels] => GremlinScala[OutEnd, OutLabels]):
      GremlinScala[OutEnd, OutLabels] = f(gs)


      /**
        * Apply a function to a query pipeline, returning some result
        *<commit_msg>update comments<commit_after>package io.mediachain

import com.orientechnologies.orient.core.id.ORecordId
import java.util.UUID

import org.apache.tinkerpop.gremlin.process.traversal.step.util.BulkSet
import shapeless.HNil
import scala.collection.JavaConverters._
import gremlin.scala._
import Types._
import core.GraphError
import core.GraphError._
import cats.data.Xor
import shapeless.HList

object Traversals {

  object Implicits {

    implicit class GremlinScalaImplicits[End, Labels <: HList]
    (val gs: GremlinScala[End, Labels]) extends AnyVal
    {
      /**
        * Chain together query pipeline operations.
        *
        * e.g.
        *
        * graph.V ~> personsBlobsWithExactMatch(pablo) ~> getCanonical
        *
        * The right-hand side of the ~> operator must be a function of
        * `GremlinScala[A, InLabels] => GremlinScala[B, OutLabels]`
        *
        * The `A` and `B` type parameters represent the type of value that's
        * at the "end" of the pipeline; they can be the same type or different
        * depending on the operation.
        *
        * Likewise, the `Labels` and `OutLabels` type params may be the same
        * concrete type or different types.
        *
        * This can be used with partially applied (curried) functions, e.g.:
        *
        * def findTheMcGuffin[Labels <: HList]
        *   (foo: String)(gs: GremlinScala[Vertex, Labels])
        * : GremlinScala[Vertex, Labels] = gs.has('foo', foo)
        *
        * can be chained by partially applying the method:
        * graph.V ~> findTheMcGuffin("bar")
        *
        * Note that to call methods on the resulting pipeline, you'll either
        * need to wrap the chain in parens:
        * (graph.V ~> findKittens).headOption
        *
        * or, you can use the >> operator with an anonymous function:
        * graph.V ~> findKittens >> (_.headOption)
        *
        */
      def ~>[OutEnd, OutLabels <: HList]
      (f: GremlinScala[End, Labels] => GremlinScala[OutEnd, OutLabels]):
      GremlinScala[OutEnd, OutLabels] = f(gs)


      /**
        * Apply a function to a query pipeline, returning some result
        *
{'fraction_non_alphanumeric': 0.09829777031886838, 'fraction_numerical': 0.0, 'mean_word_length': 2.479566305254379, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 29, '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': '251034', 'n_tokens_mistral': 1311, 'n_tokens_neox': 1270, 'n_words': 365}