nodes: 0, module; 1, function_definition; 2, function_name:get_app_list; 3, parameters; 4, block; 5, identifier:site; 6, identifier:request; 7, expression_statement; 8, expression_statement; 9, comment:# Sort the apps alphabetically.; 10, expression_statement; 11, comment:# Sort the models alphabetically within each app.; 12, for_statement; 13, return_statement; 14, comment:"""
      Returns a sorted list of all the installed apps that have been
      registered in this site.
      """; 15, assignment; 16, assignment; 17, identifier:app; 18, identifier:app_list; 19, block; 20, identifier:app_list; 21, identifier:app_dict; 22, call; 23, identifier:app_list; 24, call; 25, expression_statement; 26, identifier:_build_app_dict; 27, argument_list; 28, identifier:sorted; 29, argument_list; 30, call; 31, identifier:site; 32, identifier:request; 33, call; 34, keyword_argument; 35, attribute; 36, argument_list; 37, attribute; 38, argument_list; 39, identifier:key; 40, lambda; 41, subscript; 42, identifier:sort; 43, keyword_argument; 44, identifier:app_dict; 45, identifier:values; 46, lambda_parameters; 47, call; 48, identifier:app; 49, string; 50, identifier:key; 51, lambda; 52, identifier:x; 53, attribute; 54, argument_list; 55, string_content:models; 56, lambda_parameters; 57, subscript; 58, subscript; 59, identifier:lower; 60, identifier:x; 61, identifier:x; 62, string; 63, identifier:x; 64, string; 65, string_content:name; 66, string_content:name
code: def get_app_list(site, request):
      """
      Returns a sorted list of all the installed apps that have been
      registered in this site.
      """
      app_dict = _build_app_dict(site, request)
  
      # Sort the apps alphabetically.
      app_list = sorted(app_dict.values(), key=lambda x: x['name'].lower())
  
      # Sort the models alphabetically within each app.
      for app in app_list:
          app['models'].sort(key=lambda x: x['name'])
  
      return app_list