code: def test_latest_k_edge_attr():
      edge_index = torch.tensor(
          [[0, 0, 1, 1, 2, 2, 0], [0, 1, 0, 1, 0, 1, 2]]
      )
      edge_time = torch.tensor([3, 1, 2, 3, 1, 2, 3])
      edge_attr = torch.tensor([1, -1, 3, 4, -1, 6, 7]).view(-1, 1)
  
      k = 2
      out = get_latest_k_edge_attr(
          k, edge_index, edge_attr, edge_time, num_nodes=3
      )
      expected = torch.tensor([[[1], [3]], [[4], [6]], [[7], [0]]])
      assert out.size() == (3, 2, 1)
      assert torch.equal(out, expected)
  
      k = 1
      out = get_latest_k_edge_attr(
          k, edge_index, edge_attr, edge_time, num_nodes=3
      )
      expected = torch.tensor([[[1]], [[4]], [[7]]])
      assert out.size() == (3, 1, 1)
      assert torch.equal(out, expected)
  
imports: import torch
  from torch_geometric.nn.models.graph_mixer import LinkEncoder, NodeEncoder, get_latest_k_edge_attr
label_desc: Use image node_id 3 for calling a global function with example usage: test_latest_k_edge_attr() without return types