def METHOD_NAME(self, xp, dtype):
    a = testing.shaped_arange(self.shape, xp, dtype)
    res = xp.linalg.norm(a, self.ord, self.axis, self.keepdims)
    if xp == numpy and not isinstance(res, numpy.ndarray):
        real_dtype = a.real.dtype
        if issubclass(real_dtype.type, numpy.inexact):
            # Avoid numpy bug. See numpy/numpy#10667
            res = res.astype(a.real.dtype)
    return res