def METHOD_NAME(self, x, y, axis):
    if axis is None:
        newaxis = list(range(x.ndim))
    elif isinstance(axis, int):
        if axis < 0:
            newaxis = [axis + x.type.ndim]
        else:
            newaxis = [axis]
    else:
        newaxis = []
        for a in axis:
            if a < 0:
                a += x.type.ndim
            newaxis.append(a)
    i = 0
    new_dims = []
    for j, _ in enumerate(x.shape):
        if j in newaxis:
            new_dims.append("x")
        else:
            new_dims.append(i)
            i += 1
    return DimShuffle(y.type.broadcastable, new_dims)(y)