Module continuous_delivery_scripts.utils.python.python_helpers

Utilities around python language.

Functions

def flatten_dictionary(dictionary: dict) ‑> list
Expand source code
def flatten_dictionary(dictionary: dict) -> list:
    """Flattens a dictionary and transforms it into a list [key, value, ...]."""
    flat_list = list()
    for k, v in dictionary.items():
        flat_list.append(k)
        if isinstance(v, list):
            flat_list.extend(v)
        else:
            flat_list.append(v)
    return flat_list

Flattens a dictionary and transforms it into a list [key, value, …].