<commit_before>import os
import stat
import logging
import time

import six.moves.configparser as configparser
from pkglib.six.moves.urllib.error import HTTPError
from pkglib.six.moves.urllib.request import HTTPBasicAuthHandler, Request, build_opener
from pkglib.six.moves.urllib.parse import urlencode

from pkglib import errors


def get_log():
    return logging.getLogger(__name__)


class PyPIRC(object):

    _no_arg = object()

    def __init__(self, filename=None, check_permissions=True):
        self.cfg = self._read_pypirc(filename, check_permissions)
        self._ensure_distutils_section_exists()

    def _read_pypirc(self, filename, check_permissions=True):
        cfg = configparser.ConfigParser()
        if filename is None or not os.path.exists(filename):
            return cfg

        st_mode = os.stat(filename).st_mode
        if check_permissions and st_mode & (stat.S_IRGRP | stat.S_IWGRP |
                                            stat.S_IROTH | stat.S_IWOTH) != 0:<commit_msg>Fixing a six import to use pkglib.six.<commit_after>import os
import stat
import logging
import time

from pkglib.six.moves import configparser
from pkglib.six.moves.urllib.error import HTTPError
from pkglib.six.moves.urllib.request import HTTPBasicAuthHandler, Request, build_opener
from pkglib.six.moves.urllib.parse import urlencode

from pkglib import errors


def get_log():
    return logging.getLogger(__name__)


class PyPIRC(object):

    _no_arg = object()

    def __init__(self, filename=None, check_permissions=True):
        self.cfg = self._read_pypirc(filename, check_permissions)
        self._ensure_distutils_section_exists()

    def _read_pypirc(self, filename, check_permissions=True):
        cfg = configparser.ConfigParser()
        if filename is None or not os.path.exists(filename):
            return cfg

        st_mode = os.stat(filename).st_mode
        if check_permissions and st_mode & (stat.S_IRGRP | stat.S_IWGRP |
                                            stat.S_IROTH | stat.S_IWOTH) != 0:
{'fraction_non_alphanumeric': 0.07937285644292014, 'fraction_numerical': 0.0009799118079372856, 'mean_word_length': 3.227743271221532, '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': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3193768', 'n_tokens_mistral': 663, 'n_tokens_neox': 642, 'n_words': 149}