code: def __setstate__(self, state):
      import tempfile
      import base64
      from os import path
  
      from hnswlib import Index
  
      # If a base64 index is given, we have to load the index
      if "b64_index" in state:
          assert "index" not in state
          b64_index = state["b64_index"]
          del state["b64_index"]
  
          hnsw_metric = state["metric"]
          hnsw_aliases = {
              "cosine": "cosine",
              "dot": "ip",
              "euclidean": "l2",
              "ip": "ip",
              "l2": "l2",
          }
          if hnsw_metric in hnsw_aliases:
              hnsw_metric = hnsw_aliases[hnsw_metric]
  
          self.index = Index(
              space=hnsw_metric, dim=state["data"].data.shape[1]
          )
          with tempfile.TemporaryDirectory() as dirname:
              with open(path.join(dirname, "tmp.bin"), "wb") as f:
                  f.write(base64.b64decode(b64_index))
              self.index.load_index(path.join(dirname, "tmp.bin"))
  
      self.__dict__.update(state)
  
imports: import logging
  import os
  import warnings
  import numpy
  from scipy.spatial.distance import cdist
  from sklearn import neighbors
  from sklearn.utils import check_random_state
  from openTSNE import utils
label_desc: Use image node_id 5 for calling the HNSW obj's underlying member method code with example usage: obj.__setstate__(state) without return types