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