def with_file_object(f):
    nbsource = nbformat.writes(contents)
    f.write(nbsource.encode('UTF-8'))
    f.flush()
    func(f.name)
def with_file_object(f):
    nbsource = nbformat.writes(contents)
    f.write(nbsource.encode('UTF-8'))
    f.flush()
    func(f.name)