def str2tuple(s, sep='/'):
 loc = s.rfind(sep)
 if (loc >= 0):
  return (s[:loc], s[(loc + len(sep)):].upper())
 else:
  return (s, None)

def str2tuple ( s , sep = '/' ) : loc = s . rfind ( sep ) if ( loc >= 0 ) : return ( s [ : loc ] , s [ ( loc + len ( sep ) ) : ] . upper ( ) ) else : return ( s , None )
given the string representation of a tagged token .