def bool_from_string(subject, strict=False):
    if not isinstance(subject, six.string_types):
        subject = str(subject)

    lowered = subject.strip().lower()

    if lowered in TRUE_STRINGS:
        return True
    elif lowered in FALSE_STRINGS:
        return False
    elif strict:
        acceptable = ', '.join(
            "'%s'" % s for s in sorted(TRUE_STRINGS + FALSE_STRINGS))
        msg = _("Unrecognized value '%(val)s', acceptable values are:"
                " %(acceptable)s") % {'val': subject,
                                      'acceptable': acceptable}
        raise ValueError(msg)
    else:
        return False
If not already set, creates self.username and self.password,
dataset/ETHPy150Open openstack/python-monascaclient/monascaclient/openstack/common/strutils.py/bool_from_string--crossover with--dataset/ETHPy150Open rapidsms/rapidsms/rapidsms/tests/harness/base.py/LoginMixin.login