<commit_before>import logging
import os.path
import platform
import re
import argparse

logger = logging.getLogger(__name__)

class ParseError(Exception):
    pass


class HeaderHandler(object):

    def __init__(self, include_paths):
        self.include_paths = list(include_paths)

    def open_local_header(self, current_header, include_header):
        header_path = os.path.join(os.path.dirname(current_header),
                                   include_header)
        return self._open(os.path.normpath(header_path))

    def _open(self, header_path):
        try:
            f = open(header_path)
        except IOError:
            return None
        else:
            return f        

    def add_include_paths(self, include_paths):
        self.include_paths.extend(include_paths)

    def open_header(self, include_header):
        for include_path in self.include_paths:
            header_path = os.path.join(include_path, include_header)
            f = self._open(os.path.normpath(header_path))
            if f:
                break
        return f


def calculate_windows_constants(bitness=None):
    if bitness is None:
        bitness, _ = platform.architecture()
    constants = {<commit_msg>Remove trailing whitespace<commit_after>import logging
import os.path
import platform
import re
import argparse

logger = logging.getLogger(__name__)

class ParseError(Exception):
    pass


class HeaderHandler(object):

    def __init__(self, include_paths):
        self.include_paths = list(include_paths)

    def open_local_header(self, current_header, include_header):
        header_path = os.path.join(os.path.dirname(current_header),
                                   include_header)
        return self._open(os.path.normpath(header_path))

    def _open(self, header_path):
        try:
            f = open(header_path)
        except IOError:
            return None
        else:
            return f

    def add_include_paths(self, include_paths):
        self.include_paths.extend(include_paths)

    def open_header(self, include_header):
        for include_path in self.include_paths:
            header_path = os.path.join(include_path, include_header)
            f = self._open(os.path.normpath(header_path))
            if f:
                break
        return f


def calculate_windows_constants(bitness=None):
    if bitness is None:
        bitness, _ = platform.architecture()
    constants = {
{'fraction_non_alphanumeric': 0.07770961145194274, 'fraction_numerical': 0.0, 'mean_word_length': 2.45968882602546, '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': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '476984', 'n_tokens_mistral': 697, 'n_tokens_neox': 680, 'n_words': 150}