def filter_hypermut_samples(df_mut, max_muts_per_sample, return_blacklist=False):
    """ Remove samples that have more mutations than the specified threshold
    """
    sample_cnt = df_mut.SAMPLE.value_counts()
    samples_blacklist = sample_cnt[sample_cnt > max_muts_per_sample].index.to_list()

    df_whitelist = df_mut[~df_mut.SAMPLE.isin(samples_blacklist)]

    if return_blacklist:
        return df_whitelist, samples_blacklist

    return df_whitelist