Python dictionaries have a `.get()` method that simplifies this:

    if response.get('metadata-flavor') == 'Google':