class_docstr: Identifies and tracks unique objects within a list, even if they are
  duplicates based on internal memory addresses (using id()).
  It Optimizes operations involving unique objects by avoiding redundant
  processing.
  
  Examples
  --------
  >>> from deepchem.utils import Uniquifier
  >>> a = 1
  >>> b = 2
  >>> c = 3
  >>> d = 1
  >>> u = Uniquifier([a, b, c, a, d])
  >>> u.get_unique_objs()
  [1, 2, 3]
docstr: Initialize the uniquifier.
  
  Parameters
  ----------
  allobjs: List
      The list of objects to be uniquified.
docstr_tok: ["Initialize","the","uniquifier",".","Parameters","--","--","--","--","--","allobjs",":","List","The","list","of","objects","to","be","uniquified","."]
code: def __init__(self, allobjs: List):
      """Initialize the uniquifier.
  
      Parameters
      ----------
      allobjs: List
          The list of objects to be uniquified.
  
      """
      self.nobjs = len(allobjs)
  
      id2idx: Dict[int, int] = {}
      unique_objs: List[int] = []
      unique_idxs: List[int] = []
      nonunique_map_idxs: List[int] = [-self.nobjs * 2] * self.nobjs
      num_unique = 0
      for i, obj in enumerate(allobjs):
          id_obj = id(obj)
          if id_obj in id2idx:
              nonunique_map_idxs[i] = id2idx[id_obj]
              continue
          id2idx[id_obj] = num_unique
          unique_objs.append(obj)
          nonunique_map_idxs[i] = num_unique
          unique_idxs.append(i)
          num_unique += 1
  
      self.unique_objs = unique_objs
      self.unique_idxs = unique_idxs
      self.nonunique_map_idxs = nonunique_map_idxs
      self.num_unique = num_unique
      self.all_unique = self.nobjs == self.num_unique
  
file_path: deepchem/deepchem/utils/misc_utils.py
imports: from typing import Dict, List, Optional
label_desc: Use image node_id 1 to create a new Uniquifier object from inherited base classes: object with example: obj = Uniquifier(allobjs)