code: def test_sample_neighbors_homo_pick_number(
      fanouts, 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   1   1   1   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
      0   0   0   0   0   0
      """
      # Initialize data.
      total_num_edges = 6
      indptr = torch.LongTensor([0, 6, 6, 6, 6, 6, 6])
      indices = torch.LongTensor([0, 1, 2, 3, 4, 5])
      assert indptr[-1] == total_num_edges
      assert indptr[-1] == len(indices)
  
      edge_attributes = {
          "mask": torch.BoolTensor([1, 0, 0, 1, 0, 1]),
          "all": torch.BoolTensor([1, 1, 1, 1, 1, 1]),
          "zero": torch.BoolTensor([0, 0, 0, 0, 0, 0]),
      }
  
      # Construct FusedCSCSamplingGraph.
      graph = gb.fused_csc_sampling_graph(
          indptr, indices, edge_attributes=edge_attributes
      )
  
      # Generate subgraph via sample neighbors.
      nodes = torch.LongTensor([0, 1])
  
      sampler = (
          graph.sample_layer_neighbors
          if labor
          else graph.sample_neighbors
      )
  
      # Make sure no exception will be thrown.
      subgraph = sampler(
          nodes,
          fanouts=torch.LongTensor(fanouts),
          replace=replace,
          probs_name=probs_name if probs_name != "none" else None,
      )
      sampled_num = subgraph.sampled_csc.indices.size(0)
      assert subgraph.sampled_csc.indptr.size(0) == 3
      # Verify in subgraph.
      if probs_name == "mask":
          if fanouts[0] == -1:
              assert sampled_num == 3
          else:
              if replace:
                  assert sampled_num == fanouts[0]
              else:
                  assert sampled_num == min(fanouts[0], 3)
      elif probs_name == "zero":
          assert sampled_num == 0
      else:
          if fanouts[0] == -1:
              assert sampled_num == 6
          else:
              if replace:
                  assert sampled_num == fanouts[0]
              else:
                  assert sampled_num == min(fanouts[0], 6)
  
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 41 for calling a global function with example usage: test_sample_neighbors_homo_pick_number(fanouts, replace, labor, probs_name) without return types