import os


def function(rows):

    if (not os.path.exists("foo")):
        os.mkdir("foo")
    if (not os.path.exists("bar")):
        os.mkdir("bar")

    foo_file = open(model_output('foo/foo.txt'), 'w')
    bar_file = open(model_output('bar/foo.txt'), 'w')

    count = 0
    for row in rows:
        count += 1

    foo_file.write(str(count))
    bar_file.write(str(count * 2))

    foo_file.close()
    bar_file.close()
