def _resolve_walltime(walltime):
    """ ensure wall time is in format HH:MM:SS

    Parameters
    ----------
    walltime: str

    Returns
    -------

    """
    components = walltime.split(':')
    for c in components:
        try:
            int(c)
        except ValueError:
            raise ValueError('the walltime is not in the correct format: {}'
                .format(walltime))
    if len(components) > 3:
        raise ValueError('the walltime is not in the correct format: {}'.
            format(walltime))
    elif len(components) == 3:
        return ':'.join([components[0], '{:02d}'.format(int(components[1])),
            '{:02d}'.format(int(components[2]))])
    elif len(components) == 2:
        return ':'.join([components[0], '{:02d}'.format(int(components[1])),
            '00'])
    elif len(components) == 1:
        return ':'.join([components[0], '00', '00'])
