def env_to_bool(input):
 if isinstance(input, str):
  if (input == 'False'):
   return False
  else:
   return True
 else:
  return input

def env_to_bool ( input ) : if isinstance ( input , str ) : if ( input == 'False' ) : return False else : return True else : return input
must change string from environment variable into boolean defaults to true .