pyvista.core._validation.check.check_contains#
- check_contains( ) None [source]#
Check if an item is in a container.
- Parameters:
- container
Any
Container to check.
- must_contain
Any
Item which must be in the container.
- name
str
, default: “Input” Variable name to use in the error messages if any are raised.
- container
- Raises:
ValueError
If the item is not in the container.
See also
Examples
Check if
"A"
is in a list of strings.>>> from pyvista import _validation >>> _validation.check_contains(['A', 'B', 'C'], must_contain='A')