MCPcopy Create free account
hub / github.com/TheAlgorithms/Python / _validate_lists

Function _validate_lists

dynamic_programming/viterbi.py:248–261  ·  view source on GitHub ↗

>>> _validate_lists(["a"], ["b"]) >>> _validate_lists(1234, ["b"]) Traceback (most recent call last): ... ValueError: observations_space must be a list >>> _validate_lists(["a"], [3]) Traceback (most recent call last): ... ValueError: states_space

(observations_space: Any, states_space: Any)

Source from the content-addressed store, hash-verified

246
247
248def _validate_lists(observations_space: Any, states_space: Any) -> None:
249 """
250 >>> _validate_lists(["a"], ["b"])
251 >>> _validate_lists(1234, ["b"])
252 Traceback (most recent call last):
253 ...
254 ValueError: observations_space must be a list
255 >>> _validate_lists(["a"], [3])
256 Traceback (most recent call last):
257 ...
258 ValueError: states_space must be a list of strings
259 """
260 _validate_list(observations_space, "observations_space")
261 _validate_list(states_space, "states_space")
262
263
264def _validate_list(_object: Any, var_name: str) -> None:

Callers 1

_validationFunction · 0.85

Calls 1

_validate_listFunction · 0.85

Tested by

no test coverage detected