def safe_peekline(handle):
 line = handle.peekline()
 if (not line):
  raise ValueError('Unexpected end of stream.')
 return line

def safe_peekline ( handle ) : line = handle . peekline ( ) if ( not line ) : raise ValueError ( 'Unexpected end of stream.' ) return line
safe_peekline -> line peek at the next line in an undohandle and return it .