def load_market_data(trading_day=None, trading_days=None, bm_symbol='^GSPC'):
 if (trading_day is None):
  trading_day = get_calendar('NYSE').trading_day
 if (trading_days is None):
  trading_days = get_calendar('NYSE').all_sessions
 first_date = trading_days[0]
 now = pd.Timestamp.utcnow()
 last_date = trading_days[(trading_days.get_loc(now, method='ffill') - 2)]
 br = ensure_benchmark_data(bm_symbol, first_date, last_date, now, trading_day)
 tc = ensure_treasury_data(bm_symbol, first_date, last_date, now)
 benchmark_returns = br[br.index.slice_indexer(first_date, last_date)]
 treasury_curves = tc[tc.index.slice_indexer(first_date, last_date)]
 return (benchmark_returns, treasury_curves)

def load_market_data ( trading_day = None , trading_days = None , bm_symbol = '^GSPC' ) : if ( trading_day is None ) : trading_day = get_calendar ( 'NYSE' ) . trading_day if ( trading_days is None ) : trading_days = get_calendar ( 'NYSE' ) . all_sessions first_date = trading_days [ 0 ] now = pd . Timestamp . utcnow ( ) last_date = trading_days [ ( trading_days . get_loc ( now , method = 'ffill' ) - 2 ) ] br = ensure_benchmark_data ( bm_symbol , first_date , last_date , now , trading_day ) tc = ensure_treasury_data ( bm_symbol , first_date , last_date , now ) benchmark_returns = br [ br . index . slice_indexer ( first_date , last_date ) ] treasury_curves = tc [ tc . index . slice_indexer ( first_date , last_date ) ] return ( benchmark_returns , treasury_curves )
load benchmark returns and treasury yield curves for the given calendar and benchmark symbol .