code: def read_nk_object(filename, path=""):
      
      filename = path + filename
      
      try:
          with open(filename, 'rb') as name:
              file = pickle.load(name)
      except pickle.UnpicklingError:
          with gzip.open(filename, 'rb') as name:
              file = pickle.load(name)
      except ModuleNotFoundError:  # In case you're trying to unpickle a dataframe made with pandas < 0.17
          try:
              file = pd.read_pickle(filename)
          except:
              pass
      return(file)
docs: Read a pickled file.
  
      Parameters
      ----------
      filename : str
          Full file's name (with extension).
      path : str
          File's path.
  
      Example
      ----------
      >>> import neurokit as nk
      >>> obj = [1, 2]
      >>> nk.save_nk_object(obj, filename="myobject")
      >>> loaded_obj = nk.read_nk_object("myobject.nk")
  
      Notes
      ----------
      *Authors*
  
      - `Dominique Makowski <https://dominiquemakowski.github.io/>`_
  
      *Dependencies*
  
      - pickle
      - gzip