def nrRequests(self,timeSpan=600):
        ''' return number of requests in past timespan (s) '''
        delta = dt.timedelta(seconds=timeSpan)
        now = dt.datetime.now()
        requests = 0
        
        with open(self.dataFile,'r') as f:
            lines = f.readlines()
            
        for line in lines:
            if now-dt.datetime.strptime(line.strip(),self._timeFormat) < delta:
                requests+=1
    
        if requests==0: # erase all contents if no requests are relevant
            open(self.dataFile,'w').close() 
            
        self._log.debug('past requests: {0}'.format(requests))
        return requests
dataset/ETHPy150Open cmorgan/trading-with-python/historicDataDownloader/timeKeeper.py/TimeKeeper.nrRequests/original