def _add_trailing_padding(value, padding):
from numpy.core.multiarray import dtype<EOL>if value.fields is None:<EOL><INDENT>vfields = {'<STR_LIT>': (value, <NUM_LIT:0>)}<EOL><DEDENT>else:<EOL><INDENT>vfields = dict(value.fields)<EOL><DEDENT>if value.names and value.names[-<NUM_LIT:1>] == '<STR_LIT>' andvalue['<STR_LIT>'].char == '<STR_LIT>':<EOL><INDENT>vfields['<STR_LIT>'] = ('<STR_LIT>' % (vfields['<STR_LIT>'][<NUM_LIT:0>].itemsize + padding),<EOL>vfields['<STR_LIT>'][<NUM_LIT:1>])<EOL>value = dtype(vfields)<EOL><DEDENT>else:<EOL><INDENT>j = <NUM_LIT:0><EOL>while True:<EOL><INDENT>name = '<STR_LIT>' % j<EOL>if name not in vfields:<EOL><INDENT>vfields[name] = ('<STR_LIT>' % padding, value.itemsize)<EOL>break<EOL><DEDENT>j += <NUM_LIT:1><EOL><DEDENT>value = dtype(vfields)<EOL>if '<STR_LIT>' not in vfields:<EOL><INDENT>names = list(value.names)<EOL>names[-<NUM_LIT:1>] = '<STR_LIT>'<EOL>value.names = tuple(names)<EOL><DEDENT><DEDENT>return value<EOL>
Inject the specified number of padding bytes at the end of a dtype