How to use the emmental.utils.utils.str2bool function in emmental

To help you get started, we’ve selected a few emmental examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github SenWu / emmental / tests / utils / test_utils.py View on Github external
def test_str2bool(caplog):
    """Unit test of str2bool."""
    caplog.set_level(logging.INFO)

    assert str2bool("Yes") is True
    assert str2bool("YeS") is True
    assert str2bool("TRUE") is True
    assert str2bool("True") is True
    assert str2bool("T") is True
    assert str2bool("Y") is True
    assert str2bool("1") is True

    assert str2bool("N") is False
    assert str2bool("No") is False
    assert str2bool("False") is False
    assert str2bool("n") is False
    assert str2bool("f") is False
    assert str2bool("0") is False
github SenWu / emmental / tests / utils / test_utils.py View on Github external
def test_str2bool(caplog):
    """Unit test of str2bool."""
    caplog.set_level(logging.INFO)

    assert str2bool("Yes") is True
    assert str2bool("YeS") is True
    assert str2bool("TRUE") is True
    assert str2bool("True") is True
    assert str2bool("T") is True
    assert str2bool("Y") is True
    assert str2bool("1") is True

    assert str2bool("N") is False
    assert str2bool("No") is False
    assert str2bool("False") is False
    assert str2bool("n") is False
    assert str2bool("f") is False
    assert str2bool("0") is False
github SenWu / emmental / tests / utils / test_utils.py View on Github external
def test_str2bool(caplog):
    """Unit test of str2bool."""
    caplog.set_level(logging.INFO)

    assert str2bool("Yes") is True
    assert str2bool("YeS") is True
    assert str2bool("TRUE") is True
    assert str2bool("True") is True
    assert str2bool("T") is True
    assert str2bool("Y") is True
    assert str2bool("1") is True

    assert str2bool("N") is False
    assert str2bool("No") is False
    assert str2bool("False") is False
    assert str2bool("n") is False
    assert str2bool("f") is False
    assert str2bool("0") is False
github SenWu / emmental / tests / utils / test_utils.py View on Github external
def test_str2bool(caplog):
    """Unit test of str2bool."""
    caplog.set_level(logging.INFO)

    assert str2bool("Yes") is True
    assert str2bool("YeS") is True
    assert str2bool("TRUE") is True
    assert str2bool("True") is True
    assert str2bool("T") is True
    assert str2bool("Y") is True
    assert str2bool("1") is True

    assert str2bool("N") is False
    assert str2bool("No") is False
    assert str2bool("False") is False
    assert str2bool("n") is False
    assert str2bool("f") is False
    assert str2bool("0") is False
github SenWu / emmental / tests / utils / test_utils.py View on Github external
def test_str2bool(caplog):
    """Unit test of str2bool."""
    caplog.set_level(logging.INFO)

    assert str2bool("Yes") is True
    assert str2bool("YeS") is True
    assert str2bool("TRUE") is True
    assert str2bool("True") is True
    assert str2bool("T") is True
    assert str2bool("Y") is True
    assert str2bool("1") is True

    assert str2bool("N") is False
    assert str2bool("No") is False
    assert str2bool("False") is False
    assert str2bool("n") is False
    assert str2bool("f") is False
    assert str2bool("0") is False
github SenWu / emmental / tests / utils / test_utils.py View on Github external
"""Unit test of str2bool."""
    caplog.set_level(logging.INFO)

    assert str2bool("Yes") is True
    assert str2bool("YeS") is True
    assert str2bool("TRUE") is True
    assert str2bool("True") is True
    assert str2bool("T") is True
    assert str2bool("Y") is True
    assert str2bool("1") is True

    assert str2bool("N") is False
    assert str2bool("No") is False
    assert str2bool("False") is False
    assert str2bool("n") is False
    assert str2bool("f") is False
    assert str2bool("0") is False
github SenWu / emmental / tests / utils / test_utils.py View on Github external
def test_str2bool(caplog):
    """Unit test of str2bool."""
    caplog.set_level(logging.INFO)

    assert str2bool("Yes") is True
    assert str2bool("YeS") is True
    assert str2bool("TRUE") is True
    assert str2bool("True") is True
    assert str2bool("T") is True
    assert str2bool("Y") is True
    assert str2bool("1") is True

    assert str2bool("N") is False
    assert str2bool("No") is False
    assert str2bool("False") is False
    assert str2bool("n") is False
    assert str2bool("f") is False
    assert str2bool("0") is False
github SenWu / emmental / tests / utils / test_utils.py View on Github external
def test_str2bool(caplog):
    """Unit test of str2bool."""
    caplog.set_level(logging.INFO)

    assert str2bool("Yes") is True
    assert str2bool("YeS") is True
    assert str2bool("TRUE") is True
    assert str2bool("True") is True
    assert str2bool("T") is True
    assert str2bool("Y") is True
    assert str2bool("1") is True

    assert str2bool("N") is False
    assert str2bool("No") is False
    assert str2bool("False") is False
    assert str2bool("n") is False
    assert str2bool("f") is False
    assert str2bool("0") is False
github SenWu / emmental / tests / utils / test_utils.py View on Github external
caplog.set_level(logging.INFO)

    assert str2bool("Yes") is True
    assert str2bool("YeS") is True
    assert str2bool("TRUE") is True
    assert str2bool("True") is True
    assert str2bool("T") is True
    assert str2bool("Y") is True
    assert str2bool("1") is True

    assert str2bool("N") is False
    assert str2bool("No") is False
    assert str2bool("False") is False
    assert str2bool("n") is False
    assert str2bool("f") is False
    assert str2bool("0") is False
github SenWu / emmental / tests / utils / test_utils.py View on Github external
def test_str2bool(caplog):
    """Unit test of str2bool."""
    caplog.set_level(logging.INFO)

    assert str2bool("Yes") is True
    assert str2bool("YeS") is True
    assert str2bool("TRUE") is True
    assert str2bool("True") is True
    assert str2bool("T") is True
    assert str2bool("Y") is True
    assert str2bool("1") is True

    assert str2bool("N") is False
    assert str2bool("No") is False
    assert str2bool("False") is False
    assert str2bool("n") is False
    assert str2bool("f") is False
    assert str2bool("0") is False