docs: def merge_collections(collections, force_dense=False, sampling_rate='auto'):
      ''' Merge two or more collections at the same level of analysis.
  
      Args:
          collections (list): List of Collections to merge.
          sampling_rate (int, str): Sampling rate to use if it becomes necessary
              to resample DenseRunVariables. Either an integer or 'auto' (see
              merge_variables docstring for further explanation).
  
      Returns:
          A BIDSVariableCollection or BIDSRunVariableCollection, depending
          on the type of the input collections.
      '''
      if len(listify(collections)) == 1:
          return collections
  
      levels = set([c.level for c in collections])
      if len(levels) > 1:
          raise ValueError("At the moment, it's only possible to merge "
                           "Collections at the same level of analysis. You "
                           "passed collections at levels: %s." % levels)
  
      variables = list(chain(*[c.variables.values() for c in collections]))
      cls = collections[0].__class__
  
      variables = cls.merge_variables(variables, sampling_rate=sampling_rate)
  
      if isinstance(collections[0], BIDSRunVariableCollection):
          if sampling_rate == 'auto':
              rates = [var.sampling_rate for var in variables
                       if isinstance(var, DenseRunVariable)]
  
              sampling_rate = rates[0] if rates else None
  
          return cls(variables, sampling_rate)
  
      return cls(variables)