@memoized
def smart_fill_file(var_name, file_name):
 extension = guess_extension(var_name, file_name)
 (_, file_content, file_name) = get_file_from_template(extension)
 return NamedStringIO(file_content, name=file_name)

@ memoized def smart_fill_file ( var_name , file_name ) : extension = guess_extension ( var_name , file_name ) ( _ , file_content , file_name ) = get_file_from_template ( extension ) return NamedStringIO ( file_content , name = file_name )
this function will return a namedstringio .