def add_channels(self, add_list, copy=None):
        """Append new channels to the instance.

        Parameters
        ----------
        add_list : list
            A list of objects to append to self. Must contain all the same
            type as the current object
        copy : bool
            This parameter has been deprecated and will be removed in 0.13.
            Use inst.copy() instead.
            Whether to return a new instance or modify in place.

        Returns
        -------
        inst : instance of Raw, Epochs, or Evoked
            The modified instance.
        """
        out = _check_copy_dep(self, copy)
        # avoid circular imports
        from ..io import _BaseRaw, _merge_info
        from ..epochs import _BaseEpochs

        if not isinstance(add_list, (list, tuple)):
            raise AssertionError('Input must be a list or tuple of objs')

        # Object-specific checks
        if isinstance(self, (_BaseRaw, _BaseEpochs)):
            if not all([inst.preload for inst in add_list] + [self.preload]):
                raise AssertionError('All data must be preloaded')
            data_name = '_data'
            if isinstance(self, _BaseRaw):
                con_axis = 0
                comp_class = _BaseRaw
            elif isinstance(self, _BaseEpochs):
                con_axis = 1
                comp_class = _BaseEpochs
        else:
            data_name = 'data'
            con_axis = 0
            comp_class = type(self)
        if not all(isinstance(inst, comp_class) for inst in add_list):
            raise AssertionError('All input data must be of same type')
        data = [getattr(inst, data_name) for inst in [self] + add_list]

        # Make sure that all dimensions other than channel axis are the same
        compare_axes = [i for i in range(data[0].ndim) if i != con_axis]
        shapes = np.array([dat.shape for dat in data])[:, compare_axes]
        if not ((shapes[0] - shapes) == 0).all():
            raise AssertionError('All dimensions except channels must match')

        # Create final data / info objects
        data = np.concatenate(data, axis=con_axis)
        infos = [self.info] + [inst.info for inst in add_list]
        new_info = _merge_info(infos)

        # Now update the attributes
        setattr(out, data_name, data)
        out.info = new_info
        if isinstance(self, _BaseRaw):
            out._cals = np.concatenate([getattr(inst, '_cals')
                                        for inst in [self] + add_list])
        return out
dataset/ETHPy150Open mne-tools/mne-python/mne/channels/channels.py/UpdateChannelsMixin.add_channels/original