Utility functions and classes to help with content negotiation in Python