scene_synthesizer.utils.select_sublist

scene_synthesizer.utils.select_sublist(query, all_items)

Select a sublist of a given list, using a query. The query can be a regular expression, string, or list of strings.

Parameters:
  • query (str or list) – A regular expression, string or list.

  • all_items (list[str]) – A list of options to select from.

Raises:

ValueError – Raises an error if no element from all_items is selected. Usually hints to an unintended query.

Returns:

A list of items from all_items matching the query.

Return type:

list[str]