def _npy_num2fits(d, table_type='<STR_LIT>', write_bitcols=False):
dim = None<EOL>name = d[<NUM_LIT:0>]<EOL>npy_dtype = d[<NUM_LIT:1>][<NUM_LIT:1>:]<EOL>if npy_dtype[<NUM_LIT:0>] == '<STR_LIT:S>' or npy_dtype[<NUM_LIT:0>] == '<STR_LIT>':<EOL><INDENT>raise ValueError("<STR_LIT>")<EOL><DEDENT>if npy_dtype not in _table_npy2fits_form:<EOL><INDENT>raise ValueError("<STR_LIT>" % npy_dtype)<EOL><DEDENT>if table_type == '<STR_LIT>':<EOL><INDENT>form = _table_npy2fits_form[npy_dtype]<EOL><DEDENT>else:<EOL><INDENT>form = _table_npy2fits_form_ascii[npy_dtype]<EOL><DEDENT>if len(d) > <NUM_LIT:2>:<EOL><INDENT>if table_type == '<STR_LIT:ascii>':<EOL><INDENT>raise ValueError(<EOL>"<STR_LIT>" % str(d))<EOL><DEDENT>if write_bitcols and npy_dtype == '<STR_LIT>':<EOL><INDENT>form = '<STR_LIT:X>'<EOL><DEDENT>if isinstance(d[<NUM_LIT:2>], tuple):<EOL><INDENT>count = reduce(lambda x, y: x*y, d[<NUM_LIT:2>])<EOL>form = '<STR_LIT>' % (count, form)<EOL>if len(d[<NUM_LIT:2>]) > <NUM_LIT:1>:<EOL><INDENT>dim = list(reversed(d[<NUM_LIT:2>]))<EOL>dim = [str(e) for e in dim]<EOL>dim = '<STR_LIT:(>' + '<STR_LIT:U+002C>'.join(dim)+'<STR_LIT:)>'<EOL><DEDENT><DEDENT>else:<EOL><INDENT>count = d[<NUM_LIT:2>]<EOL>form = '<STR_LIT>' % (count, form)<EOL><DEDENT><DEDENT>return name, form, dim<EOL>
d is the full element from the descr

For vector,array columns the form is the total counts
followed by the code.

For array columns with dimension greater than 1, the dim is set to
    (dim1, dim2, ...)
So it is treated like an extra dimension