code: def from_json(cls, json):
          ''' Load a document from JSON.
  
          json (JSON-data) :
              A JSON-encoded document to create a new Document from.
  
          Returns:
              Document :
  
          '''
          roots_json = json['roots']
          root_ids = roots_json['root_ids']
          references_json = roots_json['references']
  
          references = instantiate_references_json(references_json)
          initialize_references_json(references_json, references)
  
          doc = Document()
          for r in root_ids:
              doc.add_root(references[r])
  
          doc.title = json['title']
  
          return dof from_json(cls, json):
          ''' Load a document from JSON.
  
          json (JSON-data) :
              A JSON-encoded document to create a new Document from.
  
          Returns:
              Document :
  
          '''
          roots_json = json['roots']
          root_ids = roots_json['root_ids']
          references_json = roots_json['references']
  
          references = instantiate_references_json(references_json)
          initialize_references_json(references_json, references)
  
          doc = Document()
          for r in root_ids:
              doc.add_root(references[r])
  
          doc.title = json['title']
  
          return doc
docs: Load a document from JSON.
  
          json (JSON-data) :
              A JSON-encoded document to create a new Document from.
  
          Returns:
              Document :