def get_transform(self, image):
    shape = image.shape[(- self.ndim):]
    ndim = len(shape)
    params = self._get_param_values(use_schedulers=True)
    p = params['p']
    param_translate = params['translate']
    translate = self._format_param(param_translate, ParamKind.MULTI_ARG, ndim)
    if (self._rand() >= p):
        return NoOpTransform()
    translate = [int((self._rand_range(*x) * s)) for (x, s) in zip(translate, shape)]
    return TranslationTransform(translate, pad_mode=self.pad_mode, pad_value=self.pad_value)
def get_transform(self, image):
    shape = image.shape[(- self.ndim):]
    ndim = len(shape)
    params = self._get_param_values(use_schedulers=True)
    p = params['p']
    param_translate = params['translate']
    translate = self._format_param(param_translate, ParamKind.MULTI_ARG, ndim)
    if (self._rand() >= p):
        return NoOpTransform()
    translate = [int((self._rand_range(*x) * s)) for (x, s) in zip(translate, shape)]
    return TranslationTransform(translate, pad_mode=self.pad_mode, pad_value=self.pad_value)