def _downsample_one_or_the_other(mask, mask_indexes, stft, stft_indexes):
assert len(mask.shape) == <NUM_LIT:2>, "<STR_LIT>".format(len(mask.shape))<EOL>assert len(stft.shape) == <NUM_LIT:2>, "<STR_LIT>".format(len(stft.shape))<EOL>if mask.shape[<NUM_LIT:1>] > stft.shape[<NUM_LIT:1>]:<EOL><INDENT>downsample_factor = mask.shape[<NUM_LIT:1>] / stft.shape[<NUM_LIT:1>]<EOL>indexes = _get_downsampled_indexes(mask, downsample_factor)<EOL>mask = mask[:, indexes]<EOL>mask_indexes = np.array(indexes)<EOL><DEDENT>elif mask.shape[<NUM_LIT:1>] < stft.shape[<NUM_LIT:1>]:<EOL><INDENT>downsample_factor = stft.shape[<NUM_LIT:1>] / mask.shape[<NUM_LIT:1>]<EOL>indexes = _get_downsampled_indexes(stft, downsample_factor)<EOL>stft = stft[:, indexes]<EOL>stft_indexes = np.array(indexes)<EOL><DEDENT>return mask, mask_indexes, stft, stft_indexes<EOL>
Takes the given `mask` and `stft`, which must be matrices of shape `frequencies, times`
and downsamples one of them into the other one's times, so that the time dimensions
are equal. Leaves the frequency dimension untouched.