<commit_before>class Node
  attr_accessor :weight, :neighbors

  def initialize(weight: weight, neighbors: [])
    @weight    = weight
    @neighbors = neighbors
  end

  def self.bf_search(start)
    open = Array.new
    open.push(start)

    distance = Hash.new
    distance[start] = 0

    while(current = open.shift)
      current.neighbors.each do |neighbor|
        unless distance[neighbor]
          distance[neighbor] = distance[current] + 1
          open.push(neighbor)
        end
      end
    end

    return distance
  end
end
<commit_msg>refinement<commit_after>class Node
  attr_accessor :weight, :neighbors

  def initialize(weight: weight, neighbors: [])
    @weight    = weight
    @neighbors = neighbors
  end

  def self.bf_search(start)
    open = Array.new
    open.push(start)

    distances = Hash.new
    distances[start] = 0

    while(current = open.shift)
      current.neighbors.each do |neighbor|
        unless distances[neighbor]
          distances[neighbor] = distances[current] + 1
          open.push(neighbor)
        end
      end
    end

    return distances
  end
end

{'fraction_non_alphanumeric': 0.08820882088208822, 'fraction_numerical': 0.0036003600360036, 'mean_word_length': 2.4641744548286604, 'pattern_counts': {'":': 0, '<': 3, '<?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': '4892400', 'n_tokens_mistral': 360, 'n_tokens_neox': 342, 'n_words': 82}