def create_pubsub_client():
    credentials = GoogleCredentials.get_application_default()
    if credentials.create_scoped_required():
        credentials = credentials.create_scoped(PUBSUB_SCOPES)
    return discovery.build('pubsub', 'v1beta2', credentials=credentials)
Build the pubsub client.
dataset/ETHPy150Open GoogleCloudPlatform/cloud-pubsub-samples-python/gce-cmdline-publisher/traffic_pubsub_generator.py/create_pubsub_client