Find the median in a stream of integers.
Implement a function that receives the integers in arrival order and returns the running median after each insertion. For an even number of values, return the arithmetic mean of the two middle values.
Input: a non-empty list of integers. Output: a list of numeric medians with the same length as the input.
def running_medians(nums):