quantify_scheduler.helpers.collections

Helpers for various collections.

Module Contents

Functions

make_hash(→ int)

Makes a hash from a dictionary, list, tuple or set to any level, that contains

without(→ dict)

Utility that copies a dictionary excluding a specific list of keys.

make_hash(obj: Any) int[source]

Makes a hash from a dictionary, list, tuple or set to any level, that contains only other hashable types (including any lists, tuples, sets, and dictionaries).

From: https://stackoverflow.com/questions/5884066/hashing-a-dictionary

Parameters:

obj – Input collection.

Returns:

Hash.

without(dict_in: dict, keys: list) dict[source]

Utility that copies a dictionary excluding a specific list of keys.

Parameters:
  • dict_in – Input dictionary.

  • keys – List of keys to exclude.

Returns:

Filtered dictionary.