code: def insert(self, src: Tensor, dst: Tensor):
      # Inserts newly encountered interactions into an ever-growing
      # (undirected) temporal graph.
  
      # Collect central nodes, their neighbors and the current event ids.
      neighbors = torch.cat([src, dst], dim=0)
      nodes = torch.cat([dst, src], dim=0)
      e_id = torch.arange(
          self.cur_e_id, self.cur_e_id + src.size(0), device=src.device
      ).repeat(2)
      self.cur_e_id += src.numel()
  
      # Convert newly encountered interaction ids so that they point to
      # locations of a "dense" format of shape [num_nodes, size].
      nodes, perm = nodes.sort()
      neighbors, e_id = neighbors[perm], e_id[perm]
  
      n_id = nodes.unique()
      self._assoc[n_id] = torch.arange(n_id.numel(), device=n_id.device)
  
      dense_id = (
          torch.arange(nodes.size(0), device=nodes.device) % self.size
      )
      dense_id += self._assoc[nodes].mul_(self.size)
  
      dense_e_id = e_id.new_full((n_id.numel() * self.size,), -1)
      dense_e_id[dense_id] = e_id
      dense_e_id = dense_e_id.view(-1, self.size)
  
      dense_neighbors = e_id.new_empty(n_id.numel() * self.size)
      dense_neighbors[dense_id] = neighbors
      dense_neighbors = dense_neighbors.view(-1, self.size)
  
      # Collect new and old interactions...
      e_id = torch.cat(
          [self.e_id[n_id, : self.size], dense_e_id], dim=-1
      )
      neighbors = torch.cat(
          [self.neighbors[n_id, : self.size], dense_neighbors], dim=-1
      )
  
      # And sort them based on `e_id`.
      e_id, perm = e_id.topk(self.size, dim=-1)
      self.e_id[n_id] = e_id
      self.neighbors[n_id] = torch.gather(neighbors, 1, perm)
  
imports: import copy
  from typing import Callable, Dict, Tuple
  import torch
  from torch import Tensor
  from torch.nn import GRUCell, Linear
  from torch_geometric.nn.inits import zeros
  from torch_geometric.utils import scatter
  from torch_geometric.utils._scatter import scatter_argmax
label_desc: Use image node_id 3 for calling the LastNeighborLoader obj's underlying member method code with example usage: obj.insert(src, dst) without return types