code: def read_cBpack(filename):
      
      with gzip.open(filename, 'rb') as infile:
          data = msgpack.load(infile, raw=False)
      header = data[0]
      if (
          not isinstance(header, dict) or header.get('format') != 'cB'
          or header.get('version') != 1
      ):
          raise ValueError("Unexpected header: %r" % header)
      return data[1:]
docs: Read a file from an idiosyncratic format that we use for storing
      approximate word frequencies, called "cBpack".
  
      The cBpack format is as follows:
  
      - The file on disk is a gzipped file in msgpack format, which decodes to a
        list whose first element is a header, and whose remaining elements are
        lists of words.
  
      - The header is a dictionary with 'format' and 'version' keys that make
        sure that we're reading the right thing.
  
      - Each inner list of words corresponds to a particular word frequency,
        rounded to the nearest centibel -- that is, one tenth of a decibel, or
        a factor of 10 ** .01.
  
        0 cB represents a word that occurs with probability 1, so it is the only
        word in the data (this of course doesn't happen). -200 cB represents a
        word that occurs once per 100 tokens, -300 cB represents a word that
        occurs once per 1000 tokens, and so on.
  
      - The index of each list within the overall list (without the header) is
        the negative of its frequency in centibels.
  
      - Each inner list is sorted in alphabetical order.
  
      As an example, consider a corpus consisting only of the words "red fish
      blue fish". The word "fish" occurs as 50% of tokens (-30 cB), while "red"
      and "blue" occur as 25% of tokens (-60 cB). The cBpack file of their word
      frequencies would decode to this:
  
          [
              {'format': 'cB', 'version': 1},
              [], [], [], ...    # 30 empty lists
              ['fish'],
              [], [], [], ...    # 29 more empty lists
              ['blue', 'red']
          ]