code: def kde(
      data: FloatArray, grid: FloatArray, package: str, **kwargs: Any
  ) -> FloatArray:
      """
      Kernel Density Estimation
  
      Parameters
      ----------
      package :
          Package whose kernel density estimation to use.
          Should be one of
          `['statsmodels-u', 'statsmodels-m', 'scipy', 'sklearn']`.
      data :
          Data points used to compute a density estimator. It
          has `n x p` dimensions, representing n points and p
          variables.
      grid :
          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)
  
file_path: plotnine/plotnine/stats/density.py
imports: from __future__ import annotations
  import typing
  import numpy
  from .._utils import array_kind
label_desc: Use image node_id 6 for calling a global function with example usage: kde(data, grid, package) and returns: func