<commit_before>module Pacer
  class RubyGraph
    import com.tinkerpop.blueprints.pgm.Element
    import com.tinkerpop.blueprints.pgm.Graph

    include Graph

    class << self
      def next_graph_id
        @next_graph_id = 0 unless defined? @next_graph_id
        @next_graph_id += 1
      end
    end

    def initialize
      @graph_id = RubyGraph.next_graph_id
      clear
    end

    def element_class
      RubyElement
    end

    def vertex_class
      RubyVertex
    end

    def edge_class
      RubyEdge
    end

    def addVertex(id)
      id ||= next_id
      @vertices[id] = vertex_class.new self, id
    end

    def getVertex(id)
      @vertices[id]
    end

    def removeVertex(vertex)
      @vertices.delete vertex.element_id
    end

    def getVertices
      Pacer::Pipes::EnumerablePipe.new @vertices.values
    end

    def addEdge(id, outVertex, inVertex, label)
      id ||= next_id
      @edges[id] = edge_class.new self, id, outVertex, inVertex, label
    end

    def getEdge(id)
      @edges[id]
    end

    def removeEdge(edge)
      @edges.delete edge.element_id
    end

    def getEdges
      Pacer::Pipes::EnumerablePipe.new @edges.values
    end

    def clear
      if defined? @vertices
        getEdges.each { |e| e.clear }
        getVertices.each { |v| v.clear }
      end
      @vertices = {}
      @edges = {}
      @next_id = 0
    end

    def shutdown
      clear
    end

    def ==(other)
      other.equal? self
    end

    include GraphExtensions
<commit_msg>Remove relic<commit_after>module Pacer
  class RubyGraph
    import com.tinkerpop.blueprints.pgm.Element
    import com.tinkerpop.blueprints.pgm.Graph

    include Graph

    class << self
      def next_graph_id
        @next_graph_id = 0 unless defined? @next_graph_id
        @next_graph_id += 1
      end
    end

    def initialize
      @graph_id = RubyGraph.next_graph_id
      clear
    end

    def element_class
      RubyElement
    end

    def vertex_class
      RubyVertex
    end

    def edge_class
      RubyEdge
    end

    def addVertex(id)
      id ||= next_id
      @vertices[id] = vertex_class.new self, id
    end

    def getVertex(id)
      @vertices[id]
    end

    def removeVertex(vertex)
      @vertices.delete vertex.element_id
    end

    def getVertices
      Pacer::Pipes::EnumerablePipe.new @vertices.values
    end

    def addEdge(id, outVertex, inVertex, label)
      id ||= next_id
      @edges[id] = edge_class.new self, id, outVertex, inVertex, label
    end

    def getEdge(id)
      @edges[id]
    end

    def removeEdge(edge)
      @edges.delete edge.element_id
    end

    def getEdges
      Pacer::Pipes::EnumerablePipe.new @edges.values
    end

    def clear
      @vertices = {}
      @edges = {}
      @next_id = 0
    end

    def shutdown
      clear
    end

    def ==(other)
      other.equal? self
    end

    include GraphExtensions

{'fraction_non_alphanumeric': 0.07422680412371134, 'fraction_numerical': 0.002061855670103093, 'mean_word_length': 2.0322916666666666, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 3, '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': '1061016', 'n_tokens_mistral': 986, 'n_tokens_neox': 936, 'n_words': 233}