code: def _move_point_cat(
      point,
      ipoint,
      to_clust,
      from_clust,
      cl_attr_freq,
      membship,
      centroids,
      sample_weight,
  ):
      """Move point between clusters, categorical attributes."""
      membship[to_clust, ipoint] = 1
      membship[from_clust, ipoint] = 0
      # Update frequencies of attributes in cluster.
      for iattr, curattr in enumerate(point):
          to_attr_counts = cl_attr_freq[to_clust][iattr]
          from_attr_counts = cl_attr_freq[from_clust][iattr]
  
          # Increment the attribute count for the new "to" cluster
          to_attr_counts[curattr] += sample_weight
  
          current_attribute_value_freq = to_attr_counts[curattr]
          current_centroid_value = centroids[to_clust][iattr]
          current_centroid_freq = to_attr_counts[current_centroid_value]
          if current_centroid_freq < current_attribute_value_freq:
              # We have incremented this value to the new mode. Update the centroid.
              centroids[to_clust][iattr] = curattr
  
          # Decrement the attribute count for the old "from" cluster
          from_attr_counts[curattr] -= sample_weight
  
          old_centroid_value = centroids[from_clust][iattr]
          if old_centroid_value == curattr:
              # We have just removed a count from the old centroid value. We need to
              # recalculate the centroid as it may no longer be the maximum
              centroids[from_clust][iattr] = get_max_value_key(
                  from_attr_counts
              )
  
      return cl_attr_freq, membship, centroids
  
imports: from collections import defaultdict
  import numpy
  from joblib import Parallel, delayed
  from scipy import sparse
  from sklearn.base import BaseEstimator, ClusterMixin
  from sklearn.utils import check_random_state
  from sklearn.utils.validation import check_array
  from .util import get_max_value_key, encode_features, get_unique_rows, decode_centroids, pandas_to_numpy
  from .util.dissim import matching_dissim, ng_dissim
  from .util.init_methods import init_cao, init_huang
label_desc: Use image node_id 5 for calling a global function with example usage: _move_point_cat(point, ipoint, to_clust, from_clust, cl_attr_freq, membship, centroids, sample_weight) and returns: cl_attr_freq,  membship,  centroids