Display an adaptive ETA / countdown bar with a message.

    Parameters
    ----------
    msg: str
        Message to prefix countdown bar line with

    max_value: max_value
        The max number of progress bar steps/updates

def eta_bar(msg, max_value):
    """Display an adaptive ETA / countdown bar with a message.

    Parameters
    ----------
    msg: str
        Message to prefix countdown bar line with

    max_value: max_value
        The max number of progress bar steps/updates
    """

    widgets = [
        "{msg}:".format(msg=msg),
        progressbar.Bar(), ' ', progressbar.AdaptiveETA(),
    ]

    return progressbar.ProgressBar(widgets=widgets, max_value=max_value)