code: def test_graph_schema_sampling_tree(example_graph_schema):
      # Create dummy graph schema
      schema = example_graph_schema(bb=0)
      type_list = schema.type_adjacency_list(["A", "B"], 3)
      _, type_tree = schema.sampling_tree(["A", "B"], 3)
  
      # Check that the tree corresponds to the adjacency list
      def check_tree(tree):
          items = []
          for x in tree:
              chd = check_tree(x[2])
              assert x[1] == type_list[x[0]][0]
              assert chd == type_list[x[0]][1]
              items.append(x[0])
          return items
  
      check_tree(type_tree)
  
file_path: stellargraph/tests/core/test_schema.py
imports: import pytest
  from stellargraph.core.schema import *
  import itertools
label_desc: Use image node_id 5 for calling a global function with example usage: test_graph_schema_sampling_tree(example_graph_schema) and returns: items