code: def testGetAdjacency(self):
      # Undirected case
      g = Graph.Tree(6, 3)
      g.es["weight"] = list(range(5))
      self.assertTrue(
          g.get_adjacency()
          == Matrix(
              [
                  [0, 1, 1, 1, 0, 0],
                  [1, 0, 0, 0, 1, 1],
                  [1, 0, 0, 0, 0, 0],
                  [1, 0, 0, 0, 0, 0],
                  [0, 1, 0, 0, 0, 0],
                  [0, 1, 0, 0, 0, 0],
              ]
          )
      )
      self.assertTrue(
          g.get_adjacency(attribute="weight")
          == Matrix(
              [
                  [0, 0, 1, 2, 0, 0],
                  [0, 0, 0, 0, 3, 4],
                  [1, 0, 0, 0, 0, 0],
                  [2, 0, 0, 0, 0, 0],
                  [0, 3, 0, 0, 0, 0],
                  [0, 4, 0, 0, 0, 0],
              ]
          )
      )
  
      # Directed case
      g = Graph.Tree(6, 3, "tree_out")
      g.add_edges([(0, 1), (1, 0)])
      self.assertTrue(
          g.get_adjacency()
          == Matrix(
              [
                  [0, 2, 1, 1, 0, 0],
                  [1, 0, 0, 0, 1, 1],
                  [0, 0, 0, 0, 0, 0],
                  [0, 0, 0, 0, 0, 0],
                  [0, 0, 0, 0, 0, 0],
                  [0, 0, 0, 0, 0, 0],
              ]
          )
      )
  
file_path: python-igraph/tests/test_conversion.py
imports: import random
  import unittest
  from igraph import Graph, Matrix
label_desc: Use image node_id 1 for calling the GraphRepresentationTests obj's underlying member method code with example usage: obj.testGetAdjacency() without return types