<commit_before>#!/bin/python

import argparse
import threading
from functools import partial
from exch_btcc import ExchGwBtcc
from sqlite_client import SqliteClient
from mysql_client import MysqlClient

if __name__ == '__main__':
    parser = argparse.ArgumentParser(description='Bitcoin exchange market data feed handler.')
    parser.add_argument('-sqlite', action='store_true', help='Use SQLite database')
    parser.add_argument('-mysql', action='store_true', help='Use MySQL')
    parser.add_argument('-dbpath', action='store', dest='dbpath', help='Database file path. Supported for SQLite only.')
    parser.add_argument('-dbaddr', action='store', dest='dbaddr',
                                   help='Database address, e.g. 127.0.0.1:3032. Supported for database with connection')
    parser.add_argument('-dbuser', action='store', dest='dbuser',
                        help='Database user. Supported for database with connection')
    parser.add_argument('-dbpwd', action='store', dest='dbpwd',
                        help='Database password. Supported for database with connection')
    parser.add_argument('-dbschema', action='store', dest='dbschema',
                        help='Database schema. Supported for database with connection')
    args = parser.parse_args()

    if args.sqlite:
        db_client = SqliteClient()
        db_client.connect(path=args.dbpath)
    elif args.mysql:
        db_client = MysqlClient()
        db_client.connect(host=args.dbaddr,
                          user=args.dbuser,
                          pwd=args.db<PASSWORD>,
                          schema=args.dbschema)

    exch_gws = []
    exch_gws.append(ExchGwBtcc(db_client))
    threads = []
    for exch in exch_gws:
        subscription_instmts = exch.get_subscription_instmts()
        exch.init()
        for instmt in subscription_instmts:
            t1 = threading.Thread(target=partial(exch.get_order_book, instmt))
            threads.append(t1)
            t1.start()
            t2 = threading.Thread(target=partial(exch.get_trades, instmt))
            threads.append(t2)
            t2.start()

<commit_msg>Update mysql connection<commit_after>#!/bin/python

import argparse
import threading
from functools import partial
from exch_btcc import ExchGwBtcc
from sqlite_client import SqliteClient
from mysql_client import MysqlClient

if __name__ == '__main__':
    parser = argparse.ArgumentParser(description='Bitcoin exchange market data feed handler.')
    parser.add_argument('-sqlite', action='store_true', help='Use SQLite database')
    parser.add_argument('-mysql', action='store_true', help='Use MySQL')
    parser.add_argument('-dbpath', action='store', dest='dbpath', help='Database file path. Supported for SQLite only.')
    parser.add_argument('-dbaddr', action='store', dest='dbaddr', default='localhost',
                        help='Database address. Defaulted as localhost. Supported for database with connection')
    parser.add_argument('-dbport', action='store', dest='dbport', default='3306',
                        help='Database port, Defaulted as 3306. Supported for database with connection')
    parser.add_argument('-dbuser', action='store', dest='dbuser',
                        help='Database user. Supported for database with connection')
    parser.add_argument('-dbpwd', action='store', dest='dbpwd',
                        help='Database password. Supported for database with connection')
    parser.add_argument('-dbschema', action='store', dest='dbschema',
                        help='Database schema. Supported for database with connection')
    args = parser.parse_args()

    if args.sqlite:
        db_client = SqliteClient()
        db_client.connect(path=args.dbpath)
    elif args.mysql:
        db_client = MysqlClient()
        db_client.connect(host=args.dbaddr,
                          port=args.dbport,
                          user=args.dbuser,
                          pwd=args.dbpwd,
                          schema=args.dbschema)

    exch_gws = []
    exch_gws.append(ExchGwBtcc(db_client))
    threads = []
    for exch in exch_gws:
        subscription_instmts = exch.get_subscription_instmts()
        exch.init()
        for instmt in subscription_instmts:
            t1 = threading.Thread(target=partial(exch.get_order_book, instmt))
            threads.append(t1)
            t1.start()
            t2 = threading.Thread(target=partial(exch.get_trades, instmt))
            threads.append(t2)
            t2.start()


{'fraction_non_alphanumeric': 0.10973176679228552, 'fraction_numerical': 0.006650410108623365, 'mean_word_length': 2.7443983402489627, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 1, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5295690', 'n_tokens_mistral': 1319, 'n_tokens_neox': 1273, 'n_words': 281}