def flatten_param(param):
    """
    Turn a parameter that looks like this param[name_one][name_two][name_three]
    into this param_name_one_name_two_name_three
    """

    param = param.replace(']', '').replace('[', '_').replace('<','').replace('>','')
    if param.startswith('_'):
        param = param.replace('_', '', 1)

    return param