def _read_array(f, typecode, array_desc):
if typecode in [<NUM_LIT:1>, <NUM_LIT:3>, <NUM_LIT:4>, <NUM_LIT:5>, <NUM_LIT:6>, <NUM_LIT:9>, <NUM_LIT>, <NUM_LIT>, <NUM_LIT:15>]:<EOL><INDENT>if typecode == <NUM_LIT:1>:<EOL><INDENT>nbytes = _read_int32(f)<EOL>if nbytes != array_desc['<STR_LIT>']:<EOL><INDENT>raise Exception("<STR_LIT>")<EOL><DEDENT><DEDENT>array = np.fromstring(f.read(array_desc['<STR_LIT>']),<EOL>dtype=DTYPE_DICT[typecode])<EOL><DEDENT>elif typecode in [<NUM_LIT:2>, <NUM_LIT:12>]:<EOL><INDENT>array = np.fromstring(f.read(array_desc['<STR_LIT>']*<NUM_LIT:2>),<EOL>dtype=DTYPE_DICT[typecode])[<NUM_LIT:1>::<NUM_LIT:2>]<EOL><DEDENT>else:<EOL><INDENT>array = []<EOL>for i in range(array_desc['<STR_LIT>']):<EOL><INDENT>dtype = typecode<EOL>data = _read_data(f, dtype)<EOL>array.append(data)<EOL><DEDENT>array = np.array(array, dtype=np.object_)<EOL><DEDENT>if array_desc['<STR_LIT>'] > <NUM_LIT:1>:<EOL><INDENT>dims = array_desc['<STR_LIT>'][:int(array_desc['<STR_LIT>'])]<EOL>dims.reverse()<EOL>array = array.reshape(dims)<EOL><DEDENT>_align_32(f)<EOL>return array<EOL>
Read an array of type `typecode`, with the array descriptor given as
`array_desc`.