code: def test_graph_schema_sampling(example_graph_schema):
      # Create dummy graph schema
      schema = example_graph_schema(bb=0)
  
      # Only accepts lists & tuples
      with pytest.raises(TypeError):
          schema.type_adjacency_list("A", 2)
  
      # Only accepts int for n_hops
      with pytest.raises(TypeError):
          schema.type_adjacency_list("A", None)
  
      type_list = schema.type_adjacency_list(["A", "B"], n_hops=2)
  
      assert type_list[0][0] == "A"
      assert type_list[1][0] == "B"
  
      for lt in type_list:
          adj_types = [t.n2 for t in schema.schema[lt[0]]]
          list_types = [type_list[adj_n][0] for adj_n in lt[1]]
  
          if len(list_types) > 0:
              assert set(adj_types) == set(list_types)
  
file_path: stellargraph/tests/core/test_schema.py
imports: import pytest
  from stellargraph.core.schema import *
  import itertools
label_desc: Use image node_id 3 for calling a global function with example usage: test_graph_schema_sampling(example_graph_schema) without return types