<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def nested_to_ring(nested_index, nside):
 """ Convert a HEALPix 'nested' index to a HEALPix 'ring' index Parameters nested_index : int or `~numpy.ndarray` Healpix index using the 'nested' ordering nside : int or `~numpy.ndarray` Number of pixels along the side of each of the 12 top-level HEALPix tiles Returns ------- ring_index : int or `~numpy.ndarray` Healpix index using the 'ring' ordering """


    nside = np.asarray(nside, dtype=np.intc)

    return _core.nested_to_ring(nested_index, nside)