code: def get_bin_seeds(X, bin_size, min_bin_freq=1):
      """Finds seeds for mean_shift.
  
      Finds seeds by first binning data onto a grid whose lines are
      spaced bin_size apart, and then choosing those bins with at least
      min_bin_freq points.
  
      Parameters
      ----------
  
      X : array-like, shape=[n_samples, n_features]
          Input points, the same points that will be used in mean_shift.
  
      bin_size : float
          Controls the coarseness of the binning. Smaller values lead
          to more seeding (which is computationally more expensive). If you're
          not sure how to set this, set it to the value of the bandwidth used
          in clustering.mean_shift.
  
      min_bin_freq : integer, optional
          Only bins with at least min_bin_freq will be selected as seeds.
          Raising this value decreases the number of seeds found, which
          makes mean_shift computationally cheaper.
  
      Returns
      -------
      bin_seeds : array-like, shape=[n_samples, n_features]
          Points used as initial kernel positions in clustering.mean_shift.
      """
  
      # Bin points
      bin_sizes = defaultdict(int)
      for point in X:
          binned_point = np.round(point / bin_size)
          bin_sizes[tuple(binned_point)] += 1
  
      # Select only those bins as seeds which have enough members
      bin_seeds = np.array(
          [
              point
              for point, freq in six.iteritems(bin_sizes)
              if freq >= min_bin_freq
          ],
          dtype=np.float32,
      )
      if len(bin_seeds) == len(X):
          warnings.warn(
              "Binning data failed with provided bin_size=%f,"
              " using data points as seeds." % bin_size
          )
          return X
      bin_seeds = bin_seeds * bin_size
      return bin_seeds
  
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 4 for calling a global function with example usage: get_bin_seeds(X, bin_size, min_bin_freq) and returns: bin_seeds, X