<commit_before>#!/usr/bin/python

import yaml
import os, sys
from lib.pluginsloader import PluginsLoader
from lib.proxylogger import ProxyLogger
from argparse import ArgumentParser

ProxyOptionsDefaultValues = {
}


def parse_options(opts, version):
    global ProxyOptionsDefaultValues
    ProxyOptionsDefaultValues.update(opts)

    usage = "Usage: %%prog [options]"
    parser = ArgumentParser(usage=usage, prog="%prog " + version)

    parser.add_argument("-c", "--config", dest='config',
        help="External configuration file. Defines values for below options, however specifying them on command line will supersed ones from file.")

    # General options
    parser.add_argument("-v", "--verbose", dest='verbose',
        help="Displays verbose output.", action="store_true")
    parser.add_argument("-V", "--trace", dest='trace',
        help="Displays HTTP requests and responses.", action="store_true")
    parser.add_argument("-d", "--debug", dest='debug',
        help="Displays debugging informations (implies verbose output).", action="store_true")
    parser.add_argument("-s", "--silent", dest='silent',
        help="Surpresses all of the output logging.", action="store_true")
    parser.add_argument("-z", "--allow-invalid", dest='allow_invalid',
        help="Process invalid HTTP requests. By default if a stream not resembling HTTP protocol reaches proxy2 listener - it will be dropped.", action="store_true")
    parser.add_argument("-N", "--no-proxy", dest='no_proxy',
        help="Disable standard HTTP/HTTPS proxy capability (will not serve CONNECT requests). Useful when we only need plugin to run.", action="store_true")
    parser.add_argument("-W", "--tee", dest='tee',
        help="While logging to output file, print to stdout also.", action="store_true")
    parser.add_argument("-w", "--output", dest='log', 
        help="Specifies output log file.", metavar="PATH", type=str)
    parser.add_argument("-A", "--access-log", dest='access_log', 
        help="Specifies where to write access attempts in Apache2 format.", metavar="PATH", type=str)
    parser.add_argument("-B", "--bind", dest='bind', metavar='NAME',
        help="Specifies proxy's binding address along with protocol to serve (http/https). If scheme is specified here, don't add another scheme specification to the listening port number (123/https). Default: "+ opts['bind'] +".", 
        type=str, default=opts['bind'])
    parser.add_argument("-P", "--port", dest='port', metavar='NUM',
        help="Specifies proxy's binding port number(s). A value can be followed with either '/http' or '/https' to specify which type of server to bound on this port. Supports multiple binding ports by repeating this option: '--port 80 --port 443/https'. The port specification may also override globally used --bind address by preceding it with address and colon (--port 127.0.0.1:80/http). Default: "+ str(opts['port'][0]) +".", 
        type=str, action="append", default = [])
    parser.add_argument("-t", "--timeout", dest='timeout', metavar='SECS',
        help="Specifies timeout for proxy's response in seconds. Default: "+ str(opts['timeout']) +".", 
        type=int, default=opts['timeout'])
    parser.add_argument("-u", "--proxy-url", dest='proxy_self_url', metavar='URL',
        help="Specifies proxy's self url. Default: "+ opts['proxy_self_url'] +".", 
        type=str, default=opts['proxy_self_url'])
    
<commit_msg>Option rephrase<commit_after>#!/usr/bin/python

import yaml
import os, sys
from lib.pluginsloader import PluginsLoader
from lib.proxylogger import ProxyLogger
from argparse import ArgumentParser

ProxyOptionsDefaultValues = {
}


def parse_options(opts, version):
    global ProxyOptionsDefaultValues
    ProxyOptionsDefaultValues.update(opts)

    usage = "Usage: %%prog [options]"
    parser = ArgumentParser(usage=usage, prog="%prog " + version)

    parser.add_argument("-c", "--config", dest='config',
        help="External configuration file. Defines values for below options, however specifying them on command line will supersed ones from file.")

    # General options
    parser.add_argument("-v", "--verbose", dest='verbose',
        help="Displays verbose output.", action="store_true")
    parser.add_argument("-V", "--trace", dest='trace',
        help="Displays HTTP requests and responses.", action="store_true")
    parser.add_argument("-d", "--debug", dest='debug',
        help="Displays debugging informations (implies verbose output).", action="store_true")
    parser.add_argument("-s", "--silent", dest='silent',
        help="Surpresses all of the output logging.", action="store_true")
    parser.add_argument("-z", "--allow-invalid", dest='allow_invalid',
        help="Process invalid HTTP requests. By default if a stream not resembling HTTP protocol reaches proxy2 listener - it will be dropped.", action="store_true")
    parser.add_argument("-N", "--no-proxy", dest='no_proxy',
        help="Disable standard HTTP/HTTPS proxy capability (will not serve CONNECT requests). Useful when we only need plugin to run.", action="store_true")
    parser.add_argument("-W", "--tee", dest='tee',
        help="While logging to output file, print to stdout also.", action="store_true")
    parser.add_argument("-w", "--output", dest='log', 
        help="Specifies output log file.", metavar="PATH", type=str)
    parser.add_argument("-A", "--access-log", dest='access_log', 
        help="Specifies where to write access attempts in Apache2 combined log format.", metavar="PATH", type=str)
    parser.add_argument("-B", "--bind", dest='bind', metavar='NAME',
        help="Specifies proxy's binding address along with protocol to serve (http/https). If scheme is specified here, don't add another scheme specification to the listening port number (123/https). Default: "+ opts['bind'] +".", 
        type=str, default=opts['bind'])
    parser.add_argument("-P", "--port", dest='port', metavar='NUM',
        help="Specifies proxy's binding port number(s). A value can be followed with either '/http' or '/https' to specify which type of server to bound on this port. Supports multiple binding ports by repeating this option: '--port 80 --port 443/https'. The port specification may also override globally used --bind address by preceding it with address and colon (--port 127.0.0.1:80/http). Default: "+ str(opts['port'][0]) +".", 
        type=str, action="append", default = [])
    parser.add_argument("-t", "--timeout", dest='timeout', metavar='SECS',
        help="Specifies timeout for proxy's response in seconds. Default: "+ str(opts['timeout']) +".", 
        type=int, default=opts['timeout'])
    parser.add_argument("-u", "--proxy-url", dest='proxy_self_url', metavar='URL',
        help="Specifies proxy's self url. Default: "+ opts['proxy_self_url'] +".", 
        type=str, default=opts['proxy_self_url'])
    

{'fraction_non_alphanumeric': 0.1493968899869205, 'fraction_numerical': 0.0055224531318122366, 'mean_word_length': 4.128166915052161, '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': '3668947', 'n_tokens_mistral': 1935, 'n_tokens_neox': 1872, 'n_words': 607}