class_docstr: Base class for label propagation module.
  
  Parameters
  ----------
  kernel : {'knn', 'rbf'}
      String identifier for kernel function to use.
      Only 'rbf' and 'knn' kernels are currently supported..
  
  gamma : float
      Parameter for rbf kernel
  
  alpha : float
      Clamping factor
  
  max_iter : float
      Change maximum number of iterations allowed
  
  tol : float
      Convergence tolerance: threshold to consider the system at steady
      state
  
  n_neighbors : integer > 0
      Parameter for knn kernel
  
  n_jobs : int, optional (default = 1)
      The number of parallel jobs to run.
      If ``-1``, then the number of jobs is set to the number of CPU cores.
class_docstr_tok: ["Base","class","for","label","propagation","module",".","Parameters","--","--","--","--","--","kernel",":","{","'knn","'",",","'rbf","'","}","String","identifier","for","kernel","function","to","use",".","Only","'rbf","'","and","'knn","'","kernels","are","currently","supported","..","gamma",":","float","Parameter","for","rbf","kernel","alpha",":","float","Clamping","factor","max_iter",":","float","Change","maximum","number","of","iterations","allowed","tol",":","float","Convergence","tolerance",":","threshold","to","consider","the","system","at","steady","state","n_neighbors",":","integer",">","0","Parameter","for","knn","kernel","n_jobs",":","int",",","optional","(","default","=","1",")","The","number","of","parallel","jobs","to","run",".","If","``","-1","``",",","then","the","number","of","jobs","is","set","to","the","number","of","CPU","cores","."]
code: def _get_kernel(self, X, y=None):
      if self.kernel == "rbf":
          if y is None:
              return rbf_kernel(X, X, gamma=self.gamma)
          else:
              return rbf_kernel(X, y, gamma=self.gamma)
      elif self.kernel == "knn":
          if self.nn_fit is None:
              self.nn_fit = NearestNeighbors(
                  self.n_neighbors, n_jobs=self.n_jobs
              ).fit(X)
          if y is None:
              return self.nn_fit.kneighbors_graph(
                  self.nn_fit._fit_X,
                  self.n_neighbors,
                  mode="connectivity",
              )
          else:
              return self.nn_fit.kneighbors(y, return_distance=False)
      else:
          raise ValueError(
              "%s is not a valid kernel. Only rbf and knn"
              " are supported at this time" % self.kernel
          )
  
imports: from abc import ABCMeta, abstractmethod
  import numpy
  from scipy import sparse
  from ..base import BaseEstimator, ClassifierMixin
  from ..externals import six
  from ..metrics.pairwise import rbf_kernel
  from ..neighbors.unsupervised import NearestNeighbors
  from ..utils.extmath import safe_sparse_dot
  from ..utils.graph import graph_laplacian
  from ..utils.multiclass import check_classification_targets
  from ..utils.validation import check_X_y, check_is_fitted, check_array
label_desc: Use image node_id 2 for calling the BaseLabelPropagation obj's underlying member method code with example usage: obj._get_kernel(X, y) and returns: rbf_kernel, rbf_kernel, self, self