code: def squeeze(self):
          
          axis = tuple(range(1, len(self.shape) - 1)) if prod(self.shape[1:]) == 1 else None
          return self.map(lambda x: x.squeeze(axis=axis))
docs: Remove single-dimensional axes from images.