def get_unicode_index(symbol, math=True):
 if (not math):
  return ord(symbol)
 if (symbol == u'-'):
  return 8722
 try:
  return ord(symbol)
 except TypeError:
  pass
 try:
  return tex2uni[symbol.strip(u'\\')]
 except KeyError:
  message = (u"'%(symbol)s' is not a valid Unicode character or\nTeX/Type1 symbol" % locals())
  raise ValueError(message)

def get_unicode_index ( symbol , math = True ) : if ( not math ) : return ord ( symbol ) if ( symbol == u'-' ) : return 8722 try : return ord ( symbol ) except TypeError : pass try : return tex2uni [ symbol . strip ( u'\\' ) ] except KeyError : message = ( u"'%(symbol)s' is not a valid Unicode character or\nTeX/Type1 symbol" % locals ( ) ) raise ValueError ( message )
get_unicode_index -> integer return the integer index of symbol .