@with_bloomberg<EOL>def bdib(ticker, dt, typ='<STR_LIT>', **kwargs) -> pd.DataFrame:
from xbbg.core import missing<EOL>logger = logs.get_logger(bdib, level=kwargs.pop('<STR_LIT>', logs.LOG_LEVEL))<EOL>t_1 = pd.Timestamp('<STR_LIT>').date() - pd.Timedelta('<STR_LIT>')<EOL>whole_day = pd.Timestamp(dt).date() < t_1<EOL>batch = kwargs.pop('<STR_LIT>', False)<EOL>if (not whole_day) and batch:<EOL><INDENT>logger.warning(f'<STR_LIT>')<EOL>return pd.DataFrame()<EOL><DEDENT>cur_dt = pd.Timestamp(dt).strftime('<STR_LIT>')<EOL>asset = ticker.split()[-<NUM_LIT:1>]<EOL>info_log = f'<STR_LIT>'<EOL>if asset in ['<STR_LIT>', '<STR_LIT>', '<STR_LIT>', '<STR_LIT>']:<EOL><INDENT>exch = const.exch_info(ticker=ticker)<EOL>if exch.empty: return pd.DataFrame()<EOL><DEDENT>else:<EOL><INDENT>logger.error(f'<STR_LIT>')<EOL>return pd.DataFrame()<EOL><DEDENT>time_fmt = '<STR_LIT>'<EOL>time_idx = pd.DatetimeIndex([<EOL>f'<STR_LIT>', f'<STR_LIT>']<EOL>).tz_localize(exch.tz).tz_convert(DEFAULT_TZ).tz_convert('<STR_LIT>')<EOL>if time_idx[<NUM_LIT:0>] > time_idx[<NUM_LIT:1>]: time_idx -= pd.TimedeltaIndex(['<STR_LIT>', '<STR_LIT>'])<EOL>q_tckr = ticker<EOL>if exch.get('<STR_LIT>', False):<EOL><INDENT>if '<STR_LIT>' not in exch:<EOL><INDENT>logger.error(f'<STR_LIT>')<EOL><DEDENT>is_sprd = exch.get('<STR_LIT>', False) and (len(ticker[:-<NUM_LIT:1>]) != exch['<STR_LIT>'][<NUM_LIT:0>])<EOL>if not is_sprd:<EOL><INDENT>q_tckr = fut_ticker(gen_ticker=ticker, dt=dt, freq=exch['<STR_LIT>'])<EOL>if q_tckr == '<STR_LIT>':<EOL><INDENT>logger.error(f'<STR_LIT>')<EOL>return pd.DataFrame()<EOL><DEDENT><DEDENT><DEDENT>info_log = f'<STR_LIT>'<EOL>miss_kw = dict(ticker=ticker, dt=dt, typ=typ, func='<STR_LIT>')<EOL>cur_miss = missing.current_missing(**miss_kw)<EOL>if cur_miss >= <NUM_LIT:2>:<EOL><INDENT>if batch: return pd.DataFrame()<EOL>logger.info(f'<STR_LIT>')<EOL>return pd.DataFrame()<EOL><DEDENT>logger.info(f'<STR_LIT>')<EOL>con, _ = create_connection()<EOL>try:<EOL><INDENT>data = con.bdib(<EOL>ticker=q_tckr, event_type=typ, interval=<NUM_LIT:1>,<EOL>start_datetime=time_idx[<NUM_LIT:0>].strftime(time_fmt),<EOL>end_datetime=time_idx[<NUM_LIT:1>].strftime(time_fmt),<EOL>)<EOL><DEDENT>except KeyError:<EOL><INDENT>data = pd.DataFrame()<EOL><DEDENT>if not isinstance(data, pd.DataFrame):<EOL><INDENT>raise ValueError(f'<STR_LIT>')<EOL><DEDENT>if data.empty:<EOL><INDENT>logger.warning(f'<STR_LIT>')<EOL>missing.update_missing(**miss_kw)<EOL>return pd.DataFrame()<EOL><DEDENT>data = data.tz_localize('<STR_LIT>').tz_convert(exch.tz)<EOL>storage.save_intraday(data=data, ticker=ticker, dt=dt, typ=typ)<EOL>return pd.DataFrame() if batch else assist.format_intraday(data=data, ticker=ticker)<EOL>
Bloomberg intraday bar data

Args:
    ticker: ticker name
    dt: date to download
    typ: [TRADE, BID, ASK, BID_BEST, ASK_BEST, BEST_BID, BEST_ASK]
    **kwargs:
        batch: whether is batch process to download data
        log: level of logs

Returns:
    pd.DataFrame