utils

Exceptions:

TimeoutException

Functions:

contextmanager(func)

@contextmanager decorator.

init_logger(module_name[, log_level, …])

Initialize a logger for logging events.

time_limit(seconds)

timeout(func)

Defines a decorator for a 50ms timeout.

exception pvp.common.utils.TimeoutException[source]

Bases: Exception

pvp.common.utils.time_limit(seconds)[source]
pvp.common.utils.timeout(func)[source]

Defines a decorator for a 50ms timeout. Usage/Test:

@timeout def foo(sleeptime):

time.sleep(sleeptime)

print(“hello”)