code: def parse_nds2_enums(func):
      
      @wraps(func)
      def wrapped_func(*args, **kwargs):  # pylint: disable=missing-docstring
          for kwd, enum_ in (('type', Nds2ChannelType),
                             ('dtype', Nds2DataType)):
              if kwargs.get(kwd, None) is None:
                  kwargs[kwd] = enum_.any()
              elif not isinstance(kwargs[kwd], int):
                  kwargs[kwd] = enum_.find(kwargs[kwd]).value
          return func(*args, **kwargs)
      return wrapped_func
docs: Decorate a function to translate a type string into an integer