import base64


def decode(msg):
    """ Convert data per pubsub protocol / data format
    Args:
        msg: The msg from Google Cloud
    Returns:
        data: The msg data as a string
    """
    if 'data' in msg:
        data = base64.b64decode(msg['data']).decode('utf-8')
        return data