def _make_tag(base_dt, val, mdtype, sde=False):
base_dt = np.dtype(base_dt)<EOL>bo = boc.to_numpy_code(base_dt.byteorder)<EOL>byte_count = base_dt.itemsize<EOL>if not sde:<EOL><INDENT>udt = bo + '<STR_LIT>'<EOL>padding = <NUM_LIT:8> - (byte_count % <NUM_LIT:8>)<EOL>all_dt = [('<STR_LIT>', udt),<EOL>('<STR_LIT>', udt),<EOL>('<STR_LIT>', base_dt)]<EOL>if padding:<EOL><INDENT>all_dt.append(('<STR_LIT>', '<STR_LIT>', padding))<EOL><DEDENT><DEDENT>else:  <EOL><INDENT>udt = bo + '<STR_LIT>'<EOL>padding = <NUM_LIT:4>-byte_count<EOL>if bo == '<STR_LIT:<>':  <EOL><INDENT>all_dt = [('<STR_LIT>', udt),<EOL>('<STR_LIT>', udt),<EOL>('<STR_LIT>', base_dt)]<EOL><DEDENT>else:  <EOL><INDENT>all_dt = [('<STR_LIT>', udt),<EOL>('<STR_LIT>', udt),<EOL>('<STR_LIT>', base_dt)]<EOL><DEDENT>if padding:<EOL><INDENT>all_dt.append(('<STR_LIT>', '<STR_LIT>', padding))<EOL><DEDENT><DEDENT>tag = np.zeros((<NUM_LIT:1>,), dtype=all_dt)<EOL>tag['<STR_LIT>'] = mdtype<EOL>tag['<STR_LIT>'] = byte_count<EOL>tag['<STR_LIT>'] = val<EOL>return tag<EOL>
Makes a simple matlab tag, full or sde