code: def model_ext_functions(vk, model):
      
      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
docs: Fill the model with extensions functions