<commit_before>import spstore
from backtrader.metabase import MetaParams
from backtrader.utils.py3 import with_metaclass
from backtrader.brokers.bbroker import BackBroker
from backtrader.comminfo import CommInfoBase

class MetaSharpPointBackTester(MetaParams):
    def __init__(cls, name, bases, dct):
        '''Class has already been created ... register'''
        # Initialize the class
        spstore.SharpPointStore.BackTestCls = cls

class SharpPointBackTester(with_metaclass(MetaSharpPointBackTester,
                                          BackBroker)):
    params = ()
    def init(self):
        super(SharpPointBackTester, self).init()
    def getcommissioninfo(self, data):
        if data._name in self.comminfo:
            return self.comminfo[data._name]
        if data._name[0:3] == 'HSI':
            self.setcommission(stocklike=False, mult=50.0,
                               name=data._name,
                               commtype=CommInfoBase.COMM_FIXED)
        elif data._name[0:3] == 'MHI':
            self.setcommission(stocklike=False, mult=10.0,
                               name=data._name,
                               commtype=CommInfoBase.COMM_FIXED)
        return super(SharpPointBackTester, self).getcommissioninfo(data)<commit_msg>add debug<commit_after>import spstore
import logging
from backtrader.metabase import MetaParams
from backtrader.utils.py3 import with_metaclass
from backtrader.brokers.bbroker import BackBroker
from backtrader.comminfo import CommInfoBase

class MetaSharpPointBackTester(MetaParams):
    def __init__(cls, name, bases, dct):
        '''Class has already been created ... register'''
        # Initialize the class
        spstore.SharpPointStore.BackTestCls = cls

class SharpPointBackTester(with_metaclass(MetaSharpPointBackTester,
                                          BackBroker)):
    params = (
        ('loglevel', logging.INFO),
        )
    def init(self):
        super(SharpPointBackTester, self).init()
    def getcommissioninfo(self, data):
        if data._name in self.comminfo:
            return self.comminfo[data._name]
        if data._name[0:3] == 'HSI':
            self.setcommission(stocklike=False, mult=50.0,
                               name=data._name,
                               commtype=CommInfoBase.COMM_FIXED)
        elif data._name[0:3] == 'MHI':
            self.setcommission(stocklike=False, mult=10.0,
                               name=data._name,
                               commtype=CommInfoBase.COMM_FIXED)
        if self.p.loglevel <= logging.DEBUG:
            print(comminfo)
        return super(SharpPointBackTester, self).getcommissioninfo(data)
{'fraction_non_alphanumeric': 0.08745813174544101, 'fraction_numerical': 0.008187569780424266, 'mean_word_length': 2.2542372881355934, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2453759', 'n_tokens_mistral': 768, 'n_tokens_neox': 752, 'n_words': 148}