import json


def _parse_dict(token, default=None):
    """Returns a dict from a string token
    Returns the default value if the token cannot be converted to dict"""
    try:
        result = json.loads(token)
        return result
    except ValueError:
        return default or {}