def parse_besancon_dict(bd):
    """
    Turn a dict like default_keys into a list of tuples.

    Must be a list of tuples because there are some repeated entries,
    which dictionaries do not support.

    .. todo::
        In the future, a better way to do this is to make each dict entry a
        list; requests knows how to deal with this properly
    """
    http_dict = []
    for key, val in bd.items():
        if isinstance(val, list):
            if '[]' in key:
                for listval in val:
                    http_dict.append((key, listval))
            else:
                for ii, listval in enumerate(val):
                    if isinstance(listval, list):
                        for jj, lv in enumerate(listval):
                            http_dict.append((key + '[%i][%i]' % (ii, jj), lv))
                    else:
                        http_dict.append((key + '[%i]' % ii, listval))
        else:
            http_dict.append((key, val))
    return http_dict
