input: Write a python function to compute the online median of a list of numbers.
  assert online_median([2, 1, 5, 7, 2, 0, 5]) == [2, 1.5, 2, 3.5, 2, 2, 2]
  assert online_median([10, 20, 30, 40, 50]) == [10, 15.0, 20, 25.0, 30]
  assert online_median([5, 15, 10, 20, 3]) == [5, 10.0, 10, 12.5, 10]
output: import heapq
  
  def online_median(nums):
      def add_number(num, lowers, highers):
          if len(lowers) == 0 or num < -lowers[0]:
              heapq.heappush(lowers, -num)
          else:
              heapq.heappush(highers, num)
          
      def rebalance(lowers, highers):
          if len(lowers) > len(highers) + 1:
              heapq.heappush(highers, -heapq.heappop(lowers))
          elif len(highers) > len(lowers):
              heapq.heappush(lowers, -heapq.heappop(highers))
      
      def get_median(lowers, highers):
          if len(lowers) == len(highers):
              return (-lowers[0] + highers[0]) / 2.0
          else:
              return float(-lowers[0])
      
      lowers = []  # Max-heap (inverted min-heap)
      highers = []  # Min-heap
      medians = []
      
      for num in nums:
          add_number(num, lowers, highers)
          rebalance(lowers, highers)
          medians.append(get_median(lowers, highers))
          
      return medians