hal.data package¶
Submodules¶
hal.data.dicts module¶
Typical operations on dicts made easy
-
hal.data.dicts.
get_inner_data
(dictionary)[source]¶ Gets 2nd-level data into 1st-level dictionary
Parameters: dictionary – dict Returns: with 2nd-level data
hal.data.linked_list module¶
Linked list implementation
-
class
hal.data.linked_list.
LinkedList
(lst)[source]¶ Bases:
object
Models a linked list
-
execute
(func, *args, **kwargs)[source]¶ Executes function on each item
Parameters: - func – Function to execute on each item
- args – args of function
- kwargs – extra args of function
Returns: list: Results of calling the function on each item
-
static
from_list
(lst)[source]¶ Parses list
Parameters: lst – list of elements Returns: LinkedList: Nodes from list
-
insert
(val, position=0)[source]¶ Insert in position
Parameters: - val – Object to insert
- position – Index of insertion
Returns: bool: True iff insertion completed successfully
-
insert_first
(val)[source]¶ Insert in head
Parameters: val – Object to insert Returns: True iff insertion completed successfully
-
insert_last
(val)[source]¶ Appends to list
Parameters: val – Object to insert Returns: bool: Appends element to last
-
hal.data.lists module¶
Tools to deal with lists
-
hal.data.lists.
find_commons
(lists)[source]¶ Finds common values
Parameters: lists – List of lists Returns: List of values that are in common between inner lists
-
hal.data.lists.
is_in_all
(value, lists)[source]¶ Checks if item is in all lists
Parameters: - value – Value to check
- lists – List of lists
Returns: True iff value is in all inner lists
hal.data.matrix module¶
Functions to deal with matrices
-
class
hal.data.matrix.
Matrix
(matrix)[source]¶ Bases:
object
Table of data
-
decode
(encoder)[source]¶ Decodes matrix
Parameters: encoder – Encoder used to encode matrix Returns: list: Decodes matrix
-
static
from_columns
(columns)[source]¶ Parses raw columns
Parameters: columns – matrix divided into columns Returns: Matrix: Merge the columns to form a matrix
-