def temporal_sample_neighbors(
        self,
        seeds: Union[torch.Tensor, Dict[str, torch.Tensor]],
        seeds_timestamp: Union[torch.Tensor, Dict[str, torch.Tensor]],
        fanouts: torch.Tensor,
        replace: bool = False,
        seeds_pre_time_window: Optional[
            Union[torch.Tensor, Dict[str, torch.Tensor]]
        ] = None,
        probs_name: Optional[str] = None,
        node_timestamp_attr_name: Optional[str] = None,
        edge_timestamp_attr_name: Optional[str] = None,
    ) -> torch.ScriptObject:
        """Temporally Sample neighboring edges of the given nodes and return the induced
        subgraph.

        If `node_timestamp_attr_name` or `edge_timestamp_attr_name` is given,
        the sampled neighbor or edge of an seed node must have a timestamp
        that is smaller than that of the seed node.

        Parameters
        ----------
        seeds: torch.Tensor
            IDs of the given seed nodes.
        seeds_timestamp: torch.Tensor
            Timestamps of the given seed nodes.
        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.
        seeds_pre_time_window: torch.Tensor
            The time window of the nodes represents a period of time before
            `seeds_timestamp`. If provided, only neighbors and related
            edges whose timestamps fall within `[seeds_timestamp -
            seeds_pre_time_window, seeds_timestamp]` will be filtered.
        probs_name: str, optional
            An optional string specifying the name of an edge attribute. 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.
        node_timestamp_attr_name: str, optional
            An optional string specifying the name of an node attribute.
        edge_timestamp_attr_name: str, optional
            An optional string specifying the name of an edge attribute.

        Returns
        -------
        SampledSubgraphImpl
            The sampled subgraph.
        """
        seed_offsets = None
        if isinstance(seeds, dict):
            (
                seeds,
                seed_offsets,
                seeds_timestamp,
                seeds_pre_time_window,
            ) = self._convert_to_homogeneous_nodes(
                seeds, seeds_timestamp, seeds_pre_time_window
            )
        elif seeds is None:
            seed_offsets = self._indptr_node_type_offset_list

        # Ensure nodes is 1-D tensor.
        probs_or_mask = self.edge_attributes[probs_name] if probs_name else None
        self._check_sampler_arguments(seeds, fanouts, probs_or_mask)
        C_sampled_subgraph = self._c_csc_graph.temporal_sample_neighbors(
            seeds,
            seed_offsets,
            seeds_timestamp,
            fanouts.tolist(),
            replace,
            False,  # is_labor
            False,  # returning_indices_is_optional
            seeds_pre_time_window,
            probs_or_mask,
            node_timestamp_attr_name,
            edge_timestamp_attr_name,
            None,  # random_seed, labor parameter
            0,  # seed2_contribution, labor_parameter
        )
        return self._convert_to_sampled_subgraph(
            C_sampled_subgraph, seed_offsets
        )
Temporally Sample neighboring edges of the given nodes and return the induced
        subgraph.

        If `node_timestamp_attr_name` or `edge_timestamp_attr_name` is given,
        the sampled neighbor or edge of an seed node must have a timestamp
        that is smaller than that of the seed node.

        Parameters
        ----------
        seeds: torch.Tensor
            IDs of the given seed nodes.
        seeds_timestamp: torch.Tensor
            Timestamps of the given seed nodes.
        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.
        seeds_pre_time_window: torch.Tensor
            The time window of the nodes represents a period of time before
            `seeds_timestamp`. If provided, only neighbors and related
            edges whose timestamps fall within `[seeds_timestamp -
            seeds_pre_time_window, seeds_timestamp]` will be filtered.
        probs_name: str, optional
            An optional string specifying the name of an edge attribute. 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.
        node_timestamp_attr_name: str, optional
            An optional string specifying the name of an node attribute.
        edge_timestamp_attr_name: str, optional
            An optional string specifying the name of an edge attribute.

        Returns
        -------
        SampledSubgraphImpl
            The sampled subgraph.
        
python/dgl/graphbolt/impl/fused_csc_sampling_graph.py