code: def resize_hess(self, func):
          
          if func is None:
              return None
          @wraps(func)
          def resized(*args, **kwargs):
              out = func(*args, **kwargs)
              # Make two dimensional, corresponding to a scalar function.
              out = np.atleast_2d(np.squeeze(out))
              mask = [p not in self._fixed_params for p in self.parameters]
              return np.atleast_2d(out[mask, mask])
          return resized
docs: Removes values with identical indices to fixed parameters from the
          output of func. func has to return the Hessian of a scalar function.
  
          :param func: Hessian function to be wrapped. Is assumed to be the
              Hessian of a scalar function.
          :return: Hessian corresponding to free parameters only.