code: def get_candles_df(candles, field, freq, bar_count, end_dt):
      all_series = dict()
  
      for asset in candles:
          asset_df = transform_candles_to_df(candles[asset])
          rounded_end_dt = end_dt.floor(freq)
          periods = pd.date_range(
              end=rounded_end_dt, periods=bar_count, freq=freq
          )
          asset_df = forward_fill_df_if_needed(asset_df, periods)
  
          all_series[asset] = pd.Series(asset_df[field])
  
      df = pd.DataFrame(all_series)
      df.dropna(inplace=True)
  
      return df
  
imports: import hashlib
  import json
  import os
  import pickle
  import shutil
  from datetime import date, datetime
  import pandas
  from catalyst.assets._assets import TradingPair
  from six import string_types
  from six.moves.urllib import request
  from catalyst.constants import DATE_FORMAT, SYMBOLS_URL
  from catalyst.exchange.exchange_errors import ExchangeSymbolsNotFound
  from catalyst.exchange.utils.serialization_utils import ExchangeJSONEncoder, ExchangeJSONDecoder
  from catalyst.utils.memoize import weak_lru_cache
  from catalyst.utils.paths import data_root, ensure_directory, last_modified_time
label_desc: Use image node_id 33 for calling a global function with example usage: get_candles_df(candles, field, freq, bar_count, end_dt) and returns: df