<commit_before>#!/usr/bin/env python

import functools

def notify_stdout(msg, key=None, **kwargs):
	print msg

libnotify_ids = {}
def notify_libnotify(msg, key=None, timeout=1, **kwargs):
	import dbus, wmiidbus

	session_bus = wmiidbus.get_session_bus(start_thread=False)
	proxy = session_bus.get_object('org.freedesktop.Notifications', '/org/freedesktop/Notifications')
	notifications = dbus.Interface(proxy, 'org.freedesktop.Notifications')

	id = libnotify_ids.get(key, 0)
	id = notifications.Notify('purple-DBus-Example-2-libnotify', id, '', '', msg, [], {}, timeout)
	if key is not None:
		libnotify_ids[key] = id

notify = notify_libnotify

def notify_exception(arg):
	"""
	Decorator to catch unhandled exceptions and display some info.
	Exceptions are re-raised to allow normal exception handling to occur.
	"""
	comment = None
	def wrap1(f):<commit_msg>i3 companion: Change default notification to 1000ms<commit_after>#!/usr/bin/env python

import functools

def notify_stdout(msg, key=None, **kwargs):
	print msg

libnotify_ids = {}
def notify_libnotify(msg, key=None, timeout=1000, **kwargs):
	import dbus, wmiidbus

	session_bus = wmiidbus.get_session_bus(start_thread=False)
	proxy = session_bus.get_object('org.freedesktop.Notifications', '/org/freedesktop/Notifications')
	notifications = dbus.Interface(proxy, 'org.freedesktop.Notifications')

	id = libnotify_ids.get(key, 0)
	id = notifications.Notify('purple-DBus-Example-2-libnotify', id, '', '', msg, [], {}, timeout)
	if key is not None:
		libnotify_ids[key] = id

notify = notify_libnotify

def notify_exception(arg):
	"""
	Decorator to catch unhandled exceptions and display some info.
	Exceptions are re-raised to allow normal exception handling to occur.
	"""
	comment = None
	def wrap1(f):
{'fraction_non_alphanumeric': 0.12407932011331445, 'fraction_numerical': 0.009065155807365438, 'mean_word_length': 5.664150943396226, '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': '5385734', 'n_tokens_mistral': 615, 'n_tokens_neox': 587, 'n_words': 143}