def default_stream_factory(total_content_length, filename, content_type, content_length=None):
 if (total_content_length > (1024 * 500)):
  return TemporaryFile('wb+')
 return StringIO()

def default_stream_factory ( total_content_length , filename , content_type , content_length = None ) : if ( total_content_length > ( 1024 * 500 ) ) : return TemporaryFile ( 'wb+' ) return StringIO ( )
the stream factory that is used per default .