class_docstr: Representation of a common effects term in PyMC
  
  An object that builds the PyMC distribution for a common effects term. It also contains the
  coordinates that we then add to the model.
  
  Parameters
  ----------
  term : bambi.terms.Term
      An object representing a common effects term.
class_docstr_tok: ["Representation","of","a","common","effects","term","in","PyMC","An","object","that","builds","the","PyMC","distribution","for","a","common","effects","term",".","It","also","contains","the","coordinates","that","we","then","add","to","the","model",".","Parameters","--","--","--","--","--","term",":","bambi.terms.Term","An","object","representing","a","common","effects","term","."]
code: def build(self, spec):
      data = self.term.data
      label = self.name
      args = self.term.prior.args
      distribution = get_distribution_from_prior(self.term.prior)
  
      # Dims of the response variable
      response_dims = []
      if isinstance(spec.family, (MultivariateFamily, Categorical)):
          response_dims = list(
              spec.response_component.response_term.coords
          )
          response_dims_n = len(
              spec.response_component.response_term.coords[
                  response_dims[0]
              ]
          )
          # Arguments may be of shape (a,) but we need them to be of shape (a, b)
          # a: length of predictor coordinates
          # b: length of response coordinates
          for key, value in args.items():
              if value.ndim == 1:
                  args[key] = np.hstack(
                      [value[:, np.newaxis]] * response_dims_n
                  )
  
      dims = list(self.coords) + response_dims
      if dims:
          coef = distribution(label, dims=dims, **args)
      else:
          if data.ndim == 1:
              shape = None
          elif data.shape[1] == 1:
              shape = None
          else:
              shape = data.shape[1]
          coef = distribution(label, shape=shape, **args)
          coef = pt.atleast_1d(
              coef
          )  # If only a single numeric column it won't be 1D
  
      # Prepends one dimension if response is multivariate and the predictor is 1D
      if response_dims and len(dims) == 1:
          coef = coef[np.newaxis, :]
  
      return coef, data
  
imports: import inspect
  import numpy
  import pymc
  import pytensor.tensor
  from bambi.backend.utils import get_distribution_from_likelihood, get_distribution_from_prior, get_linkinv, has_hyperprior, make_weighted_distribution, GP_KERNELS
  from bambi.families.multivariate import MultivariateFamily, Multinomial, DirichletMultinomial
  from bambi.families.univariate import Categorical
  from bambi.priors import Prior
  from bambi.utils import get_aliased_name
label_desc: Use image node_id 2 for calling the CommonTerm obj's underlying member method code with example usage: obj.build(spec) and returns: coef,  data