code: def add_pref_suff(pref_suff_map):
      
      def dec(cls):
          # Need _make_method to ensure new variable picked up for each iteration
          # of the loop.  The defined method picks up this new variable in its
          # scope.
          for key, (prefix, suffix) in pref_suff_map.items():
              setattr(cls, 'visit_' + key, _make_method(prefix))
              setattr(cls, 'depart_' + key, _make_method(suffix))
          return cls
  
      return dec
docs: Decorator adds visit, depart methods for prefix/suffix pairs