def int_from_bool_as_string(subject):
    return bool_from_string(subject) and 1 or 0
Interpret a string as a boolean and return either 1 or 0.
dataset/ETHPy150Open openstack/python-rackclient/rackclient/openstack/common/strutils.py/int_from_bool_as_string