def get_client_from_credentials(credentials):
    if credentials.create_scoped_required():
        credentials = credentials.create_scoped(PUBSUB_SCOPES)

    http = httplib2.Http(memcache)
    credentials.authorize(http)

    return discovery.build('pubsub', 'v1', http=http)
Creates Pub/Sub client from a given credentials and returns it.
dataset/ETHPy150Open GoogleCloudPlatform/cloud-pubsub-samples-python/appengine-push/pubsub_utils.py/get_client_from_credentials