code: def create_from_documents(cls, documents):
      webgraph = cls()
  
      for document in documents:
          webgraph.add_page(Link(document.uri))
  
      for document in documents:
          for link in document.links:
              if webgraph.has_page(link):
                  webgraph.connect_pages(Link(document.uri), link)
                  continue
  
              link_uri = urlparse(link.uri)
              link_url = link_uri.path
  
              for existed_link, _ in webgraph:
                  existed_link_uri = urlparse(existed_link.uri)
                  existed_link_url = existed_link_uri.path
  
                  if link_url == existed_link_url:
                      webgraph.connect_pages(
                          Link(document.uri),
                          Link(existed_link.uri, link.text),
                      )
      return webgraph
  
imports: import pprint
  from collections import OrderedDict, namedtuple
  import six
  import numpy
  import scipy.sparse
  from six.moves.urllib.parse import urlparse
  from pagerank import pagerank
label_desc: Use image node_id 2 for calling the WebPageGraph obj's underlying member method code with example usage: obj.create_from_documents(cls, documents) and returns: webgraph