def _strtobool(val):
val = val.lower()<EOL>if val in ("<STR_LIT:y>", "<STR_LIT:yes>", "<STR_LIT:t>", "<STR_LIT:true>", "<STR_LIT>", "<STR_LIT:1>"):<EOL><INDENT>return <NUM_LIT:1><EOL><DEDENT>elif val in ("<STR_LIT:n>", "<STR_LIT>", "<STR_LIT:f>", "<STR_LIT:false>", "<STR_LIT>", "<STR_LIT:0>"):<EOL><INDENT>return <NUM_LIT:0><EOL><DEDENT>else:<EOL><INDENT>raise ValueError("<STR_LIT>" % (val,))<EOL><DEDENT>
Convert a string representation of truth to true (1) or false (0).

    True values are 'y', 'yes', 't', 'true', 'on', and '1'; false values
    are 'n', 'no', 'f', 'false', 'off', and '0'.  Raises ValueError if
    'val' is anything else.

    .. note:: copied from distutils.util