<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def get_interp_val(m, theta, phi, nest=False, lonlat=False):
 """ Drop-in replacement for healpy `~healpy.pixelfunc.get_interp_val`. """

    lon, lat = _healpy_to_lonlat(theta, phi, lonlat=lonlat)
    return interpolate_bilinear_lonlat(lon, lat, m, order='nested' if nest else 'ring')