code: def create_calc_dh_dv(estimator):
      
      dh_dv = diags(np.ones(estimator.design.shape[0]), 0, format='csr')
      # Create a function that will take in the pre-formed matrix, replace its
      # data in-place with the new data, and return the correct dh_dv on each
      # iteration of the minimizer
      calc_dh_dv = partial(_uneven_transform_deriv_v, output_array=dh_dv)
      return calc_dh_dv
docs: Return the function that can be used in the various gradient and hessian
      calculations to calculate the derivative of the transformation with respect
      to the index.
  
      Parameters
      ----------
      estimator : an instance of the estimation.LogitTypeEstimator class.
          Should contain a `design` attribute that is a 2D ndarray representing
          the design matrix for this model and dataset.
  
      Returns
      -------
      Callable.
          Will accept a 1D array of systematic utility values, a 1D array of
          alternative IDs, (shape parameters if there are any) and miscellaneous
          args and kwargs. Should return a 2D array whose elements contain the
          derivative of the tranformed utility vector with respect to the vector
          of systematic utilities. The dimensions of the returned vector should
          be `(design.shape[0], design.shape[0])`.