

def refresh(source, stamp, cmd):
    try:
        if (os.path.getmtime(source) == os.path.getmtime(stamp)):
            return
    except:
        pass
    try:
        exec_cmd(cmd)
        ensure_dir(os.path.dirname(stamp))
        open(stamp, 'a').close()
        os.utime(stamp, (os.path.getatime(source), os.path.getmtime(stamp)))
    except:
        logging.exception('unable to generate files')
        try:
            os.unlink(stamp)
        except:
            pass

dataset/ETHPy150Open viewfinderco/viewfinder/__init__.py refresh/VarMisuse@106/120 `source`->`stamp`