<commit_before>#!/usr/bin/env python
# -*- coding: utf-8 -*-
import logging
import os
import sys
from typing import TYPE_CHECKING

try:
    from setuptools import setup
except ImportError:
    from distutils.core import setup
if TYPE_CHECKING:
    from typing import Iterable, Set

MAGPIE_ROOT = os.path.abspath(os.path.dirname(__file__))
MAGPIE_MODULE_DIR = os.path.join(MAGPIE_ROOT, "magpie")
sys.path.insert(0, MAGPIE_MODULE_DIR)

from magpie import __meta__  # isort:skip # noqa: E402

LOGGER = logging.getLogger("magpie.setup")
if logging.StreamHandler not in LOGGER.handlers:
    LOGGER.addHandler(logging.StreamHandler(sys.stdout))  # type: ignore # noqa
LOGGER.setLevel(logging.INFO)
LOGGER.info("starting setup")


with open("README.rst") as readme_file:
    README = readme_file.read()

with open("HISTORY.rst") as history_file:
    HISTORY = history_file.read().replace(".. :changelog:", "")


def _parse_requirements(file_path, requirements, links):
    # type: (str, Set[str], Set[str]) -> None
    """
    Parses a requirements file to extra packages and links.

    :param file_path: file path to the requirements file.
    :param requirements: pre-initialized set in which to store extracted package requirements.
    :param links: pre-initialized set in which to store extracted link reference requirements.
    :returns: None
    """
    with open(file_path, 'r') as requirements_file:
        for line in requirements_file:<commit_msg>patch setup install error<commit_after>#!/usr/bin/env python
# -*- coding: utf-8 -*-
import logging
import os
import sys
from typing import TYPE_CHECKING

try:
    from setuptools import setup
except ImportError:
    from distutils.core import setup
if TYPE_CHECKING:
    from typing import Iterable, Set

MAGPIE_ROOT = os.path.abspath(os.path.dirname(__file__))
MAGPIE_MODULE_DIR = os.path.join(MAGPIE_ROOT, "magpie")
sys.path.insert(0, MAGPIE_MODULE_DIR)
# do not use 'from magpie' to avoid import error on not yet installed packages
import __meta__  # isort:skip # noqa: E402

LOGGER = logging.getLogger("magpie.setup")
if logging.StreamHandler not in LOGGER.handlers:
    LOGGER.addHandler(logging.StreamHandler(sys.stdout))  # type: ignore # noqa
LOGGER.setLevel(logging.INFO)
LOGGER.info("starting setup")


with open("README.rst") as readme_file:
    README = readme_file.read()

with open("HISTORY.rst") as history_file:
    HISTORY = history_file.read().replace(".. :changelog:", "")


def _parse_requirements(file_path, requirements, links):
    # type: (str, Set[str], Set[str]) -> None
    """
    Parses a requirements file to extra packages and links.

    :param file_path: file path to the requirements file.
    :param requirements: pre-initialized set in which to store extracted package requirements.
    :param links: pre-initialized set in which to store extracted link reference requirements.
    :returns: None
    """
    with open(file_path, 'r') as requirements_file:
        for line in requirements_file:
{'fraction_non_alphanumeric': 0.10348292029470864, 'fraction_numerical': 0.003348961821835231, 'mean_word_length': 4.372302158273381, 'pattern_counts': {'":': 0, '<': 3, '<?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': '3237640', 'n_tokens_mistral': 937, 'n_tokens_neox': 930, 'n_words': 280}