class_docstr: An implementation of a distributed and asynchronised neighbor sampler
  used by :class:`~torch_geometric.distributed.DistNeighborLoader`.
class_docstr_tok: ["An","implementation","of","a","distributed","and","asynchronised","neighbor","sampler","used","by",":","class",":","`","~torch_geometric.distributed.DistNeighborLoader","`","."]
code: def __init__(
      self,
      current_ctx: DistContext,
      data: Tuple[LocalFeatureStore, LocalGraphStore],
      num_neighbors: NumNeighborsType,
      channel: Optional[mp.Queue] = None,
      replace: bool = False,
      subgraph_type: Union[SubgraphType, str] = "directional",
      disjoint: bool = False,
      temporal_strategy: str = "uniform",
      time_attr: Optional[str] = None,
      concurrency: int = 1,
      device: Optional[torch.device] = None,
      **kwargs,
  ):
      self.current_ctx = current_ctx
  
      self.feature_store, self.graph_store = data
      assert isinstance(self.graph_store, LocalGraphStore)
      assert isinstance(self.feature_store, LocalFeatureStore)
      self.is_hetero = self.graph_store.meta["is_hetero"]
  
      self.num_neighbors = num_neighbors
      self.channel = channel
      self.concurrency = concurrency
      self.device = device
      self.event_loop = None
      self.replace = replace
      self.subgraph_type = SubgraphType(subgraph_type)
      self.disjoint = disjoint
      self.temporal_strategy = temporal_strategy
      self.time_attr = time_attr
      self.temporal = time_attr is not None
      self.with_edge_attr = self.feature_store.has_edge_attr()
      self.csc = True
  
imports: import itertools
  import logging
  import math
  from typing import Any, Callable, Dict, List, Optional, Tuple, Union
  import numpy
  import torch
  import torch.multiprocessing
  from torch import Tensor
  from torch_geometric.distributed import LocalFeatureStore, LocalGraphStore
  from torch_geometric.distributed.dist_context import DistContext
  from torch_geometric.distributed.event_loop import ConcurrentEventLoop, to_asyncio_future
  from torch_geometric.distributed.rpc import RPCCallBase, RPCRouter, rpc_async, rpc_partition_to_workers, rpc_register
  from torch_geometric.distributed.utils import BatchDict, NodeDict, remove_duplicates
  from torch_geometric.sampler import EdgeSamplerInput, HeteroSamplerOutput, NegativeSampling, NeighborSampler, NodeSamplerInput, SamplerOutput
  from torch_geometric.sampler.base import NumNeighbors, SubgraphType
  from torch_geometric.sampler.neighbor_sampler import neg_sample
  from torch_geometric.sampler.utils import remap_keys
  from torch_geometric.typing import EdgeType, NodeType
label_desc: Use image node_id 1 to create a new DistNeighborSampler object  with example: obj = DistNeighborSampler(current_ctx, data, num_neighbors, channel, replace, subgraph_type, disjoint, temporal_strategy, time_attr, concurrency, device)