def ensure_dtype(func, argname, arg):
 try:
  return dtype(arg)
 except TypeError:
  raise TypeError("{func}() couldn't convert argument {argname}={arg!r} to a numpy dtype.".format(func=_qualified_name(func), argname=argname, arg=arg))

def ensure_dtype ( func , argname , arg ) : try : return dtype ( arg ) except TypeError : raise TypeError ( "{func}() couldn't convert argument {argname}={arg!r} to a numpy dtype." . format ( func = _qualified_name ( func ) , argname = argname , arg = arg ) )
argument preprocessor that converts the input into a numpy dtype .