code: def depth(n, tree):
      """get depth of an element in the tree"""
      d = 0
      parent = tree[n]
      while parent is not None:
          d += 1
          parent = tree[parent]
      return d
  
imports: import re
  import socket
  from functools import reduce
  import zmq
  from ipyparallel.serialize import deserialize_object, serialize_object
  from ipyparallel.util import disambiguate_url
label_desc: Use image node_id 3 for calling a global function with example usage: depth(n, tree) and returns: d