<commit_before>require 'browser/location'
require 'browser/navigator'
require 'browser/history'
require 'browser/cookies'
require 'browser/dom'

require 'browser/window/interval'
require 'browser/window/timeout'

module Browser

class Window < Native
  include DOM::Event::Target

  def alert(text)
    `#@native.alert(text)`
  end

  def location
    Location.new(`#@native.location`) if `#@native.location`
  end

  def navigator
    Navigator.new(`#@native.navigator`) if `#@native.navigator`
  end

  def history
    History.new(`#@native.history`) if `#@native.history`
  end

  def document
    DOM(`#@native.document`)
  end

  def every(time, &block)
    Interval.new(@native, time, &block)
  end

  def once(time, &block)
    Timeout.new(@native, time, &block)
  end

  alias once_after once

  alias after once
end

end

$window   = Browser::Window.new(`window`)
$document = $window.document

module Kernel
  def Window(what)
    Browser::Window.new(what)
  end

  def alert(text)
    $window.alert(text)
  end

  def log(what)
    `#{$window.to_n}.console.log(what)`
  end
end<commit_msg>window: remove useless Window helper<commit_after>require 'browser/location'
require 'browser/navigator'
require 'browser/history'
require 'browser/cookies'
require 'browser/dom'

require 'browser/window/interval'
require 'browser/window/timeout'

module Browser

class Window < Native
  include DOM::Event::Target

  def alert(text)
    `#@native.alert(text)`
  end

  def location
    Location.new(`#@native.<EMAIL>`) if `#@native.location`
  end

  def navigator
    Navigator.new(`#@native.navigator`) if `#@native.navigator`
  end

  def history
    History.new(`#@native.history`) if `#@native.history`
  end

  def document
    DOM(`#@native.document`)
  end

  def every(time, &block)
    Interval.new(@native, time, &block)
  end

  def once(time, &block)
    Timeout.new(@native, time, &block)
  end

  alias once_after once

  alias after once
end

end

$window   = Browser::Window.new(`window`)
$document = $window.document

module Kernel
  def alert(text)
    $window.alert(text)
  end

  def log(what)
    `#{$window.to_n}.console.log(what)`
  end
end
{'fraction_non_alphanumeric': 0.13401109057301294, 'fraction_numerical': 0.0, 'mean_word_length': 3.931662870159453, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 4, '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': '2845502', 'n_tokens_mistral': 758, 'n_tokens_neox': 725, 'n_words': 175}