<commit_before>#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
    :copyright: 2012 by OpenSlides team, see AUTHORS.
    :license: GNU GPL, see LICENSE for more details.
"""

import errno
import glob
import os
import re
import shutil
import sys
import zlib
zlib.Z_DEFAULT_COMPRESSION = zlib.Z_BEST_COMPRESSION
import zipfile

import distutils.ccompiler
import distutils.sysconfig

import pkg_resources

sys.path.insert(0, os.getcwd())
import openslides

COMMON_EXCLUDE = [
    r".pyc$",
    r".pyo$",
    r".po$",
    r".egg-info",
    r"\blocale/(?!de/|en/)[^/]+/"
]

LIBEXCLUDE = [
    r"^site-packages/",
    r"^test/",
    r"^curses/",
    r"^idlelib/",
    r"^lib2to3/",
    r"^lib-tk/",
    r"^msilib/",
    r"^multiprocessing/",
    r"^unittest/",
]


SITE_PACKAGES = {
    "django": {
        "copy": ["django"],
        "exclude": [
            r"^contrib/admindocs/",
            r"^contrib/comments/",
            r"^contrib/databrowse/",
            r"^contrib/flatpages/",
            r"^contrib/formtools/",
            r"^contrib/gis/",
            r"^contrib/humanize/",
            r"^contrib/localflavor/",
            r"^contrib/markup/",
            r"^contrib/redirects/",
            r"^contrib/sitemaps/",
            r"^contrib/syndication/",
            r"^contrib/webdesign/",
        ]
    },
    "django-mptt": {
        "copy": ["mptt"],
    },
    "reportlab": {
        "copy": [
            "reportlab",
            "_renderPM.pyd",
            "_rl_accel.pyd",
            "sgmlop.pyd",
            "pyHnj.pyd",
        ],
    },
    "pil": {
        # NOTE: PIL is a special case, see copy_pil
        "copy": [],
    }
}

PY_DLLS = [
    "unicodedata.pyd",
    "sqlite3.dll",
    "_sqlite3.pyd",
    "_socket.pyd",
    "select.pyd",
]

MSVCR_PUBLIC_KEY = "<KEY>"
MSVCR_VERSION = "9.0.21022.8"
MSVCR_NAME = "Microsoft.VC90.CRT"

README_LICENSE_SECTION = """

License
=======
OpenSlides is distributed under the GNU General Public License
version 2. For details about this license and the licenses of the
bundled packages, please refer to the corresponding file in the
licenses/ directory.
"""

def compile_re_list(patterns):
    expr = "|".join("(?:{0})".format(x) for x in patterns)
    return re.compile(expr)
<commit_msg>Copy _ctypes.pyd<commit_after>#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
    :copyright: 2012 by OpenSlides team, see AUTHORS.
    :license: GNU GPL, see LICENSE for more details.
"""

import errno
import glob
import os
import re
import shutil
import sys
import zlib
zlib.Z_DEFAULT_COMPRESSION = zlib.Z_BEST_COMPRESSION
import zipfile

import distutils.ccompiler
import distutils.sysconfig

import pkg_resources

sys.path.insert(0, os.getcwd())
import openslides

COMMON_EXCLUDE = [
    r".pyc$",
    r".pyo$",
    r".po$",
    r".egg-info",
    r"\blocale/(?!de/|en/)[^/]+/"
]

LIBEXCLUDE = [
    r"^site-packages/",
    r"^test/",
    r"^curses/",
    r"^idlelib/",
    r"^lib2to3/",
    r"^lib-tk/",
    r"^msilib/",
    r"^multiprocessing/",
    r"^unittest/",
]


SITE_PACKAGES = {
    "django": {
        "copy": ["django"],
        "exclude": [
            r"^contrib/admindocs/",
            r"^contrib/comments/",
            r"^contrib/databrowse/",
            r"^contrib/flatpages/",
            r"^contrib/formtools/",
            r"^contrib/gis/",
            r"^contrib/humanize/",
            r"^contrib/localflavor/",
            r"^contrib/markup/",
            r"^contrib/redirects/",
            r"^contrib/sitemaps/",
            r"^contrib/syndication/",
            r"^contrib/webdesign/",
        ]
    },
    "django-mptt": {
        "copy": ["mptt"],
    },
    "reportlab": {
        "copy": [
            "reportlab",
            "_renderPM.pyd",
            "_rl_accel.pyd",
            "sgmlop.pyd",
            "pyHnj.pyd",
        ],
    },
    "pil": {
        # NOTE: PIL is a special case, see copy_pil
        "copy": [],
    }
}

PY_DLLS = [
    "unicodedata.pyd",
    "sqlite3.dll",
    "_sqlite3.pyd",
    "_socket.pyd",
    "select.pyd",
    "_ctypes.pyd",
]

MSVCR_PUBLIC_KEY = "<KEY>"
MSVCR_VERSION = "9.0.21022.8"
MSVCR_NAME = "Microsoft.VC90.CRT"

README_LICENSE_SECTION = """

License
=======
OpenSlides is distributed under the GNU General Public License
version 2. For details about this license and the licenses of the
bundled packages, please refer to the corresponding file in the
licenses/ directory.
"""

def compile_re_list(patterns):
    expr = "|".join("(?:{0})".format(x) for x in patterns)
    return re.compile(expr)

{'fraction_non_alphanumeric': 0.16622633201232936, 'fraction_numerical': 0.009687362395420519, 'mean_word_length': 2.219702338766832, 'pattern_counts': {'":': 18, '<': 5, '<?xml version=': 0, '>': 5, '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': '3857592', 'n_tokens_mistral': 1714, 'n_tokens_neox': 1659, 'n_words': 318}