def parse_boolean_envvar(val):
 if ((not val) or (val.lower() in {'false', '0'})):
  return False
 elif (val.lower() in {'true', '1'}):
  return True
 else:
  raise ValueError(('Invalid boolean environment variable: %s' % val))

def parse_boolean_envvar ( val ) : if ( ( not val ) or ( val . lower ( ) in { 'false' , '0' } ) ) : return False elif ( val . lower ( ) in { 'true' , '1' } ) : return True else : raise ValueError ( ( 'Invalid boolean environment variable: %s' % val ) )
parse a boolean environment variable .