<commit_before># Copyright 2014 ARM Limited
#
# Licensed under the Apache License, Version 2.0
# See LICENSE file for details.

# standard library modules, , ,
import os
import errno
import shutil
import stat

def mkDirP(path):
    try:
        os.makedirs(path)
    except OSError as exception:
        if exception.errno != errno.EEXIST:
            raise

def rmF(path):
    try:
        if isLink(path):
            rmLink(path)
        else:
            os.remove(path)
    except OSError as exception:
        if exception.errno != errno.ENOENT:
            raise

def _rmRfNoRetry(path):
    # we may have to make files writable before we can successfully delete
    # them, to do this
    def fixPermissions(fn, path, excinfo):
        if os.access(path, os.W_OK):
            raise
        else:
            os.chmod(path, stat.S_IWUSR)
            fn(path)
    try:
        if isLink(path):
            rmLink(path)
        elif os.path.isfile(path):
            rmF(path)
        else:
            shutil.rmtree(path, onerror=fixPermissions)
    except OSError as exception:
        if exception.errno == errno.ENOTDIR:
            rmF(path)<commit_msg>supress inaccurate error reported by updated pylint<commit_after># Copyright 2014 ARM Limited
#
# Licensed under the Apache License, Version 2.0
# See LICENSE file for details.

# standard library modules, , ,
import os
import errno
import shutil
import stat

def mkDirP(path):
    try:
        os.makedirs(path)
    except OSError as exception:
        if exception.errno != errno.EEXIST:
            raise

def rmF(path):
    try:
        if isLink(path):
            rmLink(path)
        else:
            os.remove(path)
    except OSError as exception:
        if exception.errno != errno.ENOENT:
            raise

def _rmRfNoRetry(path):
    # we may have to make files writable before we can successfully delete
    # them, to do this
    def fixPermissions(fn, path, excinfo):
        if os.access(path, os.W_OK):
            # there should always be an active exception when this function is
            # called, so a bare raise should be safe:
            raise #pylint: disable=misplaced-bare-raise
        else:
            os.chmod(path, stat.S_IWUSR)
            fn(path)
    try:
        if isLink(path):
            rmLink(path)
        elif os.path.isfile(path):
            rmF(path)
        else:
            shutil.rmtree(path, onerror=fixPermissions)
    except OSError as exception:
        if exception.errno == errno.ENOTDIR:
            rmF(path)
{'fraction_non_alphanumeric': 0.08080409932991722, 'fraction_numerical': 0.004729996058336618, 'mean_word_length': 2.028639618138425, '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': '4400201', 'n_tokens_mistral': 778, 'n_tokens_neox': 753, 'n_words': 234}