code: def multi_substitution(*substitutions):
      """
      Take a sequence of pairs specifying substitutions, and create
      a function that performs those substitutions.
  
      >>> multi_substitution(('foo', 'bar'), ('bar', 'baz'))('foo')
      'baz'
      """
      substitutions = itertools.starmap(substitution, substitutions)
      # compose function applies last function first, so reverse the
      #  substitutions to get the expected order.
      substitutions = reversed(tuple(substitutions))
      return compose(*substitutions)
  
imports: import re
  import itertools
  import textwrap
  import functools
  from setuptools.extern.jaraco.functools import compose, method_cache
  from setuptools.extern.jaraco.context import ExceptionTrap
label_desc: Use image node_id 2 for calling a global function with example usage: multi_substitution() and returns: compose