code: def get_parent(parent):
      
      if isinstance(parent, Interface):
          return parent.id
      elif isinstance(parent, int):
          return parent
      else:
          raise TypeError(
              "parent must be an Interface or int, not %s" % (
                  type(parent).__name__))
docs: Get the parent to send to the handler.