docs: def _get_kriging_matrix(self, n, n_withdrifts):
          """Assembles the kriging matrix."""
  
          xyz = np.concatenate((self.X_ADJUSTED[:, np.newaxis], self.Y_ADJUSTED[:, np.newaxis],
                                self.Z_ADJUSTED[:, np.newaxis]), axis=1)
          d = cdist(xyz, xyz, '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
              a[:n, i] = self.Z_ADJUSTED
              a[i, :n] = self.Z_ADJUSTED
              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, self.Z_ADJUSTED)
                  a[i, :n] = func(self.X_ADJUSTED, self.Y_ADJUSTED, self.Z_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