<commit_before>#!/usr/bin/env python
# coding=utf-8

from __future__ import print_function
import distutils.dir_util as distutils
import filecmp
import hashlib
import glob
import plistlib
import os
import os.path
import shutil
from zipfile import ZipFile, ZIP_DEFLATED

import biplist


# Create parent directories for the given path if they don't exist
def create_parent_dirs(path):
    parent_path = os.path.dirname(path)
    if parent_path:
        try:
            os.makedirs(parent_path)
        except OSError:
            pass


# Retrieve correct path to directory containing Alfred's user preferences
def get_user_prefs_dir():

    library_dir = os.path.join(os.path.expanduser('~'), 'Library')
    core_prefs = biplist.readPlist(os.path.join(
        library_dir, 'Preferences',
        'com.runningwithcrayons.Alfred-Preferences-3.plist'))

    # If user is syncing their preferences using a syncing service
    if 'syncfolder' in core_prefs:
        return os.path.expanduser(core_prefs['syncfolder'])
    else:
        return os.path.join(
            library_dir, 'Application Support', 'Alfred 3')<commit_msg>Point to Alfred 4 plist and data store<commit_after>#!/usr/bin/env python
# coding=utf-8

from __future__ import print_function
import distutils.dir_util as distutils
import filecmp
import hashlib
import glob
import plistlib
import os
import os.path
import shutil
from zipfile import ZipFile, ZIP_DEFLATED

import biplist


# Create parent directories for the given path if they don't exist
def create_parent_dirs(path):
    parent_path = os.path.dirname(path)
    if parent_path:
        try:
            os.makedirs(parent_path)
        except OSError:
            pass


# Retrieve correct path to directory containing Alfred's user preferences
def get_user_prefs_dir():

    library_dir = os.path.join(os.path.expanduser('~'), 'Library')
    core_prefs = biplist.readPlist(os.path.join(
        library_dir, 'Preferences',
        'com.runningwithcrayons.Alfred-Preferences.plist'))

    # If user is syncing their preferences using a syncing service
    if 'syncfolder' in core_prefs:
        return os.path.expanduser(core_prefs['syncfolder'])
    else:
        return os.path.join(
            library_dir, 'Application Support', 'Alfred')
{'fraction_non_alphanumeric': 0.08058124174372523, 'fraction_numerical': 0.002201673271686482, 'mean_word_length': 3.5258964143426295, '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': '2589102', 'n_tokens_mistral': 706, 'n_tokens_neox': 677, 'n_words': 199}