code: def unserialize(jsonstr):
          '''
          Unserialize a JSON string representation of a topology
          '''
          topod = json.loads(jsonstr)
          G = json_graph.node_link_graph(topod)
          for n,ndict in G.nodes(data=True):
              if 'nodeobj' not in ndict or 'type' not in ndict:
                  raise Exception("Required type information is not present in serialized node {} :{}".format(n, ndict))
              nobj = ndict['nodeobj']
              cls = eval(ndict['type'])
              ndict['nodeobj'] = cls(**dict(nobj))
          t = Topology(nxgraph=G)
          return f unserialize(jsonstr):
          '''
          Unserialize a JSON string representation of a topology
          '''
          topod = json.loads(jsonstr)
          G = json_graph.node_link_graph(topod)
          for n,ndict in G.nodes(data=True):
              if 'nodeobj' not in ndict or 'type' not in ndict:
                  raise Exception("Required type information is not present in serialized node {} :{}".format(n, ndict))
              nobj = ndict['nodeobj']
              cls = eval(ndict['type'])
              ndict['nodeobj'] = cls(**dict(nobj))
          t = Topology(nxgraph=G)
          return t
docs: Unserialize a JSON string representation of a topology