def METHOD_NAME(f):
    @wraps(f)
    def do_migration(data):
        if not data.get('type'):
            data['type'] = 'exam' if 'navigation' in data else 'question'
        if data.get('type')=='exam':
            for question in data.setdefault('questions',[]):
                f(question)
        elif data.get('type')=='question':
            f(data)
    return do_migration