def check_duplicates(arg_list):
    assert isinstance(arg_list, list), 'only lists can be verified for duplicates'
    dups = list(filter(lambda x: arg_list.count(x) > 1, arg_list))
    assert len(dups) == 0, 'List cannot contain duplicates: {}'.format(', '.join(set(dups)))
dataset/ETHPy150Open dcos/dcos/ssh/validate.py/check_duplicates/original