def rmfiles(path=None, *extensions):
    path = path or os.curdir
    if not os.path.isdir(path):
        return 0
    assert extensions
    for ext in extensions:
        assert ext
    trem = 0
    tall = 0
    files = os.listdir(path)
    for name in files:
        fullpath = os.path.join(path, name)
        if os.path.isfile(fullpath):
            sf = name.split('.')
            if len(sf) == 2 and extensions in sf[1]:
                tall += 1
                trem += rmgeneric(fullpath, os.remove)
        elif name == '__pycache__':
            shutil.rmtree(fullpath)
            tall += 1
        elif os.path.isdir(fullpath) and not name.startswith('.'):
            r, ra = rmfiles(fullpath, *extensions)
            trem += r
            tall += ra
    return trem, tall
dataset/ETHPy150Open quantmind/pulsar/clean.py/rmfiles/swapped operands of `in`