code: def morista_index(points):
      # Morisita Index of Dispersion
  
      N = points.shape[1]
  
      ims = []
      for i in range(1, N):
          bins, _, _ = np.histogram2d(points[0], points[1], i)
  
          # I_M  = Q * (\sum_{k=1}^{Q}{n_k * (n_k - 1)})/(N * (N _ 1))
          Q = len(bins)  # num_quadrants
  
          # Eqn 1.
          I_M = (
              Q
              * np.sum(np.ravel(bins) * (np.ravel(bins) - 1))
              / (N * (N - 1))
          )
          ims.append([i, I_M])
  
      return np.array(ims).T[1].max()
  
file_path: scattertext/scattertext/categoryprojector/OptimalProjection.py
imports: from typing import Optional, Callable
  import numpy
  from sklearn.decomposition import PCA
  from scattertext.Scalers import stretch_0_to_1
  from scattertext.termscoring.RankDifference import RankDifference
  from scattertext.categoryprojector.CategoryProjector import CategoryProjector
  from scattertext.termcompaction.AssociationCompactor import AssociationCompactor, AssociationCompactorByRank, TermCategoryRanker
label_desc: Use image node_id 1 for calling a global function with example usage: morista_index(points) and returns: np