<commit_before>module Vectorize
  # Example usage:
  # Vectorize.draw(200, 200) do |v|
  #   v.move_to(100, 100)
  #   v.line_to(175, 175)
  #   v.stroke
  #
  #   v.save_as "foo.png"
  # end
  def self.draw(width, height)
    surface = Surfaces::Image.new(width, height)
    dsl     = DSL.new(surface)

    yield dsl
  end

  class DSL
    def initialize(surface)
      @surface = surface
    end

    def move_to(x, y)
      CairoWrapper.cairo_move_to(@surface.context, x, y)
    end

    def line_to(x, y)
      CairoWrapper.cairo_line_to(@surface.context, x, y)
    end

    def stroke
      CairoWrapper.cairo_stroke(@surface.context)
    end

    def save_as(filename)
      @surface.write_to_png(filename)
    end
  end
end<commit_msg>Minor method rename<commit_after>module Vectorize
  # Example usage:
  # Vectorize.draw(200, 200) do |v|
  #   v.move_to(100, 100)
  #   v.line_to(175, 175)
  #   v.stroke
  #
  #   v.save_as_png "foo.png"
  # end
  def self.draw(width, height)
    surface = Surfaces::Image.new(width, height)
    dsl     = DSL.new(surface)

    yield dsl
  end

  class DSL
    def initialize(surface)
      @surface = surface
    end

    def move_to(x, y)
      CairoWrapper.cairo_move_to(@surface.context, x, y)
    end

    def line_to(x, y)
      CairoWrapper.cairo_line_to(@surface.context, x, y)
    end

    def stroke
      CairoWrapper.cairo_stroke(@surface.context)
    end

    def save_as_png(filename)
      @surface.write_to_png(filename)
    end
  end
end
{'fraction_non_alphanumeric': 0.1081441922563418, 'fraction_numerical': 0.02403204272363151, 'mean_word_length': 2.5775656324582337, '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': '1508101', 'n_tokens_mistral': 609, 'n_tokens_neox': 561, 'n_words': 117}