code: def test_uniform_neighbor_sample_tree(directed):
      input_data_path = small_tree.get_path()
  
      df = cudf.read_csv(
          input_data_path,
          delimiter=" ",
          names=["src", "dst", "value"],
          dtype=["int32", "int32", "float32"],
      )
  
      G = cugraph.Graph(directed=directed)
      G.from_cudf_edgelist(df, "src", "dst", "value")
  
      #
      # Make sure the old C++ renumbering was skipped because:
      #    1) Pylibcugraph already does renumbering
      #    2) Uniform neighborhood sampling allows int32 weights
      #       which are not supported by the C++ renumbering
      # This should be 'True' only for string vertices and multi columns vertices
      #
  
      assert G.renumbered is False
  
      # Retrieve the input dataframe.
      # input_df != df if 'directed = False' because df will be symmetrized
      # internally.
      input_df = G.edgelist.edgelist_df
  
      # TODO: Incomplete, include more testing for tree graph as well as
      # for larger graphs
      start_list = cudf.Series([0, 0], dtype="int32")
      fanout_vals = [4, 1, 3]
      with_replacement = True
      result_nbr = uniform_neighbor_sample(
          G, start_list, fanout_vals, with_replacement=with_replacement
      )
  
      result_nbr = result_nbr.drop_duplicates()
  
      join = result_nbr.merge(
          input_df,
          left_on=[*result_nbr.columns[:2]],
          right_on=[*input_df.columns[:2]],
      )
  
      assert len(join) == len(result_nbr)
      # Since the validity of results have (probably) been tested at both the C++
      # and C layers, simply test that the python interface and conversions were
      # done correctly.
      assert result_nbr["sources"].dtype == "int32"
      assert result_nbr["destinations"].dtype == "int32"
      assert result_nbr["indices"].dtype == "float32"
  
      result_nbr_vertices = (
          cudf.concat(
              [result_nbr["sources"], result_nbr["destinations"]]
          )
          .drop_duplicates()
          .reset_index(drop=True)
      )
  
      assert set(start_list.to_pandas()).issubset(
          set(result_nbr_vertices.to_pandas())
      )
  
imports: import gc
  import random
  import pytest
  import cupy
  import cudf
  import cugraph
  from cugraph import uniform_neighbor_sample
  from cugraph.testing import UNDIRECTED_DATASETS
  from cugraph.datasets import email_Eu_core, small_tree
  from pylibcugraph.testing.utils import gen_fixture_params_product
label_desc: Use image node_id 5 for calling a global function with example usage: test_uniform_neighbor_sample_tree(directed) without return types