<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _add_fixed_dim(self, fixed_dim=-1):
 """Makes note of which dimension needs to be fixed, defaulting to last."""


        if fixed_dim in [-1, None, 'last']:
            fixed_dim = len(self.input_image.shape) - 1  # last dimension

        if int(fixed_dim)!=fixed_dim or \
            fixed_dim > len(self.input_image.shape) or \
            fixed_dim < -1:
            raise ValueError('invalid value for the dimension to be fixed!'
                             'Must be an integer in range [0, {}] inclusive'
                             ''.format(len(self.input_image.shape)))

        if self.input_image.shape[fixed_dim] < 2:
            raise ValueError('Input image must have atleast two samples '
                             'in the fixed dimension. It has {}. '
                             'Full image shape: {} '
                             ''.format(self.input_image.shape[fixed_dim],
                                       self.input_image.shape))

        self.fixed_dim = int(fixed_dim)