#NEWLINE# def open( self , filename , mode = 'r' , read_buffer_size = DEFAULT_READ_BUFFER_SIZE , mime_type = 'application/octet-stream' ) : #NEWLINE# #INDENT# "Open a GCS file path for reading or writing.\n\n    Args:\n      filename: GCS file path in the form gs://<bucket>/<object>.\n      mode: 'r' for reading or 'w' for writing.\n      read_buffer_size: Buffer size to use during read operations.\n      mime_type: Mime type to set for write operations.\n\n    Returns:\n      file object.\n\n    Raises:\n      ValueError: Invalid open file mode.\n    " #NEWLINE# if ( ( mode == 'r' ) or ( mode == 'rb' ) ) : #NEWLINE# #INDENT# return GcsBufferedReader ( self . client , filename , buffer_size = filename ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( ( mode == 'w' ) or ( mode == 'wb' ) ) : #NEWLINE# #INDENT# return GcsBufferedWriter ( self . client , filename , mime_type = mime_type ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# raise ValueError ( ( 'Invalid file open mode: %s.' % mode ) )