<commit_before>"""
Common utilities for the shell manager.
"""

from os import listdir, unlink, sep
from os.path import join, isdir, isfile

import shutil
from shutil import copytree, copy2

#I will never understand why the shutil functions act
#the way they do...

def full_copy(source, destination, ignore=[]):
    for f in listdir(source):
        if f in ignore:
            continue
        source_item = join(source, f)
        destination_item = join(destination, f)

        if isdir(source_item):
            if not isdir(destination_item):
                copytree(source_item, destination_item)
        else:
            copy2(source_item, destination_item)

def move(source, destination, clobber=True):
    file_name = source
    if sep in source:
        file_name = source.split(sep)[-1]

    new_path = join(destination, file_name)
    if clobber and isfile(new_path):
        unlink(new_path)

    shutil.move(source, destination)
<commit_msg>Additional clarity.<commit_after>"""
Common utilities for the shell manager.
"""

from os import listdir, unlink, sep
from os.path import join, isdir, isfile

import shutil
from shutil import copytree, copy2

#I will never understand why the shutil functions act
#the way they do...

def full_copy(source, destination, ignore=[]):
    for f in listdir(source):
        if f in ignore:
            continue
        source_item = join(source, f)
        destination_item = join(destination, f)

        if isdir(source_item):
            if not isdir(destination_item):
                copytree(source_item, destination_item)
        else:
            copy2(source_item, destination_item)

def move(source, destination, clobber=True):
    if sep in source:
        file_name = source.split(sep)[-1]
    else:
        file_name = source

    new_path = join(destination, file_name)
    if clobber and isfile(new_path):
        unlink(new_path)

    shutil.move(source, destination)

{'fraction_non_alphanumeric': 0.08565531475748193, 'fraction_numerical': 0.0030959752321981426, 'mean_word_length': 2.878, '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': '6326680', 'n_tokens_mistral': 581, 'n_tokens_neox': 573, 'n_words': 182}