code: def testWeightedAdjacency(self):
      mat = [[0, 1, 2, 0], [2, 0, 0, 0], [0, 0, 2.5, 0], [0, 1, 0, 0]]
  
      g = Graph.Weighted_Adjacency(mat, attr="w0")
      el = g.get_edgelist()
      self.assertTrue(el == [(0, 1), (0, 2), (1, 0), (2, 2), (3, 1)])
      self.assertTrue(g.es["w0"] == [1, 2, 2, 2.5, 1])
  
      g = Graph.Weighted_Adjacency(mat, mode="plus")
      el = g.get_edgelist()
      self.assertTrue(el == [(0, 1), (0, 2), (1, 3), (2, 2)])
      self.assertTrue(g.es["weight"] == [3, 2, 1, 2.5])
  
      g = Graph.Weighted_Adjacency(mat, attr="w0", loops=False)
      el = g.get_edgelist()
      self.assertTrue(el == [(0, 1), (0, 2), (1, 0), (3, 1)])
      self.assertTrue(g.es["w0"] == [1, 2, 2, 1])
  
      g = Graph.Weighted_Adjacency(mat, attr="w0", loops="twice")
      el = g.get_edgelist()
      self.assertTrue(el == [(0, 1), (0, 2), (1, 0), (2, 2), (3, 1)])
      self.assertTrue(g.es["w0"] == [1, 2, 2, 1.25, 1])
  
imports: import unittest
  from igraph import Graph, InternalError
label_desc: Use image node_id 18 for calling the GeneratorTests obj's underlying member method code with example usage: obj.testWeightedAdjacency() without return types