def get_from_collection_wrapper(collection:dict):
    """
    wrapper function that returns a function which gets items from collection using key.
    Used to avoid a lambda function in key argument for sorted (seems to disrupt numba jit)
    :param collection: collection to be used
    :return: function that takes in key to access items in the collection
    """
    def get_from_collection(key):
        return collection[key]
    return get_from_collection