code: def MakeCdfFromItems(items, name=''):
      
      runsum = 0
      xs = []
      cs = []
  
      for value, count in sorted(items):
          runsum += count
          xs.append(value)
          cs.append(runsum)
  
      total = float(runsum)
      ps = [c / total for c in cs]
  
      cdf = Cdf(xs, ps, name)
      return cdf
docs: Makes a cdf from an unsorted sequence of (value, frequency) pairs.
  
      Args:
          items: unsorted sequence of (value, frequency) pairs
          name: string name for this CDF
  
      Returns:
          cdf: list of (value, fraction) pairs