def xmlInvariance(n, forwardpasses=1):
 tmpfile = tempfile.NamedTemporaryFile(dir='.')
 f = tmpfile.name
 tmpfile.close()
 NetworkWriter.writeToFile(n, f)
 tmpnet = NetworkReader.readFrom(f)
 NetworkWriter.writeToFile(tmpnet, f)
 endnet = NetworkReader.readFrom(f)
 os.unlink(f)
 netCompare(tmpnet, endnet, forwardpasses, True)

def xmlInvariance ( n , forwardpasses = 1 ) : tmpfile = tempfile . NamedTemporaryFile ( dir = '.' ) f = tmpfile . name tmpfile . close ( ) NetworkWriter . writeToFile ( n , f ) tmpnet = NetworkReader . readFrom ( f ) NetworkWriter . writeToFile ( tmpnet , f ) endnet = NetworkReader . readFrom ( f ) os . unlink ( f ) netCompare ( tmpnet , endnet , forwardpasses , True )
try writing a network to an xml file .