def _read_valuation_line(s):
 pieces = _VAL_SPLIT_RE.split(s)
 symbol = pieces[0]
 value = pieces[1]
 if value.startswith(u'{'):
  value = value[1:(-1)]
  tuple_strings = _TUPLES_RE.findall(value)
  if tuple_strings:
   set_elements = []
   for ts in tuple_strings:
    ts = ts[1:(-1)]
    element = tuple(_ELEMENT_SPLIT_RE.split(ts))
    set_elements.append(element)
  else:
   set_elements = _ELEMENT_SPLIT_RE.split(value)
  value = set(set_elements)
 return (symbol, value)

def _read_valuation_line ( s ) : pieces = _VAL_SPLIT_RE . split ( s ) symbol = pieces [ 0 ] value = pieces [ 1 ] if value . startswith ( u'{' ) : value = value [ 1 : ( - 1 ) ] tuple_strings = _TUPLES_RE . findall ( value ) if tuple_strings : set_elements = [ ] for ts in tuple_strings : ts = ts [ 1 : ( - 1 ) ] element = tuple ( _ELEMENT_SPLIT_RE . split ( ts ) ) set_elements . append ( element ) else : set_elements = _ELEMENT_SPLIT_RE . split ( value ) value = set ( set_elements ) return ( symbol , value )
read a line in a valuation file .