code: def _HCCM(results, scale):
      """
      sandwich with pinv(x) * diag(scale) * pinv(x).T
  
      where pinv(x) = (X'X)^(-1) X
      and scale is (nobs,)
      """
      H = np.dot(
          results.model.pinv_wexog,
          scale[:, None] * results.model.pinv_wexog.T,
      )
      return H
  
imports: import numpy
  from statsmodels.tools.grouputils import combine_indices, group_sums
  from statsmodels.stats.moment_helpers import se_cov
label_desc: Use image node_id 1 for calling a global function with example usage: _HCCM(results, scale) and returns: H