def parse_config_string(config_string, issue_warnings=True):
 config_dict = {}
 my_splitter = shlex.shlex(config_string, posix=True)
 my_splitter.whitespace = ','
 my_splitter.whitespace_split = True
 for kv_pair in my_splitter:
  kv_pair = kv_pair.strip()
  if (not kv_pair):
   continue
  kv_tuple = kv_pair.split('=', 1)
  if (len(kv_tuple) == 1):
   if issue_warnings:
    TheanoConfigWarning.warn(("Config key '%s' has no value, ignoring it" % kv_tuple[0]), stacklevel=1)
  else:
   (k, v) = kv_tuple
   config_dict[k] = v
 return config_dict

def parse_config_string ( config_string , issue_warnings = True ) : config_dict = { } my_splitter = shlex . shlex ( config_string , posix = True ) my_splitter . whitespace = ',' my_splitter . whitespace_split = True for kv_pair in my_splitter : kv_pair = kv_pair . strip ( ) if ( not kv_pair ) : continue kv_tuple = kv_pair . split ( '=' , 1 ) if ( len ( kv_tuple ) == 1 ) : if issue_warnings : TheanoConfigWarning . warn ( ( "Config key '%s' has no value, ignoring it" % kv_tuple [ 0 ] ) , stacklevel = 1 ) else : ( k , v ) = kv_tuple config_dict [ k ] = v return config_dict
parses a config string into a dict .