<commit_before>'''
@author: <NAME>

@summary: Contains the default settings.
'''

from django.conf import settings
from django.utils.importlib import import_module

DEFAULTS = {
    "HEADERS_TO_INCLUDE": ["HTTP_USER_AGENT", "HTTP_COOKIE"],
    "DEFAULT_CONTENT_TYPE": "application/json",
    "USE_HTTPS": False,
    "EXECUTE_PARALLEL": False,
    "MAX_LIMIT": 20
}


USER_DEFINED_SETTINGS = getattr(settings, 'BATCH_REQUESTS', {})


def import_class(class_path):
    '''
        Imports the class for the given class name.
    '''
    module_name, class_name = class_path.rsplit(".", 1)
    module = import_module(module_name)
    claz = getattr(module, class_name)
    return claz


class BatchRequestSettings(object):

    '''
        Allow API settings to be accessed as properties.
    '''

    def __init__(self, user_settings=None, defaults=None):
        self.user_settings = user_settings or {}
        self.defaults = defaults or {}
        self.executor = self._executor()
<commit_msg>Adding default settings for concurrency<commit_after>'''
@author: <NAME>

@summary: Contains the default settings.
'''

from django.conf import settings
from django.utils.importlib import import_module
import multiprocessing

DEFAULTS = {
    "HEADERS_TO_INCLUDE": ["HTTP_USER_AGENT", "HTTP_COOKIE"],
    "DEFAULT_CONTENT_TYPE": "application/json",
    "USE_HTTPS": False,
    "EXECUTE_PARALLEL": False,
    "CONCURRENT_EXECUTOR": "batch_requests.concurrent.executor.ThreadBasedExecutor",
    "NUM_WORKERS": multiprocessing.cpu_count() * 4,
    "MAX_LIMIT": 20
}


USER_DEFINED_SETTINGS = getattr(settings, 'BATCH_REQUESTS', {})


def import_class(class_path):
    '''
        Imports the class for the given class name.
    '''
    module_name, class_name = class_path.rsplit(".", 1)
    module = import_module(module_name)
    claz = getattr(module, class_name)
    return claz


class BatchRequestSettings(object):

    '''
        Allow API settings to be accessed as properties.
    '''

    def __init__(self, user_settings=None, defaults=None):
        self.user_settings = user_settings or {}
        self.defaults = defaults or {}
        self.executor = self._executor()

{'fraction_non_alphanumeric': 0.11443014705882353, 'fraction_numerical': 0.003216911764705882, 'mean_word_length': 3.848552338530067, 'pattern_counts': {'":': 12, '<': 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': '1329522', 'n_tokens_mistral': 702, 'n_tokens_neox': 685, 'n_words': 159}