We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Redundant profile menu
Selecting the Profile option in the menu leads to a menu with the option Profile. Below is a screenshot of the menu described.

![image](https://github.com/archlinux/archinstall/assets/11915375/e2fac7f7-2ee9-4e49-a7e2-a9d4fe09fafc)

--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `archinstall/lib/profile/profile_menu.py`
Content:
```
1 from __future__ import annotations
2 
3 from typing import TYPE_CHECKING, Any, Optional, Dict
4 
5 from archinstall.default_profiles.profile import Profile, GreeterType
6 from .profile_model import ProfileConfiguration
7 from ..menu import Menu, MenuSelectionType, AbstractSubMenu, Selector
8 from ..interactions.system_conf import select_driver
9 from ..hardware import GfxDriver
10 
11 if TYPE_CHECKING:
12 	_: Any
13 
14 
15 class ProfileMenu(AbstractSubMenu):
16 	def __init__(
17 		self,
18 		data_store: Dict[str, Any],
19 		preset: Optional[ProfileConfiguration] = None
20 	):
21 		if preset:
22 			self._preset = preset
23 		else:
24 			self._preset = ProfileConfiguration()
25 
26 		super().__init__(data_store=data_store)
27 
28 	def setup_selection_menu_options(self):
29 		self._menu_options['profile'] = Selector(
30 			_('Profile'),
31 			lambda x: self._select_profile(x),
32 			display_func=lambda x: x.name if x else None,
33 			preview_func=self._preview_profile,
34 			default=self._preset.profile,
35 			enabled=True
36 		)
37 
38 		self._menu_options['gfx_driver'] = Selector(
39 			_('Graphics driver'),
40 			lambda preset: self._select_gfx_driver(preset),
41 			display_func=lambda x: x.value if x else None,
42 			dependencies=['profile'],
43 			default=self._preset.gfx_driver if self._preset.profile and self._preset.profile.is_graphic_driver_supported() else None,
44 			enabled=self._preset.profile.is_graphic_driver_supported() if self._preset.profile else False
45 		)
46 
47 		self._menu_options['greeter'] = Selector(
48 			_('Greeter'),
49 			lambda preset: select_greeter(self._menu_options['profile'].current_selection, preset),
50 			display_func=lambda x: x.value if x else None,
51 			dependencies=['profile'],
52 			default=self._preset.greeter if self._preset.profile and self._preset.profile.is_greeter_supported() else None,
53 			enabled=self._preset.profile.is_greeter_supported() if self._preset.profile else False
54 		)
55 
56 	def run(self, allow_reset: bool = True) -> Optional[ProfileConfiguration]:
57 		super().run(allow_reset=allow_reset)
58 
59 		if self._data_store.get('profile', None):
60 			return ProfileConfiguration(
61 				self._menu_options['profile'].current_selection,
62 				self._menu_options['gfx_driver'].current_selection,
63 				self._menu_options['greeter'].current_selection
64 			)
65 
66 		return None
67 
68 	def _select_profile(self, preset: Optional[Profile]) -> Optional[Profile]:
69 		profile = select_profile(preset)
70 		if profile is not None:
71 			if not profile.is_graphic_driver_supported():
72 				self._menu_options['gfx_driver'].set_enabled(False)
73 				self._menu_options['gfx_driver'].set_current_selection(None)
74 			else:
75 				self._menu_options['gfx_driver'].set_enabled(True)
76 				self._menu_options['gfx_driver'].set_current_selection(GfxDriver.AllOpenSource)
77 
78 			if not profile.is_greeter_supported():
79 				self._menu_options['greeter'].set_enabled(False)
80 				self._menu_options['greeter'].set_current_selection(None)
81 			else:
82 				self._menu_options['greeter'].set_enabled(True)
83 				self._menu_options['greeter'].set_current_selection(profile.default_greeter_type)
84 		else:
85 			self._menu_options['gfx_driver'].set_current_selection(None)
86 			self._menu_options['greeter'].set_current_selection(None)
87 
88 		return profile
89 
90 	def _select_gfx_driver(self, preset: Optional[GfxDriver] = None) -> Optional[GfxDriver]:
91 		driver = preset
92 		profile: Optional[Profile] = self._menu_options['profile'].current_selection
93 
94 		if profile:
95 			if profile.is_graphic_driver_supported():
96 				driver = select_driver(current_value=preset)
97 
98 			if driver and 'Sway' in profile.current_selection_names():
99 				if driver.is_nvidia():
100 					prompt = str(_('The proprietary Nvidia driver is not supported by Sway. It is likely that you will run into issues, are you okay with that?'))
101 					choice = Menu(prompt, Menu.yes_no(), default_option=Menu.no(), skip=False).run()
102 
103 					if choice.value == Menu.no():
104 						return None
105 
106 		return driver
107 
108 	def _preview_profile(self) -> Optional[str]:
109 		profile: Optional[Profile] = self._menu_options['profile'].current_selection
110 
111 		if profile:
112 			names = profile.current_selection_names()
113 			return '\n'.join(names)
114 
115 		return None
116 
117 
118 def select_greeter(
119 	profile: Optional[Profile] = None,
120 	preset: Optional[GreeterType] = None
121 ) -> Optional[GreeterType]:
122 	if not profile or profile.is_greeter_supported():
123 		title = str(_('Please chose which greeter to install'))
124 		greeter_options = [greeter.value for greeter in GreeterType]
125 
126 		default: Optional[GreeterType] = None
127 
128 		if preset is not None:
129 			default = preset
130 		elif profile is not None:
131 			default_greeter = profile.default_greeter_type
132 			default = default_greeter if default_greeter else None
133 
134 		choice = Menu(
135 			title,
136 			greeter_options,
137 			skip=True,
138 			default_option=default.value if default else None
139 		).run()
140 
141 		match choice.type_:
142 			case MenuSelectionType.Skip:
143 				return default
144 
145 		return GreeterType(choice.single_value)
146 
147 	return None
148 
149 
150 def select_profile(
151 	current_profile: Optional[Profile] = None,
152 	title: Optional[str] = None,
153 	allow_reset: bool = True,
154 	multi: bool = False
155 ) -> Optional[Profile]:
156 	from archinstall.lib.profile.profiles_handler import profile_handler
157 	top_level_profiles = profile_handler.get_top_level_profiles()
158 
159 	display_title = title
160 	if not display_title:
161 		display_title = str(_('This is a list of pre-programmed default_profiles'))
162 
163 	choice = profile_handler.select_profile(
164 		top_level_profiles,
165 		current_profile=current_profile,
166 		title=display_title,
167 		allow_reset=allow_reset,
168 		multi=multi
169 	)
170 
171 	match choice.type_:
172 		case MenuSelectionType.Selection:
173 			profile_selection: Profile = choice.single_value
174 			select_result = profile_selection.do_on_select()
175 
176 			if not select_result:
177 				return select_profile(
178 					current_profile=current_profile,
179 					title=title,
180 					allow_reset=allow_reset,
181 					multi=multi
182 				)
183 
184 			# we're going to reset the currently selected profile(s) to avoid
185 			# any stale data laying around
186 			match select_result:
187 				case select_result.NewSelection:
188 					profile_handler.reset_top_level_profiles(exclude=[profile_selection])
189 					current_profile = profile_selection
190 				case select_result.ResetCurrent:
191 					profile_handler.reset_top_level_profiles()
192 					current_profile = None
193 				case select_result.SameSelection:
194 					pass
195 
196 			return current_profile
197 		case MenuSelectionType.Reset:
198 			return None
199 		case MenuSelectionType.Skip:
200 			return current_profile
201
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/archinstall/lib/profile/profile_menu.py b/archinstall/lib/profile/profile_menu.py
--- a/archinstall/lib/profile/profile_menu.py
+++ b/archinstall/lib/profile/profile_menu.py
@@ -27,7 +27,7 @@
 
 	def setup_selection_menu_options(self):
 		self._menu_options['profile'] = Selector(
-			_('Profile'),
+			_('Type'),
 			lambda x: self._select_profile(x),
 			display_func=lambda x: x.name if x else None,
 			preview_func=self._preview_profile,

{"golden_diff": "diff --git a/archinstall/lib/profile/profile_menu.py b/archinstall/lib/profile/profile_menu.py\n--- a/archinstall/lib/profile/profile_menu.py\n+++ b/archinstall/lib/profile/profile_menu.py\n@@ -27,7 +27,7 @@\n \n \tdef setup_selection_menu_options(self):\n \t\tself._menu_options['profile'] = Selector(\n-\t\t\t_('Profile'),\n+\t\t\t_('Type'),\n \t\t\tlambda x: self._select_profile(x),\n \t\t\tdisplay_func=lambda x: x.name if x else None,\n \t\t\tpreview_func=self._preview_profile,\n", "issue": "Redundant profile menu\nSelecting the Profile option in the menu leads to a menu with the option Profile. Below is a screenshot of the menu described.\r\n\r\n![image](https://github.com/archlinux/archinstall/assets/11915375/e2fac7f7-2ee9-4e49-a7e2-a9d4fe09fafc)\n", "before_files": [{"content": "from __future__ import annotations\n\nfrom typing import TYPE_CHECKING, Any, Optional, Dict\n\nfrom archinstall.default_profiles.profile import Profile, GreeterType\nfrom .profile_model import ProfileConfiguration\nfrom ..menu import Menu, MenuSelectionType, AbstractSubMenu, Selector\nfrom ..interactions.system_conf import select_driver\nfrom ..hardware import GfxDriver\n\nif TYPE_CHECKING:\n\t_: Any\n\n\nclass ProfileMenu(AbstractSubMenu):\n\tdef __init__(\n\t\tself,\n\t\tdata_store: Dict[str, Any],\n\t\tpreset: Optional[ProfileConfiguration] = None\n\t):\n\t\tif preset:\n\t\t\tself._preset = preset\n\t\telse:\n\t\t\tself._preset = ProfileConfiguration()\n\n\t\tsuper().__init__(data_store=data_store)\n\n\tdef setup_selection_menu_options(self):\n\t\tself._menu_options['profile'] = Selector(\n\t\t\t_('Profile'),\n\t\t\tlambda x: self._select_profile(x),\n\t\t\tdisplay_func=lambda x: x.name if x else None,\n\t\t\tpreview_func=self._preview_profile,\n\t\t\tdefault=self._preset.profile,\n\t\t\tenabled=True\n\t\t)\n\n\t\tself._menu_options['gfx_driver'] = Selector(\n\t\t\t_('Graphics driver'),\n\t\t\tlambda preset: self._select_gfx_driver(preset),\n\t\t\tdisplay_func=lambda x: x.value if x else None,\n\t\t\tdependencies=['profile'],\n\t\t\tdefault=self._preset.gfx_driver if self._preset.profile and self._preset.profile.is_graphic_driver_supported() else None,\n\t\t\tenabled=self._preset.profile.is_graphic_driver_supported() if self._preset.profile else False\n\t\t)\n\n\t\tself._menu_options['greeter'] = Selector(\n\t\t\t_('Greeter'),\n\t\t\tlambda preset: select_greeter(self._menu_options['profile'].current_selection, preset),\n\t\t\tdisplay_func=lambda x: x.value if x else None,\n\t\t\tdependencies=['profile'],\n\t\t\tdefault=self._preset.greeter if self._preset.profile and self._preset.profile.is_greeter_supported() else None,\n\t\t\tenabled=self._preset.profile.is_greeter_supported() if self._preset.profile else False\n\t\t)\n\n\tdef run(self, allow_reset: bool = True) -> Optional[ProfileConfiguration]:\n\t\tsuper().run(allow_reset=allow_reset)\n\n\t\tif self._data_store.get('profile', None):\n\t\t\treturn ProfileConfiguration(\n\t\t\t\tself._menu_options['profile'].current_selection,\n\t\t\t\tself._menu_options['gfx_driver'].current_selection,\n\t\t\t\tself._menu_options['greeter'].current_selection\n\t\t\t)\n\n\t\treturn None\n\n\tdef _select_profile(self, preset: Optional[Profile]) -> Optional[Profile]:\n\t\tprofile = select_profile(preset)\n\t\tif profile is not None:\n\t\t\tif not profile.is_graphic_driver_supported():\n\t\t\t\tself._menu_options['gfx_driver'].set_enabled(False)\n\t\t\t\tself._menu_options['gfx_driver'].set_current_selection(None)\n\t\t\telse:\n\t\t\t\tself._menu_options['gfx_driver'].set_enabled(True)\n\t\t\t\tself._menu_options['gfx_driver'].set_current_selection(GfxDriver.AllOpenSource)\n\n\t\t\tif not profile.is_greeter_supported():\n\t\t\t\tself._menu_options['greeter'].set_enabled(False)\n\t\t\t\tself._menu_options['greeter'].set_current_selection(None)\n\t\t\telse:\n\t\t\t\tself._menu_options['greeter'].set_enabled(True)\n\t\t\t\tself._menu_options['greeter'].set_current_selection(profile.default_greeter_type)\n\t\telse:\n\t\t\tself._menu_options['gfx_driver'].set_current_selection(None)\n\t\t\tself._menu_options['greeter'].set_current_selection(None)\n\n\t\treturn profile\n\n\tdef _select_gfx_driver(self, preset: Optional[GfxDriver] = None) -> Optional[GfxDriver]:\n\t\tdriver = preset\n\t\tprofile: Optional[Profile] = self._menu_options['profile'].current_selection\n\n\t\tif profile:\n\t\t\tif profile.is_graphic_driver_supported():\n\t\t\t\tdriver = select_driver(current_value=preset)\n\n\t\t\tif driver and 'Sway' in profile.current_selection_names():\n\t\t\t\tif driver.is_nvidia():\n\t\t\t\t\tprompt = str(_('The proprietary Nvidia driver is not supported by Sway. It is likely that you will run into issues, are you okay with that?'))\n\t\t\t\t\tchoice = Menu(prompt, Menu.yes_no(), default_option=Menu.no(), skip=False).run()\n\n\t\t\t\t\tif choice.value == Menu.no():\n\t\t\t\t\t\treturn None\n\n\t\treturn driver\n\n\tdef _preview_profile(self) -> Optional[str]:\n\t\tprofile: Optional[Profile] = self._menu_options['profile'].current_selection\n\n\t\tif profile:\n\t\t\tnames = profile.current_selection_names()\n\t\t\treturn '\\n'.join(names)\n\n\t\treturn None\n\n\ndef select_greeter(\n\tprofile: Optional[Profile] = None,\n\tpreset: Optional[GreeterType] = None\n) -> Optional[GreeterType]:\n\tif not profile or profile.is_greeter_supported():\n\t\ttitle = str(_('Please chose which greeter to install'))\n\t\tgreeter_options = [greeter.value for greeter in GreeterType]\n\n\t\tdefault: Optional[GreeterType] = None\n\n\t\tif preset is not None:\n\t\t\tdefault = preset\n\t\telif profile is not None:\n\t\t\tdefault_greeter = profile.default_greeter_type\n\t\t\tdefault = default_greeter if default_greeter else None\n\n\t\tchoice = Menu(\n\t\t\ttitle,\n\t\t\tgreeter_options,\n\t\t\tskip=True,\n\t\t\tdefault_option=default.value if default else None\n\t\t).run()\n\n\t\tmatch choice.type_:\n\t\t\tcase MenuSelectionType.Skip:\n\t\t\t\treturn default\n\n\t\treturn GreeterType(choice.single_value)\n\n\treturn None\n\n\ndef select_profile(\n\tcurrent_profile: Optional[Profile] = None,\n\ttitle: Optional[str] = None,\n\tallow_reset: bool = True,\n\tmulti: bool = False\n) -> Optional[Profile]:\n\tfrom archinstall.lib.profile.profiles_handler import profile_handler\n\ttop_level_profiles = profile_handler.get_top_level_profiles()\n\n\tdisplay_title = title\n\tif not display_title:\n\t\tdisplay_title = str(_('This is a list of pre-programmed default_profiles'))\n\n\tchoice = profile_handler.select_profile(\n\t\ttop_level_profiles,\n\t\tcurrent_profile=current_profile,\n\t\ttitle=display_title,\n\t\tallow_reset=allow_reset,\n\t\tmulti=multi\n\t)\n\n\tmatch choice.type_:\n\t\tcase MenuSelectionType.Selection:\n\t\t\tprofile_selection: Profile = choice.single_value\n\t\t\tselect_result = profile_selection.do_on_select()\n\n\t\t\tif not select_result:\n\t\t\t\treturn select_profile(\n\t\t\t\t\tcurrent_profile=current_profile,\n\t\t\t\t\ttitle=title,\n\t\t\t\t\tallow_reset=allow_reset,\n\t\t\t\t\tmulti=multi\n\t\t\t\t)\n\n\t\t\t# we're going to reset the currently selected profile(s) to avoid\n\t\t\t# any stale data laying around\n\t\t\tmatch select_result:\n\t\t\t\tcase select_result.NewSelection:\n\t\t\t\t\tprofile_handler.reset_top_level_profiles(exclude=[profile_selection])\n\t\t\t\t\tcurrent_profile = profile_selection\n\t\t\t\tcase select_result.ResetCurrent:\n\t\t\t\t\tprofile_handler.reset_top_level_profiles()\n\t\t\t\t\tcurrent_profile = None\n\t\t\t\tcase select_result.SameSelection:\n\t\t\t\t\tpass\n\n\t\t\treturn current_profile\n\t\tcase MenuSelectionType.Reset:\n\t\t\treturn None\n\t\tcase MenuSelectionType.Skip:\n\t\t\treturn current_profile\n", "path": "archinstall/lib/profile/profile_menu.py"}], "after_files": [{"content": "from __future__ import annotations\n\nfrom typing import TYPE_CHECKING, Any, Optional, Dict\n\nfrom archinstall.default_profiles.profile import Profile, GreeterType\nfrom .profile_model import ProfileConfiguration\nfrom ..menu import Menu, MenuSelectionType, AbstractSubMenu, Selector\nfrom ..interactions.system_conf import select_driver\nfrom ..hardware import GfxDriver\n\nif TYPE_CHECKING:\n\t_: Any\n\n\nclass ProfileMenu(AbstractSubMenu):\n\tdef __init__(\n\t\tself,\n\t\tdata_store: Dict[str, Any],\n\t\tpreset: Optional[ProfileConfiguration] = None\n\t):\n\t\tif preset:\n\t\t\tself._preset = preset\n\t\telse:\n\t\t\tself._preset = ProfileConfiguration()\n\n\t\tsuper().__init__(data_store=data_store)\n\n\tdef setup_selection_menu_options(self):\n\t\tself._menu_options['profile'] = Selector(\n\t\t\t_('Type'),\n\t\t\tlambda x: self._select_profile(x),\n\t\t\tdisplay_func=lambda x: x.name if x else None,\n\t\t\tpreview_func=self._preview_profile,\n\t\t\tdefault=self._preset.profile,\n\t\t\tenabled=True\n\t\t)\n\n\t\tself._menu_options['gfx_driver'] = Selector(\n\t\t\t_('Graphics driver'),\n\t\t\tlambda preset: self._select_gfx_driver(preset),\n\t\t\tdisplay_func=lambda x: x.value if x else None,\n\t\t\tdependencies=['profile'],\n\t\t\tdefault=self._preset.gfx_driver if self._preset.profile and self._preset.profile.is_graphic_driver_supported() else None,\n\t\t\tenabled=self._preset.profile.is_graphic_driver_supported() if self._preset.profile else False\n\t\t)\n\n\t\tself._menu_options['greeter'] = Selector(\n\t\t\t_('Greeter'),\n\t\t\tlambda preset: select_greeter(self._menu_options['profile'].current_selection, preset),\n\t\t\tdisplay_func=lambda x: x.value if x else None,\n\t\t\tdependencies=['profile'],\n\t\t\tdefault=self._preset.greeter if self._preset.profile and self._preset.profile.is_greeter_supported() else None,\n\t\t\tenabled=self._preset.profile.is_greeter_supported() if self._preset.profile else False\n\t\t)\n\n\tdef run(self, allow_reset: bool = True) -> Optional[ProfileConfiguration]:\n\t\tsuper().run(allow_reset=allow_reset)\n\n\t\tif self._data_store.get('profile', None):\n\t\t\treturn ProfileConfiguration(\n\t\t\t\tself._menu_options['profile'].current_selection,\n\t\t\t\tself._menu_options['gfx_driver'].current_selection,\n\t\t\t\tself._menu_options['greeter'].current_selection\n\t\t\t)\n\n\t\treturn None\n\n\tdef _select_profile(self, preset: Optional[Profile]) -> Optional[Profile]:\n\t\tprofile = select_profile(preset)\n\t\tif profile is not None:\n\t\t\tif not profile.is_graphic_driver_supported():\n\t\t\t\tself._menu_options['gfx_driver'].set_enabled(False)\n\t\t\t\tself._menu_options['gfx_driver'].set_current_selection(None)\n\t\t\telse:\n\t\t\t\tself._menu_options['gfx_driver'].set_enabled(True)\n\t\t\t\tself._menu_options['gfx_driver'].set_current_selection(GfxDriver.AllOpenSource)\n\n\t\t\tif not profile.is_greeter_supported():\n\t\t\t\tself._menu_options['greeter'].set_enabled(False)\n\t\t\t\tself._menu_options['greeter'].set_current_selection(None)\n\t\t\telse:\n\t\t\t\tself._menu_options['greeter'].set_enabled(True)\n\t\t\t\tself._menu_options['greeter'].set_current_selection(profile.default_greeter_type)\n\t\telse:\n\t\t\tself._menu_options['gfx_driver'].set_current_selection(None)\n\t\t\tself._menu_options['greeter'].set_current_selection(None)\n\n\t\treturn profile\n\n\tdef _select_gfx_driver(self, preset: Optional[GfxDriver] = None) -> Optional[GfxDriver]:\n\t\tdriver = preset\n\t\tprofile: Optional[Profile] = self._menu_options['profile'].current_selection\n\n\t\tif profile:\n\t\t\tif profile.is_graphic_driver_supported():\n\t\t\t\tdriver = select_driver(current_value=preset)\n\n\t\t\tif driver and 'Sway' in profile.current_selection_names():\n\t\t\t\tif driver.is_nvidia():\n\t\t\t\t\tprompt = str(_('The proprietary Nvidia driver is not supported by Sway. It is likely that you will run into issues, are you okay with that?'))\n\t\t\t\t\tchoice = Menu(prompt, Menu.yes_no(), default_option=Menu.no(), skip=False).run()\n\n\t\t\t\t\tif choice.value == Menu.no():\n\t\t\t\t\t\treturn None\n\n\t\treturn driver\n\n\tdef _preview_profile(self) -> Optional[str]:\n\t\tprofile: Optional[Profile] = self._menu_options['profile'].current_selection\n\n\t\tif profile:\n\t\t\tnames = profile.current_selection_names()\n\t\t\treturn '\\n'.join(names)\n\n\t\treturn None\n\n\ndef select_greeter(\n\tprofile: Optional[Profile] = None,\n\tpreset: Optional[GreeterType] = None\n) -> Optional[GreeterType]:\n\tif not profile or profile.is_greeter_supported():\n\t\ttitle = str(_('Please chose which greeter to install'))\n\t\tgreeter_options = [greeter.value for greeter in GreeterType]\n\n\t\tdefault: Optional[GreeterType] = None\n\n\t\tif preset is not None:\n\t\t\tdefault = preset\n\t\telif profile is not None:\n\t\t\tdefault_greeter = profile.default_greeter_type\n\t\t\tdefault = default_greeter if default_greeter else None\n\n\t\tchoice = Menu(\n\t\t\ttitle,\n\t\t\tgreeter_options,\n\t\t\tskip=True,\n\t\t\tdefault_option=default.value if default else None\n\t\t).run()\n\n\t\tmatch choice.type_:\n\t\t\tcase MenuSelectionType.Skip:\n\t\t\t\treturn default\n\n\t\treturn GreeterType(choice.single_value)\n\n\treturn None\n\n\ndef select_profile(\n\tcurrent_profile: Optional[Profile] = None,\n\ttitle: Optional[str] = None,\n\tallow_reset: bool = True,\n\tmulti: bool = False\n) -> Optional[Profile]:\n\tfrom archinstall.lib.profile.profiles_handler import profile_handler\n\ttop_level_profiles = profile_handler.get_top_level_profiles()\n\n\tdisplay_title = title\n\tif not display_title:\n\t\tdisplay_title = str(_('This is a list of pre-programmed default_profiles'))\n\n\tchoice = profile_handler.select_profile(\n\t\ttop_level_profiles,\n\t\tcurrent_profile=current_profile,\n\t\ttitle=display_title,\n\t\tallow_reset=allow_reset,\n\t\tmulti=multi\n\t)\n\n\tmatch choice.type_:\n\t\tcase MenuSelectionType.Selection:\n\t\t\tprofile_selection: Profile = choice.single_value\n\t\t\tselect_result = profile_selection.do_on_select()\n\n\t\t\tif not select_result:\n\t\t\t\treturn select_profile(\n\t\t\t\t\tcurrent_profile=current_profile,\n\t\t\t\t\ttitle=title,\n\t\t\t\t\tallow_reset=allow_reset,\n\t\t\t\t\tmulti=multi\n\t\t\t\t)\n\n\t\t\t# we're going to reset the currently selected profile(s) to avoid\n\t\t\t# any stale data laying around\n\t\t\tmatch select_result:\n\t\t\t\tcase select_result.NewSelection:\n\t\t\t\t\tprofile_handler.reset_top_level_profiles(exclude=[profile_selection])\n\t\t\t\t\tcurrent_profile = profile_selection\n\t\t\t\tcase select_result.ResetCurrent:\n\t\t\t\t\tprofile_handler.reset_top_level_profiles()\n\t\t\t\t\tcurrent_profile = None\n\t\t\t\tcase select_result.SameSelection:\n\t\t\t\t\tpass\n\n\t\t\treturn current_profile\n\t\tcase MenuSelectionType.Reset:\n\t\t\treturn None\n\t\tcase MenuSelectionType.Skip:\n\t\t\treturn current_profile\n", "path": "archinstall/lib/profile/profile_menu.py"}]}