code: def _hits_scipy(
      G, max_iter=100, tol=1.0e-6, nstart=None, normalized=True
  ):
      """Returns HITS hubs and authorities values for nodes.
  
  
      The HITS algorithm computes two numbers for a node.
      Authorities estimates the node value based on the incoming links.
      Hubs estimates the node value based on outgoing links.
  
      Parameters
      ----------
      G : graph
        A NetworkX graph
  
      max_iter : integer, optional
        Maximum number of iterations in power method.
  
      tol : float, optional
        Error tolerance used to check convergence in power method iteration.
  
      nstart : dictionary, optional
        Starting value of each node for power method iteration.
  
      normalized : bool (default=True)
         Normalize results by the sum of all of the values.
  
      Returns
      -------
      (hubs,authorities) : two-tuple of dictionaries
         Two dictionaries keyed by node containing the hub and authority
         values.
  
      Examples
      --------
      >>> from networkx.algorithms.link_analysis.hits_alg import _hits_scipy
      >>> G = nx.path_graph(4)
      >>> h, a = _hits_scipy(G)
  
      Notes
      -----
      This implementation uses SciPy sparse matrices.
  
      The eigenvector calculation is done by the power iteration method
      and has no guarantee of convergence.  The iteration will stop
      after max_iter iterations or an error tolerance of
      number_of_nodes(G)*tol has been reached.
  
      The HITS algorithm was designed for directed graphs but this
      algorithm does not check if the input graph is directed and will
      execute on undirected graphs.
  
      Raises
      ------
      PowerIterationFailedConvergence
          If the algorithm fails to converge to the specified tolerance
          within the specified number of iterations of the power iteration
          method.
  
      References
      ----------
      .. [1] A. Langville and C. Meyer,
         "A survey of eigenvector methods of web information retrieval."
         http://citeseer.ist.psu.edu/713792.html
      .. [2] Jon Kleinberg,
         Authoritative sources in a hyperlinked environment
         Journal of the ACM 46 (5): 604-632, 1999.
         doi:10.1145/324133.324140.
         http://www.cs.cornell.edu/home/kleinber/auth.pdf.
      """
      import numpy as np
  
      if len(G) == 0:
          return {}, {}
      A = nx.to_scipy_sparse_array(G, nodelist=list(G))
      (n, _) = A.shape  # should be square
      ATA = A.T @ A  # authority matrix
      # choose fixed starting vector if not given
      if nstart is None:
          x = np.ones((n, 1)) / n
      else:
          x = np.array([nstart.get(n, 0) for n in list(G)], dtype=float)
          x /= x.sum()
  
      # power iteration on authority matrix
      i = 0
      while True:
          xlast = x
          x = ATA @ x
          x /= x.max()
          # check convergence, l1 norm
          err = np.absolute(x - xlast).sum()
          if err < tol:
              break
          if i > max_iter:
              raise nx.PowerIterationFailedConvergence(max_iter)
          i += 1
  
      a = x.flatten()
      h = A @ a
      if normalized:
          h /= h.sum()
          a /= a.sum()
      hubs = dict(zip(G, map(float, h)))
      authorities = dict(zip(G, map(float, a)))
      return hubs, authorities
  
imports: import networkx
label_desc: Use image node_id 4 for calling a global function with example usage: _hits_scipy(G, max_iter, tol, nstart, normalized) and returns: hubs,  authorities, dict,  dict