docs: def _get_kriging_matrix(self, n, n_withdrifts):
          """Assembles the kriging matrix."""
  
          xy = np.concatenate((self.X_ADJUSTED[:, np.newaxis],
                               self.Y_ADJUSTED[:, np.newaxis]), axis=1)
          d = cdist(xy, xy, 'euclidean')
          if self.UNBIAS:
              a = np.zeros((n_withdrifts+1, n_withdrifts+1))
          else:
              a = np.zeros((n_withdrifts, n_withdrifts))
          a[:n, :n] = - self.variogram_function(self.variogram_model_parameters, d)
          np.fill_diagonal(a, 0.)
  
          i = n
          if self.regional_linear_drift:
              a[:n, i] = self.X_ADJUSTED
              a[i, :n] = self.X_ADJUSTED
              i += 1
              a[:n, i] = self.Y_ADJUSTED
              a[i, :n] = self.Y_ADJUSTED
              i += 1
          if self.point_log_drift:
              for well_no in range(self.point_log_array.shape[0]):
                  log_dist = np.log(np.sqrt((self.X_ADJUSTED - self.point_log_array[well_no, 0])**2 +
                                            (self.Y_ADJUSTED - self.point_log_array[well_no, 1])**2))
                  if np.any(np.isinf(log_dist)):
                      log_dist[np.isinf(log_dist)] = -100.0
                  a[:n, i] = - self.point_log_array[well_no, 2] * log_dist
                  a[i, :n] = - self.point_log_array[well_no, 2] * log_dist
                  i += 1
          if self.external_Z_drift:
              a[:n, i] = self.z_scalars
              a[i, :n] = self.z_scalars
              i += 1
          if self.specified_drift:
              for arr in self.specified_drift_data_arrays:
                  a[:n, i] = arr
                  a[i, :n] = arr
                  i += 1
          if self.functional_drift:
              for func in self.functional_drift_terms:
                  a[:n, i] = func(self.X_ADJUSTED, self.Y_ADJUSTED)
                  a[i, :n] = func(self.X_ADJUSTED, self.Y_ADJUSTED)
                  i += 1
          if i != n_withdrifts:
              warnings.warn("Error in creating kriging matrix. Kriging may fail.",
                            RuntimeWarning)
          if self.UNBIAS:
              a[n_withdrifts, :n] = 1.0
              a[:n, n_withdrifts] = 1.0
              a[n:n_withdrifts + 1, n:n_withdrifts + 1] = 0.0
  
          return a