def parse_nds2_enums(func):
@wraps(func)<EOL>def wrapped_func(*args, **kwargs):  <EOL><INDENT>for kwd, enum_ in (('<STR_LIT:type>', Nds2ChannelType),<EOL>('<STR_LIT>', Nds2DataType)):<EOL><INDENT>if kwargs.get(kwd, None) is None:<EOL><INDENT>kwargs[kwd] = enum_.any()<EOL><DEDENT>elif not isinstance(kwargs[kwd], int):<EOL><INDENT>kwargs[kwd] = enum_.find(kwargs[kwd]).value<EOL><DEDENT><DEDENT>return func(*args, **kwargs)<EOL><DEDENT>return wrapped_func<EOL>
Decorate a function to translate a type string into an integer