<commit_before>import os
import shutil
import subprocess

from toydist.installed_package_description import \
    InstalledPkgDescription, iter_files

from toydist.commands.core import \
    Command, UsageException
from toydist.core.utils import \
    pprint

def copy_installer(source, target, kind):
    dtarget = os.path.dirname(target)
    if not os.path.exists(dtarget):
        os.makedirs(dtarget)
    shutil.copy(source, target)
    if kind == "executables":
        os.chmod(target, 0555)

def unix_installer(source, target, kind):
    if kind in ["executables"]:
        mode = "755"
    else:
        mode = "644"
    cmd = ["install", "-m", mode, source, target]
    strcmd = "INSTALL %s -> %s" % (source, target)
    pprint('GREEN', strcmd)
    if not os.path.exists(os.path.dirname(target)):<commit_msg>BUG: fix permissions on installed scripts.<commit_after>import os
import shutil
import subprocess

from toydist.installed_package_description import \
    InstalledPkgDescription, iter_files

from toydist.commands.core import \
    Command, UsageException
from toydist.core.utils import \
    pprint

def copy_installer(source, target, kind):
    dtarget = os.path.dirname(target)
    if not os.path.exists(dtarget):
        os.makedirs(dtarget)
    shutil.copy(source, target)
    if kind == "executables":
        os.chmod(target, 0755)

def unix_installer(source, target, kind):
    if kind in ["executables"]:
        mode = "755"
    else:
        mode = "644"
    cmd = ["install", "-m", mode, source, target]
    strcmd = "INSTALL %s -> %s" % (source, target)
    pprint('GREEN', strcmd)
    if not os.path.exists(os.path.dirname(target)):
{'fraction_non_alphanumeric': 0.1190619362597715, 'fraction_numerical': 0.012026458208057728, 'mean_word_length': 3.390501319261214, 'pattern_counts': {'":': 2, '<': 3, '<?xml version=': 0, '>': 5, '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': '5909588', 'n_tokens_mistral': 559, 'n_tokens_neox': 540, 'n_words': 138}