<commit_before># -*- coding: utf-8 -*-
#
# Copyright (C) 2005 Edgewall Software
# Copyright (C) 2005 <NAME> <<EMAIL>>
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution. The terms
# are also available at http://trac.edgewall.com/license.html.
#
# This software consists of voluntary contributions made by many
# individuals. For the exact contribution history, see the revision
# history and logs, available at http://projects.edgewall.com/trac/.
#
# Author: <NAME> <<EMAIL>>

from trac.web.api import RequestDone
from trac.web.cgi_frontend import CGIRequest
from trac.web.main import dispatch_request, get_environment, \
                          send_pretty_error, send_project_index

import _fcgi
import os
import locale

def run():
    locale.setlocale(locale.LC_ALL, '')
    _fcgi.Server(_handler).run()


def _handler(_req):
    req = CGIRequest(_req.params, _req.stdin, _req.stdout)
    env = get_environment(req, os.environ)

    if not env:
        send_project_index(req, os.environ)
        return _fcgi.CGI_REQUEST_COMPLETE, 0

    try:  
        dispatch_request(req.path_info, req, env)
    except Exception, e:
        send_pretty_error(e, env, req)
    return _fcgi.FCGI_REQUEST_COMPLETE, 0<commit_msg>Fixed typo in fcgi_frontend.py.<commit_after># -*- coding: utf-8 -*-
#
# Copyright (C) 2005 Edgewall Software
# Copyright (C) 2005 <NAME> <<EMAIL>>
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution. The terms
# are also available at http://trac.edgewall.com/license.html.
#
# This software consists of voluntary contributions made by many
# individuals. For the exact contribution history, see the revision
# history and logs, available at http://projects.edgewall.com/trac/.
#
# Author: <NAME> <<EMAIL>>

from trac.web.api import RequestDone
from trac.web.cgi_frontend import CGIRequest
from trac.web.main import dispatch_request, get_environment, \
                          send_pretty_error, send_project_index

import _fcgi
import os
import locale

def run():
    locale.setlocale(locale.LC_ALL, '')
    _fcgi.Server(_handler).run()


def _handler(_req):
    req = CGIRequest(_req.params, _req.stdin, _req.stdout)
    env = get_environment(req, os.environ)

    if not env:
        send_project_index(req, os.environ)
        return _fcgi.FCGI_REQUEST_COMPLETE, 0

    try:  
        dispatch_request(req.path_info, req, env)
    except Exception, e:
        send_pretty_error(e, env, req)
    return _fcgi.FCGI_REQUEST_COMPLETE, 0
{'fraction_non_alphanumeric': 0.0973217653715579, 'fraction_numerical': 0.008298755186721992, 'mean_word_length': 3.6202090592334493, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 15, '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': '4594337', 'n_tokens_mistral': 844, 'n_tokens_neox': 810, 'n_words': 252}