<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def stereo_bm_preset(self, value):
 """Set private ``_stereo_bm_preset`` and reset ``_block_matcher``."""

        if value in (cv2.STEREO_BM_BASIC_PRESET,
                     cv2.STEREO_BM_FISH_EYE_PRESET,
                     cv2.STEREO_BM_NARROW_PRESET):
            self._bm_preset = value
        else:
            raise InvalidBMPresetError("Stereo BM preset must be defined as "
                                       "cv2.STEREO_BM_*_PRESET.")
        self._replace_bm()