code: def _find_closest(self, n0):
          
          dmin = np.inf
          nclose = None
  
          ds = []
          nodes = []
  
          ds.append(np.inf)
          nodes.append(self)
  
          for n in self:
              if n is n0:
                  continue
              try:
                  if n._in_same_observation(n0):
                      continue
                  ds.append(n.distance(n0))
                  nodes.append(n)
              except AttributeError:
                  pass
  
          inds = np.argsort(ds)
          ds = [ds[i] for i in inds]
          nodes = [nodes[i] for i in inds]
  
          for d,n in zip(ds, nodes):
              try:
                  if d < n.resolution or n.resolution==-1:
                      return n
              except AttributeError:
                  pass
  
          # If nothing else works
          return self
docs: returns the node in the tree that is closest to n0, but not
            in the same observation