<commit_before>import sys, os, socket, ConfigParser, errno, logging, httplib, BaseHTTPServer, mimetypes, json, signal
import time, cgi, pprint, urllib, urlparse, itertools, base64, hashlib
from ..config import config, read_config, get_numeric_loglevel
from .. import cnscom

###

L = logging.getLogger("httpfendapp")

###

STRFTIME_FMT = "%d-%b-%Y %H:%M:%S"

###

# Initialize mimetypes
if not mimetypes.inited:
		mimetypes.init()

###

class httpfend_app(object):

	instance = None

	def __init__(self):
		assert self.instance is None
		httpfend_app.instance = self
		
		# Read config
		read_config()
		
		# Configure logging
		try:
			loglvl = get_numeric_loglevel(config.get(os.environ['RAMONA_SECTION'], 'loglevel'))
		except:
			loglvl = logging.INFO
		logging.basicConfig(
			level=loglvl,
			stream=sys.stderr,
			format="%(asctime)s %(levelname)s: %(message)s",
		)

		try:
			host = config.get(os.environ['RAMONA_SECTION'], 'host')
			port = config.getint(os.environ['RAMONA_SECTION'], 'port')
		except ConfigParser.NoSectionError, e:
			L.fatal("Missing configuration section {0}. Exiting.".format(os.environ['RAMONA_SECTION']))
			sys.exit(1)
		except ConfigParser.NoOptionError, e:
			L.fatal("Missing configuration option: {0}. Exiting".format(e))
			sys.exit(1)
		
		self.username = None
		self.password = <PASSWORD> 
		try:
			self.username = config.get(os.environ['RAMONA_SECTION'], 'username')<commit_msg>Default configuration values for httpfend<commit_after>import sys, os, socket, ConfigParser, errno, logging, httplib, BaseHTTPServer, mimetypes, json, signal
import time, cgi, pprint, urllib, urlparse, itertools, base64, hashlib
from ..config import config, read_config, get_numeric_loglevel
from .. import cnscom

###

L = logging.getLogger("httpfendapp")

###

STRFTIME_FMT = "%d-%b-%Y %H:%M:%S"

###

# Initialize mimetypes
if not mimetypes.inited:
		mimetypes.init()

###

class httpfend_app(object):

	instance = None

	def __init__(self):
		assert self.instance is None
		httpfend_app.instance = self
		
		# Read config
		read_config()
		
		# Configure logging
		try:
			loglvl = get_numeric_loglevel(config.get(os.environ['RAMONA_SECTION'], 'loglevel'))
		except:
			loglvl = logging.INFO
		logging.basicConfig(
			level=loglvl,
			stream=sys.stderr,
			format="%(asctime)s %(levelname)s: %(message)s",
		)

		try:
			host = config.get(os.environ['RAMONA_SECTION'], 'host')
		except (ConfigParser.NoSectionError, ConfigParser.NoOptionError):
			host = "localhost"
		
		try:
			port = config.getint(os.environ['RAMONA_SECTION'], 'port')
		except (ConfigParser.NoSectionError, ConfigParser.NoOptionError):
			port = 5588
		
		self.username = None
		self.password = None 
		try:
			self.username = config.get(os.environ['RAMONA_SECTION'], 'username')
{'fraction_non_alphanumeric': 0.13688760806916425, 'fraction_numerical': 0.004322766570605188, 'mean_word_length': 4.632860040567952, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, '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': '6922701', 'n_tokens_mistral': 1092, 'n_tokens_neox': 973, 'n_words': 204}