dcase_util.containers.ListContainer
- class dcase_util.containers.ListContainer(*args, **kwargs)[source]
List container class inherited from standard list class.
Constructor
- Parameters
- filenamestr, optional
File path
Methods
__init__
(*args, **kwargs)Constructor
append
(object, /)Append object to the end of the list.
clear
(/)Remove all items from list.
copy
(/)Return a shallow copy of the list.
count
(value, /)Return number of occurrences of value.
delimiter
([exclude_delimiters])Use csv.sniffer to guess delimiter for CSV file
detect_file_format
([filename])Detect file format from extension
empty
()Check if file is empty
exists
()Checks that file exists
extend
(iterable, /)Extend list by appending elements from the iterable.
get_dump_content
(data)Clean internal content for saving
get_file_information
()Get file information, filename
index
(value[, start, stop])Return first index of value.
insert
(index, object, /)Insert object before index.
is_package
([filename])Determine if the file is compressed package.
load
([filename, headers, file_format])Load file
log
([level])Log container content
pop
([index])Remove and return item at index (default last).
remove
(value, /)Remove first occurrence of value.
reverse
(/)Reverse IN PLACE.
save
([filename, file_format])Save file
show
([mode, indent, visualize])Print container content
sort
(*[, key, reverse])Sort the list in ascending order and return None.
to_html
([indent])Get container information in a HTML formatted string
to_string
([ui, indent])Get container information in a string
update
(data)Replace content with given list
validate_format
()Validate file format
Attributes
bytes
File size in bytes
logger
Logger instance
md5
Checksum for file.
valid_formats
Valid file formats