code: def test_cora_load_weighted() -> None:
      def weights(graph, subjects, edges):
          sources = graph.node_features(edges.source)
          targets = graph.node_features(edges.target)
  
          and_ = np.logical_and(sources, targets).sum(axis=1)
          or_ = np.logical_or(sources, targets).sum(axis=1)
          jaccard = and_ / or_
  
          same_subject = (
              subjects[edges.source].to_numpy()
              == subjects[edges.target].to_numpy()
          )
  
          return same_subject + jaccard
  
      g, subjects = Cora().load(edge_weights=weights)
  
      _, weights = g.edges(include_edge_weight=True)
      # some edges have neither subject nor any features in common
      assert weights.min() == 0.0
      # "same subject" is either 0 or 1 and some edges definitely have 1, and jaccard is in [0, 1], so
      # we can get a bound on the weights:
      assert 1 <= weights.max() <= 2
  
imports: import pytest
  import tempfile
  import os
  import sys
  import numpy
  from stellargraph.datasets import *
  from urllib.error import URLError
  from stellargraph.datasets.dataset_loader import DatasetLoader
  from urllib.request import urlretrieve
  from unittest.mock import patch
label_desc: Use image node_id 12 for calling a global function with example usage: test_cora_load_weighted() and returns: unknown