code: def n_nonzero_columns(X):
      """Number of columns with at least one non-zero value in a CSR matrix.
  
      This is useful to count the number of features columns that are effectively
      active when using the FeatureHasher.
      """
      return len(np.unique(X.nonzero()[1]))
  
file_path: scikit-learn/examples/text/plot_hashing_vs_dict_vectorizer.py
imports: from sklearn.datasets import fetch_20newsgroups
  import re
  from collections import defaultdict
  from time import time
  from sklearn.feature_extraction import DictVectorizer
  import numpy
  from sklearn.feature_extraction import FeatureHasher
  import matplotlib.pyplot
  from sklearn.feature_extraction.text import CountVectorizer
  from sklearn.feature_extraction.text import HashingVectorizer
  from sklearn.feature_extraction.text import TfidfVectorizer
label_desc: Use image node_id 3 for calling a global function with example usage: n_nonzero_columns(X) and returns: len