<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def kde(data, grid, package, **kwargs):
 """ Kernel Density Estimation Parameters package : str Package whose kernel density estimation to use. Should be one of `['statsmodels-u', 'statsmodels-m', 'scipy', 'sklearn']`. data : numpy.array Data points used to compute a density estimator. It has `n x p` dimensions, representing n points and p variables. grid : numpy.array Data points at which the desity will be estimated. It has `m x p` dimensions, representing m points and p variables. Returns ------- out : numpy.array Density estimate. Has `m x 1` dimensions """

    if package == 'statsmodels':
        package = 'statsmodels-m'
    func = KDE_FUNCS[package]
    return func(data, grid, **kwargs)