return action
elif all(
name[:6] == "action" and
(name[6:name.index("-")].isnumeric() if "-" in name else name[6:].isnumeric())
for name in action
):
actions = list()
After Change
elif all(name.startswith("gymmdc") for name in action) or \
all(name.startswith("gymbox") for name in action) or \
all(name.startswith("gymtpl") for name in action):
space_type = next(iter(action))[:6]
actions = list()
n = 0
while True:
if any(name.startswith(space_type + str(n) + "-") for name in action):