def METHOD_NAME(inst, cov, iir_filter, random_state, allow_subselection=True):
    """Add noise, possibly with channel subselection."""
    _validate_type(cov, Covariance, "cov")
    _validate_type(
        inst, (BaseRaw, BaseEpochs, Evoked), "inst", "Raw, Epochs, or Evoked"
    )
    _check_preload(inst, "Adding noise")
    data = inst._data
    assert data.ndim in (2, 3)
    if data.ndim == 2:
        data = data[np.newaxis]
    # Subselect if necessary
    info = inst.info
    info._check_consistency()
    picks = gen_picks = slice(None)
    if allow_subselection:
        use_chs = list(set(info["ch_names"]) & set(cov["names"]))
        picks = np.where(np.in1d(info["ch_names"], use_chs))[0]
        logger.info(
            "Adding noise to %d/%d channels (%d channels in cov)"
            % (len(picks), len(info["chs"]), len(cov["names"]))
        )
        info = pick_info(inst.info, picks)
        info._check_consistency()
        gen_picks = np.arange(info["nchan"])
    for epoch in data:
        epoch[picks] += _generate_noise(
            info, cov, iir_filter, random_state, epoch.shape[1], picks=gen_picks
        )[0]
    return inst