<commit_before># Represents a single cell in the Sudoku puzzle.
# Coordinates are offered by @row and @column (1-9)
# A cell is considered solved when the @solution != 0
# Cells are required to have coordinates.
# Cell solution defaults to 0 and must be set manually for solved cells.
class Cell
  attr_reader :row, :column, :solution
  attr_accessor :possible_solutions

  def initialize(row, column, solution = 0)
    @row = row
    @column = column
    @solution = solution
    @possible_solutions = []
  end

  def solve
    if @possible_solutions.length == 1
      @solution = @possible_solutions.pop
    end
  end

  def solved?
    !@solution.zero?
  end

  def coordinates
    [@row, @column]
  end

  def to_s
    "row: #{@row}, column: #{@column}"
  end
end

# Parent class for groups of cells. Used by Row, Column, and Grid.
# Provides shared methods for checking and validating solutions.
class CellGroup
  attr_reader :cells, :position

  def solved?
    @cells.length == 9 && @cells.all? { |cell| cell.solved? } && valid_solution
  end

  def solutions
    @cells.map { |cell| cell.solution }
  end
<commit_msg>:cat: add unsolved helper<commit_after># Represents a single cell in the Sudoku puzzle.
# Coordinates are offered by @row and @column (1-9)
# A cell is considered solved when the @solution != 0
# Cells are required to have coordinates.
# Cell solution defaults to 0 and must be set manually for solved cells.
class Cell
  attr_reader :row, :column, :solution
  attr_accessor :possible_solutions, :test_solutions

  def initialize(row, column, solution = 0)
    @row = row
    @column = column
    @solution = solution
    @possible_solutions = []
    @test_solutions = []
  end

  def solve
    if @test_solutions.length == 1
      @solution = @test_solutions.pop
    end
  end

  def solved?
    !@solution.zero?
  end

  def coordinates
    [@row, @column]
  end

  def to_s
    "row: #{@row}, column: #{@column}"
  end
end

# Parent class for groups of cells. Used by Row, Column, and Grid.
# Provides shared methods for checking and validating solutions.
class CellGroup
  attr_reader :cells, :position

  def solved?
    @cells.length == 9 && @cells.all? { |cell| cell.solved? } && valid_solution
  end

  def unsolved
    @cells.select { |cell| !cell.solved? }
  end

  def solutions
    @cells.map { |cell| cell.solution }
  end

{'fraction_non_alphanumeric': 0.09699279966116052, 'fraction_numerical': 0.005929690808979246, 'mean_word_length': 3.27124773960217, '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': '5666917', 'n_tokens_mistral': 778, 'n_tokens_neox': 725, 'n_words': 275}