code: def form_error_string(call, exception, subs):
      """
      call is a function that raises exception.
      exception is an exception class, e.g., KeyError.
      subs is a list of replacements to be performed on the exception string. Each
      replacement is only performed once on the exception string so the
      replacement of multiple occurences of a pattern is specified by repeating a
      (pattern,relacement) pair in the list.
      returns modified exception string
      """
      raised = False
      try:
          call()
      except exception as e:
          raised = True
          msg = e.args[0]
          for pat, rep in subs:
              msg = msg.replace(pat, rep, 1)
      assert raised
      return msg
  
imports: import plotly.graph_objects
  from _plotly_utils.exceptions import PlotlyKeyError
  import pytest
label_desc: Use image node_id 10 for calling a global function with example usage: form_error_string(call, exception, subs) and returns: msg