<commit_before>class Gui::EventQueue
  include Singleton

  import 'javax.swing.SwingUtilities'
  import 'javax.swing.Timer'

  def sync_exec(&callback)
    SwingUtilities.invokeAndWait(&callback)
  end
  
  def future_exec(seconds = 0, &callback)
    if seconds <= 0
      SwingUtilities.invokeLater(&callback)
    else
      Timer.new(seconds * 1000, lambda { |e|
        yield
      }).start()
    end
  end
end<commit_msg>Fix bug - Swing Timer defaults to repeating.<commit_after>class Gui::EventQueue
  include Singleton

  import 'javax.swing.SwingUtilities'
  import 'javax.swing.Timer'

  def sync_exec(&callback)
    SwingUtilities.invokeAndWait(&callback)
  end
  
  def future_exec(seconds = 0, &callback)
    if seconds <= 0
      SwingUtilities.invokeLater(&callback)
    else
      Timer.new(seconds * 1000, lambda { |e|
        yield
      }).tap do |timer|
        timer.setRepeats(false)
        timer.start()
      end
    end
  end
end
{'fraction_non_alphanumeric': 0.09853249475890985, 'fraction_numerical': 0.012578616352201259, 'mean_word_length': 2.9300411522633745, 'pattern_counts': {'":': 0, '<': 5, '<?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': '1502568', 'n_tokens_mistral': 319, 'n_tokens_neox': 305, 'n_words': 70}