def METHOD_NAME(
    self,
    transforms: TypeTransformsDict,
) -> Dict[Transform, float]:
    if isinstance(transforms, dict):
        transforms_dict = dict(transforms)
        self._normalize_probabilities(transforms_dict)
    else:
        try:
            p = 1 / len(transforms)
        except TypeError as e:
            message = (
                'Transforms argument must be a dictionary or a sequence,'
                f' not {type(transforms)}'
            )
            raise ValueError(message) from e
        transforms_dict = {transform: p for transform in transforms}
    for transform in transforms_dict:
        if not isinstance(transform, Transform):
            message = (
                'All keys in transform_dict must be instances of'
                f'torchio.Transform, not "{type(transform)}"'
            )
            raise ValueError(message)
    return transforms_dict