def GetMetadata(path):
    return urllib.request.urlopen('http://metadata/computeMetadata/v1/%s' % path,
        headers={'Metadata-Flavor': 'Google'}).read()
How to auth into BigQuery on Google Compute Engine?