def parse_boolean_envvar(val):
if not val or val.lower() in {'<STR_LIT:false>', '<STR_LIT:0>'}:<EOL><INDENT>return False<EOL><DEDENT>elif val.lower() in {'<STR_LIT:true>', '<STR_LIT:1>'}:<EOL><INDENT>return True<EOL><DEDENT>else:<EOL><INDENT>raise ValueError('<STR_LIT>' % val)<EOL><DEDENT>
Parse a boolean environment variable.