input: Write a function to calculate the median of a list of numbers.
  assert calculate_median([1, 3, 3, 6, 7, 8, 9]) == 6
  assert calculate_median([1, 2, 3, 4, 5, 6, 8, 9]) == 4.5
  assert calculate_median([10, 20, 30, 40, 50]) == 30
  assert calculate_median([5, 5, 5, 5]) == 5
output: def calculate_median(numbers):
      numbers.sort()
      n = len(numbers)
      middle = n // 2
      
      if n % 2 == 0:
          return (numbers[middle - 1] + numbers[middle]) / 2
      else:
          return numbers[middle]