neurolang.utils.various module

neurolang.utils.various.log_performance(logger, init_message, init_args=None, end_message=None, end_args=None, level=20)

Context manager to log the performance of executed commands in the context.

Parameters:
loggerlogging.Logger

Logger to use for the message

init_messagestr

Message to display before executing the code within the context.

init_argstuple, optional

Tuple with the arguments for the init message, by default None

end_messagestr, optional

Message to display when code has finished first parameter is the elapsed seconds, by default None

end_argstuple, optional

more arguments for the end message, by default None

levellogging level, optional

level to log, by default logging.INFO

neurolang.utils.various.powerset(iterable)