def xmlInvariance(n, forwardpasses = 1):
    # We only use this for file creation.
    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)

    # Unlink temporary file.
    os.unlink(f)

    netCompare(tmpnet, endnet, forwardpasses, True)
try writing a network to an xml file, reading it, rewrite it, reread it, and compare
dataset/ETHPy150Open pybrain/pybrain/pybrain/tests/helpers.py/xmlInvariance