Anders and Briegel in Python
Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

123456789101112131415161718192021222324
  1. from abp import GraphState, fancy
  2. from abp import clifford
  3. from demograph import demograph
  4. import time
  5. import json
  6. def test_json_basic():
  7. """ Test that we can export to JSON """
  8. g = demograph()
  9. js = g.to_json()
  10. assert "adj" in js
  11. assert "node" in js
  12. e = GraphState()
  13. def test_tuple_keys():
  14. """ Test that we can write tuple-ish keys """
  15. g = fancy.GraphState()
  16. g.add_node("string")
  17. g.add_node((1, 2, 3))
  18. g.add_edge((1, 2, 3), "string")
  19. print json.dumps(g.to_json(True))