def read_header(fd, endian):
flag_class, nzmax = read_elements(fd, endian, ['<STR_LIT>'])<EOL>header = {<EOL>'<STR_LIT>': flag_class & <NUM_LIT>,<EOL>'<STR_LIT>': (flag_class >> <NUM_LIT:9> & <NUM_LIT:1>) == <NUM_LIT:1>,<EOL>'<STR_LIT>': (flag_class >> <NUM_LIT:10> & <NUM_LIT:1>) == <NUM_LIT:1>,<EOL>'<STR_LIT>': (flag_class >> <NUM_LIT:11> & <NUM_LIT:1>) == <NUM_LIT:1>,<EOL>'<STR_LIT>': nzmax<EOL>}<EOL>header['<STR_LIT>'] = read_elements(fd, endian, ['<STR_LIT>'])<EOL>header['<STR_LIT>'] = len(header['<STR_LIT>'])<EOL>if header['<STR_LIT>'] != <NUM_LIT:2>:<EOL><INDENT>raise ParseError('<STR_LIT>')<EOL><DEDENT>header['<STR_LIT:name>'] = read_elements(fd, endian, ['<STR_LIT>'], is_name=True)<EOL>return header<EOL>
Read and return the matrix header.