def pass_through(iterable):
    return iterable

def file_store(filename):

    def store(items):
        with open(filename, 'w') as output:
            results = []
for item in items:
    write_result(item, result, output)
result.append(item)
return results
return store
Можно ли условно использовать оператор with?