code: def estimate_bandwidth(
      X, quantile=0.3, n_samples=None, random_state=0, n_jobs=1
  ):
      """Estimate the bandwidth to use with the mean-shift algorithm.
  
      That this function takes time at least quadratic in n_samples. For large
      datasets, it's wise to set that parameter to a small value.
  
      Parameters
      ----------
      X : array-like, shape=[n_samples, n_features]
          Input points.
  
      quantile : float, default 0.3
          should be between [0, 1]
          0.5 means that the median of all pairwise distances is used.
  
      n_samples : int, optional
          The number of samples to use. If not given, all samples are used.
  
      random_state : int or RandomState
          Pseudo-random number generator state used for random sampling.
  
      n_jobs : int, optional (default = 1)
          The number of parallel jobs to run for neighbors search.
          If ``-1``, then the number of jobs is set to the number of CPU cores.
  
      Returns
      -------
      bandwidth : float
          The bandwidth parameter.
      """
      random_state = check_random_state(random_state)
      if n_samples is not None:
          idx = random_state.permutation(X.shape[0])[:n_samples]
          X = X[idx]
      nbrs = NearestNeighbors(
          n_neighbors=int(X.shape[0] * quantile), n_jobs=n_jobs
      )
      nbrs.fit(X)
  
      bandwidth = 0.0
      for batch in gen_batches(len(X), 500):
          d, _ = nbrs.kneighbors(X[batch, :], return_distance=True)
          bandwidth += np.max(d, axis=1).sum()
  
      return bandwidth / X.shape[0]
  
imports: import numpy
  import warnings
  from collections import defaultdict
  from ..externals import six
  from ..utils.validation import check_is_fitted
  from ..utils import extmath, check_random_state, gen_batches, check_array
  from ..base import BaseEstimator, ClusterMixin
  from ..neighbors import NearestNeighbors
  from ..metrics.pairwise import pairwise_distances_argmin
  from ..externals.joblib import Parallel
  from ..externals.joblib import delayed
label_desc: Use image node_id 1 for calling a global function with example usage: estimate_bandwidth(X, quantile, n_samples, random_state, n_jobs) and returns: unknown