<commit_before>from __future__ import absolute_import, unicode_literals, print_function, division

import os
import re
import sublime
import sublime_plugin
import threading
import subprocess
import functools
import os.path
import time


git_root_cache = {}
_has_warned = False


# Goal is to get: "Packages/Git", allowing for people who rename things
def find_plugin_directory():
    if ".sublime-package" in __file__:
        # zipped package, all we care about is the bit right before .sublime-package
        match = re.search(r"([^\\/]+)\.sublime-package", __file__)
        if match:
            return "Packages/" + match.group(1)
    if __file__.startswith('./'):
        # ST2, we get "./git/__init__.py" which is pretty useless since we want the part above that
        # However, os.getcwd() is the plugin directory!
        full = os.getcwd()
    else:
        # In a complete inversion, in ST3 when a plugin is loaded we
        # actually can trust __file__. It'll be something like:
        # /Users/dlynch/Library/Application Support/Sublime Text 3/Packages/Git/git/__init__.py
        full = os.path.normpath(os.path.join(os.path.dirname(__file__), '..'))
    dirname = os.path.split(full)[-1]
    return "Packages/" + dirname.replace(".sublime-package", "")
PLUGIN_DIRECTORY = find_plugin_directory()


def main_thread(callback, *args, **kwargs):<commit_msg>Fix to work with Windows backslashes in __file__<commit_after>from __future__ import absolute_import, unicode_literals, print_function, division

import os
import re
import sublime
import sublime_plugin
import threading
import subprocess
import functools
import os.path
import time


git_root_cache = {}
_has_warned = False


# Goal is to get: "Packages/Git", allowing for people who rename things
def find_plugin_directory():
    if ".sublime-package" in __file__:
        # zipped package, all we care about is the bit right before .sublime-package
        match = re.search(r"([^\\/]+)\.sublime-package", __file__)
        if match:
            return "Packages/" + match.group(1)
    if __file__.startswith('./') or __file__.startswith('.\\'):
        # ST2, we get "./git/__init__.py" which is pretty useless since we want the part above that
        # However, os.getcwd() is the plugin directory!
        full = os.getcwd()
    else:
        # In a complete inversion, in ST3 when a plugin is loaded we
        # actually can trust __file__. It'll be something like:
        # /Users/dlynch/Library/Application Support/Sublime Text 3/Packages/Git/git/__init__.py
        full = os.path.normpath(os.path.join(os.path.dirname(__file__), '..'))
    dirname = os.path.split(full)[-1]
    return "Packages/" + dirname.replace(".sublime-package", "")
PLUGIN_DIRECTORY = find_plugin_directory()


def main_thread(callback, *args, **kwargs):
{'fraction_non_alphanumeric': 0.11012433392539965, 'fraction_numerical': 0.003552397868561279, 'mean_word_length': 3.372670807453416, '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': '5851640', 'n_tokens_mistral': 884, 'n_tokens_neox': 855, 'n_words': 264}