docs: def get_contrasts(self, names=None, variables=None):
          ''' Return contrast information for the current block.
  
          Args:
              names (list): Optional list of names of contrasts to return. If
                  None (default), all contrasts are returned.
              variables (bool): Optional list of strings giving the names of
                  design matrix columns to use when generating the matrix of
                  weights.
  
          Notes:
              The 'variables' argument take precedence over the natural process
              of column selection. I.e.,
                  if a variable shows up in a contrast, but isn't named in
                  variables, it will *not* be included in the returned
  
          Returns:
              A list of ContrastInfo namedtuples, one per contrast.
          '''
  
          # Verify that there are no invalid columns in the condition_lists
          all_conds = [c['condition_list'] for c in self._block_contrasts]
          all_conds = set(chain(*all_conds))
          bad_conds = all_conds - set(self.collection.variables.keys())
          if bad_conds:
              raise ValueError("Invalid condition names passed in one or more "
                               " contrast condition lists: %s." % bad_conds)
  
          # Construct a list of all contrasts, including identity contrasts
          contrasts = list(self._block_contrasts)
  
          # Check that all contrasts have unique name
          contrast_names = [c['name'] for c in contrasts]
          if len(set(contrast_names)) < len(contrast_names):
              raise ValueError("One or more contrasts have the same name")
          contrast_names = list(set(contrast_names))
  
          if self.auto_contrasts:
              for col_name in self.auto_contrasts:
                  if (col_name in self.collection.variables.keys()
                      and col_name not in contrast_names):
                      contrasts.append({
                          'name': col_name,
                          'condition_list': [col_name],
                          'weights': [1],
                          'type': 't'
                      })
  
          # Filter on desired contrast names if passed
          if names is not None:
              contrasts = [c for c in contrasts if c['name'] in names]
  
          def setup_contrast(c):
              weights = np.atleast_2d(c['weights'])
              weights = pd.DataFrame(weights, columns=c['condition_list'])
              # If variables were explicitly passed, use them as the columns
              if variables is not None:
                  var_df = pd.DataFrame(columns=variables)
                  weights = pd.concat([weights, var_df],
                                      sort=True)[variables].fillna(0)
  
              test_type = c.get('type', ('t' if len(weights) == 1 else 'F'))
  
              return ContrastInfo(c['name'], weights, test_type, self.entities)
  
          self._contrasts = [setup_contrast(c) for c in contrasts]
  
          return self._contrasts