code: def meanshift(
      input_matrix: Union[pd.Series, pd.DataFrame],
      bandwidth=None,
      bin_seeding=False,
      min_bin_freq=1,
      cluster_all=True,
      n_jobs=-1,
      max_iter=300,
  ) -> VectorSeries:
      """
      Perform mean shift clustering on the given input.
  
      Mean shift clustering
      is used in natural language processing
      to separate texts into clusters (groups)
      (e.g. some texts in a corpus might be about sports
      and some about music, so they will differ in the usage
      of technical terms; the mean shift algorithm uses this
      to separate them into clusters). It chooses the
      number of clusters on its own.
  
      Given a document-term matrix (so in
      texthero usually a Series after applying
      :meth:`texthero.representation.tfidf` or some other first
      representation function that assigns a scalar (a weight) to each
      word), mean shift will find topics (clusters) and assign a topic
      to each document.
  
      Menashift cannot directly handle sparse input, so when calling
      meanshift on a sparse DataFrame, the input has to be expanded
      which can lead to memory problems with big datasets.
  
      Parameters
      ----------
      input_matrix: Pandas Series (VectorSeries) or DataFrame
  
      bandwidth : float, optional, default=None
          Bandwidth used in the RBF kernel.
  
          If not given, the bandwidth is estimated.
          Estimating takes time at least quadratic in the number of samples
          (i.e. documents). For large datasets, it’s wise to set the
          bandwidth to a small value.
  
      bin_seeding : bool, optional, default=False
          If true, initial kernel locations are not locations of all
          points, but rather the location of the discretized version of
          points, where points are binned onto a grid whose coarseness
          corresponds to the bandwidth. Setting this option to True will
          speed up the algorithm because fewer seeds will be initialized.
  
      min_bin_freq : int, optional, default=1
         To speed up the algorithm, accept only those bins with at least
         min_bin_freq points as seeds.
  
      cluster_all : bool, optional, default=True
          If true, then all points are clustered, even those orphans that are
          not within any kernel. Orphans are assigned to the nearest kernel.
          If false, then orphans are given cluster label -1.
  
      n_jobs : int, optional, default=-1
          The number of jobs to use for the computation.
          ``-1`` means using all processors
  
      max_iter : int, optional, default=300
          Maximum number of iterations, per seed point before the clustering
          operation terminates (for that seed point), if has not converged
          yet.
  
      Returns
      -------
      Pandas Series with the cluster the document was assigned to in each
      cell.
  
      Examples
      --------
      >>> import texthero as hero
      >>> import pandas as pd
      >>> s = pd.Series([[1, 1], [2, 1], [1, 0], [4, 7], [3, 5], [3, 6]])
      >>> hero.meanshift(s, bandwidth=2)
      0    1
      1    1
      2    1
      3    0
      4    0
      5    0
      dtype: category
      Categories (2, int64): [0, 1]
  
      See also
      --------
      `Mean-Shift on Wikipedia <https://en.wikipedia.org/wiki/Mean_shift>`_
  
      """
  
      if isinstance(input_matrix, pd.DataFrame):
          vectors = input_matrix.values
      else:
          vectors = list(input_matrix)
  
      return pd.Series(
          MeanShift(
              bandwidth=bandwidth,
              bin_seeding=bin_seeding,
              min_bin_freq=min_bin_freq,
              cluster_all=cluster_all,
              n_jobs=n_jobs,
              max_iter=max_iter,
          ).fit_predict(vectors),
          index=input_matrix.index,
      ).astype("category")
  
imports: import pandas
  import numpy
  from sklearn.feature_extraction.text import TfidfVectorizer, CountVectorizer
  from sklearn.manifold import TSNE
  from sklearn.decomposition import PCA, NMF
  from sklearn.cluster import KMeans, DBSCAN, MeanShift
  from sklearn.metrics.pairwise import cosine_similarity
  from sklearn.preprocessing import normalize
  from scipy.sparse import coo_matrix
  from typing import Optional, Union, Any
  from texthero._types import TextSeries, TokenSeries, VectorSeries, DataFrame, InputSeries
  from texthero import preprocessing
  import logging
  import warnings
label_desc: Use image node_id 9 for calling a global function with example usage: meanshift(input_matrix, bandwidth, bin_seeding, min_bin_freq, cluster_all, n_jobs, max_iter) and returns: pd