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 sample_from_nodes(
      self,
      inputs: NodeSamplerInput,
      **kwargs,
  ) -> Optional[Union[SamplerOutput, HeteroSamplerOutput]]:
      self.init_event_loop()
  
      inputs = NodeSamplerInput.cast(inputs)
      if self.channel is None:
          # synchronous sampling
          return self.event_loop.run_task(
              coro=self._sample_from(self.node_sample, inputs)
          )
  
      # asynchronous sampling
      cb = kwargs.get("callback", None)
      self.event_loop.add_task(
          coro=self._sample_from(self.node_sample, inputs), callback=cb
      )
      return None
  
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 5 for calling the DistNeighborSampler obj's underlying member method code with example usage: obj.sample_from_nodes(inputs) and returns: None, self