code: def node_str(node):
      
      if not node.prompt:
          return ""
  
      # Even for menu nodes for symbols and choices, it's wrong to check
      # Symbol.visibility / Choice.visibility here. The reason is that a symbol
      # (and a choice, in theory) can be defined in multiple locations, giving it
      # multiple menu nodes, which do not necessarily all have the same prompt
      # visibility. Symbol.visibility / Choice.visibility is calculated as the OR
      # of the visibility of all the prompts.
      prompt, prompt_cond = node.prompt
      if not expr_value(prompt_cond):
          return ""
  
      if node.item == MENU:
          return "    " + prompt
  
      if node.item == COMMENT:
          return "    *** {} ***".format(prompt)
  
      # Symbol or Choice
  
      sc = node.item
  
      if sc.type == UNKNOWN:
          # Skip symbols defined without a type (these are obscure and generate
          # a warning)
          return ""
  
      # Add help text
      if WITH_HELP_DESC:
          prompt += ' - ' + str(node.help).replace('\n', ' ').replace('\r', '')
  
      # {:3} sets the field width to three. Gives nice alignment for empty string
      # values.
      res = "{:3} {}".format(value_str(sc), prompt)
  
      # Don't print the name for unnamed choices (the normal kind)
      if sc.name is not None:
          res += " ({})".format(sc.name)
  
      return res
docs: Returns the complete menu entry text for a menu node, or "" for invisible
      menu nodes. Invisible menu nodes are those that lack a prompt or that do
      not have a satisfied prompt condition.
  
      Example return value: "[*] Bool symbol (BOOL)"
  
      The symbol name is printed in parentheses to the right of the prompt.