code: def dist_neighbor_loader_hetero(
      tmp_path: str,
      world_size: int,
      rank: int,
      master_addr: str,
      master_port: int,
      num_workers: int,
      async_sampling: bool,
  ):
      part_data = create_dist_data(tmp_path, rank)
      input_nodes = ("v0", part_data[0].get_global_id("v0"))
      current_ctx = DistContext(
          rank=rank,
          global_rank=rank,
          world_size=world_size,
          global_world_size=world_size,
          group_name="dist-loader-test",
      )
  
      loader = DistNeighborLoader(
          part_data,
          num_neighbors=[1],
          batch_size=10,
          num_workers=num_workers,
          input_nodes=input_nodes,
          master_addr=master_addr,
          master_port=master_port,
          current_ctx=current_ctx,
          concurrency=10,
          drop_last=True,
          async_sampling=async_sampling,
      )
  
      assert str(loader).startswith("DistNeighborLoader")
      assert str(mp.current_process().pid) in str(loader)
      assert isinstance(loader.dist_sampler, DistNeighborSampler)
      assert part_data[0].meta["is_hetero"]
  
      for batch in loader:
          assert isinstance(batch, HeteroData)
          assert (
              batch["v0"].input_id.numel()
              == batch["v0"].batch_size
              == 10
          )
  
          assert len(batch.node_types) == 2
          for node_type in batch.node_types:
              assert torch.equal(
                  batch[node_type].x, batch.x_dict[node_type]
              )
              assert batch.x_dict[node_type].size(0) >= 0
              assert (
                  batch[node_type].n_id.size(0)
                  == batch[node_type].num_nodes
              )
  
          assert len(batch.edge_types) == 4
          for edge_type in batch.edge_types:
              num_edges = batch[edge_type].edge_index.size(1)
  
              if num_edges > 0:  # Test edge mapping:
                  assert batch[edge_type].edge_attr.size(0) == num_edges
                  src, _, dst = edge_type
                  edge_index = part_data[1]._edge_index[
                      (edge_type, "coo")
                  ]
                  global_edge_index_1 = torch.stack(
                      [
                          batch[src].n_id[
                              batch[edge_type].edge_index[0]
                          ],
                          batch[dst].n_id[
                              batch[edge_type].edge_index[1]
                          ],
                      ],
                      dim=0,
                  )
                  global_edge_index_2 = edge_index[
                      :, batch[edge_type].e_id
                  ]
                  assert torch.equal(
                      global_edge_index_1, global_edge_index_2
                  )
      assert loader.channel.empty()
  
file_path: pytorch_geometric/test/distributed/test_dist_neighbor_loader.py
imports: import socket
  import pytest
  import torch
  import torch.multiprocessing
  from torch_geometric.data import Data, HeteroData
  from torch_geometric.datasets import FakeDataset, FakeHeteroDataset
  from torch_geometric.distributed import DistContext, DistNeighborLoader, DistNeighborSampler, LocalFeatureStore, LocalGraphStore, Partitioner
  from torch_geometric.distributed.partition import load_partition_info
  from torch_geometric.testing import onlyLinux, withPackage
label_desc: Use image node_id 3 for calling a global function with example usage: dist_neighbor_loader_hetero(tmp_path, world_size, rank, master_addr, master_port, num_workers, async_sampling) without return types