def METHOD_NAME(question):
    if 'variable_groups' in question:
        variable_groups = question.get('variable_groups')
        if type(variable_groups)==dict:
            question['variable_groups'] = [{'name':name,'variables':variables} for name,variables in variable_groups.items()]
    else:
        question['variable_groups'] = []