def parse_bool(val):

    """
    Parse bool value from cli.
    Must be represented by integer number 0 or 1.

    Return: (bool) True/False
    """
    try:
        val = int(val)
        assert val == 0 or val == 1, 'Wrong value: {}'.format(val)
    except:
        raise ValueError('Cannot parse flag {}. It must an integer 0 or 1'.format(val))
    return bool(val)