def parameters_from_model(parameters_model):
        """
        Get the tool parameters model from dictionaries

        :param parameters_model: The parameters as a mongoengine model
        :return: The tool parameters as a dictionary
        """
        parameters = {}
        for p in parameters_model:
            if p.is_function:
                code, defaults, closure = pickle.loads(p.value)
                parameters[p.key] = func_load(code, defaults, closure, globs=globals())
            elif p.is_set:
                parameters[p.key] = set(p.value)
            else:
                parameters[p.key] = p.value
        return parameters
Get the tool parameters model from dictionaries

        :param parameters_model: The parameters as a mongoengine model
        :return: The tool parameters as a dictionary