@open_file(0, mode='r')
def read_p2g(path, encoding='utf-8'):
 lines = (line.decode(encoding) for line in path)
 G = parse_p2g(lines)
 return G

@ open_file ( 0 , mode = 'r' ) def read_p2g ( path , encoding = 'utf-8' ) : lines = ( line . decode ( encoding ) for line in path ) G = parse_p2g ( lines ) return G
read graph in p2g format from path .