code: def test_weighted_homo_neighbor_loader():
      edge_index = torch.tensor(
          [
              [1, 3, 0, 4],
              [2, 2, 1, 3],
          ]
      )
      edge_weight = torch.tensor([0.0, 1.0, 0.0, 1.0])
  
      data = Data(
          num_nodes=5, edge_index=edge_index, edge_weight=edge_weight
      )
  
      loader = NeighborLoader(
          data,
          input_nodes=torch.tensor([2]),
          num_neighbors=[1] * 2,
          batch_size=1,
          weight_attr="edge_weight",
      )
      assert len(loader) == 1
  
      batch = next(iter(loader))
  
      assert batch.num_nodes == 3
      assert batch.n_id.tolist() == [2, 3, 4]
      assert batch.num_edges == 2
      assert batch.n_id[batch.edge_index].tolist() == [[3, 4], [2, 3]]
  
imports: import os.path
  import numpy
  import pytest
  import torch
  import torch_geometric.typing
  from torch_geometric import EdgeIndex
  from torch_geometric.data import Data, HeteroData
  from torch_geometric.loader import NeighborLoader
  from torch_geometric.nn import GraphConv, to_hetero
  from torch_geometric.sampler.base import SubgraphType
  from torch_geometric.testing import MyFeatureStore, MyGraphStore, get_random_edge_index, get_random_tensor_frame, onlyLinux, onlyNeighborSampler, onlyOnline, withCUDA, withPackage
  from torch_geometric.typing import WITH_EDGE_TIME_NEIGHBOR_SAMPLE, WITH_PYG_LIB, WITH_TORCH_SPARSE, WITH_WEIGHTED_NEIGHBOR_SAMPLE, TensorFrame
  from torch_geometric.utils import is_undirected, sort_edge_index, to_torch_csr_tensor, to_undirected
label_desc: Use image node_id 16 for calling a global function with example usage: test_weighted_homo_neighbor_loader() without return types