<commit_before># coding: utf-8
import os.path
import platform
import sys

if getattr(sys, 'frozen', False):
    desktop_icon = os.path.abspath(
        os.path.join(
            os.path.dirname(sys.executable), 'resources', 'icons8-Module-128.png'
        )
    )
else:
    desktop_icon = os.path.abspath(
        os.path.join(
            os.path.dirname(__file__), 'gui', 'resources', 'icons8-Module-128.png'
        )
    )

if platform.system() == 'Darwin':
    from AppKit import NSImage
    from Foundation import NSUserNotificationDefaultSoundName
    import objc

    NSUserNotification = objc.lookUpClass('NSUserNotification')
    NSUserNotificationCenter = objc.lookUpClass('NSUserNotificationCenter')

    def desktop_notify(text, title=None, sound=False):
        title = title or 'Modder'

        notification = NSUserNotification.alloc().init()
        notification.setTitle_(title.decode('utf-8'))
        notification.setInformativeText_(text.decode('utf-8'))
        notification.setValue_forKey_(NSImage.alloc().initWithContentsOfFile_(desktop_icon), '_identityImage')

        if sound:
            notification.setSoundName_(NSUserNotificationDefaultSoundName)

        NSUserNotificationCenter.defaultUserNotificationCenter().deliverNotification_(notification)  # noqa

elif platform.system() == 'Windows':
    from win10toast import ToastNotifier

    def desktop_notify(text, title=None, sound=False):
        title = title or 'Modder'

        ToastNotifier().show_toast(<commit_msg>Fix desktop icon file path<commit_after># coding: utf-8
import os.path
import platform
import sys

if getattr(sys, 'frozen', False):
    desktop_icon = os.path.abspath(
        os.path.join(
            os.path.dirname(sys.executable),
            'resources', 'icons8-Module-128.png'
        )
    )
else:
    desktop_icon = os.path.abspath(
        os.path.join(
            os.path.dirname(__file__),
            '..', 'gui', 'resources', 'icons8-Module-128.png'
        )
    )

if platform.system() == 'Darwin':
    from AppKit import NSImage
    from Foundation import NSUserNotificationDefaultSoundName
    import objc

    NSUserNotification = objc.lookUpClass('NSUserNotification')
    NSUserNotificationCenter = objc.lookUpClass('NSUserNotificationCenter')

    def desktop_notify(text, title=None, sound=False):
        title = title or 'Modder'

        notification = NSUserNotification.alloc().init()
        notification.setTitle_(title.decode('utf-8'))
        notification.setInformativeText_(text.decode('utf-8'))
        # This is a private API to replace notification icon,
        # ref: https://stackoverflow.com/a/24940893
        notification.setValue_forKey_(NSImage.alloc().initWithContentsOfFile_(desktop_icon), '_identityImage')  # noqa

        if sound:
            notification.setSoundName_(NSUserNotificationDefaultSoundName)

        NSUserNotificationCenter.defaultUserNotificationCenter().deliverNotification_(notification)  # noqa

elif platform.system() == 'Windows':
    from win10toast import ToastNotifier

    def desktop_notify(text, title=None, sound=False):
        title = title or 'Modder'

        ToastNotifier().show_toast(
{'fraction_non_alphanumeric': 0.10751336057843446, 'fraction_numerical': 0.01068846274756366, 'mean_word_length': 3.3529411764705883, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 1, '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': '3612629', 'n_tokens_mistral': 935, 'n_tokens_neox': 898, 'n_words': 173}