<commit_before>------------------------------------------------------------------------------
--
--  LGI Gtk3 override module.
--
--  Copyright (c) 2010, 2011 <NAME>
--  Licensed under the MIT license:
--  http://www.opensource.org/licenses/mit-license.php
--
------------------------------------------------------------------------------

local select, type, pairs, ipairs, unpack, setmetatable, error, next, rawget
   = select, type, pairs, ipairs, unpack, setmetatable, error, next, rawget
local lgi = require 'lgi'
local core = require 'lgi.core'
local Gtk = lgi.Gtk
local Gdk = lgi.Gdk
local GObject = lgi.GObject
local cairo = lgi.cairo

local log = lgi.log.domain('lgi.Gtk')

-- Initialize GTK.
Gtk.disable_setlocale()
assert(Gtk.init_check())

-- Gtk.Allocation is just an alias to Gdk.Rectangle.
Gtk.Allocation = Gdk.Rectangle

-------------------------------- Gtk.Widget overrides.
Gtk.Widget._attribute = {
   width = { get = Gtk.Widget.get_allocated_width },
   height = { get = Gtk.Widget.get_allocated_height },
   events = {},
   style = {},
}

-- Add widget attributes for some get/set method combinations not covered by
-- native widget properties.
for _, name in pairs { 'allocation', 'direction', 'settings', 'realized',
		       'mapped', 'display', 'screen', 'window', 'root_window',
		       'has_window', 'style_context' } do
   if not Gtk.Widget._property[name] then<commit_msg>Add compat for lua 5.3<commit_after>------------------------------------------------------------------------------
--
--  LGI Gtk3 override module.
--
--  Copyright (c) 2010, 2011 <NAME>
--  Licensed under the MIT license:
--  http://www.opensource.org/licenses/mit-license.php
--
------------------------------------------------------------------------------

local select, type, pairs, ipairs, unpack, setmetatable, error, next, rawget
   = select, type, pairs, ipairs, unpack or table.unpack, setmetatable, error, next, rawget
local lgi = require 'lgi'
local core = require 'lgi.core'
local Gtk = lgi.Gtk
local Gdk = lgi.Gdk
local GObject = lgi.GObject
local cairo = lgi.cairo

local log = lgi.log.domain('lgi.Gtk')

-- Initialize GTK.
Gtk.disable_setlocale()
assert(Gtk.init_check())

-- Gtk.Allocation is just an alias to Gdk.Rectangle.
Gtk.Allocation = Gdk.Rectangle

-------------------------------- Gtk.Widget overrides.
Gtk.Widget._attribute = {
   width = { get = Gtk.Widget.get_allocated_width },
   height = { get = Gtk.Widget.get_allocated_height },
   events = {},
   style = {},
}

-- Add widget attributes for some get/set method combinations not covered by
-- native widget properties.
for _, name in pairs { 'allocation', 'direction', 'settings', 'realized',
		       'mapped', 'display', 'screen', 'window', 'root_window',
		       'has_window', 'style_context' } do
   if not Gtk.Widget._property[name] then
{'fraction_non_alphanumeric': 0.25097207493814067, 'fraction_numerical': 0.007069635913750442, 'mean_word_length': 2.1270718232044197, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '2716843', 'n_tokens_mistral': 868, 'n_tokens_neox': 835, 'n_words': 237}