import json


def erl_tuple_to_list(raw_data):
    """
    Formats Erlang data to be testable in Python.
    raw_data is a list of Erlang tuples serialised as string
    E.g.: '[{"giver1","recipient1"},{"giver2","recipient2"}]'
    formatted_list is a list of lists:
    E.g.:[ ['giver1','recipient1'], ['giver2','recipient2'] ]
    """
    # Replace Erlang tuple chars (and binary strings) with json list chars.
    replacements = {
        '{': '[',
        '}': ']',
        '<<': '',
        '>>': ''
    }

    for old_val, new_val in replacements.items():
        raw_data = raw_data.replace(old_val, new_val)

    # Deserialise into list of lists
    formatted_list = json.loads(raw_data)

    return formatted_list