code: def to_items(self, func=str):
          
          return [
              (key, func(self.kwargs[key]))
              for key in sorted(self.kwargs.keys())
          ]
docs: Contruct a list of dictionary items.
  
          The items are normalized using:
            -  A sort function by key (for consistent results)
            -  A transformation function for values
  
          The transformation function will default to `str`, which is a good choice when encoding values
          as part of a response; this requires that complex types (UUID, Enum, etc.) have a valid string
          encoding.
  
          The transformation function should be set to `identity` in cases where raw values are desired;
          this is normally necessary when passing page data to controller functions as kwargs.