<commit_before>from OnePy.builtin_module.backtest_forex.forex_bar import BarForex
from OnePy.builtin_module.backtest_stock.stock_bar import BarAshares
from OnePy.constants import EVENT
from OnePy.sys_module.metabase_env import OnePyEnvBase

# 控制事件发生顺序
EVENT_LOOP = [dict(if_event=EVENT.Market_updated,
                   then_event=EVENT.Data_cleaned,
                   module_dict=OnePyEnvBase.env.cleaners),

              dict(if_event=EVENT.Data_cleaned,
                   then_event=EVENT.Signal_generated,
                   module_dict=OnePyEnvBase.env.strategies),

              dict(if_event=EVENT.Signal_generated,
                   then_event=EVENT.Submit_order,
                   module_dict=OnePyEnvBase.env.risk_managers),

              dict(if_event=EVENT.Submit_order,
                   then_event=EVENT.Record_result,
                   module_dict=OnePyEnvBase.env.brokers),

              dict(if_event=EVENT.Record_result,
                   then_event=None,
                   module_dict=OnePyEnvBase.env.recorders)]


class SettingFactory(OnePyEnvBase):

    @classmethod
    def get_bar_class(cls, instrument):
        if instrument == 'A_shares':
            return BarAshares
        elif instrument == 'Forex':
            return BarForex
        else:
            raise Exception("instrument should be A_shares or Forex")
<commit_msg>Remove junk code<commit_after>from OnePy.builtin_module.backtest_forex.forex_bar import BarForex
from OnePy.builtin_module.backtest_stock.stock_bar import BarAshares
from OnePy.constants import EVENT
from OnePy.sys_module.metabase_env import OnePyEnvBase

# 控制事件发生顺序
EVENT_LOOP = [dict(if_event=EVENT.Market_updated,
                   then_event=EVENT.Data_cleaned,
                   module_dict=OnePyEnvBase.env.cleaners),

              dict(if_event=EVENT.Data_cleaned,
                   then_event=EVENT.Signal_generated,
                   module_dict=OnePyEnvBase.env.strategies),

              dict(if_event=EVENT.Signal_generated,
                   then_event=EVENT.Submit_order,
                   module_dict=OnePyEnvBase.env.risk_managers),

              dict(if_event=EVENT.Submit_order,
                   then_event=EVENT.Record_result,
                   module_dict=OnePyEnvBase.env.brokers),

              dict(if_event=EVENT.Record_result,
                   then_event=None,
                   module_dict=OnePyEnvBase.env.recorders)]

{'fraction_non_alphanumeric': 0.07037037037037037, 'fraction_numerical': 0.0, 'mean_word_length': 2.3392857142857144, 'pattern_counts': {'":': 0, '<': 3, '<?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': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '864138', 'n_tokens_mistral': 734, 'n_tokens_neox': 706, 'n_words': 92}