code: def g2_term(O, E):
      res = O.astype(np.float64) * (np.log(O) - np.log(E))
      res[O == 0] = 0
      return res
  
file_path: scattertext/scattertext/termscoring/g2.py
imports: import numpy
  import pandas
  from scipy.stats import chi2
  from statsmodels.stats.multitest import fdrcorrection
  from scattertext.termscoring.CorpusBasedTermScorer import CorpusBasedTermScorer
label_desc: Use image node_id 1 for calling a global function with example usage: g2_term(O, E) and returns: res