code: def write_key(key, filename, header=None):
      """
      Write key string to a file.
  
      Parameters
      ----------
      key : str
          Key name.
      filename : str or file handle
          Output file.
      header : str, optional
          String that will be written at the beginning of the file as comment.
  
      Returns
      -------
      key : str
          Key name.
  
      """
      write_events([key], filename, fmt="%s", header=header)
  
imports: from __future__ import absolute_import, division, print_function
  import contextlib
  import io
  import numpy
  from .audio import load_audio_file
  from .midi import load_midi, write_midi
  from ..utils import suppress_warnings, string_types
label_desc: Use image node_id 13 for calling a global function with example usage: write_key(key, filename, header) without return types