Available log levels: "debug", "info", "warning", "error", "none"
Format a log string with colors.
This implementation taken (with modifications) from https://stackoverflow.com/a/384125.
get_logger() -> logging.Logger
logging.Logger to stderr. It can be called whenever we wish to
log some message. Messages can get mixed-up
(https://docs.python.org/3.6/library/multiprocessing.html#logging), but it
works well in most cases.
init_logging(human_log_level: str = "info") -> None
It should be called only once in the app (e.g. in
main). It sets
the log_level to one of
HUMAN_LOG_LEVELS. And sets up a handler
for stderr. The logging level is propagated to all subprocesses.
find_free_port(address: str = "127.0.0.1") -> int
Finds a free port for distributed training.
port: port number that can be used to listen