<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def model_ext_functions(vk, model):
 """Fill the model with extensions functions"""

    model['ext_functions'] = {'instance': {}, 'device': {}}

    # invert the alias to better lookup
    alias = {v: k for k, v in model['alias'].items()}

    for extension in get_extensions_filtered(vk):
        for req in extension['require']:
            if not req.get('command'):
                continue

            ext_type = extension['@type']
            for x in req['command']:
                name = x['@name']
                if name in alias.keys():
                    model['ext_functions'][ext_type][name] = alias[name]
                else:
                    model['ext_functions'][ext_type][name] = name