def file_exists(file):
    """Check if a file exists."""
    if not os.path.exists(file):
        return False
    try:
        open(file).close()
    except __HOLE__:
        return False
    return True
dataset/ETHPy150Open iron-io/iron_worker_python/iron_worker.py/file_exists