<commit_before>import ctypes
import os
import sys
import threading


def _linux_gettid():
    """Return system thread id or pid in single thread process"""
    return _libgettid.gettid()


def _universal_gettid():
    """Give up and just use Python's threading ident"""
    return threading.current_thread().ident


if 'linux' in sys.platform:
    _PATH = os.path.dirname(os.path.abspath(__file__))
    _libgettid = ctypes.cdll.LoadLibrary(os.path.join(_PATH, '_libgettid.so'))
    _libgettid.gettid.restype = ctypes.c_int
    _libgettid.gettid.argtypes = []
    gettid = _linux_gettid
else:
    gettid = _universal_gettid<commit_msg>Fallback to universal gettid even on linux<commit_after>import ctypes
import os
import sys
import threading


def _linux_gettid():
    """Return system thread id or pid in single thread process"""
    return _libgettid.gettid()


def _universal_gettid():
    """Give up and just use Python's threading ident"""
    return threading.current_thread().ident


if 'linux' in sys.platform:
    try:
        _PATH = os.path.dirname(os.path.abspath(__file__))
        _libgettid = ctypes.cdll.LoadLibrary(
                os.path.join(_PATH, '_libgettid.so'))
        _libgettid.gettid.restype = ctypes.c_int
        _libgettid.gettid.argtypes = []
    except:
        gettid = _universal_gettid
    else:
        gettid = _linux_gettid
else:
    gettid = _universal_gettid
{'fraction_non_alphanumeric': 0.09857142857142857, 'fraction_numerical': 0.0, 'mean_word_length': 3.4903846153846154, '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': '2601041', 'n_tokens_mistral': 468, 'n_tokens_neox': 450, 'n_words': 113}