<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def skydir_to_pix(skydir, wcs):
 """Convert skydir object to pixel coordinates. Gracefully handles 0-d coordinate arrays. Parameters skydir : `~astropy.coordinates.SkyCoord` wcs : `~astropy.wcs.WCS` Returns ------- xp, yp : `numpy.ndarray` The pixel coordinates """

    if len(skydir.shape) > 0 and len(skydir) == 0:
        return [np.empty(0), np.empty(0)]

    return skydir.to_pixel(wcs, origin=0)