nodes: 0, module; 1, function_definition; 2, function_name:read_cBpack; 3, parameters; 4, block; 5, identifier:filename; 6, expression_statement; 7, with_statement; 8, expression_statement; 9, if_statement; 10, return_statement; 11, comment:"""
      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']
          ]
      """; 12, with_clause; 13, block; 14, assignment; 15, parenthesized_expression; 16, block; 17, subscript; 18, with_item; 19, expression_statement; 20, identifier:header; 21, subscript; 22, boolean_operator; 23, raise_statement; 24, identifier:data; 25, slice; 26, as_pattern; 27, assignment; 28, identifier:data; 29, integer:0; 30, boolean_operator; 31, comparison_operator:header.get('version') != 1; 32, call; 33, integer:1; 34, call; 35, as_pattern_target; 36, identifier:data; 37, call; 38, not_operator; 39, comparison_operator:header.get('format') != 'cB'; 40, call; 41, integer:1; 42, identifier:ValueError; 43, argument_list; 44, attribute; 45, argument_list; 46, identifier:infile; 47, attribute; 48, argument_list; 49, call; 50, call; 51, string; 52, attribute; 53, argument_list; 54, binary_operator:"Unexpected header: %r" % header; 55, identifier:gzip; 56, identifier:open; 57, identifier:filename; 58, string; 59, identifier:msgpack; 60, identifier:load; 61, identifier:infile; 62, keyword_argument; 63, identifier:isinstance; 64, argument_list; 65, attribute; 66, argument_list; 67, string_content:cB; 68, identifier:header; 69, identifier:get; 70, string; 71, string:"Unexpected header: %r"; 72, identifier:header; 73, string_content:rb; 74, identifier:raw; 75, False; 76, identifier:header; 77, identifier:dict; 78, identifier:header; 79, identifier:get; 80, string; 81, string_content:version; 82, string_content:format
code: def read_cBpack(filename):
      """
      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']
          ]
      """
      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:]