<commit_before># -*- coding: utf-8 -*-
# 15/6/27
# create by: snower

from __future__ import absolute_import, division, print_function, with_statement

import sys
import argparse
import multiprocessing
from ..forsun import Forsun, config

parser = argparse.ArgumentParser(description='High-performance timing scheduling service')
parser.add_argument('--bind', dest='bind_host', default="0.0.0.0", help='bind host (default: 0.0.0.0)')
parser.add_argument('--port', dest='bind_port', default=6458, type=int, help='bind port (default: 6458)')
parser.add_argument('--demon', dest='demon', default=False, type=bool, help='run demon mode')
parser.add_argument('--log', dest='log_file', default='/var/log/forsun.log', type=str, help='log file')
parser.add_argument('--log-level', dest='log_level', default='INFO', type=str, help='log level (defaul: INFO)')
parser.add_argument('--driver', dest='driver', default='mem', type=str, help='store driver mem or redis (defaul: mem)')
parser.add_argument('--driver-mem-store-file', dest='store_mem_store_file', default='/tmp/forsun.session', type=str, help='store mem driver store file (defaul: /tmp/forsun.session)')
parser.add_argument('--driver-redis-host', dest='driver_redis_host', default='127.0.0.1', type=str, help='store reids driver host (defaul: 127.0.0.1)')
parser.add_argument('--driver-redis-port', dest='driver_redis_port', default=6379, type=int, help='store reids driver port (defaul: 6379)')
parser.add_argument('--driver-redis-db', dest='driver_redis_db', default=0, type=int, help='store reids driver db (defaul: 0)')
parser.add_argument('--driver-redis-prefix', dest='driver_redis_prefix', default='forsun', type=str, help='store reids driver key prefix (defaul: forsun)')
parser.add_argument('--driver-redis-server-id', dest='driver_redis_server_id', default=0, type=int, help='store reids driver server id (defaul: 0)')
parser.add_argument('--extension-path', dest='extension_path', default='', type=str, help='extension path')
parser.add_argument('--extension', dest='extensions', default=[], action="append", type=str, help='extension name')

def main():
    args = parser.parse_args()

    config.set("LOG_FILE", args.log_file)
    config.set("LOG_LEVEL", args.log_level)

    config.set("BIND_ADDRESS", args.bind_host)
    config.set("PORT", args.bind_port)

    config.set("STORE_DRIVER", args.driver)<commit_msg>fix demon<commit_after># -*- coding: utf-8 -*-
# 15/6/27
# create by: snower

from __future__ import absolute_import, division, print_function, with_statement

import sys
import argparse
import multiprocessing
from ..forsun import Forsun, config

parser = argparse.ArgumentParser(description='High-performance timing scheduling service')
parser.add_argument('--bind', dest='bind_host', default="0.0.0.0", help='bind host (default: 0.0.0.0)')
parser.add_argument('--port', dest='bind_port', default=6458, type=int, help='bind port (default: 6458)')
parser.add_argument('--demon', dest='demon', nargs='?', const=True, default=False, type=bool, help='run demon mode')
parser.add_argument('--log', dest='log_file', default='/var/log/forsun.log', type=str, help='log file')
parser.add_argument('--log-level', dest='log_level', default='INFO', type=str, help='log level (defaul: INFO)')
parser.add_argument('--driver', dest='driver', default='mem', type=str, help='store driver mem or redis (defaul: mem)')
parser.add_argument('--driver-mem-store-file', dest='store_mem_store_file', default='/tmp/forsun.session', type=str, help='store mem driver store file (defaul: /tmp/forsun.session)')
parser.add_argument('--driver-redis-host', dest='driver_redis_host', default='127.0.0.1', type=str, help='store reids driver host (defaul: 127.0.0.1)')
parser.add_argument('--driver-redis-port', dest='driver_redis_port', default=6379, type=int, help='store reids driver port (defaul: 6379)')
parser.add_argument('--driver-redis-db', dest='driver_redis_db', default=0, type=int, help='store reids driver db (defaul: 0)')
parser.add_argument('--driver-redis-prefix', dest='driver_redis_prefix', default='forsun', type=str, help='store reids driver key prefix (defaul: forsun)')
parser.add_argument('--driver-redis-server-id', dest='driver_redis_server_id', default=0, type=int, help='store reids driver server id (defaul: 0)')
parser.add_argument('--extension-path', dest='extension_path', default='', type=str, help='extension path')
parser.add_argument('--extension', dest='extensions', default=[], action="append", type=str, help='extension name')

def main():
    args = parser.parse_args()

    config.set("LOG_FILE", args.log_file)
    config.set("LOG_LEVEL", args.log_level)

    config.set("BIND_ADDRESS", args.bind_host)
    config.set("PORT", args.bind_port)

    config.set("STORE_DRIVER", args.driver)
{'fraction_non_alphanumeric': 0.180465311255502, 'fraction_numerical': 0.019283169146929364, 'mean_word_length': 6.771986970684039, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 8, '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': '4706846', 'n_tokens_mistral': 1631, 'n_tokens_neox': 1565, 'n_words': 336}