nodes: 0, module; 1, function_definition; 2, function_name:hash_prefix_list_checksum; 3, parameters; 4, block; 5, identifier:self; 6, identifier:threat_list; 7, expression_statement; 8, expression_statement; 9, expression_statement; 10, with_statement; 11, return_statement; 12, comment:"""Returns SHA256 checksum for alphabetically-sorted concatenated list of hash prefixes"""; 13, assignment; 14, assignment; 15, with_clause; 16, block; 17, identifier:checksum; 18, identifier:q; 19, string; 20, identifier:params; 21, list; 22, with_item; 23, expression_statement; 24, expression_statement; 25, expression_statement; 26, string_content:SELECT value FROM hash_prefix
                  WHERE threat_type=? AND platform_type=? AND threat_entry_type=?
                  ORDER BY value; 27, attribute; 28, attribute; 29, attribute; 30, as_pattern; 31, call; 32, assignment; 33, assignment; 34, identifier:threat_list; 35, identifier:threat_type; 36, identifier:threat_list; 37, identifier:platform_type; 38, identifier:threat_list; 39, identifier:threat_entry_type; 40, call; 41, as_pattern_target; 42, attribute; 43, argument_list; 44, identifier:all_hashes; 45, call; 46, identifier:checksum; 47, call; 48, attribute; 49, argument_list; 50, identifier:dbc; 51, identifier:dbc; 52, identifier:execute; 53, identifier:q; 54, identifier:params; 55, attribute; 56, generator_expression; 57, attribute; 58, argument_list; 59, identifier:self; 60, identifier:get_cursor; 61, string; 62, identifier:join; 63, call; 64, for_in_clause; 65, call; 66, identifier:digest; 67, identifier:bytes; 68, argument_list; 69, identifier:h; 70, call; 71, attribute; 72, argument_list; 73, subscript; 74, attribute; 75, argument_list; 76, identifier:hashlib; 77, identifier:sha256; 78, identifier:all_hashes; 79, identifier:h; 80, integer:0; 81, identifier:dbc; 82, identifier:fetchall
code: def hash_prefix_list_checksum(self, threat_list):
          """Returns SHA256 checksum for alphabetically-sorted concatenated list of hash prefixes"""
          q = '''SELECT value FROM hash_prefix
                  WHERE threat_type=? AND platform_type=? AND threat_entry_type=?
                  ORDER BY value
          '''
          params = [threat_list.threat_type, threat_list.platform_type, threat_list.threat_entry_type]
          with self.get_cursor() as dbc:
              dbc.execute(q, params)
              all_hashes = b''.join(bytes(h[0]) for h in dbc.fetchall())
              checksum = hashlib.sha256(all_hashes).digest()
          return checksum