def rm_from_pattern(dir, pattern):
    for f in os.listdir(dir):
        if re.search(pattern, f):
                os.remove(os.path.join(dir, f))
Removes directory files matching with a provided
dataset/ETHPy150Open oleiade/Elevator/tests/core/utils.py/rm_from_pattern