espnet2.asr.state_spaces.utils.is_dict
Less than 1 minute
espnet2.asr.state_spaces.utils.is_dict
espnet2.asr.state_spaces.utils.is_dict(x)
Determines whether the given object is a dictionary-like structure.
This function checks if the provided input is an instance of a dictionary or any mapping type. It can be useful for type-checking when working with configuration data or other collections.
- Parameters:x – The object to check.
- Returns: True if the object is a dictionary-like structure, False otherwise.
- Return type: bool
Examples
>>> is_dict({'key': 'value'})
True
>>> is_dict(['item1', 'item2'])
False
>>> is_dict(None)
False
>>> is_dict({'key1': 1, 'key2': 2})
True