#NEWLINE# def _CreateOutputFileHandles( self , output_type ) : #NEWLINE# #INDENT# 'Creates a new gzipped output tempfile for the output type.\n\n    We write to JSON data to gzip_filehandle to get compressed data. We hold a\n    reference to the original filehandle (gzip_filehandle_parent) so we can pass\n    the gzip data to bigquery.\n\n    Args:\n      output_type: string of export type to be used in filename. e.g.\n          ExportedFile\n    Returns:\n      A TempOutputTracker object\n    ' #NEWLINE# gzip_filehandle_parent = tempfile . NamedTemporaryFile ( suffix = output_type ) #NEWLINE# gzip_filehandle = gzip . GzipFile ( gzip_filehandle_parent . name , 'wb' , self . GZIP_COMPRESSION_LEVEL , gzip_filehandle_parent ) #NEWLINE# self . temp_output_trackers [ output_type ] = TempOutputTracker ( output_type = output_type , gzip_filehandle = gzip_filehandle , gzip_filehandle_parent = gzip_filehandle_parent ) #NEWLINE# return self . temp_output_trackers [ output_type ]