<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def proportions( self, axis=None, weighted=True, include_transforms_for_dims=None, include_mr_cat=False, prune=False, ):
 """Return percentage values for cube as `numpy.ndarray`. This function calculates the proportions across the selected axis of a crunch cube. For most variable types, it means the value divided by the margin value. For a multiple-response variable, the value is divided by the sum of selected and non-selected slices. *axis* (int):
 base axis of proportions calculation. If no axis is provided, calculations are done across the entire table. *weighted* (bool):
 Specifies weighted or non-weighted proportions. *include_transforms_for_dims* (list):
 Also include headings and subtotals transformations for the provided dimensions. If the dimensions have the transformations, they'll be included in the resulting numpy array. If the dimensions don't have the transformations, nothing will happen (the result will be the same as if the argument weren't provided). *include_transforms_for_dims* (list):
 Include headers and subtotals (H&S) across various dimensions. The dimensions are provided as list elements. For example: "include_transforms_for_dims=[0, 1]" instructs the CrunchCube to return H&S for both rows and columns (if it's a 2D cube). *include_mr_cat* (bool):
 Include MR categories. *prune* (bool):
 Instructs the CrunchCube to prune empty rows/cols. Emptiness is determined by the state of the margin (if it's either 0 or nan at certain index). If it is, the corresponding row/col is not included in the result. Example 1:: np.array([ [5, 2], [5, 3], ]) np.array([ [0.3333333, 0.1333333], [0.3333333, 0.2000000], ]) Example 2:: np.array([ [5, 2], [5, 3], ]) np.array([ [0.5, 0.4], [0.5, 0.6], ]) """


        # Calculate numerator from table (include all H&S dimensions).
        table = self._measure(weighted).raw_cube_array
        num = self._apply_subtotals(
            self._apply_missings(table), include_transforms_for_dims
        )

        proportions = num / self._denominator(
            weighted, include_transforms_for_dims, axis
        )
        if not include_mr_cat:
            proportions = self._drop_mr_cat_dims(proportions)

        # Apply correct mask (based on the as_array shape)
        arr = self.as_array(
            prune=prune, include_transforms_for_dims=include_transforms_for_dims
        )
        if isinstance(arr, np.ma.core.MaskedArray):
            proportions = np.ma.masked_array(proportions, arr.mask)

        return proportions