code: def handle_data(context, data):
      log.info("handling bar {}".format(data.current_dt))
      try:
          _handle_data(context, data)
      except Exception as e:
          log.warn("aborting the bar on error {}".format(e))
          context.errors.append(e)
  
      log.info(
          "completed bar {}, total execution errors {}".format(
              data.current_dt, len(context.errors)
          )
      )
  
      if len(context.errors) > 0:
          log.info("the errors:\n{}".format(context.errors))
  
imports: import os
  import matplotlib.pyplot
  import numpy
  import pandas
  import talib
  from logbook import Logger
  from matplotlib.dates import date2num
  from mpl_finance import candlestick_ohlc
  from catalyst import run_algorithm
  from catalyst.api import order, order_target_percent, symbol
  from catalyst.exchange.utils.stats_utils import get_pretty_stats
label_desc: Use image node_id 3 for calling a global function with example usage: handle_data(context, data) without return types