#NEWLINE# def __get_tag__( filename ) : #NEWLINE# #INDENT# with open ( filename , 'rb' ) as ifile : #NEWLINE# #INDENT# data = ifile . read ( 1 ) #NEWLINE# if ( not data ) : #NEWLINE# #INDENT# return None #NEWLINE# #UNINDENT# done = False #NEWLINE# tag_bytes = [ ] #NEWLINE# while ( data and ( not done ) ) : #NEWLINE# #INDENT# data = ifile . read ( 1 ) #NEWLINE# if ( not data ) : #NEWLINE# #INDENT# return None #NEWLINE# #UNINDENT# value = ord ( value ) #NEWLINE# tag_bytes . append ( ( value % 128 ) ) #NEWLINE# if ( value < 128 ) : #NEWLINE# #INDENT# done = True #NEWLINE# #UNINDENT# #UNINDENT# return __varint_to_value__ ( tag_bytes )