code: def _download_button(
      self,
      label: str,
      data: DownloadButtonDataType,
      file_name: Optional[str] = None,
      mime: Optional[str] = None,
      key: Optional[Key] = None,
      help: Optional[str] = None,
      on_click: Optional[WidgetCallback] = None,
      args: Optional[WidgetArgs] = None,
      kwargs: Optional[WidgetKwargs] = None,
      *,  # keyword-only arguments:
      type: Literal["primary", "secondary"] = "secondary",
      disabled: bool = False,
      use_container_width: bool = False,
      ctx: Optional[ScriptRunContext] = None,
  ) -> bool:
      key = to_key(key)
      check_session_state_rules(
          default_value=None, key=key, writes_allowed=False
      )
  
      id = compute_widget_id(
          "download_button",
          user_key=key,
          label=label,
          file_name=file_name,
          mime=mime,
          key=key,
          help=help,
          type=type,
          use_container_width=use_container_width,
          page=ctx.page_script_hash if ctx else None,
      )
  
      if is_in_form(self.dg):
          raise StreamlitAPIException(
              f"`st.download_button()` can't be used in an `st.form()`.{FORM_DOCS_INFO}"
          )
  
      download_button_proto = DownloadButtonProto()
      download_button_proto.id = id
      download_button_proto.use_container_width = use_container_width
      download_button_proto.label = label
      download_button_proto.default = False
      download_button_proto.type = type
      marshall_file(
          self.dg._get_delta_path_str(),
          data,
          download_button_proto,
          mime,
          file_name,
      )
      download_button_proto.disabled = disabled
  
      if help is not None:
          download_button_proto.help = dedent(help)
  
      serde = ButtonSerde()
  
      button_state = register_widget(
          "download_button",
          download_button_proto,
          user_key=key,
          on_change_handler=on_click,
          args=args,
          kwargs=kwargs,
          deserializer=serde.deserialize,
          serializer=serde.serialize,
          ctx=ctx,
      )
  
      self.dg._enqueue("download_button", download_button_proto)
      return button_state.value
  
imports: import io
  from dataclasses import dataclass
  from textwrap import dedent
  from typing import TYPE_CHECKING, BinaryIO, Optional, TextIO, Union, cast
  from typing_extensions import Final, Literal
  from streamlit import runtime
  from streamlit.elements.form import current_form_id, is_in_form
  from streamlit.elements.utils import check_callback_rules, check_session_state_rules
  from streamlit.errors import StreamlitAPIException
  from streamlit.proto.Button_pb2 import Button
  from streamlit.proto.DownloadButton_pb2 import DownloadButton
  from streamlit.proto.LinkButton_pb2 import LinkButton
  from streamlit.runtime.metrics_util import gather_metrics
  from streamlit.runtime.scriptrunner import ScriptRunContext, get_script_run_ctx
  from streamlit.runtime.state import WidgetArgs, WidgetCallback, WidgetKwargs, register_widget
  from streamlit.runtime.state.common import compute_widget_id
  from streamlit.type_util import Key, to_key
label_desc: Use image node_id 4 for calling the ButtonMixin obj's underlying member method code with example usage: obj._download_button(label, data, file_name, mime, key, help, on_click, args, kwargs) and returns: button_state