def display_coil(n, r0, R, half=False):
    """
    Display a coils in the 3D view.
    If half is True, display only one half of the coil.
    """
    n, l, m = base_vectors(n)
    theta = np.linspace(0, (2-half)*np.pi, 30)
    theta = theta[..., np.newaxis]
    coil = np.atleast_1d(R)*(np.sin(theta)*l + np.cos(theta)*m)
    coil += r0
    coil_x = coil[:, 0]
    coil_y = coil[:, 1]
    coil_z = coil[:, 2]
    mlab.plot3d(coil_x, coil_y, coil_z,
            tube_radius=0.01,
            name=display_coil.num % 'Coil %i',
            color=(0, 0, 0))
    display_coil.num += 1
    return coil_x, coil_y, coil_z
dataset/ETHPy150Open enthought/mayavi/docs/source/mayavi/auto/magnetic_field.py/display_coil/swapped operands of `%`