code: def node_is_embedded_doc_attr(node):
      
      embedded_doc = get_field_embedded_doc(node.last_child())
      name = node.attrname
      try:
          r = bool(embedded_doc.lookup(name)[1][0])
      except IndexError:
          r = False
  
      return r
docs: Checks if a node is a valid field or method in a embedded document.