import base64
import json


def _read_pubsub_json(event):
  """Extracts the json payload from a pub/sub message.

    Args:
      event: A Pub/Sub event.

    Returns:
      The json_payload from a pub/sub message.
  """

  pubsub_message = base64.b64decode(event['data']).decode('utf-8')
  return json.loads(pubsub_message)