class_docstr: Sorting network class.
  
  From Wikipedia : A sorting network is an abstract mathematical model
  of a network of wires and comparator modules that is used to sort a
  sequence of numbers. Each comparator connects two wires and sort the
  values by outputting the smaller value to one wire, and a larger
  value to the other.
class_docstr_tok: ["Sorting","network","class",".","From","Wikipedia",":","A","sorting","network","is","an","abstract","mathematical","model","of","a","network","of","wires","and","comparator","modules","that","is","used","to","sort","a","sequence","of","numbers",".","Each","comparator","connects","two","wires","and","sort","the","values","by","outputting","the","smaller","value","to","one","wire",",","and","a","larger","value","to","the","other","."]
docstr: Return an ASCII representation of the network.
docstr_tok: ["Return","an","ASCII","representation","of","the","network","."]
code: def draw(self):
      """Return an ASCII representation of the network."""
      str_wires = [["-"] * 7 * self.depth]
      str_wires[0][0] = "0"
      str_wires[0][1] = " o"
      str_spaces = []
  
      for i in range(1, self.dimension):
          str_wires.append(["-"] * 7 * self.depth)
          str_spaces.append([" "] * 7 * self.depth)
          str_wires[i][0] = str(i)
          str_wires[i][1] = " o"
  
      for index, level in enumerate(self):
          for wire1, wire2 in level:
              str_wires[wire1][(index + 1) * 6] = "x"
              str_wires[wire2][(index + 1) * 6] = "x"
              for i in range(wire1, wire2):
                  str_spaces[i][(index + 1) * 6 + 1] = "|"
              for i in range(wire1 + 1, wire2):
                  str_wires[i][(index + 1) * 6] = "|"
  
      network_draw = "".join(str_wires[0])
      for line, space in zip(str_wires[1:], str_spaces):
          network_draw += "\n"
          network_draw += "".join(space)
          network_draw += "\n"
          network_draw += "".join(line)
      return network_draw
  
file_path: deap/examples/ga/sortingnetwork.py
imports: from itertools import product
label_desc: Use image node_id 6 for calling the SortingNetwork obj's underlying member method code with example usage: obj.draw() and returns: network_draw