code: def _get_grid(
      x_min,
      x_max,
      x_std,
      extend_fct,
      grid_len,
      custom_lims,
      extend=True,
      bound_correction=False,
  ):
      """Compute the grid that bins the data used to estimate the density function.
  
      Parameters
      ----------
      x_min : float
          Minimum value of the data
      x_max: float
          Maximum value of the data.
      x_std: float
          Standard deviation of the data.
      extend_fct: bool
          Indicates the factor by which `x_std` is multiplied
          to extend the range of the data.
      grid_len: int
          Number of bins
      custom_lims: tuple or list
          Custom limits for the domain of the density estimation.
          Must be numeric of length 2. Overrides `extend`.
      extend: bool, optional
          Whether to extend the range of the data or not.
          Default is True.
      bound_correction: bool, optional
          Whether the density estimations performs boundary correction or not.
          This does not impacts directly in the output, but is used
          to override `extend`. Overrides `extend`.
          Default is False.
  
      Returns
      -------
      grid_len: int
          Number of bins
      grid_min: float
          Minimum value of the grid
      grid_max: float
          Maximum value of the grid
      """
      # Set up number of bins.
      grid_len = max(int(grid_len), 100)
  
      # Set up domain
      if custom_lims is not None:
          custom_lims = _check_custom_lims(custom_lims, x_min, x_max)
          grid_min = custom_lims[0]
          grid_max = custom_lims[1]
      elif extend and not bound_correction:
          grid_extend = extend_fct * x_std
          grid_min = x_min - grid_extend
          grid_max = x_max + grid_extend
      else:
          grid_min = x_min
          grid_max = x_max
      return grid_min, grid_max, grid_len
  
imports: import warnings
  import numpy
  from scipy.fftpack import fft
  from scipy.optimize import brentq
  from scipy.signal import convolve, convolve2d, gaussian
  from scipy.sparse import coo_matrix
  from scipy.special import ive
  from ..utils import _cov, _dot, _stack, conditional_jit
label_desc: Use image node_id 14 for calling a global function with example usage: _get_grid(x_min, x_max, x_std, extend_fct, grid_len, custom_lims, extend, bound_correction) and returns: grid_min,  grid_max,  grid_len