code: def query(self, rank):
          
          self._flush()
  
          current = self._head
          if not current:
            return 0
  
          mid_rank = math.floor(rank * self._observations)
          max_rank = mid_rank + math.floor(
              self._invariant(mid_rank, self._observations) / 2)
  
          rank = 0.0
          while current._successor:
              rank += current._rank
              if rank + current._successor._rank + current._successor._delta > max_rank:
                  return current._value
  
              current = current._successor
  
          return current._value
docs: Retrieves the value estimate for the requested quantile rank.
  
          The requested quantile rank must be registered in the estimator's
          invariants a priori!
  
          Args:
              rank: A floating point quantile rank along the interval [0, 1].
  
          Returns:
              A numeric value for the quantile estimate.