code: def get_node_type(tree):
      
      if isinstance(tree, (RSTTree, nltk.tree.Tree)):
          if tree.label() in ('N', 'S'):
              return tree.label()
          else:
              return 'relation'
      elif isinstance(tree, basestring):
          return 'edu'
      else:
          raise ValueError("Unknown tree/node type: {}".format(type(tree)))
docs: Returns the type of the root node of the given RST tree
      (one of 'N', 'S', 'relation' or 'edu'.)