<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def weighted_counts(self):
 """_WeightedCountMeasure object for this cube. This object provides access to weighted counts for this cube, if available. If the cube response is not weighted, the _UnweightedCountMeasure object for this cube is returned. """

        if not self.is_weighted:
            return self.unweighted_counts
        return _WeightedCountMeasure(self._cube_dict, self._all_dimensions)