code: def test_sample_neighbors_probs(replace, labor, probs_name):
      if F._default_context_str == "gpu" and replace == True:
          pytest.skip(
              "Sampling with replacement not yet supported on GPU."
          )
      """Original graph in COO:
      1   0   1   0   1
      1   0   1   1   0
      0   1   0   1   0
      0   1   0   0   1
      1   0   0   0   1
      """
      # Initialize data.
      total_num_edges = 12
      indptr = torch.LongTensor([0, 3, 5, 7, 9, 12])
      indices = torch.LongTensor([0, 1, 4, 2, 3, 0, 1, 1, 2, 0, 3, 4])
      assert indptr[-1] == total_num_edges
      assert indptr[-1] == len(indices)
  
      edge_attributes = {
          "weight": torch.FloatTensor(
              [2.5, 0, 8.4, 0, 0.4, 1.2, 2.5, 0, 8.4, 0.5, 0.4, 1.2]
          ),
          "mask": torch.BoolTensor(
              [1, 0, 1, 0, 1, 1, 1, 0, 1, 1, 1, 1]
          ),
      }
  
      # Construct FusedCSCSamplingGraph.
      graph = gb.fused_csc_sampling_graph(
          indptr, indices, edge_attributes=edge_attributes
      )
  
      # Generate subgraph via sample neighbors.
      nodes = torch.LongTensor([1, 3, 4])
  
      sampler = (
          graph.sample_layer_neighbors
          if labor
          else graph.sample_neighbors
      )
      subgraph = sampler(
          nodes,
          fanouts=torch.tensor([2]),
          replace=replace,
          probs_name=probs_name,
      )
  
      # Verify in subgraph.
      sampled_num = subgraph.sampled_csc.indices.size(0)
      assert subgraph.sampled_csc.indptr.size(0) == 4
      if replace:
          assert sampled_num == 6
      else:
          assert sampled_num == 4
  
imports: import os
  import pickle
  import re
  import tempfile
  import unittest
  import backend
  import dgl
  import dgl.graphbolt
  import pytest
  import torch
  import torch.multiprocessing
  from dgl.graphbolt.base import etype_str_to_tuple
  from scipy import sparse
  from ..None import gb_test_utils
label_desc: Use image node_id 39 for calling a global function with example usage: test_sample_neighbors_probs(replace, labor, probs_name) without return types