code: def button_to_string(button: Dict[Text, Any], idx: int = 0) -> Text:
      """Create a string representation of a button."""
      title = button.pop("title", "")
  
      if "payload" in button:
          payload = " ({})".format(button.pop("payload"))
      else:
          payload = ""
  
      # if there are any additional attributes, we append them to the output
      if button:
          details = " - {}".format(json.dumps(button, sort_keys=True))
      else:
          details = ""
  
      button_string = "{idx}: {title}{payload}{details}".format(
          idx=idx + 1, title=title, payload=payload, details=details
      )
  
      return button_string
  
imports: import json
  import argparse
  import logging
  import os
  import sys
  import time
  from types import FrameType
  from typing import Any, Dict, List, Optional, TYPE_CHECKING, Text, Union, overload
  import randomname
  import rasa.shared.utils.cli
  import rasa.shared.utils.io
  from rasa.shared.importers.importer import TrainingDataImporter
  from rasa.shared.constants import ASSISTANT_ID_DEFAULT_VALUE, ASSISTANT_ID_KEY, DEFAULT_CONFIG_PATH
  from rasa.shared.utils.cli import print_error
  from rasa import telemetry
label_desc: Use image node_id 15 for calling a global function with example usage: button_to_string(button, idx) and returns: button_string