docs: def temporary_file(contents, suffix='', prefix='tmp'):
      """Creates a temporary file with specified contents that persists for the context.
  
      :param contents: binary string that will be written to the file.
      :param prefix: will be prefixed to the filename.
      :param suffix: will be appended to the filename.
      :returns path of the created file.
      """
      tmp = tempfile.NamedTemporaryFile(suffix=suffix, prefix=prefix, delete=False)
      with tmp:
          tmp.write(contents)
  
      try:
          yield tmp.name
      finally:
          os.unlink(tmp.name)