code: def get_epoch_number( block_height ):
      
      global EPOCHS
  
      if block_height <= EPOCHS[0]['end_block']:
          return 0
  
      for i in xrange(1, len(EPOCHS)):
          if EPOCHS[i-1]['end_block'] < block_height and (block_height <= EPOCHS[i]['end_block'] or EPOCHS[i]['end_block'] == EPOCH_NOW):
              return i
  
      # should never happen 
      log.error("FATAL: No epoch for %s" % block_height)
      os.abort()
docs: Which epoch are we in?
      Return integer (>=0) on success