# Path: fooltrader/utils/utils.py
# def to_time_str(the_time, time_fmt=TIME_FORMAT_DAY):
#     try:
#         if time_fmt == TIME_FORMAT_MICRO:
#             return to_timestamp(the_time).strftime(time_fmt)[0:-3]
#         else:
#             return to_timestamp(the_time).strftime(time_fmt)
#     except Exception as e:
#         return the_time


from fooltrader.utils.utils import to_time_str
# -*- coding: utf-8 -*-


def get_kafka_tick_topic(security_id):
    return '{}_tick'.format(security_id)


def get_kafka_kdata_topic(security_id, fuquan="hfq", level='day'):

# Path: fooltrader/utils/utils.py
# def to_time_str(the_time, time_fmt=TIME_FORMAT_DAY):
#     try:
#         if time_fmt == TIME_FORMAT_MICRO:
#             return to_timestamp(the_time).strftime(time_fmt)[0:-3]
#         else:
#             return to_timestamp(the_time).strftime(time_fmt)
#     except Exception as e:
#         return the_time


# Path: fooltrader/contract/kafka_contract.py
from fooltrader.utils.utils import to_time_str

# -*- coding: utf-8 -*-


def get_kafka_tick_topic(security_id):
    return '{}_tick'.format(security_id)


def get_kafka_kdata_topic(security_id, fuquan="hfq", level='day'):

    if fuquan == 'qfq' or fuquan == 'hfq':