code: def stack_contrasts(contrasts, name, keys):
      """
      Create a new F-contrast matrix called 'name'
      based on a sequence of keys. The contrast
      is added to contrasts, in-place.
  
      Parameters
      ----------
      contrasts : dict
         Dictionary of contrast matrices
      name : str
         Name of new contrast. Should not already be a key of contrasts.
      keys : sequence of str
         Keys of contrasts that are to be stacked.
  
      Returns
      -------
      None
      """
      if name in contrasts:
          raise ValueError(f'contrast "{name}" already exists')
  
      contrasts[name] = np.vstack([contrasts[k] for k in keys])
  
imports: import itertools
  from functools import reduce
  from operator import mul
  import numpy
  from nipy.algorithms.statistics.formula import formulae
  from nipy.algorithms.statistics.formula.formulae import Factor, Formula, Term, make_recarray
  from nipy.algorithms.statistics.utils import combinations
  from .hrf import glover
  from .utils import T, blocks, convolve_functions, events
  from .utils import fourier_basis
label_desc: Use image node_id 7 for calling a global function with example usage: stack_contrasts(contrasts, name, keys) without return types