or, alternately:

    if any('Metadata-Flavor: Google' in h for h in response.info().headers):