code: def regularizer_diagonal(self, X, regularizer=None):
          r
          reg = self.regularizer.value if regularizer is None else regularizer
          diag = np.full(self.get_dim(X), reg, dtype=float)
          return diag, slice(None)
docs: r"""
          Get the diagonal of the prior variance on the weights (regularizer).
  
          This also returns a slice into the regression weights to which this
          regularizer applies.
  
          Parameters
          ----------
          X : ndarray
              (N, d) array of observations where N is the number of samples, and
              d is the dimensionality of X.
          regularizer : float, optional
              use this value instead of the value passed into the constructor for
              the regularizer.
  
          Returns
          -------
          ndarray :
              an array of shape (D,) that is the diagonal of the prior variance
              of the weights, :math:`\boldsymbol\Lambda` in :math:`\mathbf{w}
              \sim \mathcal{N}(\mathbf{0}, \boldsymbol\Lambda)`.
          slice:
              the slice into the regression weights that this regularizer
              applies to.
  
          Note
          ----
          You should not have to modify this method if you inherit from ``Basis``
          unless you are doing something very interesting...