def enforce_types(key, val):
 non_string_params = {'ssl_verify': bool, 'insecure_auth': bool, 'env_whitelist': 'stringlist', 'env_blacklist': 'stringlist', 'gitfs_env_whitelist': 'stringlist', 'gitfs_env_blacklist': 'stringlist'}
 if (key not in non_string_params):
  return six.text_type(val)
 else:
  expected = non_string_params[key]
  if (expected is bool):
   return val
  elif (expected == 'stringlist'):
   if (not isinstance(val, (six.string_types, list))):
    val = six.text_type(val)
   if isinstance(val, six.string_types):
    return [x.strip() for x in val.split(',')]
   return [six.text_type(x) for x in val]

def enforce_types ( key , val ) : non_string_params = { 'ssl_verify' : bool , 'insecure_auth' : bool , 'env_whitelist' : 'stringlist' , 'env_blacklist' : 'stringlist' , 'gitfs_env_whitelist' : 'stringlist' , 'gitfs_env_blacklist' : 'stringlist' } if ( key not in non_string_params ) : return six . text_type ( val ) else : expected = non_string_params [ key ] if ( expected is bool ) : return val elif ( expected == 'stringlist' ) : if ( not isinstance ( val , ( six . string_types , list ) ) ) : val = six . text_type ( val ) if isinstance ( val , six . string_types ) : return [ x . strip ( ) for x in val . split ( ',' ) ] return [ six . text_type ( x ) for x in val ]
force params to be strings unless they should remain a different type .