code: def median(seq, key=identity):
      """Returns the median of *seq* - the numeric value separating the higher
      half of a sample from the lower half. If there is an even number of
      elements in *seq*, it returns the mean of the two middle values.
      """
      sseq = sorted(seq, key=key)
      length = len(seq)
      if length % 2 == 1:
          return key(sseq[(length - 1) // 2])
      else:
          return (
              key(sseq[(length - 1) // 2]) + key(sseq[length // 2])
          ) / 2.0
  
imports: import bisect
  from collections import defaultdict, namedtuple
  from itertools import chain
  import math
  from operator import attrgetter, itemgetter
  import random
  import numpy
label_desc: Use image node_id 7 for calling a global function with example usage: median(seq, key) and returns: key, unknown