<commit_before># -*- coding: utf-8 -
#
# This file is part of gunicorn released under the MIT license. 
# See the NOTICE for more information.

from optparse import make_option
import sys
import os

 
import django
from django.core.management.base import BaseCommand, CommandError
from django.conf import settings
from django.utils import translation

from gunicorn.config import Config
from gunicorn.app.djangoapp import DjangoApplicationCommand
 
class Command(BaseCommand):
    option_list = BaseCommand.option_list + (
        make_option('--adminmedia', dest='admin_media_path', default='',
            help='Specifies the directory from which to serve admin media.'),
        make_option('-c', '--config', dest='gconfig', type='string',
            help='Gunicorn Config file. [%default]'),
        make_option('-k', '--worker-class', dest='worker_class',
            help="The type of request processing to use "+
            "[egg:gunicorn#sync]"),
        make_option('-w', '--workers', dest='workers', 
            help='Specifies the number of worker processes to use.'),
        make_option('--pid', dest='pidfile',
            help='set the background PID file'),
        make_option( '--daemon', dest='daemon', action="store_true",
            help='Run daemonized in the background.'),
        make_option('--umask', dest='umask',
            help="Define umask of daemon process"),
        make_option('-u', '--user', dest="user", 
            help="Change worker user"),
        make_option('-g', '--group', dest="group", 
            help="Change worker group"),
        make_option('-n', '--name', dest='proc_name',
            help="Process name"),
    )
    help = "Starts a fully-functional Web server using gunicorn."
    args = '[optional port number, or ipaddr:port or unix:/path/to/sockfile]'
 
    # Validation is called explicitly each time the server is reloaded.
    requires_model_validation = False
 
    def handle(self, addrport='', *args, **options):
        if args:
            raise CommandError('Usage is runserver %s' % self.args)
            
        options['bind'] = addrport or '127.0.0.1'
        
        options['default_proc_name'] =settings.SETTINGS_MODULE
<commit_msg>handle preload in django command<commit_after># -*- coding: utf-8 -
#
# This file is part of gunicorn released under the MIT license. 
# See the NOTICE for more information.

from optparse import make_option
import sys
import os

 
import django
from django.core.management.base import BaseCommand, CommandError
from django.conf import settings
from django.utils import translation

from gunicorn.config import Config
from gunicorn.app.djangoapp import DjangoApplicationCommand
 
class Command(BaseCommand):
    option_list = BaseCommand.option_list + (
        make_option('--adminmedia', dest='admin_media_path', default='',
            help='Specifies the directory from which to serve admin media.'),
        make_option('-c', '--config', dest='gconfig', type='string',
            help='Gunicorn Config file. [%default]'),
        make_option('-k', '--worker-class', dest='worker_class',
            help="The type of request processing to use "+
            "[egg:gunicorn#sync]"),
        make_option('-w', '--workers', dest='workers', 
            help='Specifies the number of worker processes to use.'),
        make_option('--pid', dest='pidfile',
            help='set the background PID file'),
        make_option( '--daemon', dest='daemon', action="store_true",
            help='Run daemonized in the background.'),
        make_option('--umask', dest='umask',
            help="Define umask of daemon process"),
        make_option('-u', '--user', dest="user", 
            help="Change worker user"),
        make_option('-g', '--group', dest="group", 
            help="Change worker group"),
        make_option('-n', '--name', dest='proc_name',
            help="Process name"),
        make_option('--preload', dest='preload_app', action='store_true', default=False,
            help="Load application code before the worker processes are forked.")
    )
    help = "Starts a fully-functional Web server using gunicorn."
    args = '[optional port number, or ipaddr:port or unix:/path/to/sockfile]'
 
    # Validation is called explicitly each time the server is reloaded.
    requires_model_validation = False
 
    def handle(self, addrport='', *args, **options):
        if args:
            raise CommandError('Usage is runserver %s' % self.args)
            
        options['bind'] = addrport or '127.0.0.1'
        
        options['default_proc_name'] =settings.SETTINGS_MODULE

{'fraction_non_alphanumeric': 0.12905317769131, 'fraction_numerical': 0.0030263726761781237, 'mean_word_length': 2.9178662150719727, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, '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': '6530708', 'n_tokens_mistral': 1292, 'n_tokens_neox': 1243, 'n_words': 385}