def sbool(s):
 if isinstance(s, str):
  return (s.lower() in ['true', '1', 't', 'y', 'yes', 'yeah', 'yup', 'certainly', 'uh-huh'])
 else:
  return bool(s)

def sbool ( s ) : if isinstance ( s , str ) : return ( s . lower ( ) in [ 'true' , '1' , 't' , 'y' , 'yes' , 'yeah' , 'yup' , 'certainly' , 'uh-huh' ] ) else : return bool ( s )
convert a string that is probably supposed to be a boolean value into an actual bool type .