code: def filter_out_unigrams_that_only_occur_in_one_bigram(df):
      # type: (pd.DataFrame) -> pd.DataFrame
      bigrams = {bigram for bigram in df.index if " " in bigram}
      unigrams_to_remove = unigrams_that_only_occur_in_one_bigram(
          bigrams
      )
      return df.drop(unigrams_to_remove)
  
file_path: scattertext/scattertext/TermDocMatrixFilter.py
imports: from collections import Counter
  import numpy
  from scattertext.Common import DEFAULT_PMI_THRESHOLD_COEFFICIENT
label_desc: Use image node_id 2 for calling a global function with example usage: filter_out_unigrams_that_only_occur_in_one_bigram(df) and returns: df