code: def __getstate__(self):
      import tempfile
      import base64
      from os import path
  
      d = dict(self.__dict__)
      # If the index is not None, we want to save the encoded index
      if self.index is not None:
          with tempfile.TemporaryDirectory() as dirname:
              self.index.save(path.join(dirname, "tmp.ann"))
  
              with open(path.join(dirname, "tmp.ann"), "rb") as f:
                  b64_index = base64.b64encode(f.read())
  
          d["b64_index"] = b64_index
          del d["index"]
  
      return d
  
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 4 for calling the Annoy obj's underlying member method code with example usage: obj.__getstate__() and returns: d