input: Write a python function to shuffle an array and calculate its median.
  assert calculate_median(shuffle([1, 2, 3, 4, 5])) in [3]
  assert calculate_median(shuffle([7, 8, 9, 10, 11, 12])) in [9.5]
  assert calculate_median(shuffle([1, 3, 3, 6, 7, 8, 9])) in [6]
  assert calculate_median(shuffle([1, 2, 3])) in [2]
output: import random
  
  def shuffle(arr):
      random.shuffle(arr)
      return arr
  
  def calculate_median(arr):
      arr.sort()
      n = len(arr)
      mid = n // 2
      if n % 2 == 0:
          return (arr[mid - 1] + arr[mid]) / 2
      else:
          return arr[mid]