docs: def saveNetworkToFile(self, filename, makeWrapper = 1, mode = "pickle", counter = None):
          """
          Deprecated.
          """
          if "?" in filename: # replace ? pattern in filename with epoch number
              import re
              char = "?"
              match = re.search(re.escape(char) + "+", filename)
              if match:
                  num = self.epoch
                  if counter != None:
                      num = counter
                  elif self.totalEpoch != 0: # use a total epoch, if one:
                      num = self.totalEpoch
                  fstring = "%%0%dd" % len(match.group())
                  filename = filename[:match.start()] + \
                             fstring % num + \
                             filename[match.end():]
                  self.lastAutoSaveNetworkFilename = filename
          if mode == "pickle":
              # dump network via pickle:
              import pickle
              basename = filename.split('.')[0]
              filename += ".pickle"
              fp = open(filename, 'w')
              pickle.dump(self, fp)
              fp.close()
              # make wrapper python file:
              if makeWrapper:
                  fp = open(basename + ".py", "w")
                  fp.write("from pyrobot.brain.conx import *\n")
                  fp.write("import pickle\n")
                  fp.write("fp = open('%s', 'r')\n" % filename)
                  fp.write("network = pickle.load(fp)")
                  fp.close()
              # give some help:
              print("To load network:")
              print("   %% python -i %s " % (basename + ".py"))
              print("   >>> network.train() # for example")
              print("--- OR ---")
              print("   % python")
              print("   >>> from pyrobot.brain.conx import *")
              print("   >>> network = loadNetwork(%s)" % filename)
              print("   >>> network.train() # for example")
          elif mode in ["plain", "conx"]:
              fp = open(filename, "w")
              fp.write("network, %s\n" % (self.__class__.__name__))
              for layer in self.layers:
                  fp.write("layer, %s, %s\n" % (layer.name, layer.size))
                  # biases:
                  for i in range(layer.size):
                      fp.write("%f " % layer.weight[i])
                  fp.write("\n")
              for connection in self.connections:
                  fp.write("connection, %s, %s\n" %(connection.fromLayer.name, connection.toLayer.name))
                  # weights:
                  for i in range(connection.fromLayer.size):
                      for j in range(connection.toLayer.size):
                          fp.write("%f " % connection.weight[i][j])
                      fp.write("\n")
              fp.close()