def get_history(self, *args, **kwargs):
        columns = kwargs.pop('columns', self.default_history_dataframe_columns)
        include_current = kwargs.pop('include_current', False)
        if 'time' not in columns:
            columns = ('time',) + tuple(columns)
        while True:
            try:
                response = None
                response = self._api.get_history(*args, **kwargs)
                if response and response.get('candles'):
                    df = pd.DataFrame(
                        data=response['candles'],
                        columns=columns,
                    )
                    df['time'] = df['time'].map(date_parse.parse)
                    df['closeMid'] = df[['closeBid','closeAsk']].mean(axis=1)
                    if not include_current:
                        df = df[df.complete == True]
                    return df
                else:
                    return pd.DataFrame()
            except (ValueError) as e:
                print "[!] Error when loading candles for {}: {}".format(kwargs['instrument'], e)
                return pd.DataFrame()
            except (ProtocolError, OandaError, SysCallError) as e:
                print "[!] Connection error ({0:s}). Reconnecting...".format(e)
            sleep(3)
dataset/ETHPy150Open jmelett/pyFxTrader/trader/broker/base.py/OandaBrokerBase.get_history/original