code: def getBars(
      self,
      instrument,
      frequency,
      timezone=None,
      fromDateTime=None,
      toDateTime=None,
  ):
      instrument = normalize_instrument(instrument)
      sql = (
          "select bar.timestamp, bar.open, bar.high, bar.low, bar.close, bar.volume, bar.adj_close, bar.frequency"
          " from bar join instrument on (bar.instrument_id = instrument.instrument_id)"
          " where instrument.name = ? and bar.frequency = ?"
      )
      args = [instrument, frequency]
  
      if fromDateTime is not None:
          sql += " and bar.timestamp >= ?"
          args.append(dt.datetime_to_timestamp(fromDateTime))
      if toDateTime is not None:
          sql += " and bar.timestamp <= ?"
          args.append(dt.datetime_to_timestamp(toDateTime))
  
      sql += " order by bar.timestamp asc"
      cursor = self.__connection.cursor()
      cursor.execute(sql, args)
      ret = []
      for row in cursor:
          dateTime = dt.timestamp_to_datetime(row[0])
          if timezone:
              dateTime = dt.localize(dateTime, timezone)
          ret.append(
              bar.BasicBar(
                  dateTime,
                  row[1],
                  row[2],
                  row[3],
                  row[4],
                  row[5],
                  row[6],
                  row[7],
              )
          )
      cursor.close()
      return ret
  
imports: from pyalgotrade.barfeed import dbfeed
  from pyalgotrade.barfeed import membf
  from pyalgotrade import bar
  from pyalgotrade.utils import dt
  import sqlite3
  import os
label_desc: Use image node_id 7 for calling the Database obj's underlying member method code with example usage: obj.getBars(instrument, frequency, timezone, fromDateTime, toDateTime) and returns: ret