<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def find(cls, dtype):
 """Returns the NDS2 type corresponding to the given python type """

        try:
            return cls._member_map_[dtype]
        except KeyError:
            try:
                dtype = numpy.dtype(dtype).type
            except TypeError:
                for ndstype in cls._member_map_.values():
                    if ndstype.value is dtype:
                        return ndstype
            else:
                for ndstype in cls._member_map_.values():
                    if ndstype.value and ndstype.numpy_dtype is dtype:
                        return ndstype
            raise ValueError('%s is not a valid %s' % (dtype, cls.__name__))