<commit_before>module SecretSharing
  # This class is used to store a two dimensional point consisting of integers.
  class Point
    attr_accessor :x, :y

    # Create a Point object.
    #
    # Examples
    #
    #   Point.new(1, 2)
    #   # => #<Point: @x=1 @y=2>
    #
    # @param x [Integer] The x value of the point
    # @param y [Integer] The y value of the point
    def initialize(x, y)
      @x = x
      @y = y
    end

    # A nicer inspection of a point object than by default.
    #
    # @return [String] String representation of a Point
    #
    # Examples
    #
    #   SecretSharing::Point.new(1, 2).inspect
    #   # => "#<Point: @x=1 @y=2>"
    def inspect
      "#<Point: @x=#{x} @y=#{y}>"
    end

    # An implementation similar to Array#transpose for Arrays of Points
    #
    # @return [Array] Two Arrays in an Array
    #
    # Examples
    #
    #   point1 = SecretSharing::Point.new(1, 2)
    #   point2 = SecretSharing::Point.new(3, 4)
    #   points = [point1, point2]
    #   Point.transpose(points)
    #   # => [[1, 3], [2, 4]]
    def self.transpose(points)
      x_values = []
      y_values = []

      points.each do |point|
        x_values << point.x
        y_values << point.y
      end
      [x_values, y_values]
    end
  end
end
<commit_msg>make point immutable<commit_after>module SecretSharing
  # This class is used to store a two dimensional point consisting of integers.
  class Point
    attr_reader :x, :y

    # Create a Point object.
    #
    # Examples
    #
    #   Point.new(1, 2)
    #   # => #<Point: @x=1 @y=2>
    #
    # @param x [Integer] The x value of the point
    # @param y [Integer] The y value of the point
    def initialize(x, y)
      @x = x
      @y = y
    end

    # A nicer inspection of a point object than by default.
    #
    # @return [String] String representation of a Point
    #
    # Examples
    #
    #   SecretSharing::Point.new(1, 2).inspect
    #   # => "#<Point: @x=1 @y=2>"
    def inspect
      "#<Point: @x=#{x} @y=#{y}>"
    end

    # An implementation similar to Array#transpose for Arrays of Points
    #
    # @return [Array] Two Arrays in an Array
    #
    # Examples
    #
    #   point1 = SecretSharing::Point.new(1, 2)
    #   point2 = SecretSharing::Point.new(3, 4)
    #   points = [point1, point2]
    #   Point.transpose(points)
    #   # => [[1, 3], [2, 4]]
    def self.transpose(points)
      x_values = []
      y_values = []

      points.each do |point|
        x_values << point.x
        y_values << point.y
      end
      [x_values, y_values]
    end
  end
end

{'fraction_non_alphanumeric': 0.12601468882875919, 'fraction_numerical': 0.015461925009663703, 'mean_word_length': 2.0411280846063455, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 15, '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': '6510529', 'n_tokens_mistral': 923, 'n_tokens_neox': 900, 'n_words': 268}