espnet2.asr.state_spaces.utils.is_list
Less than 1 minute
espnet2.asr.state_spaces.utils.is_list
espnet2.asr.state_spaces.utils.is_list(x)
Determine if the input is a list-like object.
This function checks whether the provided input x is an instance of a sequence (like a list or tuple) but not a string. It is useful for differentiating between sequence types in various data processing tasks.
- Parameters:x – The input object to check.
- Returns: True if x is a sequence and not a string; False otherwise.
- Return type: bool
Examples
>>> is_list([1, 2, 3])
True
>>> is_list((1, 2, 3))
True
>>> is_list("hello")
False
>>> is_list(123)
False