code: def __init__(
      self,
      kde=None,
      metric="euclidean",
      fit_bandwidth=True,
      bandwidths=_BANDWIDTHS,
      sigma="bandwidth",
      n_jobs=1,
      random_state=None,
  ):
      if kde is None:
          kde = KernelDensity(rtol=1e-7, atol=1e-7)
      self.kde = kde
      self.fit_bandwidth = fit_bandwidth
      self.bandwidths = bandwidths
      self.metric = metric
      self.n_jobs = n_jobs
      if not isinstance(sigma, (int, float)):
          allowed = {"bandwidth"}
          if sigma not in allowed:
              raise ValueError(
                  "sigma must be either "
                  "a number or one of {}".format(allowed)
              )
      self.sigma = sigma
      self.random_state = random_state
      self.rng_ = check_random_state(self.random_state)
  
imports: from __future__ import absolute_import
  import abc
  from functools import partial
  from typing import List, Tuple, Any, Union, Dict, Optional
  import six
  import numpy
  from scipy.stats import itemfreq
  from sklearn.base import BaseEstimator, clone
  from sklearn.neighbors import KernelDensity
  from sklearn.metrics import pairwise_distances
  from sklearn.model_selection import GridSearchCV, KFold
  from sklearn.utils import check_random_state
  from eli5.utils import vstack
  from eli5.lime.utils import rbf
  from .textutils import generate_samples, DEFAULT_TOKEN_PATTERN, TokenizedText
label_desc: Use image node_id 1 to create a new _BaseKernelDensitySampler object from inherited base classes: BaseSampler with example: obj = _BaseKernelDensitySampler(kde, metric, fit_bandwidth, bandwidths, sigma, n_jobs, random_state)