<commit_before># -*- coding: utf-8 -*-
"""
============================
crossplatformshell
============================
"""
from __future__ import (print_function, division, absolute_import,
                       unicode_literals)

import pathlib
import io
import os
import shutil
import distutils.dir_util

# Use subprocess32 if available
try:
    import subprocess32 as subprocess
except:
    import subprocess as subprocess

# Versioneer versioning
from ._version import get_versions
__version__ = get_versions()['version']
del get_versions


def new_path(path_string):
    """Return pathlib.Path, expanding '~' to a user's HOME directory"""
    return pathlib.Path(os.path.expanduser(path_string))


def copy(src_path, dst_path):
    shutil.copy(str(src_path), str(dst_path))

cp = copy


def copy_tree(src_path, dst_path):
    """Recursively copy all files and folders from src_path to dst_path"""
    distutils.dir_util.copy_tree(str(src_path), str(dst_path))

cp_r = copy_tree

def mkdir(path):
    """Make a directory from the specified path"""
    os.mkdir(str(path))


def remove(path):
    """Remove the specified path."""
    os.remove(str(path))

def rm(*args):
    for path in args:
        try:
            os.remove(str(path))
        except OSError:
            pass

def rmtree(path):
    """Recursively remove paths."""
    shutil.rmtree(str(path))

def rm_rf(path):
    """Recursively delete directories, if they exist"""
    try:
        shutil.rmtree(str(path))
    except OSError:
        pass

def read_file(filename):
    return io.open(str(filename)).read()


def write_file(filename, string, encoding="utf-8"):
    io.open(str(filename), 'w', encoding=encoding).write(string)

<commit_msg>Updated rm_rf<commit_after># -*- coding: utf-8 -*-
"""
============================
crossplatformshell
============================
"""
from __future__ import (print_function, division, absolute_import,
                       unicode_literals)

import pathlib
import io
import os
import shutil
import distutils.dir_util

# Use subprocess32 if available
try:
    import subprocess32 as subprocess
except:
    import subprocess as subprocess

# Versioneer versioning
from ._version import get_versions
__version__ = get_versions()['version']
del get_versions


def new_path(path_string):
    """Return pathlib.Path, expanding '~' to a user's HOME directory"""
    return pathlib.Path(os.path.expanduser(path_string))


def copy(src_path, dst_path):
    shutil.copy(str(src_path), str(dst_path))

cp = copy


def copy_tree(src_path, dst_path):
    """Recursively copy all files and folders from src_path to dst_path"""
    distutils.dir_util.copy_tree(str(src_path), str(dst_path))

cp_r = copy_tree

def mkdir(*args):
    """Make a directory from the specified path"""
    for arg in args:
        os.mkdir(str(path))


def remove(path):
    """Remove the specified path."""
    os.remove(str(path))


def rm(*args):
    for path in args:
        try:
            os.remove(str(path))
        except OSError:
            pass


def rmtree(path):
    """Recursively remove paths."""
    shutil.rmtree(str(path))


def rm_rf(*args):
    """Recursively delete directories, if they exist"""
    for path in args:
        try:
            os.remove(str(path))
        except OSError:
            pass


def read_file(filename):
    return io.open(str(filename)).read()


def write_file(filename, string, encoding="utf-8"):
    io.open(str(filename), 'w', encoding=encoding).write(string)
{'fraction_non_alphanumeric': 0.14583929082070346, 'fraction_numerical': 0.0034315127251930227, 'mean_word_length': 3.689008042895442, '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': '4867269', 'n_tokens_mistral': 1112, 'n_tokens_neox': 1075, 'n_words': 287}