code: def _counts(self, weighted):
          
          return (
              self._measures.weighted_counts
              if weighted
              else self._measures.unweighted_counts
          )
docs: Return _BaseMeasure subclass for *weighted* counts.
  
          The return value is a _WeightedCountMeasure object if *weighted* is
          True and the cube response is weighted. Otherwise it is an
          _UnweightedCountMeasure object. Any means measure that may be present
          is not considered. Contrast with `._measure()` below.