code: def dist_link_neighbor_loader_hetero(
      tmp_path: str,
      world_size: int,
      rank: int,
      master_addr: str,
      master_port: int,
      num_workers: int,
      async_sampling: bool,
      neg_ratio: float,
      edge_type: Tuple[str, str, str],
  ):
      part_data = create_dist_data(tmp_path, rank)
      current_ctx = DistContext(
          rank=rank,
          global_rank=rank,
          world_size=world_size,
          global_world_size=world_size,
          group_name="dist-loader-test",
      )
  
      edge_label_index = part_data[1].get_edge_index(edge_type, "coo")
      edge_label = torch.randint(
          high=2, size=(edge_label_index.size(1),)
      )
  
      loader = DistLinkNeighborLoader(
          data=part_data,
          edge_label_index=(edge_type, edge_label_index),
          edge_label=edge_label if neg_ratio is not None else None,
          num_neighbors=[1],
          batch_size=10,
          num_workers=num_workers,
          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("DistLinkNeighborLoader")
      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[edge_type].input_id.numel()
              == batch[edge_type].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:
              assert batch[edge_type].edge_attr.size(0) == batch[
                  edge_type
              ].edge_index.size(1)
      assert loader.channel.empty()
  
file_path: pytorch_geometric/test/distributed/test_dist_link_neighbor_loader.py
imports: import socket
  from typing import Tuple
  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, DistLinkNeighborLoader, 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_link_neighbor_loader_hetero(tmp_path, world_size, rank, master_addr, master_port, num_workers, async_sampling, neg_ratio, edge_type) without return types