<commit_before>"""This module contains all the logic required to parse the authentication
server's command line."""

import optparse
import logging

from yar.util import clparserutil


class CommandLineParser(optparse.OptionParser):
    """This class parses the auth server's command line."""

    def __init__(self):
        optparse.OptionParser.__init__(
            self,
            "usage: %prog [options]",
            option_class=clparserutil.Option)

        default = logging.ERROR
        fmt = (
            "logging level "
            "[DEBUG,INFO,WARNING,ERROR,CRITICAL,FATAL]"
            " - default = %s"
        )
        help = fmt % logging.getLevelName(default)
        self.add_option(
            "--log",
            action="store",
            dest="logging_level",
            default=logging.ERROR,
            type="logginglevel",
            help=help)

        default = 8000
        help = "port - default = %d" % default
        self.add_option(
            "--port",
            action="store",
            dest="port",
            default=default,
            type=int,
            help=help)

        default = "YAR",
        help = "app server's authorization method - default = %s" % default
        self.add_option(
            "--authmethod",
            action="store",
            dest="app_server_auth_method",
            default=default,
            help=help)

        default = "127.0.0.1:8070"
        help = "key server - default = %s" % default
        self.add_option(
            "--keyserver",
            action="store",
            dest="key_server",
            default=default,
            type="hostcolonport",
            help=help)

        default = "127.0.0.1:8080"
        help = "app server - default = %s" % default
        self.add_option(
            "--appserver",
            action="store",
            dest="app_server",
            default=default,
            type="hostcolonport",
            help=help)

        default = 30
        help = "max age (in seconds) of valid request - default = %d" % default
        self.add_option(
            "--maxage",
            action="store",
            dest="maxage",
            default=default,
            type=int,
            help=help)

        default = "127.0.0.1:11211"
        help = "memcached servers for nonce store - default = %s" % default<commit_msg>fix default value 4 cl parser nonce server cluster<commit_after>"""This module contains all the logic required to parse the authentication
server's command line."""

import optparse
import logging

from yar.util import clparserutil


class CommandLineParser(optparse.OptionParser):
    """This class parses the auth server's command line."""

    def __init__(self):
        optparse.OptionParser.__init__(
            self,
            "usage: %prog [options]",
            option_class=clparserutil.Option)

        default = logging.ERROR
        fmt = (
            "logging level "
            "[DEBUG,INFO,WARNING,ERROR,CRITICAL,FATAL]"
            " - default = %s"
        )
        help = fmt % logging.getLevelName(default)
        self.add_option(
            "--log",
            action="store",
            dest="logging_level",
            default=logging.ERROR,
            type="logginglevel",
            help=help)

        default = 8000
        help = "port - default = %d" % default
        self.add_option(
            "--port",
            action="store",
            dest="port",
            default=default,
            type=int,
            help=help)

        default = "YAR",
        help = "app server's authorization method - default = %s" % default
        self.add_option(
            "--authmethod",
            action="store",
            dest="app_server_auth_method",
            default=default,
            help=help)

        default = "127.0.0.1:8070"
        help = "key server - default = %s" % default
        self.add_option(
            "--keyserver",
            action="store",
            dest="key_server",
            default=default,
            type="hostcolonport",
            help=help)

        default = "127.0.0.1:8080"
        help = "app server - default = %s" % default
        self.add_option(
            "--appserver",
            action="store",
            dest="app_server",
            default=default,
            type="hostcolonport",
            help=help)

        default = 30
        help = "max age (in seconds) of valid request - default = %d" % default
        self.add_option(
            "--maxage",
            action="store",
            dest="maxage",
            default=default,
            type=int,
            help=help)

        default = ["127.0.0.1:11211"]
        help = "memcached servers for nonce store - default = %s" % default
{'fraction_non_alphanumeric': 0.11279916753381894, 'fraction_numerical': 0.015608740894901144, 'mean_word_length': 1.5769436997319035, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 6, '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': '896829', 'n_tokens_mistral': 1329, 'n_tokens_neox': 1257, 'n_words': 305}