def _name(expr):
 if (expr in name_dict):
  return name_dict[expr]
 result = base = (expr._name or '_')
 if (result in seen_names):
  for i in itertools.count(1):
   result = ('%s_%d' % (base, i))
   if (result not in seen_names):
    break
 seen_names.add(result)
 name_dict[expr] = result
 return result

def _name ( expr ) : if ( expr in name_dict ) : return name_dict [ expr ] result = base = ( expr . _name or '_' ) if ( result in seen_names ) : for i in itertools . count ( 1 ) : result = ( '%s_%d' % ( base , i ) ) if ( result not in seen_names ) : break seen_names . add ( result ) name_dict [ expr ] = result return result
a unique and deterministic name for an expression .