def _sample_neighbors(
        self,
        seeds: torch.Tensor,
        seed_offsets: Optional[list],
        fanouts: torch.Tensor,
        replace: bool = False,
        probs_or_mask: Optional[torch.Tensor] = None,
        returning_indices_is_optional: bool = False,
        async_op: bool = False,
    ) -> torch.ScriptObject:
        """Sample neighboring edges of the given nodes and return the induced
        subgraph.

        Parameters
        ----------
        seeds: torch.Tensor
            IDs of the given seed nodes.
        seeds_offsets: list, optional
            The offsets of the given seeds,
            seeds[seed_offsets[i]: seed_offsets[i + 1]] has node type i.
        fanouts: torch.Tensor
            The number of edges to be sampled for each node with or without
            considering edge types.
              - When the length is 1, it indicates that the fanout applies to
                all neighbors of the node as a collective, regardless of the
                edge type.
              - Otherwise, the length should equal to the number of edge
                types, and each fanout value corresponds to a specific edge
                type of the nodes.
            The value of each fanout should be >= 0 or = -1.
              - When the value is -1, all neighbors (with non-zero probability,
                if weighted) will be sampled once regardless of replacement. It
                is equivalent to selecting all neighbors with non-zero
                probability when the fanout is >= the number of neighbors (and
                replace is set to false).
              - When the value is a non-negative integer, it serves as a
                minimum threshold for selecting neighbors.
        replace: bool
            Boolean indicating whether the sample is preformed with or
            without replacement. If True, a value can be selected multiple
            times. Otherwise, each value can be selected only once.
        probs_or_mask: torch.Tensor, optional
            An optional tensor of edge attribute for probability or masks. This
            attribute tensor should contain (unnormalized) probabilities
            corresponding to each neighboring edge of a node. It must be a 1D
            floating-point or boolean tensor, with the number of elements
            equalling the total number of edges.
        returning_indices_is_optional: bool
            Boolean indicating whether it is okay for the call to this function
            to leave the indices tensor uninitialized. In this case, it is the
            user's responsibility to gather it using the edge ids.
        async_op: bool
            Boolean indicating whether the call is asynchronous. If so, the
            result can be obtained by calling wait on the returned future.

        Returns
        -------
        torch.classes.graphbolt.SampledSubgraph
            The sampled C subgraph.
        """
        # Ensure nodes is 1-D tensor.
        self._check_sampler_arguments(seeds, fanouts, probs_or_mask)
        sampling_fn = (
            self._c_csc_graph.sample_neighbors_async
            if async_op
            else self._c_csc_graph.sample_neighbors
        )
        return sampling_fn(
            seeds,
            seed_offsets,
            fanouts.tolist(),
            replace,
            False,  # is_labor
            returning_indices_is_optional,
            probs_or_mask,
            None,  # random_seed, labor parameter
            0,  # seed2_contribution, labor_parameter
        )
Sample neighboring edges of the given nodes and return the induced
        subgraph.

        Parameters
        ----------
        seeds: torch.Tensor
            IDs of the given seed nodes.
        seeds_offsets: list, optional
            The offsets of the given seeds,
            seeds[seed_offsets[i]: seed_offsets[i + 1]] has node type i.
        fanouts: torch.Tensor
            The number of edges to be sampled for each node with or without
            considering edge types.
              - When the length is 1, it indicates that the fanout applies to
                all neighbors of the node as a collective, regardless of the
                edge type.
              - Otherwise, the length should equal to the number of edge
                types, and each fanout value corresponds to a specific edge
                type of the nodes.
            The value of each fanout should be >= 0 or = -1.
              - When the value is -1, all neighbors (with non-zero probability,
                if weighted) will be sampled once regardless of replacement. It
                is equivalent to selecting all neighbors with non-zero
                probability when the fanout is >= the number of neighbors (and
                replace is set to false).
              - When the value is a non-negative integer, it serves as a
                minimum threshold for selecting neighbors.
        replace: bool
            Boolean indicating whether the sample is preformed with or
            without replacement. If True, a value can be selected multiple
            times. Otherwise, each value can be selected only once.
        probs_or_mask: torch.Tensor, optional
            An optional tensor of edge attribute for probability or masks. This
            attribute tensor should contain (unnormalized) probabilities
            corresponding to each neighboring edge of a node. It must be a 1D
            floating-point or boolean tensor, with the number of elements
            equalling the total number of edges.
        returning_indices_is_optional: bool
            Boolean indicating whether it is okay for the call to this function
            to leave the indices tensor uninitialized. In this case, it is the
            user's responsibility to gather it using the edge ids.
        async_op: bool
            Boolean indicating whether the call is asynchronous. If so, the
            result can be obtained by calling wait on the returned future.

        Returns
        -------
        torch.classes.graphbolt.SampledSubgraph
            The sampled C subgraph.
        
python/dgl/graphbolt/impl/fused_csc_sampling_graph.py