code: def _limit_max_terms(self, category, df):
      df["score"] = self._term_importance_ranks(category, df)
      df = df.loc[
          df.sort_values("score")
          .iloc[: self.scatterchartdata.max_terms]
          .index
      ]
      return df[[c for c in df.columns if c != "score"]]
  
imports: import logging
  import sys
  import numpy
  import pandas
  from scipy.stats import rankdata
  from scattertext.PValGetter import get_p_vals
  from scattertext.Scalers import percentile_min, percentile_alphabetical
  from scattertext.ScatterChartData import ScatterChartData
  from scattertext.TermDocMatrixFilter import filter_bigrams_by_pmis, filter_out_unigrams_that_only_occur_in_one_bigram
  from scattertext.termscoring import ScaledFScore
  from scattertext.termscoring.RankDifference import RankDifference
  from scattertext.termscoring.CornerScore import CornerScore
label_desc: Use image node_id 21 for calling the ScatterChart obj's underlying member method code with example usage: obj._limit_max_terms(category, df) and returns: df