def METHOD_NAME(file, contains):
    with open(file, "r+") as file:
        d = file.readlines()
        file.seek(0)
        for i in d:
            if contains not in i and i != "\n":
                file.write(i)
        file.truncate()