<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _factory(slice_, axis, weighted):
 """return subclass for PairwiseSignificance, based on slice dimension types."""

        if slice_.dim_types[0] == DT.MR_SUBVAR:
            return _MrXCatPairwiseSignificance(slice_, axis, weighted)
        return _CatXCatPairwiseSignificance(slice_, axis, weighted)