code: def _iterate_columns(X, columns=None):
      """Iterate over columns of a matrix.
  
      Parameters
      ----------
      X : ndarray or csc_matrix, shape (n_samples, n_features)
          Matrix over which to iterate.
  
      columns : iterable or None, default None
          Indices of columns to iterate over. If None, iterate over all columns.
  
      Yields
      ------
      x : ndarray, shape (n_samples,)
          Columns of `X` in dense format.
      """
      if columns is None:
          columns = range(X.shape[1])
  
      if issparse(X):
          for i in columns:
              x = np.zeros(X.shape[0])
              start_ptr, end_ptr = X.indptr[i], X.indptr[i + 1]
              x[X.indices[start_ptr:end_ptr]] = X.data[
                  start_ptr:end_ptr
              ]
              yield x
      else:
          for i in columns:
              yield X[:, i]
  
file_path: catboost/contrib/python/scikit-learn/py2/sklearn/feature_selection/mutual_info_.py
imports: from __future__ import division
  import numpy
  from scipy.sparse import issparse
  from scipy.special import digamma
  from ..externals.six import moves
  from ..metrics.cluster.supervised import mutual_info_score
  from ..neighbors import NearestNeighbors
  from ..preprocessing import scale
  from ..utils import check_random_state
  from ..utils.validation import check_X_y
  from ..utils.multiclass import check_classification_targets
label_desc: Use image node_id 4 for calling a global function with example usage: _iterate_columns(X, columns) without return types