class_docstr: The number of neighbors to sample in a homogeneous or heterogeneous
  graph. In heterogeneous graphs, may also take in a dictionary denoting
  the amount of neighbors to sample for individual edge types.
  
  Args:
      values (List[int] or Dict[Tuple[str, str, str], List[int]]): The
          number of neighbors to sample.
          If an entry is set to :obj:`-1`, all neighbors will be included.
          In heterogeneous graphs, may also take in a dictionary denoting
          the amount of neighbors to sample for individual edge types.
      default (List[int], optional): The default number of neighbors for edge
          types not specified in :obj:`values`. (default: :obj:`None`)
code: def __init__(
      self,
      values: Union[List[int], Dict[EdgeType, List[int]]],
      default: Optional[List[int]] = None,
  ):
      if isinstance(values, (tuple, list)) and default is not None:
          raise ValueError(
              f"'default' must be set to 'None' in case a "
              f"single list is given as the number of "
              f"neighbors (got '{type(default)})'"
          )
  
      if isinstance(values, dict):
          values = {
              EdgeTypeStr(key): value for key, value in values.items()
          }
  
      # Write to `__dict__` since dataclass is annotated with `frozen=True`:
      self.__dict__["values"] = values
      self.__dict__["default"] = default
  
imports: import copy
  import math
  import warnings
  from abc import ABC
  from collections import defaultdict
  from dataclasses import dataclass
  from enum import Enum
  from typing import Any, Dict, List, Optional, Union
  import torch
  from torch import Tensor
  from torch_geometric.data import Data, FeatureStore, GraphStore, HeteroData
  from torch_geometric.sampler.utils import to_bidirectional
  from torch_geometric.typing import EdgeType, EdgeTypeStr, NodeType, OptTensor
  from torch_geometric.utils.mixin import CastMixin
label_desc: Use image node_id 1 to create a new NumNeighbors object  with example: obj = NumNeighbors(values, default)