compat.py 95 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165
  1. # coding: utf-8
  2. from __future__ import unicode_literals
  3. import base64
  4. import binascii
  5. import collections
  6. import ctypes
  7. import email
  8. import getpass
  9. import io
  10. import itertools
  11. import optparse
  12. import os
  13. import platform
  14. import re
  15. import shlex
  16. import shutil
  17. import socket
  18. import struct
  19. import subprocess
  20. import sys
  21. import xml.etree.ElementTree
  22. # deal with critical unicode/str things first
  23. try:
  24. # Python 2
  25. compat_str, compat_basestring, compat_chr = (
  26. unicode, basestring, unichr
  27. )
  28. from .casefold import casefold as compat_casefold
  29. except NameError:
  30. compat_str, compat_basestring, compat_chr = (
  31. str, str, chr
  32. )
  33. compat_casefold = lambda s: s.casefold()
  34. try:
  35. import collections.abc as compat_collections_abc
  36. except ImportError:
  37. import collections as compat_collections_abc
  38. try:
  39. import urllib.request as compat_urllib_request
  40. except ImportError: # Python 2
  41. import urllib2 as compat_urllib_request
  42. try:
  43. import urllib.error as compat_urllib_error
  44. except ImportError: # Python 2
  45. import urllib2 as compat_urllib_error
  46. try:
  47. import urllib.parse as compat_urllib_parse
  48. except ImportError: # Python 2
  49. import urllib as compat_urllib_parse
  50. try:
  51. from urllib.parse import urlparse as compat_urllib_parse_urlparse
  52. except ImportError: # Python 2
  53. from urlparse import urlparse as compat_urllib_parse_urlparse
  54. try:
  55. import urllib.parse as compat_urlparse
  56. except ImportError: # Python 2
  57. import urlparse as compat_urlparse
  58. try:
  59. import urllib.response as compat_urllib_response
  60. except ImportError: # Python 2
  61. import urllib as compat_urllib_response
  62. try:
  63. import http.cookiejar as compat_cookiejar
  64. except ImportError: # Python 2
  65. import cookielib as compat_cookiejar
  66. if sys.version_info[0] == 2:
  67. class compat_cookiejar_Cookie(compat_cookiejar.Cookie):
  68. def __init__(self, version, name, value, *args, **kwargs):
  69. if isinstance(name, compat_str):
  70. name = name.encode()
  71. if isinstance(value, compat_str):
  72. value = value.encode()
  73. compat_cookiejar.Cookie.__init__(self, version, name, value, *args, **kwargs)
  74. else:
  75. compat_cookiejar_Cookie = compat_cookiejar.Cookie
  76. try:
  77. import http.cookies as compat_cookies
  78. except ImportError: # Python 2
  79. import Cookie as compat_cookies
  80. if sys.version_info[0] == 2:
  81. class compat_cookies_SimpleCookie(compat_cookies.SimpleCookie):
  82. def load(self, rawdata):
  83. if isinstance(rawdata, compat_str):
  84. rawdata = str(rawdata)
  85. return super(compat_cookies_SimpleCookie, self).load(rawdata)
  86. else:
  87. compat_cookies_SimpleCookie = compat_cookies.SimpleCookie
  88. try:
  89. import html.entities as compat_html_entities
  90. except ImportError: # Python 2
  91. import htmlentitydefs as compat_html_entities
  92. try: # Python >= 3.3
  93. compat_html_entities_html5 = compat_html_entities.html5
  94. except AttributeError:
  95. # Copied from CPython 3.5.1 html/entities.py
  96. compat_html_entities_html5 = {
  97. 'Aacute': '\xc1',
  98. 'aacute': '\xe1',
  99. 'Aacute;': '\xc1',
  100. 'aacute;': '\xe1',
  101. 'Abreve;': '\u0102',
  102. 'abreve;': '\u0103',
  103. 'ac;': '\u223e',
  104. 'acd;': '\u223f',
  105. 'acE;': '\u223e\u0333',
  106. 'Acirc': '\xc2',
  107. 'acirc': '\xe2',
  108. 'Acirc;': '\xc2',
  109. 'acirc;': '\xe2',
  110. 'acute': '\xb4',
  111. 'acute;': '\xb4',
  112. 'Acy;': '\u0410',
  113. 'acy;': '\u0430',
  114. 'AElig': '\xc6',
  115. 'aelig': '\xe6',
  116. 'AElig;': '\xc6',
  117. 'aelig;': '\xe6',
  118. 'af;': '\u2061',
  119. 'Afr;': '\U0001d504',
  120. 'afr;': '\U0001d51e',
  121. 'Agrave': '\xc0',
  122. 'agrave': '\xe0',
  123. 'Agrave;': '\xc0',
  124. 'agrave;': '\xe0',
  125. 'alefsym;': '\u2135',
  126. 'aleph;': '\u2135',
  127. 'Alpha;': '\u0391',
  128. 'alpha;': '\u03b1',
  129. 'Amacr;': '\u0100',
  130. 'amacr;': '\u0101',
  131. 'amalg;': '\u2a3f',
  132. 'AMP': '&',
  133. 'amp': '&',
  134. 'AMP;': '&',
  135. 'amp;': '&',
  136. 'And;': '\u2a53',
  137. 'and;': '\u2227',
  138. 'andand;': '\u2a55',
  139. 'andd;': '\u2a5c',
  140. 'andslope;': '\u2a58',
  141. 'andv;': '\u2a5a',
  142. 'ang;': '\u2220',
  143. 'ange;': '\u29a4',
  144. 'angle;': '\u2220',
  145. 'angmsd;': '\u2221',
  146. 'angmsdaa;': '\u29a8',
  147. 'angmsdab;': '\u29a9',
  148. 'angmsdac;': '\u29aa',
  149. 'angmsdad;': '\u29ab',
  150. 'angmsdae;': '\u29ac',
  151. 'angmsdaf;': '\u29ad',
  152. 'angmsdag;': '\u29ae',
  153. 'angmsdah;': '\u29af',
  154. 'angrt;': '\u221f',
  155. 'angrtvb;': '\u22be',
  156. 'angrtvbd;': '\u299d',
  157. 'angsph;': '\u2222',
  158. 'angst;': '\xc5',
  159. 'angzarr;': '\u237c',
  160. 'Aogon;': '\u0104',
  161. 'aogon;': '\u0105',
  162. 'Aopf;': '\U0001d538',
  163. 'aopf;': '\U0001d552',
  164. 'ap;': '\u2248',
  165. 'apacir;': '\u2a6f',
  166. 'apE;': '\u2a70',
  167. 'ape;': '\u224a',
  168. 'apid;': '\u224b',
  169. 'apos;': "'",
  170. 'ApplyFunction;': '\u2061',
  171. 'approx;': '\u2248',
  172. 'approxeq;': '\u224a',
  173. 'Aring': '\xc5',
  174. 'aring': '\xe5',
  175. 'Aring;': '\xc5',
  176. 'aring;': '\xe5',
  177. 'Ascr;': '\U0001d49c',
  178. 'ascr;': '\U0001d4b6',
  179. 'Assign;': '\u2254',
  180. 'ast;': '*',
  181. 'asymp;': '\u2248',
  182. 'asympeq;': '\u224d',
  183. 'Atilde': '\xc3',
  184. 'atilde': '\xe3',
  185. 'Atilde;': '\xc3',
  186. 'atilde;': '\xe3',
  187. 'Auml': '\xc4',
  188. 'auml': '\xe4',
  189. 'Auml;': '\xc4',
  190. 'auml;': '\xe4',
  191. 'awconint;': '\u2233',
  192. 'awint;': '\u2a11',
  193. 'backcong;': '\u224c',
  194. 'backepsilon;': '\u03f6',
  195. 'backprime;': '\u2035',
  196. 'backsim;': '\u223d',
  197. 'backsimeq;': '\u22cd',
  198. 'Backslash;': '\u2216',
  199. 'Barv;': '\u2ae7',
  200. 'barvee;': '\u22bd',
  201. 'Barwed;': '\u2306',
  202. 'barwed;': '\u2305',
  203. 'barwedge;': '\u2305',
  204. 'bbrk;': '\u23b5',
  205. 'bbrktbrk;': '\u23b6',
  206. 'bcong;': '\u224c',
  207. 'Bcy;': '\u0411',
  208. 'bcy;': '\u0431',
  209. 'bdquo;': '\u201e',
  210. 'becaus;': '\u2235',
  211. 'Because;': '\u2235',
  212. 'because;': '\u2235',
  213. 'bemptyv;': '\u29b0',
  214. 'bepsi;': '\u03f6',
  215. 'bernou;': '\u212c',
  216. 'Bernoullis;': '\u212c',
  217. 'Beta;': '\u0392',
  218. 'beta;': '\u03b2',
  219. 'beth;': '\u2136',
  220. 'between;': '\u226c',
  221. 'Bfr;': '\U0001d505',
  222. 'bfr;': '\U0001d51f',
  223. 'bigcap;': '\u22c2',
  224. 'bigcirc;': '\u25ef',
  225. 'bigcup;': '\u22c3',
  226. 'bigodot;': '\u2a00',
  227. 'bigoplus;': '\u2a01',
  228. 'bigotimes;': '\u2a02',
  229. 'bigsqcup;': '\u2a06',
  230. 'bigstar;': '\u2605',
  231. 'bigtriangledown;': '\u25bd',
  232. 'bigtriangleup;': '\u25b3',
  233. 'biguplus;': '\u2a04',
  234. 'bigvee;': '\u22c1',
  235. 'bigwedge;': '\u22c0',
  236. 'bkarow;': '\u290d',
  237. 'blacklozenge;': '\u29eb',
  238. 'blacksquare;': '\u25aa',
  239. 'blacktriangle;': '\u25b4',
  240. 'blacktriangledown;': '\u25be',
  241. 'blacktriangleleft;': '\u25c2',
  242. 'blacktriangleright;': '\u25b8',
  243. 'blank;': '\u2423',
  244. 'blk12;': '\u2592',
  245. 'blk14;': '\u2591',
  246. 'blk34;': '\u2593',
  247. 'block;': '\u2588',
  248. 'bne;': '=\u20e5',
  249. 'bnequiv;': '\u2261\u20e5',
  250. 'bNot;': '\u2aed',
  251. 'bnot;': '\u2310',
  252. 'Bopf;': '\U0001d539',
  253. 'bopf;': '\U0001d553',
  254. 'bot;': '\u22a5',
  255. 'bottom;': '\u22a5',
  256. 'bowtie;': '\u22c8',
  257. 'boxbox;': '\u29c9',
  258. 'boxDL;': '\u2557',
  259. 'boxDl;': '\u2556',
  260. 'boxdL;': '\u2555',
  261. 'boxdl;': '\u2510',
  262. 'boxDR;': '\u2554',
  263. 'boxDr;': '\u2553',
  264. 'boxdR;': '\u2552',
  265. 'boxdr;': '\u250c',
  266. 'boxH;': '\u2550',
  267. 'boxh;': '\u2500',
  268. 'boxHD;': '\u2566',
  269. 'boxHd;': '\u2564',
  270. 'boxhD;': '\u2565',
  271. 'boxhd;': '\u252c',
  272. 'boxHU;': '\u2569',
  273. 'boxHu;': '\u2567',
  274. 'boxhU;': '\u2568',
  275. 'boxhu;': '\u2534',
  276. 'boxminus;': '\u229f',
  277. 'boxplus;': '\u229e',
  278. 'boxtimes;': '\u22a0',
  279. 'boxUL;': '\u255d',
  280. 'boxUl;': '\u255c',
  281. 'boxuL;': '\u255b',
  282. 'boxul;': '\u2518',
  283. 'boxUR;': '\u255a',
  284. 'boxUr;': '\u2559',
  285. 'boxuR;': '\u2558',
  286. 'boxur;': '\u2514',
  287. 'boxV;': '\u2551',
  288. 'boxv;': '\u2502',
  289. 'boxVH;': '\u256c',
  290. 'boxVh;': '\u256b',
  291. 'boxvH;': '\u256a',
  292. 'boxvh;': '\u253c',
  293. 'boxVL;': '\u2563',
  294. 'boxVl;': '\u2562',
  295. 'boxvL;': '\u2561',
  296. 'boxvl;': '\u2524',
  297. 'boxVR;': '\u2560',
  298. 'boxVr;': '\u255f',
  299. 'boxvR;': '\u255e',
  300. 'boxvr;': '\u251c',
  301. 'bprime;': '\u2035',
  302. 'Breve;': '\u02d8',
  303. 'breve;': '\u02d8',
  304. 'brvbar': '\xa6',
  305. 'brvbar;': '\xa6',
  306. 'Bscr;': '\u212c',
  307. 'bscr;': '\U0001d4b7',
  308. 'bsemi;': '\u204f',
  309. 'bsim;': '\u223d',
  310. 'bsime;': '\u22cd',
  311. 'bsol;': '\\',
  312. 'bsolb;': '\u29c5',
  313. 'bsolhsub;': '\u27c8',
  314. 'bull;': '\u2022',
  315. 'bullet;': '\u2022',
  316. 'bump;': '\u224e',
  317. 'bumpE;': '\u2aae',
  318. 'bumpe;': '\u224f',
  319. 'Bumpeq;': '\u224e',
  320. 'bumpeq;': '\u224f',
  321. 'Cacute;': '\u0106',
  322. 'cacute;': '\u0107',
  323. 'Cap;': '\u22d2',
  324. 'cap;': '\u2229',
  325. 'capand;': '\u2a44',
  326. 'capbrcup;': '\u2a49',
  327. 'capcap;': '\u2a4b',
  328. 'capcup;': '\u2a47',
  329. 'capdot;': '\u2a40',
  330. 'CapitalDifferentialD;': '\u2145',
  331. 'caps;': '\u2229\ufe00',
  332. 'caret;': '\u2041',
  333. 'caron;': '\u02c7',
  334. 'Cayleys;': '\u212d',
  335. 'ccaps;': '\u2a4d',
  336. 'Ccaron;': '\u010c',
  337. 'ccaron;': '\u010d',
  338. 'Ccedil': '\xc7',
  339. 'ccedil': '\xe7',
  340. 'Ccedil;': '\xc7',
  341. 'ccedil;': '\xe7',
  342. 'Ccirc;': '\u0108',
  343. 'ccirc;': '\u0109',
  344. 'Cconint;': '\u2230',
  345. 'ccups;': '\u2a4c',
  346. 'ccupssm;': '\u2a50',
  347. 'Cdot;': '\u010a',
  348. 'cdot;': '\u010b',
  349. 'cedil': '\xb8',
  350. 'cedil;': '\xb8',
  351. 'Cedilla;': '\xb8',
  352. 'cemptyv;': '\u29b2',
  353. 'cent': '\xa2',
  354. 'cent;': '\xa2',
  355. 'CenterDot;': '\xb7',
  356. 'centerdot;': '\xb7',
  357. 'Cfr;': '\u212d',
  358. 'cfr;': '\U0001d520',
  359. 'CHcy;': '\u0427',
  360. 'chcy;': '\u0447',
  361. 'check;': '\u2713',
  362. 'checkmark;': '\u2713',
  363. 'Chi;': '\u03a7',
  364. 'chi;': '\u03c7',
  365. 'cir;': '\u25cb',
  366. 'circ;': '\u02c6',
  367. 'circeq;': '\u2257',
  368. 'circlearrowleft;': '\u21ba',
  369. 'circlearrowright;': '\u21bb',
  370. 'circledast;': '\u229b',
  371. 'circledcirc;': '\u229a',
  372. 'circleddash;': '\u229d',
  373. 'CircleDot;': '\u2299',
  374. 'circledR;': '\xae',
  375. 'circledS;': '\u24c8',
  376. 'CircleMinus;': '\u2296',
  377. 'CirclePlus;': '\u2295',
  378. 'CircleTimes;': '\u2297',
  379. 'cirE;': '\u29c3',
  380. 'cire;': '\u2257',
  381. 'cirfnint;': '\u2a10',
  382. 'cirmid;': '\u2aef',
  383. 'cirscir;': '\u29c2',
  384. 'ClockwiseContourIntegral;': '\u2232',
  385. 'CloseCurlyDoubleQuote;': '\u201d',
  386. 'CloseCurlyQuote;': '\u2019',
  387. 'clubs;': '\u2663',
  388. 'clubsuit;': '\u2663',
  389. 'Colon;': '\u2237',
  390. 'colon;': ':',
  391. 'Colone;': '\u2a74',
  392. 'colone;': '\u2254',
  393. 'coloneq;': '\u2254',
  394. 'comma;': ',',
  395. 'commat;': '@',
  396. 'comp;': '\u2201',
  397. 'compfn;': '\u2218',
  398. 'complement;': '\u2201',
  399. 'complexes;': '\u2102',
  400. 'cong;': '\u2245',
  401. 'congdot;': '\u2a6d',
  402. 'Congruent;': '\u2261',
  403. 'Conint;': '\u222f',
  404. 'conint;': '\u222e',
  405. 'ContourIntegral;': '\u222e',
  406. 'Copf;': '\u2102',
  407. 'copf;': '\U0001d554',
  408. 'coprod;': '\u2210',
  409. 'Coproduct;': '\u2210',
  410. 'COPY': '\xa9',
  411. 'copy': '\xa9',
  412. 'COPY;': '\xa9',
  413. 'copy;': '\xa9',
  414. 'copysr;': '\u2117',
  415. 'CounterClockwiseContourIntegral;': '\u2233',
  416. 'crarr;': '\u21b5',
  417. 'Cross;': '\u2a2f',
  418. 'cross;': '\u2717',
  419. 'Cscr;': '\U0001d49e',
  420. 'cscr;': '\U0001d4b8',
  421. 'csub;': '\u2acf',
  422. 'csube;': '\u2ad1',
  423. 'csup;': '\u2ad0',
  424. 'csupe;': '\u2ad2',
  425. 'ctdot;': '\u22ef',
  426. 'cudarrl;': '\u2938',
  427. 'cudarrr;': '\u2935',
  428. 'cuepr;': '\u22de',
  429. 'cuesc;': '\u22df',
  430. 'cularr;': '\u21b6',
  431. 'cularrp;': '\u293d',
  432. 'Cup;': '\u22d3',
  433. 'cup;': '\u222a',
  434. 'cupbrcap;': '\u2a48',
  435. 'CupCap;': '\u224d',
  436. 'cupcap;': '\u2a46',
  437. 'cupcup;': '\u2a4a',
  438. 'cupdot;': '\u228d',
  439. 'cupor;': '\u2a45',
  440. 'cups;': '\u222a\ufe00',
  441. 'curarr;': '\u21b7',
  442. 'curarrm;': '\u293c',
  443. 'curlyeqprec;': '\u22de',
  444. 'curlyeqsucc;': '\u22df',
  445. 'curlyvee;': '\u22ce',
  446. 'curlywedge;': '\u22cf',
  447. 'curren': '\xa4',
  448. 'curren;': '\xa4',
  449. 'curvearrowleft;': '\u21b6',
  450. 'curvearrowright;': '\u21b7',
  451. 'cuvee;': '\u22ce',
  452. 'cuwed;': '\u22cf',
  453. 'cwconint;': '\u2232',
  454. 'cwint;': '\u2231',
  455. 'cylcty;': '\u232d',
  456. 'Dagger;': '\u2021',
  457. 'dagger;': '\u2020',
  458. 'daleth;': '\u2138',
  459. 'Darr;': '\u21a1',
  460. 'dArr;': '\u21d3',
  461. 'darr;': '\u2193',
  462. 'dash;': '\u2010',
  463. 'Dashv;': '\u2ae4',
  464. 'dashv;': '\u22a3',
  465. 'dbkarow;': '\u290f',
  466. 'dblac;': '\u02dd',
  467. 'Dcaron;': '\u010e',
  468. 'dcaron;': '\u010f',
  469. 'Dcy;': '\u0414',
  470. 'dcy;': '\u0434',
  471. 'DD;': '\u2145',
  472. 'dd;': '\u2146',
  473. 'ddagger;': '\u2021',
  474. 'ddarr;': '\u21ca',
  475. 'DDotrahd;': '\u2911',
  476. 'ddotseq;': '\u2a77',
  477. 'deg': '\xb0',
  478. 'deg;': '\xb0',
  479. 'Del;': '\u2207',
  480. 'Delta;': '\u0394',
  481. 'delta;': '\u03b4',
  482. 'demptyv;': '\u29b1',
  483. 'dfisht;': '\u297f',
  484. 'Dfr;': '\U0001d507',
  485. 'dfr;': '\U0001d521',
  486. 'dHar;': '\u2965',
  487. 'dharl;': '\u21c3',
  488. 'dharr;': '\u21c2',
  489. 'DiacriticalAcute;': '\xb4',
  490. 'DiacriticalDot;': '\u02d9',
  491. 'DiacriticalDoubleAcute;': '\u02dd',
  492. 'DiacriticalGrave;': '`',
  493. 'DiacriticalTilde;': '\u02dc',
  494. 'diam;': '\u22c4',
  495. 'Diamond;': '\u22c4',
  496. 'diamond;': '\u22c4',
  497. 'diamondsuit;': '\u2666',
  498. 'diams;': '\u2666',
  499. 'die;': '\xa8',
  500. 'DifferentialD;': '\u2146',
  501. 'digamma;': '\u03dd',
  502. 'disin;': '\u22f2',
  503. 'div;': '\xf7',
  504. 'divide': '\xf7',
  505. 'divide;': '\xf7',
  506. 'divideontimes;': '\u22c7',
  507. 'divonx;': '\u22c7',
  508. 'DJcy;': '\u0402',
  509. 'djcy;': '\u0452',
  510. 'dlcorn;': '\u231e',
  511. 'dlcrop;': '\u230d',
  512. 'dollar;': '$',
  513. 'Dopf;': '\U0001d53b',
  514. 'dopf;': '\U0001d555',
  515. 'Dot;': '\xa8',
  516. 'dot;': '\u02d9',
  517. 'DotDot;': '\u20dc',
  518. 'doteq;': '\u2250',
  519. 'doteqdot;': '\u2251',
  520. 'DotEqual;': '\u2250',
  521. 'dotminus;': '\u2238',
  522. 'dotplus;': '\u2214',
  523. 'dotsquare;': '\u22a1',
  524. 'doublebarwedge;': '\u2306',
  525. 'DoubleContourIntegral;': '\u222f',
  526. 'DoubleDot;': '\xa8',
  527. 'DoubleDownArrow;': '\u21d3',
  528. 'DoubleLeftArrow;': '\u21d0',
  529. 'DoubleLeftRightArrow;': '\u21d4',
  530. 'DoubleLeftTee;': '\u2ae4',
  531. 'DoubleLongLeftArrow;': '\u27f8',
  532. 'DoubleLongLeftRightArrow;': '\u27fa',
  533. 'DoubleLongRightArrow;': '\u27f9',
  534. 'DoubleRightArrow;': '\u21d2',
  535. 'DoubleRightTee;': '\u22a8',
  536. 'DoubleUpArrow;': '\u21d1',
  537. 'DoubleUpDownArrow;': '\u21d5',
  538. 'DoubleVerticalBar;': '\u2225',
  539. 'DownArrow;': '\u2193',
  540. 'Downarrow;': '\u21d3',
  541. 'downarrow;': '\u2193',
  542. 'DownArrowBar;': '\u2913',
  543. 'DownArrowUpArrow;': '\u21f5',
  544. 'DownBreve;': '\u0311',
  545. 'downdownarrows;': '\u21ca',
  546. 'downharpoonleft;': '\u21c3',
  547. 'downharpoonright;': '\u21c2',
  548. 'DownLeftRightVector;': '\u2950',
  549. 'DownLeftTeeVector;': '\u295e',
  550. 'DownLeftVector;': '\u21bd',
  551. 'DownLeftVectorBar;': '\u2956',
  552. 'DownRightTeeVector;': '\u295f',
  553. 'DownRightVector;': '\u21c1',
  554. 'DownRightVectorBar;': '\u2957',
  555. 'DownTee;': '\u22a4',
  556. 'DownTeeArrow;': '\u21a7',
  557. 'drbkarow;': '\u2910',
  558. 'drcorn;': '\u231f',
  559. 'drcrop;': '\u230c',
  560. 'Dscr;': '\U0001d49f',
  561. 'dscr;': '\U0001d4b9',
  562. 'DScy;': '\u0405',
  563. 'dscy;': '\u0455',
  564. 'dsol;': '\u29f6',
  565. 'Dstrok;': '\u0110',
  566. 'dstrok;': '\u0111',
  567. 'dtdot;': '\u22f1',
  568. 'dtri;': '\u25bf',
  569. 'dtrif;': '\u25be',
  570. 'duarr;': '\u21f5',
  571. 'duhar;': '\u296f',
  572. 'dwangle;': '\u29a6',
  573. 'DZcy;': '\u040f',
  574. 'dzcy;': '\u045f',
  575. 'dzigrarr;': '\u27ff',
  576. 'Eacute': '\xc9',
  577. 'eacute': '\xe9',
  578. 'Eacute;': '\xc9',
  579. 'eacute;': '\xe9',
  580. 'easter;': '\u2a6e',
  581. 'Ecaron;': '\u011a',
  582. 'ecaron;': '\u011b',
  583. 'ecir;': '\u2256',
  584. 'Ecirc': '\xca',
  585. 'ecirc': '\xea',
  586. 'Ecirc;': '\xca',
  587. 'ecirc;': '\xea',
  588. 'ecolon;': '\u2255',
  589. 'Ecy;': '\u042d',
  590. 'ecy;': '\u044d',
  591. 'eDDot;': '\u2a77',
  592. 'Edot;': '\u0116',
  593. 'eDot;': '\u2251',
  594. 'edot;': '\u0117',
  595. 'ee;': '\u2147',
  596. 'efDot;': '\u2252',
  597. 'Efr;': '\U0001d508',
  598. 'efr;': '\U0001d522',
  599. 'eg;': '\u2a9a',
  600. 'Egrave': '\xc8',
  601. 'egrave': '\xe8',
  602. 'Egrave;': '\xc8',
  603. 'egrave;': '\xe8',
  604. 'egs;': '\u2a96',
  605. 'egsdot;': '\u2a98',
  606. 'el;': '\u2a99',
  607. 'Element;': '\u2208',
  608. 'elinters;': '\u23e7',
  609. 'ell;': '\u2113',
  610. 'els;': '\u2a95',
  611. 'elsdot;': '\u2a97',
  612. 'Emacr;': '\u0112',
  613. 'emacr;': '\u0113',
  614. 'empty;': '\u2205',
  615. 'emptyset;': '\u2205',
  616. 'EmptySmallSquare;': '\u25fb',
  617. 'emptyv;': '\u2205',
  618. 'EmptyVerySmallSquare;': '\u25ab',
  619. 'emsp13;': '\u2004',
  620. 'emsp14;': '\u2005',
  621. 'emsp;': '\u2003',
  622. 'ENG;': '\u014a',
  623. 'eng;': '\u014b',
  624. 'ensp;': '\u2002',
  625. 'Eogon;': '\u0118',
  626. 'eogon;': '\u0119',
  627. 'Eopf;': '\U0001d53c',
  628. 'eopf;': '\U0001d556',
  629. 'epar;': '\u22d5',
  630. 'eparsl;': '\u29e3',
  631. 'eplus;': '\u2a71',
  632. 'epsi;': '\u03b5',
  633. 'Epsilon;': '\u0395',
  634. 'epsilon;': '\u03b5',
  635. 'epsiv;': '\u03f5',
  636. 'eqcirc;': '\u2256',
  637. 'eqcolon;': '\u2255',
  638. 'eqsim;': '\u2242',
  639. 'eqslantgtr;': '\u2a96',
  640. 'eqslantless;': '\u2a95',
  641. 'Equal;': '\u2a75',
  642. 'equals;': '=',
  643. 'EqualTilde;': '\u2242',
  644. 'equest;': '\u225f',
  645. 'Equilibrium;': '\u21cc',
  646. 'equiv;': '\u2261',
  647. 'equivDD;': '\u2a78',
  648. 'eqvparsl;': '\u29e5',
  649. 'erarr;': '\u2971',
  650. 'erDot;': '\u2253',
  651. 'Escr;': '\u2130',
  652. 'escr;': '\u212f',
  653. 'esdot;': '\u2250',
  654. 'Esim;': '\u2a73',
  655. 'esim;': '\u2242',
  656. 'Eta;': '\u0397',
  657. 'eta;': '\u03b7',
  658. 'ETH': '\xd0',
  659. 'eth': '\xf0',
  660. 'ETH;': '\xd0',
  661. 'eth;': '\xf0',
  662. 'Euml': '\xcb',
  663. 'euml': '\xeb',
  664. 'Euml;': '\xcb',
  665. 'euml;': '\xeb',
  666. 'euro;': '\u20ac',
  667. 'excl;': '!',
  668. 'exist;': '\u2203',
  669. 'Exists;': '\u2203',
  670. 'expectation;': '\u2130',
  671. 'ExponentialE;': '\u2147',
  672. 'exponentiale;': '\u2147',
  673. 'fallingdotseq;': '\u2252',
  674. 'Fcy;': '\u0424',
  675. 'fcy;': '\u0444',
  676. 'female;': '\u2640',
  677. 'ffilig;': '\ufb03',
  678. 'fflig;': '\ufb00',
  679. 'ffllig;': '\ufb04',
  680. 'Ffr;': '\U0001d509',
  681. 'ffr;': '\U0001d523',
  682. 'filig;': '\ufb01',
  683. 'FilledSmallSquare;': '\u25fc',
  684. 'FilledVerySmallSquare;': '\u25aa',
  685. 'fjlig;': 'fj',
  686. 'flat;': '\u266d',
  687. 'fllig;': '\ufb02',
  688. 'fltns;': '\u25b1',
  689. 'fnof;': '\u0192',
  690. 'Fopf;': '\U0001d53d',
  691. 'fopf;': '\U0001d557',
  692. 'ForAll;': '\u2200',
  693. 'forall;': '\u2200',
  694. 'fork;': '\u22d4',
  695. 'forkv;': '\u2ad9',
  696. 'Fouriertrf;': '\u2131',
  697. 'fpartint;': '\u2a0d',
  698. 'frac12': '\xbd',
  699. 'frac12;': '\xbd',
  700. 'frac13;': '\u2153',
  701. 'frac14': '\xbc',
  702. 'frac14;': '\xbc',
  703. 'frac15;': '\u2155',
  704. 'frac16;': '\u2159',
  705. 'frac18;': '\u215b',
  706. 'frac23;': '\u2154',
  707. 'frac25;': '\u2156',
  708. 'frac34': '\xbe',
  709. 'frac34;': '\xbe',
  710. 'frac35;': '\u2157',
  711. 'frac38;': '\u215c',
  712. 'frac45;': '\u2158',
  713. 'frac56;': '\u215a',
  714. 'frac58;': '\u215d',
  715. 'frac78;': '\u215e',
  716. 'frasl;': '\u2044',
  717. 'frown;': '\u2322',
  718. 'Fscr;': '\u2131',
  719. 'fscr;': '\U0001d4bb',
  720. 'gacute;': '\u01f5',
  721. 'Gamma;': '\u0393',
  722. 'gamma;': '\u03b3',
  723. 'Gammad;': '\u03dc',
  724. 'gammad;': '\u03dd',
  725. 'gap;': '\u2a86',
  726. 'Gbreve;': '\u011e',
  727. 'gbreve;': '\u011f',
  728. 'Gcedil;': '\u0122',
  729. 'Gcirc;': '\u011c',
  730. 'gcirc;': '\u011d',
  731. 'Gcy;': '\u0413',
  732. 'gcy;': '\u0433',
  733. 'Gdot;': '\u0120',
  734. 'gdot;': '\u0121',
  735. 'gE;': '\u2267',
  736. 'ge;': '\u2265',
  737. 'gEl;': '\u2a8c',
  738. 'gel;': '\u22db',
  739. 'geq;': '\u2265',
  740. 'geqq;': '\u2267',
  741. 'geqslant;': '\u2a7e',
  742. 'ges;': '\u2a7e',
  743. 'gescc;': '\u2aa9',
  744. 'gesdot;': '\u2a80',
  745. 'gesdoto;': '\u2a82',
  746. 'gesdotol;': '\u2a84',
  747. 'gesl;': '\u22db\ufe00',
  748. 'gesles;': '\u2a94',
  749. 'Gfr;': '\U0001d50a',
  750. 'gfr;': '\U0001d524',
  751. 'Gg;': '\u22d9',
  752. 'gg;': '\u226b',
  753. 'ggg;': '\u22d9',
  754. 'gimel;': '\u2137',
  755. 'GJcy;': '\u0403',
  756. 'gjcy;': '\u0453',
  757. 'gl;': '\u2277',
  758. 'gla;': '\u2aa5',
  759. 'glE;': '\u2a92',
  760. 'glj;': '\u2aa4',
  761. 'gnap;': '\u2a8a',
  762. 'gnapprox;': '\u2a8a',
  763. 'gnE;': '\u2269',
  764. 'gne;': '\u2a88',
  765. 'gneq;': '\u2a88',
  766. 'gneqq;': '\u2269',
  767. 'gnsim;': '\u22e7',
  768. 'Gopf;': '\U0001d53e',
  769. 'gopf;': '\U0001d558',
  770. 'grave;': '`',
  771. 'GreaterEqual;': '\u2265',
  772. 'GreaterEqualLess;': '\u22db',
  773. 'GreaterFullEqual;': '\u2267',
  774. 'GreaterGreater;': '\u2aa2',
  775. 'GreaterLess;': '\u2277',
  776. 'GreaterSlantEqual;': '\u2a7e',
  777. 'GreaterTilde;': '\u2273',
  778. 'Gscr;': '\U0001d4a2',
  779. 'gscr;': '\u210a',
  780. 'gsim;': '\u2273',
  781. 'gsime;': '\u2a8e',
  782. 'gsiml;': '\u2a90',
  783. 'GT': '>',
  784. 'gt': '>',
  785. 'GT;': '>',
  786. 'Gt;': '\u226b',
  787. 'gt;': '>',
  788. 'gtcc;': '\u2aa7',
  789. 'gtcir;': '\u2a7a',
  790. 'gtdot;': '\u22d7',
  791. 'gtlPar;': '\u2995',
  792. 'gtquest;': '\u2a7c',
  793. 'gtrapprox;': '\u2a86',
  794. 'gtrarr;': '\u2978',
  795. 'gtrdot;': '\u22d7',
  796. 'gtreqless;': '\u22db',
  797. 'gtreqqless;': '\u2a8c',
  798. 'gtrless;': '\u2277',
  799. 'gtrsim;': '\u2273',
  800. 'gvertneqq;': '\u2269\ufe00',
  801. 'gvnE;': '\u2269\ufe00',
  802. 'Hacek;': '\u02c7',
  803. 'hairsp;': '\u200a',
  804. 'half;': '\xbd',
  805. 'hamilt;': '\u210b',
  806. 'HARDcy;': '\u042a',
  807. 'hardcy;': '\u044a',
  808. 'hArr;': '\u21d4',
  809. 'harr;': '\u2194',
  810. 'harrcir;': '\u2948',
  811. 'harrw;': '\u21ad',
  812. 'Hat;': '^',
  813. 'hbar;': '\u210f',
  814. 'Hcirc;': '\u0124',
  815. 'hcirc;': '\u0125',
  816. 'hearts;': '\u2665',
  817. 'heartsuit;': '\u2665',
  818. 'hellip;': '\u2026',
  819. 'hercon;': '\u22b9',
  820. 'Hfr;': '\u210c',
  821. 'hfr;': '\U0001d525',
  822. 'HilbertSpace;': '\u210b',
  823. 'hksearow;': '\u2925',
  824. 'hkswarow;': '\u2926',
  825. 'hoarr;': '\u21ff',
  826. 'homtht;': '\u223b',
  827. 'hookleftarrow;': '\u21a9',
  828. 'hookrightarrow;': '\u21aa',
  829. 'Hopf;': '\u210d',
  830. 'hopf;': '\U0001d559',
  831. 'horbar;': '\u2015',
  832. 'HorizontalLine;': '\u2500',
  833. 'Hscr;': '\u210b',
  834. 'hscr;': '\U0001d4bd',
  835. 'hslash;': '\u210f',
  836. 'Hstrok;': '\u0126',
  837. 'hstrok;': '\u0127',
  838. 'HumpDownHump;': '\u224e',
  839. 'HumpEqual;': '\u224f',
  840. 'hybull;': '\u2043',
  841. 'hyphen;': '\u2010',
  842. 'Iacute': '\xcd',
  843. 'iacute': '\xed',
  844. 'Iacute;': '\xcd',
  845. 'iacute;': '\xed',
  846. 'ic;': '\u2063',
  847. 'Icirc': '\xce',
  848. 'icirc': '\xee',
  849. 'Icirc;': '\xce',
  850. 'icirc;': '\xee',
  851. 'Icy;': '\u0418',
  852. 'icy;': '\u0438',
  853. 'Idot;': '\u0130',
  854. 'IEcy;': '\u0415',
  855. 'iecy;': '\u0435',
  856. 'iexcl': '\xa1',
  857. 'iexcl;': '\xa1',
  858. 'iff;': '\u21d4',
  859. 'Ifr;': '\u2111',
  860. 'ifr;': '\U0001d526',
  861. 'Igrave': '\xcc',
  862. 'igrave': '\xec',
  863. 'Igrave;': '\xcc',
  864. 'igrave;': '\xec',
  865. 'ii;': '\u2148',
  866. 'iiiint;': '\u2a0c',
  867. 'iiint;': '\u222d',
  868. 'iinfin;': '\u29dc',
  869. 'iiota;': '\u2129',
  870. 'IJlig;': '\u0132',
  871. 'ijlig;': '\u0133',
  872. 'Im;': '\u2111',
  873. 'Imacr;': '\u012a',
  874. 'imacr;': '\u012b',
  875. 'image;': '\u2111',
  876. 'ImaginaryI;': '\u2148',
  877. 'imagline;': '\u2110',
  878. 'imagpart;': '\u2111',
  879. 'imath;': '\u0131',
  880. 'imof;': '\u22b7',
  881. 'imped;': '\u01b5',
  882. 'Implies;': '\u21d2',
  883. 'in;': '\u2208',
  884. 'incare;': '\u2105',
  885. 'infin;': '\u221e',
  886. 'infintie;': '\u29dd',
  887. 'inodot;': '\u0131',
  888. 'Int;': '\u222c',
  889. 'int;': '\u222b',
  890. 'intcal;': '\u22ba',
  891. 'integers;': '\u2124',
  892. 'Integral;': '\u222b',
  893. 'intercal;': '\u22ba',
  894. 'Intersection;': '\u22c2',
  895. 'intlarhk;': '\u2a17',
  896. 'intprod;': '\u2a3c',
  897. 'InvisibleComma;': '\u2063',
  898. 'InvisibleTimes;': '\u2062',
  899. 'IOcy;': '\u0401',
  900. 'iocy;': '\u0451',
  901. 'Iogon;': '\u012e',
  902. 'iogon;': '\u012f',
  903. 'Iopf;': '\U0001d540',
  904. 'iopf;': '\U0001d55a',
  905. 'Iota;': '\u0399',
  906. 'iota;': '\u03b9',
  907. 'iprod;': '\u2a3c',
  908. 'iquest': '\xbf',
  909. 'iquest;': '\xbf',
  910. 'Iscr;': '\u2110',
  911. 'iscr;': '\U0001d4be',
  912. 'isin;': '\u2208',
  913. 'isindot;': '\u22f5',
  914. 'isinE;': '\u22f9',
  915. 'isins;': '\u22f4',
  916. 'isinsv;': '\u22f3',
  917. 'isinv;': '\u2208',
  918. 'it;': '\u2062',
  919. 'Itilde;': '\u0128',
  920. 'itilde;': '\u0129',
  921. 'Iukcy;': '\u0406',
  922. 'iukcy;': '\u0456',
  923. 'Iuml': '\xcf',
  924. 'iuml': '\xef',
  925. 'Iuml;': '\xcf',
  926. 'iuml;': '\xef',
  927. 'Jcirc;': '\u0134',
  928. 'jcirc;': '\u0135',
  929. 'Jcy;': '\u0419',
  930. 'jcy;': '\u0439',
  931. 'Jfr;': '\U0001d50d',
  932. 'jfr;': '\U0001d527',
  933. 'jmath;': '\u0237',
  934. 'Jopf;': '\U0001d541',
  935. 'jopf;': '\U0001d55b',
  936. 'Jscr;': '\U0001d4a5',
  937. 'jscr;': '\U0001d4bf',
  938. 'Jsercy;': '\u0408',
  939. 'jsercy;': '\u0458',
  940. 'Jukcy;': '\u0404',
  941. 'jukcy;': '\u0454',
  942. 'Kappa;': '\u039a',
  943. 'kappa;': '\u03ba',
  944. 'kappav;': '\u03f0',
  945. 'Kcedil;': '\u0136',
  946. 'kcedil;': '\u0137',
  947. 'Kcy;': '\u041a',
  948. 'kcy;': '\u043a',
  949. 'Kfr;': '\U0001d50e',
  950. 'kfr;': '\U0001d528',
  951. 'kgreen;': '\u0138',
  952. 'KHcy;': '\u0425',
  953. 'khcy;': '\u0445',
  954. 'KJcy;': '\u040c',
  955. 'kjcy;': '\u045c',
  956. 'Kopf;': '\U0001d542',
  957. 'kopf;': '\U0001d55c',
  958. 'Kscr;': '\U0001d4a6',
  959. 'kscr;': '\U0001d4c0',
  960. 'lAarr;': '\u21da',
  961. 'Lacute;': '\u0139',
  962. 'lacute;': '\u013a',
  963. 'laemptyv;': '\u29b4',
  964. 'lagran;': '\u2112',
  965. 'Lambda;': '\u039b',
  966. 'lambda;': '\u03bb',
  967. 'Lang;': '\u27ea',
  968. 'lang;': '\u27e8',
  969. 'langd;': '\u2991',
  970. 'langle;': '\u27e8',
  971. 'lap;': '\u2a85',
  972. 'Laplacetrf;': '\u2112',
  973. 'laquo': '\xab',
  974. 'laquo;': '\xab',
  975. 'Larr;': '\u219e',
  976. 'lArr;': '\u21d0',
  977. 'larr;': '\u2190',
  978. 'larrb;': '\u21e4',
  979. 'larrbfs;': '\u291f',
  980. 'larrfs;': '\u291d',
  981. 'larrhk;': '\u21a9',
  982. 'larrlp;': '\u21ab',
  983. 'larrpl;': '\u2939',
  984. 'larrsim;': '\u2973',
  985. 'larrtl;': '\u21a2',
  986. 'lat;': '\u2aab',
  987. 'lAtail;': '\u291b',
  988. 'latail;': '\u2919',
  989. 'late;': '\u2aad',
  990. 'lates;': '\u2aad\ufe00',
  991. 'lBarr;': '\u290e',
  992. 'lbarr;': '\u290c',
  993. 'lbbrk;': '\u2772',
  994. 'lbrace;': '{',
  995. 'lbrack;': '[',
  996. 'lbrke;': '\u298b',
  997. 'lbrksld;': '\u298f',
  998. 'lbrkslu;': '\u298d',
  999. 'Lcaron;': '\u013d',
  1000. 'lcaron;': '\u013e',
  1001. 'Lcedil;': '\u013b',
  1002. 'lcedil;': '\u013c',
  1003. 'lceil;': '\u2308',
  1004. 'lcub;': '{',
  1005. 'Lcy;': '\u041b',
  1006. 'lcy;': '\u043b',
  1007. 'ldca;': '\u2936',
  1008. 'ldquo;': '\u201c',
  1009. 'ldquor;': '\u201e',
  1010. 'ldrdhar;': '\u2967',
  1011. 'ldrushar;': '\u294b',
  1012. 'ldsh;': '\u21b2',
  1013. 'lE;': '\u2266',
  1014. 'le;': '\u2264',
  1015. 'LeftAngleBracket;': '\u27e8',
  1016. 'LeftArrow;': '\u2190',
  1017. 'Leftarrow;': '\u21d0',
  1018. 'leftarrow;': '\u2190',
  1019. 'LeftArrowBar;': '\u21e4',
  1020. 'LeftArrowRightArrow;': '\u21c6',
  1021. 'leftarrowtail;': '\u21a2',
  1022. 'LeftCeiling;': '\u2308',
  1023. 'LeftDoubleBracket;': '\u27e6',
  1024. 'LeftDownTeeVector;': '\u2961',
  1025. 'LeftDownVector;': '\u21c3',
  1026. 'LeftDownVectorBar;': '\u2959',
  1027. 'LeftFloor;': '\u230a',
  1028. 'leftharpoondown;': '\u21bd',
  1029. 'leftharpoonup;': '\u21bc',
  1030. 'leftleftarrows;': '\u21c7',
  1031. 'LeftRightArrow;': '\u2194',
  1032. 'Leftrightarrow;': '\u21d4',
  1033. 'leftrightarrow;': '\u2194',
  1034. 'leftrightarrows;': '\u21c6',
  1035. 'leftrightharpoons;': '\u21cb',
  1036. 'leftrightsquigarrow;': '\u21ad',
  1037. 'LeftRightVector;': '\u294e',
  1038. 'LeftTee;': '\u22a3',
  1039. 'LeftTeeArrow;': '\u21a4',
  1040. 'LeftTeeVector;': '\u295a',
  1041. 'leftthreetimes;': '\u22cb',
  1042. 'LeftTriangle;': '\u22b2',
  1043. 'LeftTriangleBar;': '\u29cf',
  1044. 'LeftTriangleEqual;': '\u22b4',
  1045. 'LeftUpDownVector;': '\u2951',
  1046. 'LeftUpTeeVector;': '\u2960',
  1047. 'LeftUpVector;': '\u21bf',
  1048. 'LeftUpVectorBar;': '\u2958',
  1049. 'LeftVector;': '\u21bc',
  1050. 'LeftVectorBar;': '\u2952',
  1051. 'lEg;': '\u2a8b',
  1052. 'leg;': '\u22da',
  1053. 'leq;': '\u2264',
  1054. 'leqq;': '\u2266',
  1055. 'leqslant;': '\u2a7d',
  1056. 'les;': '\u2a7d',
  1057. 'lescc;': '\u2aa8',
  1058. 'lesdot;': '\u2a7f',
  1059. 'lesdoto;': '\u2a81',
  1060. 'lesdotor;': '\u2a83',
  1061. 'lesg;': '\u22da\ufe00',
  1062. 'lesges;': '\u2a93',
  1063. 'lessapprox;': '\u2a85',
  1064. 'lessdot;': '\u22d6',
  1065. 'lesseqgtr;': '\u22da',
  1066. 'lesseqqgtr;': '\u2a8b',
  1067. 'LessEqualGreater;': '\u22da',
  1068. 'LessFullEqual;': '\u2266',
  1069. 'LessGreater;': '\u2276',
  1070. 'lessgtr;': '\u2276',
  1071. 'LessLess;': '\u2aa1',
  1072. 'lesssim;': '\u2272',
  1073. 'LessSlantEqual;': '\u2a7d',
  1074. 'LessTilde;': '\u2272',
  1075. 'lfisht;': '\u297c',
  1076. 'lfloor;': '\u230a',
  1077. 'Lfr;': '\U0001d50f',
  1078. 'lfr;': '\U0001d529',
  1079. 'lg;': '\u2276',
  1080. 'lgE;': '\u2a91',
  1081. 'lHar;': '\u2962',
  1082. 'lhard;': '\u21bd',
  1083. 'lharu;': '\u21bc',
  1084. 'lharul;': '\u296a',
  1085. 'lhblk;': '\u2584',
  1086. 'LJcy;': '\u0409',
  1087. 'ljcy;': '\u0459',
  1088. 'Ll;': '\u22d8',
  1089. 'll;': '\u226a',
  1090. 'llarr;': '\u21c7',
  1091. 'llcorner;': '\u231e',
  1092. 'Lleftarrow;': '\u21da',
  1093. 'llhard;': '\u296b',
  1094. 'lltri;': '\u25fa',
  1095. 'Lmidot;': '\u013f',
  1096. 'lmidot;': '\u0140',
  1097. 'lmoust;': '\u23b0',
  1098. 'lmoustache;': '\u23b0',
  1099. 'lnap;': '\u2a89',
  1100. 'lnapprox;': '\u2a89',
  1101. 'lnE;': '\u2268',
  1102. 'lne;': '\u2a87',
  1103. 'lneq;': '\u2a87',
  1104. 'lneqq;': '\u2268',
  1105. 'lnsim;': '\u22e6',
  1106. 'loang;': '\u27ec',
  1107. 'loarr;': '\u21fd',
  1108. 'lobrk;': '\u27e6',
  1109. 'LongLeftArrow;': '\u27f5',
  1110. 'Longleftarrow;': '\u27f8',
  1111. 'longleftarrow;': '\u27f5',
  1112. 'LongLeftRightArrow;': '\u27f7',
  1113. 'Longleftrightarrow;': '\u27fa',
  1114. 'longleftrightarrow;': '\u27f7',
  1115. 'longmapsto;': '\u27fc',
  1116. 'LongRightArrow;': '\u27f6',
  1117. 'Longrightarrow;': '\u27f9',
  1118. 'longrightarrow;': '\u27f6',
  1119. 'looparrowleft;': '\u21ab',
  1120. 'looparrowright;': '\u21ac',
  1121. 'lopar;': '\u2985',
  1122. 'Lopf;': '\U0001d543',
  1123. 'lopf;': '\U0001d55d',
  1124. 'loplus;': '\u2a2d',
  1125. 'lotimes;': '\u2a34',
  1126. 'lowast;': '\u2217',
  1127. 'lowbar;': '_',
  1128. 'LowerLeftArrow;': '\u2199',
  1129. 'LowerRightArrow;': '\u2198',
  1130. 'loz;': '\u25ca',
  1131. 'lozenge;': '\u25ca',
  1132. 'lozf;': '\u29eb',
  1133. 'lpar;': '(',
  1134. 'lparlt;': '\u2993',
  1135. 'lrarr;': '\u21c6',
  1136. 'lrcorner;': '\u231f',
  1137. 'lrhar;': '\u21cb',
  1138. 'lrhard;': '\u296d',
  1139. 'lrm;': '\u200e',
  1140. 'lrtri;': '\u22bf',
  1141. 'lsaquo;': '\u2039',
  1142. 'Lscr;': '\u2112',
  1143. 'lscr;': '\U0001d4c1',
  1144. 'Lsh;': '\u21b0',
  1145. 'lsh;': '\u21b0',
  1146. 'lsim;': '\u2272',
  1147. 'lsime;': '\u2a8d',
  1148. 'lsimg;': '\u2a8f',
  1149. 'lsqb;': '[',
  1150. 'lsquo;': '\u2018',
  1151. 'lsquor;': '\u201a',
  1152. 'Lstrok;': '\u0141',
  1153. 'lstrok;': '\u0142',
  1154. 'LT': '<',
  1155. 'lt': '<',
  1156. 'LT;': '<',
  1157. 'Lt;': '\u226a',
  1158. 'lt;': '<',
  1159. 'ltcc;': '\u2aa6',
  1160. 'ltcir;': '\u2a79',
  1161. 'ltdot;': '\u22d6',
  1162. 'lthree;': '\u22cb',
  1163. 'ltimes;': '\u22c9',
  1164. 'ltlarr;': '\u2976',
  1165. 'ltquest;': '\u2a7b',
  1166. 'ltri;': '\u25c3',
  1167. 'ltrie;': '\u22b4',
  1168. 'ltrif;': '\u25c2',
  1169. 'ltrPar;': '\u2996',
  1170. 'lurdshar;': '\u294a',
  1171. 'luruhar;': '\u2966',
  1172. 'lvertneqq;': '\u2268\ufe00',
  1173. 'lvnE;': '\u2268\ufe00',
  1174. 'macr': '\xaf',
  1175. 'macr;': '\xaf',
  1176. 'male;': '\u2642',
  1177. 'malt;': '\u2720',
  1178. 'maltese;': '\u2720',
  1179. 'Map;': '\u2905',
  1180. 'map;': '\u21a6',
  1181. 'mapsto;': '\u21a6',
  1182. 'mapstodown;': '\u21a7',
  1183. 'mapstoleft;': '\u21a4',
  1184. 'mapstoup;': '\u21a5',
  1185. 'marker;': '\u25ae',
  1186. 'mcomma;': '\u2a29',
  1187. 'Mcy;': '\u041c',
  1188. 'mcy;': '\u043c',
  1189. 'mdash;': '\u2014',
  1190. 'mDDot;': '\u223a',
  1191. 'measuredangle;': '\u2221',
  1192. 'MediumSpace;': '\u205f',
  1193. 'Mellintrf;': '\u2133',
  1194. 'Mfr;': '\U0001d510',
  1195. 'mfr;': '\U0001d52a',
  1196. 'mho;': '\u2127',
  1197. 'micro': '\xb5',
  1198. 'micro;': '\xb5',
  1199. 'mid;': '\u2223',
  1200. 'midast;': '*',
  1201. 'midcir;': '\u2af0',
  1202. 'middot': '\xb7',
  1203. 'middot;': '\xb7',
  1204. 'minus;': '\u2212',
  1205. 'minusb;': '\u229f',
  1206. 'minusd;': '\u2238',
  1207. 'minusdu;': '\u2a2a',
  1208. 'MinusPlus;': '\u2213',
  1209. 'mlcp;': '\u2adb',
  1210. 'mldr;': '\u2026',
  1211. 'mnplus;': '\u2213',
  1212. 'models;': '\u22a7',
  1213. 'Mopf;': '\U0001d544',
  1214. 'mopf;': '\U0001d55e',
  1215. 'mp;': '\u2213',
  1216. 'Mscr;': '\u2133',
  1217. 'mscr;': '\U0001d4c2',
  1218. 'mstpos;': '\u223e',
  1219. 'Mu;': '\u039c',
  1220. 'mu;': '\u03bc',
  1221. 'multimap;': '\u22b8',
  1222. 'mumap;': '\u22b8',
  1223. 'nabla;': '\u2207',
  1224. 'Nacute;': '\u0143',
  1225. 'nacute;': '\u0144',
  1226. 'nang;': '\u2220\u20d2',
  1227. 'nap;': '\u2249',
  1228. 'napE;': '\u2a70\u0338',
  1229. 'napid;': '\u224b\u0338',
  1230. 'napos;': '\u0149',
  1231. 'napprox;': '\u2249',
  1232. 'natur;': '\u266e',
  1233. 'natural;': '\u266e',
  1234. 'naturals;': '\u2115',
  1235. 'nbsp': '\xa0',
  1236. 'nbsp;': '\xa0',
  1237. 'nbump;': '\u224e\u0338',
  1238. 'nbumpe;': '\u224f\u0338',
  1239. 'ncap;': '\u2a43',
  1240. 'Ncaron;': '\u0147',
  1241. 'ncaron;': '\u0148',
  1242. 'Ncedil;': '\u0145',
  1243. 'ncedil;': '\u0146',
  1244. 'ncong;': '\u2247',
  1245. 'ncongdot;': '\u2a6d\u0338',
  1246. 'ncup;': '\u2a42',
  1247. 'Ncy;': '\u041d',
  1248. 'ncy;': '\u043d',
  1249. 'ndash;': '\u2013',
  1250. 'ne;': '\u2260',
  1251. 'nearhk;': '\u2924',
  1252. 'neArr;': '\u21d7',
  1253. 'nearr;': '\u2197',
  1254. 'nearrow;': '\u2197',
  1255. 'nedot;': '\u2250\u0338',
  1256. 'NegativeMediumSpace;': '\u200b',
  1257. 'NegativeThickSpace;': '\u200b',
  1258. 'NegativeThinSpace;': '\u200b',
  1259. 'NegativeVeryThinSpace;': '\u200b',
  1260. 'nequiv;': '\u2262',
  1261. 'nesear;': '\u2928',
  1262. 'nesim;': '\u2242\u0338',
  1263. 'NestedGreaterGreater;': '\u226b',
  1264. 'NestedLessLess;': '\u226a',
  1265. 'NewLine;': '\n',
  1266. 'nexist;': '\u2204',
  1267. 'nexists;': '\u2204',
  1268. 'Nfr;': '\U0001d511',
  1269. 'nfr;': '\U0001d52b',
  1270. 'ngE;': '\u2267\u0338',
  1271. 'nge;': '\u2271',
  1272. 'ngeq;': '\u2271',
  1273. 'ngeqq;': '\u2267\u0338',
  1274. 'ngeqslant;': '\u2a7e\u0338',
  1275. 'nges;': '\u2a7e\u0338',
  1276. 'nGg;': '\u22d9\u0338',
  1277. 'ngsim;': '\u2275',
  1278. 'nGt;': '\u226b\u20d2',
  1279. 'ngt;': '\u226f',
  1280. 'ngtr;': '\u226f',
  1281. 'nGtv;': '\u226b\u0338',
  1282. 'nhArr;': '\u21ce',
  1283. 'nharr;': '\u21ae',
  1284. 'nhpar;': '\u2af2',
  1285. 'ni;': '\u220b',
  1286. 'nis;': '\u22fc',
  1287. 'nisd;': '\u22fa',
  1288. 'niv;': '\u220b',
  1289. 'NJcy;': '\u040a',
  1290. 'njcy;': '\u045a',
  1291. 'nlArr;': '\u21cd',
  1292. 'nlarr;': '\u219a',
  1293. 'nldr;': '\u2025',
  1294. 'nlE;': '\u2266\u0338',
  1295. 'nle;': '\u2270',
  1296. 'nLeftarrow;': '\u21cd',
  1297. 'nleftarrow;': '\u219a',
  1298. 'nLeftrightarrow;': '\u21ce',
  1299. 'nleftrightarrow;': '\u21ae',
  1300. 'nleq;': '\u2270',
  1301. 'nleqq;': '\u2266\u0338',
  1302. 'nleqslant;': '\u2a7d\u0338',
  1303. 'nles;': '\u2a7d\u0338',
  1304. 'nless;': '\u226e',
  1305. 'nLl;': '\u22d8\u0338',
  1306. 'nlsim;': '\u2274',
  1307. 'nLt;': '\u226a\u20d2',
  1308. 'nlt;': '\u226e',
  1309. 'nltri;': '\u22ea',
  1310. 'nltrie;': '\u22ec',
  1311. 'nLtv;': '\u226a\u0338',
  1312. 'nmid;': '\u2224',
  1313. 'NoBreak;': '\u2060',
  1314. 'NonBreakingSpace;': '\xa0',
  1315. 'Nopf;': '\u2115',
  1316. 'nopf;': '\U0001d55f',
  1317. 'not': '\xac',
  1318. 'Not;': '\u2aec',
  1319. 'not;': '\xac',
  1320. 'NotCongruent;': '\u2262',
  1321. 'NotCupCap;': '\u226d',
  1322. 'NotDoubleVerticalBar;': '\u2226',
  1323. 'NotElement;': '\u2209',
  1324. 'NotEqual;': '\u2260',
  1325. 'NotEqualTilde;': '\u2242\u0338',
  1326. 'NotExists;': '\u2204',
  1327. 'NotGreater;': '\u226f',
  1328. 'NotGreaterEqual;': '\u2271',
  1329. 'NotGreaterFullEqual;': '\u2267\u0338',
  1330. 'NotGreaterGreater;': '\u226b\u0338',
  1331. 'NotGreaterLess;': '\u2279',
  1332. 'NotGreaterSlantEqual;': '\u2a7e\u0338',
  1333. 'NotGreaterTilde;': '\u2275',
  1334. 'NotHumpDownHump;': '\u224e\u0338',
  1335. 'NotHumpEqual;': '\u224f\u0338',
  1336. 'notin;': '\u2209',
  1337. 'notindot;': '\u22f5\u0338',
  1338. 'notinE;': '\u22f9\u0338',
  1339. 'notinva;': '\u2209',
  1340. 'notinvb;': '\u22f7',
  1341. 'notinvc;': '\u22f6',
  1342. 'NotLeftTriangle;': '\u22ea',
  1343. 'NotLeftTriangleBar;': '\u29cf\u0338',
  1344. 'NotLeftTriangleEqual;': '\u22ec',
  1345. 'NotLess;': '\u226e',
  1346. 'NotLessEqual;': '\u2270',
  1347. 'NotLessGreater;': '\u2278',
  1348. 'NotLessLess;': '\u226a\u0338',
  1349. 'NotLessSlantEqual;': '\u2a7d\u0338',
  1350. 'NotLessTilde;': '\u2274',
  1351. 'NotNestedGreaterGreater;': '\u2aa2\u0338',
  1352. 'NotNestedLessLess;': '\u2aa1\u0338',
  1353. 'notni;': '\u220c',
  1354. 'notniva;': '\u220c',
  1355. 'notnivb;': '\u22fe',
  1356. 'notnivc;': '\u22fd',
  1357. 'NotPrecedes;': '\u2280',
  1358. 'NotPrecedesEqual;': '\u2aaf\u0338',
  1359. 'NotPrecedesSlantEqual;': '\u22e0',
  1360. 'NotReverseElement;': '\u220c',
  1361. 'NotRightTriangle;': '\u22eb',
  1362. 'NotRightTriangleBar;': '\u29d0\u0338',
  1363. 'NotRightTriangleEqual;': '\u22ed',
  1364. 'NotSquareSubset;': '\u228f\u0338',
  1365. 'NotSquareSubsetEqual;': '\u22e2',
  1366. 'NotSquareSuperset;': '\u2290\u0338',
  1367. 'NotSquareSupersetEqual;': '\u22e3',
  1368. 'NotSubset;': '\u2282\u20d2',
  1369. 'NotSubsetEqual;': '\u2288',
  1370. 'NotSucceeds;': '\u2281',
  1371. 'NotSucceedsEqual;': '\u2ab0\u0338',
  1372. 'NotSucceedsSlantEqual;': '\u22e1',
  1373. 'NotSucceedsTilde;': '\u227f\u0338',
  1374. 'NotSuperset;': '\u2283\u20d2',
  1375. 'NotSupersetEqual;': '\u2289',
  1376. 'NotTilde;': '\u2241',
  1377. 'NotTildeEqual;': '\u2244',
  1378. 'NotTildeFullEqual;': '\u2247',
  1379. 'NotTildeTilde;': '\u2249',
  1380. 'NotVerticalBar;': '\u2224',
  1381. 'npar;': '\u2226',
  1382. 'nparallel;': '\u2226',
  1383. 'nparsl;': '\u2afd\u20e5',
  1384. 'npart;': '\u2202\u0338',
  1385. 'npolint;': '\u2a14',
  1386. 'npr;': '\u2280',
  1387. 'nprcue;': '\u22e0',
  1388. 'npre;': '\u2aaf\u0338',
  1389. 'nprec;': '\u2280',
  1390. 'npreceq;': '\u2aaf\u0338',
  1391. 'nrArr;': '\u21cf',
  1392. 'nrarr;': '\u219b',
  1393. 'nrarrc;': '\u2933\u0338',
  1394. 'nrarrw;': '\u219d\u0338',
  1395. 'nRightarrow;': '\u21cf',
  1396. 'nrightarrow;': '\u219b',
  1397. 'nrtri;': '\u22eb',
  1398. 'nrtrie;': '\u22ed',
  1399. 'nsc;': '\u2281',
  1400. 'nsccue;': '\u22e1',
  1401. 'nsce;': '\u2ab0\u0338',
  1402. 'Nscr;': '\U0001d4a9',
  1403. 'nscr;': '\U0001d4c3',
  1404. 'nshortmid;': '\u2224',
  1405. 'nshortparallel;': '\u2226',
  1406. 'nsim;': '\u2241',
  1407. 'nsime;': '\u2244',
  1408. 'nsimeq;': '\u2244',
  1409. 'nsmid;': '\u2224',
  1410. 'nspar;': '\u2226',
  1411. 'nsqsube;': '\u22e2',
  1412. 'nsqsupe;': '\u22e3',
  1413. 'nsub;': '\u2284',
  1414. 'nsubE;': '\u2ac5\u0338',
  1415. 'nsube;': '\u2288',
  1416. 'nsubset;': '\u2282\u20d2',
  1417. 'nsubseteq;': '\u2288',
  1418. 'nsubseteqq;': '\u2ac5\u0338',
  1419. 'nsucc;': '\u2281',
  1420. 'nsucceq;': '\u2ab0\u0338',
  1421. 'nsup;': '\u2285',
  1422. 'nsupE;': '\u2ac6\u0338',
  1423. 'nsupe;': '\u2289',
  1424. 'nsupset;': '\u2283\u20d2',
  1425. 'nsupseteq;': '\u2289',
  1426. 'nsupseteqq;': '\u2ac6\u0338',
  1427. 'ntgl;': '\u2279',
  1428. 'Ntilde': '\xd1',
  1429. 'ntilde': '\xf1',
  1430. 'Ntilde;': '\xd1',
  1431. 'ntilde;': '\xf1',
  1432. 'ntlg;': '\u2278',
  1433. 'ntriangleleft;': '\u22ea',
  1434. 'ntrianglelefteq;': '\u22ec',
  1435. 'ntriangleright;': '\u22eb',
  1436. 'ntrianglerighteq;': '\u22ed',
  1437. 'Nu;': '\u039d',
  1438. 'nu;': '\u03bd',
  1439. 'num;': '#',
  1440. 'numero;': '\u2116',
  1441. 'numsp;': '\u2007',
  1442. 'nvap;': '\u224d\u20d2',
  1443. 'nVDash;': '\u22af',
  1444. 'nVdash;': '\u22ae',
  1445. 'nvDash;': '\u22ad',
  1446. 'nvdash;': '\u22ac',
  1447. 'nvge;': '\u2265\u20d2',
  1448. 'nvgt;': '>\u20d2',
  1449. 'nvHarr;': '\u2904',
  1450. 'nvinfin;': '\u29de',
  1451. 'nvlArr;': '\u2902',
  1452. 'nvle;': '\u2264\u20d2',
  1453. 'nvlt;': '<\u20d2',
  1454. 'nvltrie;': '\u22b4\u20d2',
  1455. 'nvrArr;': '\u2903',
  1456. 'nvrtrie;': '\u22b5\u20d2',
  1457. 'nvsim;': '\u223c\u20d2',
  1458. 'nwarhk;': '\u2923',
  1459. 'nwArr;': '\u21d6',
  1460. 'nwarr;': '\u2196',
  1461. 'nwarrow;': '\u2196',
  1462. 'nwnear;': '\u2927',
  1463. 'Oacute': '\xd3',
  1464. 'oacute': '\xf3',
  1465. 'Oacute;': '\xd3',
  1466. 'oacute;': '\xf3',
  1467. 'oast;': '\u229b',
  1468. 'ocir;': '\u229a',
  1469. 'Ocirc': '\xd4',
  1470. 'ocirc': '\xf4',
  1471. 'Ocirc;': '\xd4',
  1472. 'ocirc;': '\xf4',
  1473. 'Ocy;': '\u041e',
  1474. 'ocy;': '\u043e',
  1475. 'odash;': '\u229d',
  1476. 'Odblac;': '\u0150',
  1477. 'odblac;': '\u0151',
  1478. 'odiv;': '\u2a38',
  1479. 'odot;': '\u2299',
  1480. 'odsold;': '\u29bc',
  1481. 'OElig;': '\u0152',
  1482. 'oelig;': '\u0153',
  1483. 'ofcir;': '\u29bf',
  1484. 'Ofr;': '\U0001d512',
  1485. 'ofr;': '\U0001d52c',
  1486. 'ogon;': '\u02db',
  1487. 'Ograve': '\xd2',
  1488. 'ograve': '\xf2',
  1489. 'Ograve;': '\xd2',
  1490. 'ograve;': '\xf2',
  1491. 'ogt;': '\u29c1',
  1492. 'ohbar;': '\u29b5',
  1493. 'ohm;': '\u03a9',
  1494. 'oint;': '\u222e',
  1495. 'olarr;': '\u21ba',
  1496. 'olcir;': '\u29be',
  1497. 'olcross;': '\u29bb',
  1498. 'oline;': '\u203e',
  1499. 'olt;': '\u29c0',
  1500. 'Omacr;': '\u014c',
  1501. 'omacr;': '\u014d',
  1502. 'Omega;': '\u03a9',
  1503. 'omega;': '\u03c9',
  1504. 'Omicron;': '\u039f',
  1505. 'omicron;': '\u03bf',
  1506. 'omid;': '\u29b6',
  1507. 'ominus;': '\u2296',
  1508. 'Oopf;': '\U0001d546',
  1509. 'oopf;': '\U0001d560',
  1510. 'opar;': '\u29b7',
  1511. 'OpenCurlyDoubleQuote;': '\u201c',
  1512. 'OpenCurlyQuote;': '\u2018',
  1513. 'operp;': '\u29b9',
  1514. 'oplus;': '\u2295',
  1515. 'Or;': '\u2a54',
  1516. 'or;': '\u2228',
  1517. 'orarr;': '\u21bb',
  1518. 'ord;': '\u2a5d',
  1519. 'order;': '\u2134',
  1520. 'orderof;': '\u2134',
  1521. 'ordf': '\xaa',
  1522. 'ordf;': '\xaa',
  1523. 'ordm': '\xba',
  1524. 'ordm;': '\xba',
  1525. 'origof;': '\u22b6',
  1526. 'oror;': '\u2a56',
  1527. 'orslope;': '\u2a57',
  1528. 'orv;': '\u2a5b',
  1529. 'oS;': '\u24c8',
  1530. 'Oscr;': '\U0001d4aa',
  1531. 'oscr;': '\u2134',
  1532. 'Oslash': '\xd8',
  1533. 'oslash': '\xf8',
  1534. 'Oslash;': '\xd8',
  1535. 'oslash;': '\xf8',
  1536. 'osol;': '\u2298',
  1537. 'Otilde': '\xd5',
  1538. 'otilde': '\xf5',
  1539. 'Otilde;': '\xd5',
  1540. 'otilde;': '\xf5',
  1541. 'Otimes;': '\u2a37',
  1542. 'otimes;': '\u2297',
  1543. 'otimesas;': '\u2a36',
  1544. 'Ouml': '\xd6',
  1545. 'ouml': '\xf6',
  1546. 'Ouml;': '\xd6',
  1547. 'ouml;': '\xf6',
  1548. 'ovbar;': '\u233d',
  1549. 'OverBar;': '\u203e',
  1550. 'OverBrace;': '\u23de',
  1551. 'OverBracket;': '\u23b4',
  1552. 'OverParenthesis;': '\u23dc',
  1553. 'par;': '\u2225',
  1554. 'para': '\xb6',
  1555. 'para;': '\xb6',
  1556. 'parallel;': '\u2225',
  1557. 'parsim;': '\u2af3',
  1558. 'parsl;': '\u2afd',
  1559. 'part;': '\u2202',
  1560. 'PartialD;': '\u2202',
  1561. 'Pcy;': '\u041f',
  1562. 'pcy;': '\u043f',
  1563. 'percnt;': '%',
  1564. 'period;': '.',
  1565. 'permil;': '\u2030',
  1566. 'perp;': '\u22a5',
  1567. 'pertenk;': '\u2031',
  1568. 'Pfr;': '\U0001d513',
  1569. 'pfr;': '\U0001d52d',
  1570. 'Phi;': '\u03a6',
  1571. 'phi;': '\u03c6',
  1572. 'phiv;': '\u03d5',
  1573. 'phmmat;': '\u2133',
  1574. 'phone;': '\u260e',
  1575. 'Pi;': '\u03a0',
  1576. 'pi;': '\u03c0',
  1577. 'pitchfork;': '\u22d4',
  1578. 'piv;': '\u03d6',
  1579. 'planck;': '\u210f',
  1580. 'planckh;': '\u210e',
  1581. 'plankv;': '\u210f',
  1582. 'plus;': '+',
  1583. 'plusacir;': '\u2a23',
  1584. 'plusb;': '\u229e',
  1585. 'pluscir;': '\u2a22',
  1586. 'plusdo;': '\u2214',
  1587. 'plusdu;': '\u2a25',
  1588. 'pluse;': '\u2a72',
  1589. 'PlusMinus;': '\xb1',
  1590. 'plusmn': '\xb1',
  1591. 'plusmn;': '\xb1',
  1592. 'plussim;': '\u2a26',
  1593. 'plustwo;': '\u2a27',
  1594. 'pm;': '\xb1',
  1595. 'Poincareplane;': '\u210c',
  1596. 'pointint;': '\u2a15',
  1597. 'Popf;': '\u2119',
  1598. 'popf;': '\U0001d561',
  1599. 'pound': '\xa3',
  1600. 'pound;': '\xa3',
  1601. 'Pr;': '\u2abb',
  1602. 'pr;': '\u227a',
  1603. 'prap;': '\u2ab7',
  1604. 'prcue;': '\u227c',
  1605. 'prE;': '\u2ab3',
  1606. 'pre;': '\u2aaf',
  1607. 'prec;': '\u227a',
  1608. 'precapprox;': '\u2ab7',
  1609. 'preccurlyeq;': '\u227c',
  1610. 'Precedes;': '\u227a',
  1611. 'PrecedesEqual;': '\u2aaf',
  1612. 'PrecedesSlantEqual;': '\u227c',
  1613. 'PrecedesTilde;': '\u227e',
  1614. 'preceq;': '\u2aaf',
  1615. 'precnapprox;': '\u2ab9',
  1616. 'precneqq;': '\u2ab5',
  1617. 'precnsim;': '\u22e8',
  1618. 'precsim;': '\u227e',
  1619. 'Prime;': '\u2033',
  1620. 'prime;': '\u2032',
  1621. 'primes;': '\u2119',
  1622. 'prnap;': '\u2ab9',
  1623. 'prnE;': '\u2ab5',
  1624. 'prnsim;': '\u22e8',
  1625. 'prod;': '\u220f',
  1626. 'Product;': '\u220f',
  1627. 'profalar;': '\u232e',
  1628. 'profline;': '\u2312',
  1629. 'profsurf;': '\u2313',
  1630. 'prop;': '\u221d',
  1631. 'Proportion;': '\u2237',
  1632. 'Proportional;': '\u221d',
  1633. 'propto;': '\u221d',
  1634. 'prsim;': '\u227e',
  1635. 'prurel;': '\u22b0',
  1636. 'Pscr;': '\U0001d4ab',
  1637. 'pscr;': '\U0001d4c5',
  1638. 'Psi;': '\u03a8',
  1639. 'psi;': '\u03c8',
  1640. 'puncsp;': '\u2008',
  1641. 'Qfr;': '\U0001d514',
  1642. 'qfr;': '\U0001d52e',
  1643. 'qint;': '\u2a0c',
  1644. 'Qopf;': '\u211a',
  1645. 'qopf;': '\U0001d562',
  1646. 'qprime;': '\u2057',
  1647. 'Qscr;': '\U0001d4ac',
  1648. 'qscr;': '\U0001d4c6',
  1649. 'quaternions;': '\u210d',
  1650. 'quatint;': '\u2a16',
  1651. 'quest;': '?',
  1652. 'questeq;': '\u225f',
  1653. 'QUOT': '"',
  1654. 'quot': '"',
  1655. 'QUOT;': '"',
  1656. 'quot;': '"',
  1657. 'rAarr;': '\u21db',
  1658. 'race;': '\u223d\u0331',
  1659. 'Racute;': '\u0154',
  1660. 'racute;': '\u0155',
  1661. 'radic;': '\u221a',
  1662. 'raemptyv;': '\u29b3',
  1663. 'Rang;': '\u27eb',
  1664. 'rang;': '\u27e9',
  1665. 'rangd;': '\u2992',
  1666. 'range;': '\u29a5',
  1667. 'rangle;': '\u27e9',
  1668. 'raquo': '\xbb',
  1669. 'raquo;': '\xbb',
  1670. 'Rarr;': '\u21a0',
  1671. 'rArr;': '\u21d2',
  1672. 'rarr;': '\u2192',
  1673. 'rarrap;': '\u2975',
  1674. 'rarrb;': '\u21e5',
  1675. 'rarrbfs;': '\u2920',
  1676. 'rarrc;': '\u2933',
  1677. 'rarrfs;': '\u291e',
  1678. 'rarrhk;': '\u21aa',
  1679. 'rarrlp;': '\u21ac',
  1680. 'rarrpl;': '\u2945',
  1681. 'rarrsim;': '\u2974',
  1682. 'Rarrtl;': '\u2916',
  1683. 'rarrtl;': '\u21a3',
  1684. 'rarrw;': '\u219d',
  1685. 'rAtail;': '\u291c',
  1686. 'ratail;': '\u291a',
  1687. 'ratio;': '\u2236',
  1688. 'rationals;': '\u211a',
  1689. 'RBarr;': '\u2910',
  1690. 'rBarr;': '\u290f',
  1691. 'rbarr;': '\u290d',
  1692. 'rbbrk;': '\u2773',
  1693. 'rbrace;': '}',
  1694. 'rbrack;': ']',
  1695. 'rbrke;': '\u298c',
  1696. 'rbrksld;': '\u298e',
  1697. 'rbrkslu;': '\u2990',
  1698. 'Rcaron;': '\u0158',
  1699. 'rcaron;': '\u0159',
  1700. 'Rcedil;': '\u0156',
  1701. 'rcedil;': '\u0157',
  1702. 'rceil;': '\u2309',
  1703. 'rcub;': '}',
  1704. 'Rcy;': '\u0420',
  1705. 'rcy;': '\u0440',
  1706. 'rdca;': '\u2937',
  1707. 'rdldhar;': '\u2969',
  1708. 'rdquo;': '\u201d',
  1709. 'rdquor;': '\u201d',
  1710. 'rdsh;': '\u21b3',
  1711. 'Re;': '\u211c',
  1712. 'real;': '\u211c',
  1713. 'realine;': '\u211b',
  1714. 'realpart;': '\u211c',
  1715. 'reals;': '\u211d',
  1716. 'rect;': '\u25ad',
  1717. 'REG': '\xae',
  1718. 'reg': '\xae',
  1719. 'REG;': '\xae',
  1720. 'reg;': '\xae',
  1721. 'ReverseElement;': '\u220b',
  1722. 'ReverseEquilibrium;': '\u21cb',
  1723. 'ReverseUpEquilibrium;': '\u296f',
  1724. 'rfisht;': '\u297d',
  1725. 'rfloor;': '\u230b',
  1726. 'Rfr;': '\u211c',
  1727. 'rfr;': '\U0001d52f',
  1728. 'rHar;': '\u2964',
  1729. 'rhard;': '\u21c1',
  1730. 'rharu;': '\u21c0',
  1731. 'rharul;': '\u296c',
  1732. 'Rho;': '\u03a1',
  1733. 'rho;': '\u03c1',
  1734. 'rhov;': '\u03f1',
  1735. 'RightAngleBracket;': '\u27e9',
  1736. 'RightArrow;': '\u2192',
  1737. 'Rightarrow;': '\u21d2',
  1738. 'rightarrow;': '\u2192',
  1739. 'RightArrowBar;': '\u21e5',
  1740. 'RightArrowLeftArrow;': '\u21c4',
  1741. 'rightarrowtail;': '\u21a3',
  1742. 'RightCeiling;': '\u2309',
  1743. 'RightDoubleBracket;': '\u27e7',
  1744. 'RightDownTeeVector;': '\u295d',
  1745. 'RightDownVector;': '\u21c2',
  1746. 'RightDownVectorBar;': '\u2955',
  1747. 'RightFloor;': '\u230b',
  1748. 'rightharpoondown;': '\u21c1',
  1749. 'rightharpoonup;': '\u21c0',
  1750. 'rightleftarrows;': '\u21c4',
  1751. 'rightleftharpoons;': '\u21cc',
  1752. 'rightrightarrows;': '\u21c9',
  1753. 'rightsquigarrow;': '\u219d',
  1754. 'RightTee;': '\u22a2',
  1755. 'RightTeeArrow;': '\u21a6',
  1756. 'RightTeeVector;': '\u295b',
  1757. 'rightthreetimes;': '\u22cc',
  1758. 'RightTriangle;': '\u22b3',
  1759. 'RightTriangleBar;': '\u29d0',
  1760. 'RightTriangleEqual;': '\u22b5',
  1761. 'RightUpDownVector;': '\u294f',
  1762. 'RightUpTeeVector;': '\u295c',
  1763. 'RightUpVector;': '\u21be',
  1764. 'RightUpVectorBar;': '\u2954',
  1765. 'RightVector;': '\u21c0',
  1766. 'RightVectorBar;': '\u2953',
  1767. 'ring;': '\u02da',
  1768. 'risingdotseq;': '\u2253',
  1769. 'rlarr;': '\u21c4',
  1770. 'rlhar;': '\u21cc',
  1771. 'rlm;': '\u200f',
  1772. 'rmoust;': '\u23b1',
  1773. 'rmoustache;': '\u23b1',
  1774. 'rnmid;': '\u2aee',
  1775. 'roang;': '\u27ed',
  1776. 'roarr;': '\u21fe',
  1777. 'robrk;': '\u27e7',
  1778. 'ropar;': '\u2986',
  1779. 'Ropf;': '\u211d',
  1780. 'ropf;': '\U0001d563',
  1781. 'roplus;': '\u2a2e',
  1782. 'rotimes;': '\u2a35',
  1783. 'RoundImplies;': '\u2970',
  1784. 'rpar;': ')',
  1785. 'rpargt;': '\u2994',
  1786. 'rppolint;': '\u2a12',
  1787. 'rrarr;': '\u21c9',
  1788. 'Rrightarrow;': '\u21db',
  1789. 'rsaquo;': '\u203a',
  1790. 'Rscr;': '\u211b',
  1791. 'rscr;': '\U0001d4c7',
  1792. 'Rsh;': '\u21b1',
  1793. 'rsh;': '\u21b1',
  1794. 'rsqb;': ']',
  1795. 'rsquo;': '\u2019',
  1796. 'rsquor;': '\u2019',
  1797. 'rthree;': '\u22cc',
  1798. 'rtimes;': '\u22ca',
  1799. 'rtri;': '\u25b9',
  1800. 'rtrie;': '\u22b5',
  1801. 'rtrif;': '\u25b8',
  1802. 'rtriltri;': '\u29ce',
  1803. 'RuleDelayed;': '\u29f4',
  1804. 'ruluhar;': '\u2968',
  1805. 'rx;': '\u211e',
  1806. 'Sacute;': '\u015a',
  1807. 'sacute;': '\u015b',
  1808. 'sbquo;': '\u201a',
  1809. 'Sc;': '\u2abc',
  1810. 'sc;': '\u227b',
  1811. 'scap;': '\u2ab8',
  1812. 'Scaron;': '\u0160',
  1813. 'scaron;': '\u0161',
  1814. 'sccue;': '\u227d',
  1815. 'scE;': '\u2ab4',
  1816. 'sce;': '\u2ab0',
  1817. 'Scedil;': '\u015e',
  1818. 'scedil;': '\u015f',
  1819. 'Scirc;': '\u015c',
  1820. 'scirc;': '\u015d',
  1821. 'scnap;': '\u2aba',
  1822. 'scnE;': '\u2ab6',
  1823. 'scnsim;': '\u22e9',
  1824. 'scpolint;': '\u2a13',
  1825. 'scsim;': '\u227f',
  1826. 'Scy;': '\u0421',
  1827. 'scy;': '\u0441',
  1828. 'sdot;': '\u22c5',
  1829. 'sdotb;': '\u22a1',
  1830. 'sdote;': '\u2a66',
  1831. 'searhk;': '\u2925',
  1832. 'seArr;': '\u21d8',
  1833. 'searr;': '\u2198',
  1834. 'searrow;': '\u2198',
  1835. 'sect': '\xa7',
  1836. 'sect;': '\xa7',
  1837. 'semi;': ';',
  1838. 'seswar;': '\u2929',
  1839. 'setminus;': '\u2216',
  1840. 'setmn;': '\u2216',
  1841. 'sext;': '\u2736',
  1842. 'Sfr;': '\U0001d516',
  1843. 'sfr;': '\U0001d530',
  1844. 'sfrown;': '\u2322',
  1845. 'sharp;': '\u266f',
  1846. 'SHCHcy;': '\u0429',
  1847. 'shchcy;': '\u0449',
  1848. 'SHcy;': '\u0428',
  1849. 'shcy;': '\u0448',
  1850. 'ShortDownArrow;': '\u2193',
  1851. 'ShortLeftArrow;': '\u2190',
  1852. 'shortmid;': '\u2223',
  1853. 'shortparallel;': '\u2225',
  1854. 'ShortRightArrow;': '\u2192',
  1855. 'ShortUpArrow;': '\u2191',
  1856. 'shy': '\xad',
  1857. 'shy;': '\xad',
  1858. 'Sigma;': '\u03a3',
  1859. 'sigma;': '\u03c3',
  1860. 'sigmaf;': '\u03c2',
  1861. 'sigmav;': '\u03c2',
  1862. 'sim;': '\u223c',
  1863. 'simdot;': '\u2a6a',
  1864. 'sime;': '\u2243',
  1865. 'simeq;': '\u2243',
  1866. 'simg;': '\u2a9e',
  1867. 'simgE;': '\u2aa0',
  1868. 'siml;': '\u2a9d',
  1869. 'simlE;': '\u2a9f',
  1870. 'simne;': '\u2246',
  1871. 'simplus;': '\u2a24',
  1872. 'simrarr;': '\u2972',
  1873. 'slarr;': '\u2190',
  1874. 'SmallCircle;': '\u2218',
  1875. 'smallsetminus;': '\u2216',
  1876. 'smashp;': '\u2a33',
  1877. 'smeparsl;': '\u29e4',
  1878. 'smid;': '\u2223',
  1879. 'smile;': '\u2323',
  1880. 'smt;': '\u2aaa',
  1881. 'smte;': '\u2aac',
  1882. 'smtes;': '\u2aac\ufe00',
  1883. 'SOFTcy;': '\u042c',
  1884. 'softcy;': '\u044c',
  1885. 'sol;': '/',
  1886. 'solb;': '\u29c4',
  1887. 'solbar;': '\u233f',
  1888. 'Sopf;': '\U0001d54a',
  1889. 'sopf;': '\U0001d564',
  1890. 'spades;': '\u2660',
  1891. 'spadesuit;': '\u2660',
  1892. 'spar;': '\u2225',
  1893. 'sqcap;': '\u2293',
  1894. 'sqcaps;': '\u2293\ufe00',
  1895. 'sqcup;': '\u2294',
  1896. 'sqcups;': '\u2294\ufe00',
  1897. 'Sqrt;': '\u221a',
  1898. 'sqsub;': '\u228f',
  1899. 'sqsube;': '\u2291',
  1900. 'sqsubset;': '\u228f',
  1901. 'sqsubseteq;': '\u2291',
  1902. 'sqsup;': '\u2290',
  1903. 'sqsupe;': '\u2292',
  1904. 'sqsupset;': '\u2290',
  1905. 'sqsupseteq;': '\u2292',
  1906. 'squ;': '\u25a1',
  1907. 'Square;': '\u25a1',
  1908. 'square;': '\u25a1',
  1909. 'SquareIntersection;': '\u2293',
  1910. 'SquareSubset;': '\u228f',
  1911. 'SquareSubsetEqual;': '\u2291',
  1912. 'SquareSuperset;': '\u2290',
  1913. 'SquareSupersetEqual;': '\u2292',
  1914. 'SquareUnion;': '\u2294',
  1915. 'squarf;': '\u25aa',
  1916. 'squf;': '\u25aa',
  1917. 'srarr;': '\u2192',
  1918. 'Sscr;': '\U0001d4ae',
  1919. 'sscr;': '\U0001d4c8',
  1920. 'ssetmn;': '\u2216',
  1921. 'ssmile;': '\u2323',
  1922. 'sstarf;': '\u22c6',
  1923. 'Star;': '\u22c6',
  1924. 'star;': '\u2606',
  1925. 'starf;': '\u2605',
  1926. 'straightepsilon;': '\u03f5',
  1927. 'straightphi;': '\u03d5',
  1928. 'strns;': '\xaf',
  1929. 'Sub;': '\u22d0',
  1930. 'sub;': '\u2282',
  1931. 'subdot;': '\u2abd',
  1932. 'subE;': '\u2ac5',
  1933. 'sube;': '\u2286',
  1934. 'subedot;': '\u2ac3',
  1935. 'submult;': '\u2ac1',
  1936. 'subnE;': '\u2acb',
  1937. 'subne;': '\u228a',
  1938. 'subplus;': '\u2abf',
  1939. 'subrarr;': '\u2979',
  1940. 'Subset;': '\u22d0',
  1941. 'subset;': '\u2282',
  1942. 'subseteq;': '\u2286',
  1943. 'subseteqq;': '\u2ac5',
  1944. 'SubsetEqual;': '\u2286',
  1945. 'subsetneq;': '\u228a',
  1946. 'subsetneqq;': '\u2acb',
  1947. 'subsim;': '\u2ac7',
  1948. 'subsub;': '\u2ad5',
  1949. 'subsup;': '\u2ad3',
  1950. 'succ;': '\u227b',
  1951. 'succapprox;': '\u2ab8',
  1952. 'succcurlyeq;': '\u227d',
  1953. 'Succeeds;': '\u227b',
  1954. 'SucceedsEqual;': '\u2ab0',
  1955. 'SucceedsSlantEqual;': '\u227d',
  1956. 'SucceedsTilde;': '\u227f',
  1957. 'succeq;': '\u2ab0',
  1958. 'succnapprox;': '\u2aba',
  1959. 'succneqq;': '\u2ab6',
  1960. 'succnsim;': '\u22e9',
  1961. 'succsim;': '\u227f',
  1962. 'SuchThat;': '\u220b',
  1963. 'Sum;': '\u2211',
  1964. 'sum;': '\u2211',
  1965. 'sung;': '\u266a',
  1966. 'sup1': '\xb9',
  1967. 'sup1;': '\xb9',
  1968. 'sup2': '\xb2',
  1969. 'sup2;': '\xb2',
  1970. 'sup3': '\xb3',
  1971. 'sup3;': '\xb3',
  1972. 'Sup;': '\u22d1',
  1973. 'sup;': '\u2283',
  1974. 'supdot;': '\u2abe',
  1975. 'supdsub;': '\u2ad8',
  1976. 'supE;': '\u2ac6',
  1977. 'supe;': '\u2287',
  1978. 'supedot;': '\u2ac4',
  1979. 'Superset;': '\u2283',
  1980. 'SupersetEqual;': '\u2287',
  1981. 'suphsol;': '\u27c9',
  1982. 'suphsub;': '\u2ad7',
  1983. 'suplarr;': '\u297b',
  1984. 'supmult;': '\u2ac2',
  1985. 'supnE;': '\u2acc',
  1986. 'supne;': '\u228b',
  1987. 'supplus;': '\u2ac0',
  1988. 'Supset;': '\u22d1',
  1989. 'supset;': '\u2283',
  1990. 'supseteq;': '\u2287',
  1991. 'supseteqq;': '\u2ac6',
  1992. 'supsetneq;': '\u228b',
  1993. 'supsetneqq;': '\u2acc',
  1994. 'supsim;': '\u2ac8',
  1995. 'supsub;': '\u2ad4',
  1996. 'supsup;': '\u2ad6',
  1997. 'swarhk;': '\u2926',
  1998. 'swArr;': '\u21d9',
  1999. 'swarr;': '\u2199',
  2000. 'swarrow;': '\u2199',
  2001. 'swnwar;': '\u292a',
  2002. 'szlig': '\xdf',
  2003. 'szlig;': '\xdf',
  2004. 'Tab;': '\t',
  2005. 'target;': '\u2316',
  2006. 'Tau;': '\u03a4',
  2007. 'tau;': '\u03c4',
  2008. 'tbrk;': '\u23b4',
  2009. 'Tcaron;': '\u0164',
  2010. 'tcaron;': '\u0165',
  2011. 'Tcedil;': '\u0162',
  2012. 'tcedil;': '\u0163',
  2013. 'Tcy;': '\u0422',
  2014. 'tcy;': '\u0442',
  2015. 'tdot;': '\u20db',
  2016. 'telrec;': '\u2315',
  2017. 'Tfr;': '\U0001d517',
  2018. 'tfr;': '\U0001d531',
  2019. 'there4;': '\u2234',
  2020. 'Therefore;': '\u2234',
  2021. 'therefore;': '\u2234',
  2022. 'Theta;': '\u0398',
  2023. 'theta;': '\u03b8',
  2024. 'thetasym;': '\u03d1',
  2025. 'thetav;': '\u03d1',
  2026. 'thickapprox;': '\u2248',
  2027. 'thicksim;': '\u223c',
  2028. 'ThickSpace;': '\u205f\u200a',
  2029. 'thinsp;': '\u2009',
  2030. 'ThinSpace;': '\u2009',
  2031. 'thkap;': '\u2248',
  2032. 'thksim;': '\u223c',
  2033. 'THORN': '\xde',
  2034. 'thorn': '\xfe',
  2035. 'THORN;': '\xde',
  2036. 'thorn;': '\xfe',
  2037. 'Tilde;': '\u223c',
  2038. 'tilde;': '\u02dc',
  2039. 'TildeEqual;': '\u2243',
  2040. 'TildeFullEqual;': '\u2245',
  2041. 'TildeTilde;': '\u2248',
  2042. 'times': '\xd7',
  2043. 'times;': '\xd7',
  2044. 'timesb;': '\u22a0',
  2045. 'timesbar;': '\u2a31',
  2046. 'timesd;': '\u2a30',
  2047. 'tint;': '\u222d',
  2048. 'toea;': '\u2928',
  2049. 'top;': '\u22a4',
  2050. 'topbot;': '\u2336',
  2051. 'topcir;': '\u2af1',
  2052. 'Topf;': '\U0001d54b',
  2053. 'topf;': '\U0001d565',
  2054. 'topfork;': '\u2ada',
  2055. 'tosa;': '\u2929',
  2056. 'tprime;': '\u2034',
  2057. 'TRADE;': '\u2122',
  2058. 'trade;': '\u2122',
  2059. 'triangle;': '\u25b5',
  2060. 'triangledown;': '\u25bf',
  2061. 'triangleleft;': '\u25c3',
  2062. 'trianglelefteq;': '\u22b4',
  2063. 'triangleq;': '\u225c',
  2064. 'triangleright;': '\u25b9',
  2065. 'trianglerighteq;': '\u22b5',
  2066. 'tridot;': '\u25ec',
  2067. 'trie;': '\u225c',
  2068. 'triminus;': '\u2a3a',
  2069. 'TripleDot;': '\u20db',
  2070. 'triplus;': '\u2a39',
  2071. 'trisb;': '\u29cd',
  2072. 'tritime;': '\u2a3b',
  2073. 'trpezium;': '\u23e2',
  2074. 'Tscr;': '\U0001d4af',
  2075. 'tscr;': '\U0001d4c9',
  2076. 'TScy;': '\u0426',
  2077. 'tscy;': '\u0446',
  2078. 'TSHcy;': '\u040b',
  2079. 'tshcy;': '\u045b',
  2080. 'Tstrok;': '\u0166',
  2081. 'tstrok;': '\u0167',
  2082. 'twixt;': '\u226c',
  2083. 'twoheadleftarrow;': '\u219e',
  2084. 'twoheadrightarrow;': '\u21a0',
  2085. 'Uacute': '\xda',
  2086. 'uacute': '\xfa',
  2087. 'Uacute;': '\xda',
  2088. 'uacute;': '\xfa',
  2089. 'Uarr;': '\u219f',
  2090. 'uArr;': '\u21d1',
  2091. 'uarr;': '\u2191',
  2092. 'Uarrocir;': '\u2949',
  2093. 'Ubrcy;': '\u040e',
  2094. 'ubrcy;': '\u045e',
  2095. 'Ubreve;': '\u016c',
  2096. 'ubreve;': '\u016d',
  2097. 'Ucirc': '\xdb',
  2098. 'ucirc': '\xfb',
  2099. 'Ucirc;': '\xdb',
  2100. 'ucirc;': '\xfb',
  2101. 'Ucy;': '\u0423',
  2102. 'ucy;': '\u0443',
  2103. 'udarr;': '\u21c5',
  2104. 'Udblac;': '\u0170',
  2105. 'udblac;': '\u0171',
  2106. 'udhar;': '\u296e',
  2107. 'ufisht;': '\u297e',
  2108. 'Ufr;': '\U0001d518',
  2109. 'ufr;': '\U0001d532',
  2110. 'Ugrave': '\xd9',
  2111. 'ugrave': '\xf9',
  2112. 'Ugrave;': '\xd9',
  2113. 'ugrave;': '\xf9',
  2114. 'uHar;': '\u2963',
  2115. 'uharl;': '\u21bf',
  2116. 'uharr;': '\u21be',
  2117. 'uhblk;': '\u2580',
  2118. 'ulcorn;': '\u231c',
  2119. 'ulcorner;': '\u231c',
  2120. 'ulcrop;': '\u230f',
  2121. 'ultri;': '\u25f8',
  2122. 'Umacr;': '\u016a',
  2123. 'umacr;': '\u016b',
  2124. 'uml': '\xa8',
  2125. 'uml;': '\xa8',
  2126. 'UnderBar;': '_',
  2127. 'UnderBrace;': '\u23df',
  2128. 'UnderBracket;': '\u23b5',
  2129. 'UnderParenthesis;': '\u23dd',
  2130. 'Union;': '\u22c3',
  2131. 'UnionPlus;': '\u228e',
  2132. 'Uogon;': '\u0172',
  2133. 'uogon;': '\u0173',
  2134. 'Uopf;': '\U0001d54c',
  2135. 'uopf;': '\U0001d566',
  2136. 'UpArrow;': '\u2191',
  2137. 'Uparrow;': '\u21d1',
  2138. 'uparrow;': '\u2191',
  2139. 'UpArrowBar;': '\u2912',
  2140. 'UpArrowDownArrow;': '\u21c5',
  2141. 'UpDownArrow;': '\u2195',
  2142. 'Updownarrow;': '\u21d5',
  2143. 'updownarrow;': '\u2195',
  2144. 'UpEquilibrium;': '\u296e',
  2145. 'upharpoonleft;': '\u21bf',
  2146. 'upharpoonright;': '\u21be',
  2147. 'uplus;': '\u228e',
  2148. 'UpperLeftArrow;': '\u2196',
  2149. 'UpperRightArrow;': '\u2197',
  2150. 'Upsi;': '\u03d2',
  2151. 'upsi;': '\u03c5',
  2152. 'upsih;': '\u03d2',
  2153. 'Upsilon;': '\u03a5',
  2154. 'upsilon;': '\u03c5',
  2155. 'UpTee;': '\u22a5',
  2156. 'UpTeeArrow;': '\u21a5',
  2157. 'upuparrows;': '\u21c8',
  2158. 'urcorn;': '\u231d',
  2159. 'urcorner;': '\u231d',
  2160. 'urcrop;': '\u230e',
  2161. 'Uring;': '\u016e',
  2162. 'uring;': '\u016f',
  2163. 'urtri;': '\u25f9',
  2164. 'Uscr;': '\U0001d4b0',
  2165. 'uscr;': '\U0001d4ca',
  2166. 'utdot;': '\u22f0',
  2167. 'Utilde;': '\u0168',
  2168. 'utilde;': '\u0169',
  2169. 'utri;': '\u25b5',
  2170. 'utrif;': '\u25b4',
  2171. 'uuarr;': '\u21c8',
  2172. 'Uuml': '\xdc',
  2173. 'uuml': '\xfc',
  2174. 'Uuml;': '\xdc',
  2175. 'uuml;': '\xfc',
  2176. 'uwangle;': '\u29a7',
  2177. 'vangrt;': '\u299c',
  2178. 'varepsilon;': '\u03f5',
  2179. 'varkappa;': '\u03f0',
  2180. 'varnothing;': '\u2205',
  2181. 'varphi;': '\u03d5',
  2182. 'varpi;': '\u03d6',
  2183. 'varpropto;': '\u221d',
  2184. 'vArr;': '\u21d5',
  2185. 'varr;': '\u2195',
  2186. 'varrho;': '\u03f1',
  2187. 'varsigma;': '\u03c2',
  2188. 'varsubsetneq;': '\u228a\ufe00',
  2189. 'varsubsetneqq;': '\u2acb\ufe00',
  2190. 'varsupsetneq;': '\u228b\ufe00',
  2191. 'varsupsetneqq;': '\u2acc\ufe00',
  2192. 'vartheta;': '\u03d1',
  2193. 'vartriangleleft;': '\u22b2',
  2194. 'vartriangleright;': '\u22b3',
  2195. 'Vbar;': '\u2aeb',
  2196. 'vBar;': '\u2ae8',
  2197. 'vBarv;': '\u2ae9',
  2198. 'Vcy;': '\u0412',
  2199. 'vcy;': '\u0432',
  2200. 'VDash;': '\u22ab',
  2201. 'Vdash;': '\u22a9',
  2202. 'vDash;': '\u22a8',
  2203. 'vdash;': '\u22a2',
  2204. 'Vdashl;': '\u2ae6',
  2205. 'Vee;': '\u22c1',
  2206. 'vee;': '\u2228',
  2207. 'veebar;': '\u22bb',
  2208. 'veeeq;': '\u225a',
  2209. 'vellip;': '\u22ee',
  2210. 'Verbar;': '\u2016',
  2211. 'verbar;': '|',
  2212. 'Vert;': '\u2016',
  2213. 'vert;': '|',
  2214. 'VerticalBar;': '\u2223',
  2215. 'VerticalLine;': '|',
  2216. 'VerticalSeparator;': '\u2758',
  2217. 'VerticalTilde;': '\u2240',
  2218. 'VeryThinSpace;': '\u200a',
  2219. 'Vfr;': '\U0001d519',
  2220. 'vfr;': '\U0001d533',
  2221. 'vltri;': '\u22b2',
  2222. 'vnsub;': '\u2282\u20d2',
  2223. 'vnsup;': '\u2283\u20d2',
  2224. 'Vopf;': '\U0001d54d',
  2225. 'vopf;': '\U0001d567',
  2226. 'vprop;': '\u221d',
  2227. 'vrtri;': '\u22b3',
  2228. 'Vscr;': '\U0001d4b1',
  2229. 'vscr;': '\U0001d4cb',
  2230. 'vsubnE;': '\u2acb\ufe00',
  2231. 'vsubne;': '\u228a\ufe00',
  2232. 'vsupnE;': '\u2acc\ufe00',
  2233. 'vsupne;': '\u228b\ufe00',
  2234. 'Vvdash;': '\u22aa',
  2235. 'vzigzag;': '\u299a',
  2236. 'Wcirc;': '\u0174',
  2237. 'wcirc;': '\u0175',
  2238. 'wedbar;': '\u2a5f',
  2239. 'Wedge;': '\u22c0',
  2240. 'wedge;': '\u2227',
  2241. 'wedgeq;': '\u2259',
  2242. 'weierp;': '\u2118',
  2243. 'Wfr;': '\U0001d51a',
  2244. 'wfr;': '\U0001d534',
  2245. 'Wopf;': '\U0001d54e',
  2246. 'wopf;': '\U0001d568',
  2247. 'wp;': '\u2118',
  2248. 'wr;': '\u2240',
  2249. 'wreath;': '\u2240',
  2250. 'Wscr;': '\U0001d4b2',
  2251. 'wscr;': '\U0001d4cc',
  2252. 'xcap;': '\u22c2',
  2253. 'xcirc;': '\u25ef',
  2254. 'xcup;': '\u22c3',
  2255. 'xdtri;': '\u25bd',
  2256. 'Xfr;': '\U0001d51b',
  2257. 'xfr;': '\U0001d535',
  2258. 'xhArr;': '\u27fa',
  2259. 'xharr;': '\u27f7',
  2260. 'Xi;': '\u039e',
  2261. 'xi;': '\u03be',
  2262. 'xlArr;': '\u27f8',
  2263. 'xlarr;': '\u27f5',
  2264. 'xmap;': '\u27fc',
  2265. 'xnis;': '\u22fb',
  2266. 'xodot;': '\u2a00',
  2267. 'Xopf;': '\U0001d54f',
  2268. 'xopf;': '\U0001d569',
  2269. 'xoplus;': '\u2a01',
  2270. 'xotime;': '\u2a02',
  2271. 'xrArr;': '\u27f9',
  2272. 'xrarr;': '\u27f6',
  2273. 'Xscr;': '\U0001d4b3',
  2274. 'xscr;': '\U0001d4cd',
  2275. 'xsqcup;': '\u2a06',
  2276. 'xuplus;': '\u2a04',
  2277. 'xutri;': '\u25b3',
  2278. 'xvee;': '\u22c1',
  2279. 'xwedge;': '\u22c0',
  2280. 'Yacute': '\xdd',
  2281. 'yacute': '\xfd',
  2282. 'Yacute;': '\xdd',
  2283. 'yacute;': '\xfd',
  2284. 'YAcy;': '\u042f',
  2285. 'yacy;': '\u044f',
  2286. 'Ycirc;': '\u0176',
  2287. 'ycirc;': '\u0177',
  2288. 'Ycy;': '\u042b',
  2289. 'ycy;': '\u044b',
  2290. 'yen': '\xa5',
  2291. 'yen;': '\xa5',
  2292. 'Yfr;': '\U0001d51c',
  2293. 'yfr;': '\U0001d536',
  2294. 'YIcy;': '\u0407',
  2295. 'yicy;': '\u0457',
  2296. 'Yopf;': '\U0001d550',
  2297. 'yopf;': '\U0001d56a',
  2298. 'Yscr;': '\U0001d4b4',
  2299. 'yscr;': '\U0001d4ce',
  2300. 'YUcy;': '\u042e',
  2301. 'yucy;': '\u044e',
  2302. 'yuml': '\xff',
  2303. 'Yuml;': '\u0178',
  2304. 'yuml;': '\xff',
  2305. 'Zacute;': '\u0179',
  2306. 'zacute;': '\u017a',
  2307. 'Zcaron;': '\u017d',
  2308. 'zcaron;': '\u017e',
  2309. 'Zcy;': '\u0417',
  2310. 'zcy;': '\u0437',
  2311. 'Zdot;': '\u017b',
  2312. 'zdot;': '\u017c',
  2313. 'zeetrf;': '\u2128',
  2314. 'ZeroWidthSpace;': '\u200b',
  2315. 'Zeta;': '\u0396',
  2316. 'zeta;': '\u03b6',
  2317. 'Zfr;': '\u2128',
  2318. 'zfr;': '\U0001d537',
  2319. 'ZHcy;': '\u0416',
  2320. 'zhcy;': '\u0436',
  2321. 'zigrarr;': '\u21dd',
  2322. 'Zopf;': '\u2124',
  2323. 'zopf;': '\U0001d56b',
  2324. 'Zscr;': '\U0001d4b5',
  2325. 'zscr;': '\U0001d4cf',
  2326. 'zwj;': '\u200d',
  2327. 'zwnj;': '\u200c',
  2328. }
  2329. try:
  2330. import http.client as compat_http_client
  2331. except ImportError: # Python 2
  2332. import httplib as compat_http_client
  2333. try:
  2334. from urllib.error import HTTPError as compat_HTTPError
  2335. except ImportError: # Python 2
  2336. from urllib2 import HTTPError as compat_HTTPError
  2337. try:
  2338. from urllib.request import urlretrieve as compat_urlretrieve
  2339. except ImportError: # Python 2
  2340. from urllib import urlretrieve as compat_urlretrieve
  2341. try:
  2342. from html.parser import HTMLParser as compat_HTMLParser
  2343. except ImportError: # Python 2
  2344. from HTMLParser import HTMLParser as compat_HTMLParser
  2345. try: # Python 2
  2346. from HTMLParser import HTMLParseError as compat_HTMLParseError
  2347. except ImportError: # Python <3.4
  2348. try:
  2349. from html.parser import HTMLParseError as compat_HTMLParseError
  2350. except ImportError: # Python >3.4
  2351. # HTMLParseError has been deprecated in Python 3.3 and removed in
  2352. # Python 3.5. Introducing dummy exception for Python >3.5 for compatible
  2353. # and uniform cross-version exception handling
  2354. class compat_HTMLParseError(Exception):
  2355. pass
  2356. try:
  2357. from subprocess import DEVNULL
  2358. compat_subprocess_get_DEVNULL = lambda: DEVNULL
  2359. except ImportError:
  2360. compat_subprocess_get_DEVNULL = lambda: open(os.path.devnull, 'w')
  2361. try:
  2362. import http.server as compat_http_server
  2363. except ImportError:
  2364. import BaseHTTPServer as compat_http_server
  2365. try:
  2366. from urllib.parse import unquote_to_bytes as compat_urllib_parse_unquote_to_bytes
  2367. from urllib.parse import unquote as compat_urllib_parse_unquote
  2368. from urllib.parse import unquote_plus as compat_urllib_parse_unquote_plus
  2369. except ImportError: # Python 2
  2370. _asciire = (compat_urllib_parse._asciire if hasattr(compat_urllib_parse, '_asciire')
  2371. else re.compile(r'([\x00-\x7f]+)'))
  2372. # HACK: The following are the correct unquote_to_bytes, unquote and unquote_plus
  2373. # implementations from cpython 3.4.3's stdlib. Python 2's version
  2374. # is apparently broken (see https://github.com/ytdl-org/youtube-dl/pull/6244)
  2375. def compat_urllib_parse_unquote_to_bytes(string):
  2376. """unquote_to_bytes('abc%20def') -> b'abc def'."""
  2377. # Note: strings are encoded as UTF-8. This is only an issue if it contains
  2378. # unescaped non-ASCII characters, which URIs should not.
  2379. if not string:
  2380. # Is it a string-like object?
  2381. string.split
  2382. return b''
  2383. if isinstance(string, compat_str):
  2384. string = string.encode('utf-8')
  2385. bits = string.split(b'%')
  2386. if len(bits) == 1:
  2387. return string
  2388. res = [bits[0]]
  2389. append = res.append
  2390. for item in bits[1:]:
  2391. try:
  2392. append(compat_urllib_parse._hextochr[item[:2]])
  2393. append(item[2:])
  2394. except KeyError:
  2395. append(b'%')
  2396. append(item)
  2397. return b''.join(res)
  2398. def compat_urllib_parse_unquote(string, encoding='utf-8', errors='replace'):
  2399. """Replace %xx escapes by their single-character equivalent. The optional
  2400. encoding and errors parameters specify how to decode percent-encoded
  2401. sequences into Unicode characters, as accepted by the bytes.decode()
  2402. method.
  2403. By default, percent-encoded sequences are decoded with UTF-8, and invalid
  2404. sequences are replaced by a placeholder character.
  2405. unquote('abc%20def') -> 'abc def'.
  2406. """
  2407. if '%' not in string:
  2408. string.split
  2409. return string
  2410. if encoding is None:
  2411. encoding = 'utf-8'
  2412. if errors is None:
  2413. errors = 'replace'
  2414. bits = _asciire.split(string)
  2415. res = [bits[0]]
  2416. append = res.append
  2417. for i in range(1, len(bits), 2):
  2418. append(compat_urllib_parse_unquote_to_bytes(bits[i]).decode(encoding, errors))
  2419. append(bits[i + 1])
  2420. return ''.join(res)
  2421. def compat_urllib_parse_unquote_plus(string, encoding='utf-8', errors='replace'):
  2422. """Like unquote(), but also replace plus signs by spaces, as required for
  2423. unquoting HTML form values.
  2424. unquote_plus('%7e/abc+def') -> '~/abc def'
  2425. """
  2426. string = string.replace('+', ' ')
  2427. return compat_urllib_parse_unquote(string, encoding, errors)
  2428. try:
  2429. from urllib.parse import urlencode as compat_urllib_parse_urlencode
  2430. except ImportError: # Python 2
  2431. # Python 2 will choke in urlencode on mixture of byte and unicode strings.
  2432. # Possible solutions are to either port it from python 3 with all
  2433. # the friends or manually ensure input query contains only byte strings.
  2434. # We will stick with latter thus recursively encoding the whole query.
  2435. def compat_urllib_parse_urlencode(query, doseq=0, encoding='utf-8'):
  2436. def encode_elem(e):
  2437. if isinstance(e, dict):
  2438. e = encode_dict(e)
  2439. elif isinstance(e, (list, tuple,)):
  2440. list_e = encode_list(e)
  2441. e = tuple(list_e) if isinstance(e, tuple) else list_e
  2442. elif isinstance(e, compat_str):
  2443. e = e.encode(encoding)
  2444. return e
  2445. def encode_dict(d):
  2446. return dict((encode_elem(k), encode_elem(v)) for k, v in d.items())
  2447. def encode_list(l):
  2448. return [encode_elem(e) for e in l]
  2449. return compat_urllib_parse.urlencode(encode_elem(query), doseq=doseq)
  2450. try:
  2451. from urllib.request import DataHandler as compat_urllib_request_DataHandler
  2452. except ImportError: # Python < 3.4
  2453. # Ported from CPython 98774:1733b3bd46db, Lib/urllib/request.py
  2454. class compat_urllib_request_DataHandler(compat_urllib_request.BaseHandler):
  2455. def data_open(self, req):
  2456. # data URLs as specified in RFC 2397.
  2457. #
  2458. # ignores POSTed data
  2459. #
  2460. # syntax:
  2461. # dataurl := "data:" [ mediatype ] [ ";base64" ] "," data
  2462. # mediatype := [ type "/" subtype ] *( ";" parameter )
  2463. # data := *urlchar
  2464. # parameter := attribute "=" value
  2465. url = req.get_full_url()
  2466. scheme, data = url.split(':', 1)
  2467. mediatype, data = data.split(',', 1)
  2468. # even base64 encoded data URLs might be quoted so unquote in any case:
  2469. data = compat_urllib_parse_unquote_to_bytes(data)
  2470. if mediatype.endswith(';base64'):
  2471. data = binascii.a2b_base64(data)
  2472. mediatype = mediatype[:-7]
  2473. if not mediatype:
  2474. mediatype = 'text/plain;charset=US-ASCII'
  2475. headers = email.message_from_string(
  2476. 'Content-type: %s\nContent-length: %d\n' % (mediatype, len(data)))
  2477. return compat_urllib_response.addinfourl(io.BytesIO(data), headers, url)
  2478. try:
  2479. from xml.etree.ElementTree import ParseError as compat_xml_parse_error
  2480. except ImportError: # Python 2.6
  2481. from xml.parsers.expat import ExpatError as compat_xml_parse_error
  2482. etree = xml.etree.ElementTree
  2483. class _TreeBuilder(etree.TreeBuilder):
  2484. def doctype(self, name, pubid, system):
  2485. pass
  2486. try:
  2487. # xml.etree.ElementTree.Element is a method in Python <=2.6 and
  2488. # the following will crash with:
  2489. # TypeError: isinstance() arg 2 must be a class, type, or tuple of classes and types
  2490. isinstance(None, xml.etree.ElementTree.Element)
  2491. from xml.etree.ElementTree import Element as compat_etree_Element
  2492. except TypeError: # Python <=2.6
  2493. from xml.etree.ElementTree import _ElementInterface as compat_etree_Element
  2494. if sys.version_info[0] >= 3:
  2495. def compat_etree_fromstring(text):
  2496. return etree.XML(text, parser=etree.XMLParser(target=_TreeBuilder()))
  2497. else:
  2498. # python 2.x tries to encode unicode strings with ascii (see the
  2499. # XMLParser._fixtext method)
  2500. try:
  2501. _etree_iter = etree.Element.iter
  2502. except AttributeError: # Python <=2.6
  2503. def _etree_iter(root):
  2504. for el in root.findall('*'):
  2505. yield el
  2506. for sub in _etree_iter(el):
  2507. yield sub
  2508. # on 2.6 XML doesn't have a parser argument, function copied from CPython
  2509. # 2.7 source
  2510. def _XML(text, parser=None):
  2511. if not parser:
  2512. parser = etree.XMLParser(target=_TreeBuilder())
  2513. parser.feed(text)
  2514. return parser.close()
  2515. def _element_factory(*args, **kwargs):
  2516. el = etree.Element(*args, **kwargs)
  2517. for k, v in el.items():
  2518. if isinstance(v, bytes):
  2519. el.set(k, v.decode('utf-8'))
  2520. return el
  2521. def compat_etree_fromstring(text):
  2522. doc = _XML(text, parser=etree.XMLParser(target=_TreeBuilder(element_factory=_element_factory)))
  2523. for el in _etree_iter(doc):
  2524. if el.text is not None and isinstance(el.text, bytes):
  2525. el.text = el.text.decode('utf-8')
  2526. return doc
  2527. if hasattr(etree, 'register_namespace'):
  2528. compat_etree_register_namespace = etree.register_namespace
  2529. else:
  2530. def compat_etree_register_namespace(prefix, uri):
  2531. """Register a namespace prefix.
  2532. The registry is global, and any existing mapping for either the
  2533. given prefix or the namespace URI will be removed.
  2534. *prefix* is the namespace prefix, *uri* is a namespace uri. Tags and
  2535. attributes in this namespace will be serialized with prefix if possible.
  2536. ValueError is raised if prefix is reserved or is invalid.
  2537. """
  2538. if re.match(r"ns\d+$", prefix):
  2539. raise ValueError("Prefix format reserved for internal use")
  2540. for k, v in list(etree._namespace_map.items()):
  2541. if k == uri or v == prefix:
  2542. del etree._namespace_map[k]
  2543. etree._namespace_map[uri] = prefix
  2544. if sys.version_info < (2, 7):
  2545. # Here comes the crazy part: In 2.6, if the xpath is a unicode,
  2546. # .//node does not match if a node is a direct child of . !
  2547. def compat_xpath(xpath):
  2548. if isinstance(xpath, compat_str):
  2549. xpath = xpath.encode('ascii')
  2550. return xpath
  2551. else:
  2552. compat_xpath = lambda xpath: xpath
  2553. try:
  2554. from urllib.parse import parse_qs as compat_parse_qs
  2555. except ImportError: # Python 2
  2556. # HACK: The following is the correct parse_qs implementation from cpython 3's stdlib.
  2557. # Python 2's version is apparently totally broken
  2558. def _parse_qsl(qs, keep_blank_values=False, strict_parsing=False,
  2559. encoding='utf-8', errors='replace'):
  2560. qs, _coerce_result = qs, compat_str
  2561. pairs = [s2 for s1 in qs.split('&') for s2 in s1.split(';')]
  2562. r = []
  2563. for name_value in pairs:
  2564. if not name_value and not strict_parsing:
  2565. continue
  2566. nv = name_value.split('=', 1)
  2567. if len(nv) != 2:
  2568. if strict_parsing:
  2569. raise ValueError('bad query field: %r' % (name_value,))
  2570. # Handle case of a control-name with no equal sign
  2571. if keep_blank_values:
  2572. nv.append('')
  2573. else:
  2574. continue
  2575. if len(nv[1]) or keep_blank_values:
  2576. name = nv[0].replace('+', ' ')
  2577. name = compat_urllib_parse_unquote(
  2578. name, encoding=encoding, errors=errors)
  2579. name = _coerce_result(name)
  2580. value = nv[1].replace('+', ' ')
  2581. value = compat_urllib_parse_unquote(
  2582. value, encoding=encoding, errors=errors)
  2583. value = _coerce_result(value)
  2584. r.append((name, value))
  2585. return r
  2586. def compat_parse_qs(qs, keep_blank_values=False, strict_parsing=False,
  2587. encoding='utf-8', errors='replace'):
  2588. parsed_result = {}
  2589. pairs = _parse_qsl(qs, keep_blank_values, strict_parsing,
  2590. encoding=encoding, errors=errors)
  2591. for name, value in pairs:
  2592. if name in parsed_result:
  2593. parsed_result[name].append(value)
  2594. else:
  2595. parsed_result[name] = [value]
  2596. return parsed_result
  2597. compat_os_name = os._name if os.name == 'java' else os.name
  2598. if compat_os_name == 'nt':
  2599. def compat_shlex_quote(s):
  2600. return s if re.match(r'^[-_\w./]+$', s) else '"%s"' % s.replace('"', '\\"')
  2601. else:
  2602. try:
  2603. from shlex import quote as compat_shlex_quote
  2604. except ImportError: # Python < 3.3
  2605. def compat_shlex_quote(s):
  2606. if re.match(r'^[-_\w./]+$', s):
  2607. return s
  2608. else:
  2609. return "'" + s.replace("'", "'\"'\"'") + "'"
  2610. try:
  2611. args = shlex.split('中文')
  2612. assert (isinstance(args, list)
  2613. and isinstance(args[0], compat_str)
  2614. and args[0] == '中文')
  2615. compat_shlex_split = shlex.split
  2616. except (AssertionError, UnicodeEncodeError):
  2617. # Working around shlex issue with unicode strings on some python 2
  2618. # versions (see http://bugs.python.org/issue1548891)
  2619. def compat_shlex_split(s, comments=False, posix=True):
  2620. if isinstance(s, compat_str):
  2621. s = s.encode('utf-8')
  2622. return list(map(lambda s: s.decode('utf-8'), shlex.split(s, comments, posix)))
  2623. def compat_ord(c):
  2624. if type(c) is int:
  2625. return c
  2626. else:
  2627. return ord(c)
  2628. if sys.version_info >= (3, 0):
  2629. compat_getenv = os.getenv
  2630. compat_expanduser = os.path.expanduser
  2631. def compat_setenv(key, value, env=os.environ):
  2632. env[key] = value
  2633. else:
  2634. # Environment variables should be decoded with filesystem encoding.
  2635. # Otherwise it will fail if any non-ASCII characters present (see #3854 #3217 #2918)
  2636. def compat_getenv(key, default=None):
  2637. from .utils import get_filesystem_encoding
  2638. env = os.getenv(key, default)
  2639. if env:
  2640. env = env.decode(get_filesystem_encoding())
  2641. return env
  2642. def compat_setenv(key, value, env=os.environ):
  2643. def encode(v):
  2644. from .utils import get_filesystem_encoding
  2645. return v.encode(get_filesystem_encoding()) if isinstance(v, compat_str) else v
  2646. env[encode(key)] = encode(value)
  2647. # HACK: The default implementations of os.path.expanduser from cpython do not decode
  2648. # environment variables with filesystem encoding. We will work around this by
  2649. # providing adjusted implementations.
  2650. # The following are os.path.expanduser implementations from cpython 2.7.8 stdlib
  2651. # for different platforms with correct environment variables decoding.
  2652. if compat_os_name == 'posix':
  2653. def compat_expanduser(path):
  2654. """Expand ~ and ~user constructions. If user or $HOME is unknown,
  2655. do nothing."""
  2656. if not path.startswith('~'):
  2657. return path
  2658. i = path.find('/', 1)
  2659. if i < 0:
  2660. i = len(path)
  2661. if i == 1:
  2662. if 'HOME' not in os.environ:
  2663. import pwd
  2664. userhome = pwd.getpwuid(os.getuid()).pw_dir
  2665. else:
  2666. userhome = compat_getenv('HOME')
  2667. else:
  2668. import pwd
  2669. try:
  2670. pwent = pwd.getpwnam(path[1:i])
  2671. except KeyError:
  2672. return path
  2673. userhome = pwent.pw_dir
  2674. userhome = userhome.rstrip('/')
  2675. return (userhome + path[i:]) or '/'
  2676. elif compat_os_name in ('nt', 'ce'):
  2677. def compat_expanduser(path):
  2678. """Expand ~ and ~user constructs.
  2679. If user or $HOME is unknown, do nothing."""
  2680. if path[:1] != '~':
  2681. return path
  2682. i, n = 1, len(path)
  2683. while i < n and path[i] not in '/\\':
  2684. i = i + 1
  2685. if 'HOME' in os.environ:
  2686. userhome = compat_getenv('HOME')
  2687. elif 'USERPROFILE' in os.environ:
  2688. userhome = compat_getenv('USERPROFILE')
  2689. elif 'HOMEPATH' not in os.environ:
  2690. return path
  2691. else:
  2692. try:
  2693. drive = compat_getenv('HOMEDRIVE')
  2694. except KeyError:
  2695. drive = ''
  2696. userhome = os.path.join(drive, compat_getenv('HOMEPATH'))
  2697. if i != 1: # ~user
  2698. userhome = os.path.join(os.path.dirname(userhome), path[1:i])
  2699. return userhome + path[i:]
  2700. else:
  2701. compat_expanduser = os.path.expanduser
  2702. if compat_os_name == 'nt' and sys.version_info < (3, 8):
  2703. # os.path.realpath on Windows does not follow symbolic links
  2704. # prior to Python 3.8 (see https://bugs.python.org/issue9949)
  2705. def compat_realpath(path):
  2706. while os.path.islink(path):
  2707. path = os.path.abspath(os.readlink(path))
  2708. return path
  2709. else:
  2710. compat_realpath = os.path.realpath
  2711. if sys.version_info < (3, 0):
  2712. def compat_print(s):
  2713. from .utils import preferredencoding
  2714. print(s.encode(preferredencoding(), 'xmlcharrefreplace'))
  2715. else:
  2716. def compat_print(s):
  2717. assert isinstance(s, compat_str)
  2718. print(s)
  2719. if sys.version_info < (3, 0) and sys.platform == 'win32':
  2720. def compat_getpass(prompt, *args, **kwargs):
  2721. if isinstance(prompt, compat_str):
  2722. from .utils import preferredencoding
  2723. prompt = prompt.encode(preferredencoding())
  2724. return getpass.getpass(prompt, *args, **kwargs)
  2725. else:
  2726. compat_getpass = getpass.getpass
  2727. try:
  2728. compat_input = raw_input
  2729. except NameError: # Python 3
  2730. compat_input = input
  2731. # Python < 2.6.5 require kwargs to be bytes
  2732. try:
  2733. def _testfunc(x):
  2734. pass
  2735. _testfunc(**{'x': 0})
  2736. except TypeError:
  2737. def compat_kwargs(kwargs):
  2738. return dict((bytes(k), v) for k, v in kwargs.items())
  2739. else:
  2740. compat_kwargs = lambda kwargs: kwargs
  2741. try:
  2742. compat_numeric_types = (int, float, long, complex)
  2743. except NameError: # Python 3
  2744. compat_numeric_types = (int, float, complex)
  2745. try:
  2746. compat_integer_types = (int, long)
  2747. except NameError: # Python 3
  2748. compat_integer_types = (int, )
  2749. if sys.version_info < (2, 7):
  2750. def compat_socket_create_connection(address, timeout, source_address=None):
  2751. host, port = address
  2752. err = None
  2753. for res in socket.getaddrinfo(host, port, 0, socket.SOCK_STREAM):
  2754. af, socktype, proto, canonname, sa = res
  2755. sock = None
  2756. try:
  2757. sock = socket.socket(af, socktype, proto)
  2758. sock.settimeout(timeout)
  2759. if source_address:
  2760. sock.bind(source_address)
  2761. sock.connect(sa)
  2762. return sock
  2763. except socket.error as _:
  2764. err = _
  2765. if sock is not None:
  2766. sock.close()
  2767. if err is not None:
  2768. raise err
  2769. else:
  2770. raise socket.error('getaddrinfo returns an empty list')
  2771. else:
  2772. compat_socket_create_connection = socket.create_connection
  2773. # Fix https://github.com/ytdl-org/youtube-dl/issues/4223
  2774. # See http://bugs.python.org/issue9161 for what is broken
  2775. def workaround_optparse_bug9161():
  2776. op = optparse.OptionParser()
  2777. og = optparse.OptionGroup(op, 'foo')
  2778. try:
  2779. og.add_option('-t')
  2780. except TypeError:
  2781. real_add_option = optparse.OptionGroup.add_option
  2782. def _compat_add_option(self, *args, **kwargs):
  2783. enc = lambda v: (
  2784. v.encode('ascii', 'replace') if isinstance(v, compat_str)
  2785. else v)
  2786. bargs = [enc(a) for a in args]
  2787. bkwargs = dict(
  2788. (k, enc(v)) for k, v in kwargs.items())
  2789. return real_add_option(self, *bargs, **bkwargs)
  2790. optparse.OptionGroup.add_option = _compat_add_option
  2791. if hasattr(shutil, 'get_terminal_size'): # Python >= 3.3
  2792. compat_get_terminal_size = shutil.get_terminal_size
  2793. else:
  2794. _terminal_size = collections.namedtuple('terminal_size', ['columns', 'lines'])
  2795. def compat_get_terminal_size(fallback=(80, 24)):
  2796. from .utils import process_communicate_or_kill
  2797. columns = compat_getenv('COLUMNS')
  2798. if columns:
  2799. columns = int(columns)
  2800. else:
  2801. columns = None
  2802. lines = compat_getenv('LINES')
  2803. if lines:
  2804. lines = int(lines)
  2805. else:
  2806. lines = None
  2807. if columns is None or lines is None or columns <= 0 or lines <= 0:
  2808. try:
  2809. sp = subprocess.Popen(
  2810. ['stty', 'size'],
  2811. stdout=subprocess.PIPE, stderr=subprocess.PIPE)
  2812. out, err = process_communicate_or_kill(sp)
  2813. _lines, _columns = map(int, out.split())
  2814. except Exception:
  2815. _columns, _lines = _terminal_size(*fallback)
  2816. if columns is None or columns <= 0:
  2817. columns = _columns
  2818. if lines is None or lines <= 0:
  2819. lines = _lines
  2820. return _terminal_size(columns, lines)
  2821. try:
  2822. itertools.count(start=0, step=1)
  2823. compat_itertools_count = itertools.count
  2824. except TypeError: # Python 2.6
  2825. def compat_itertools_count(start=0, step=1):
  2826. n = start
  2827. while True:
  2828. yield n
  2829. n += step
  2830. if sys.version_info >= (3, 0):
  2831. from tokenize import tokenize as compat_tokenize_tokenize
  2832. else:
  2833. from tokenize import generate_tokens as compat_tokenize_tokenize
  2834. try:
  2835. struct.pack('!I', 0)
  2836. except TypeError:
  2837. # In Python 2.6 and 2.7.x < 2.7.7, struct requires a bytes argument
  2838. # See https://bugs.python.org/issue19099
  2839. def compat_struct_pack(spec, *args):
  2840. if isinstance(spec, compat_str):
  2841. spec = spec.encode('ascii')
  2842. return struct.pack(spec, *args)
  2843. def compat_struct_unpack(spec, *args):
  2844. if isinstance(spec, compat_str):
  2845. spec = spec.encode('ascii')
  2846. return struct.unpack(spec, *args)
  2847. class compat_Struct(struct.Struct):
  2848. def __init__(self, fmt):
  2849. if isinstance(fmt, compat_str):
  2850. fmt = fmt.encode('ascii')
  2851. super(compat_Struct, self).__init__(fmt)
  2852. else:
  2853. compat_struct_pack = struct.pack
  2854. compat_struct_unpack = struct.unpack
  2855. if platform.python_implementation() == 'IronPython' and sys.version_info < (2, 7, 8):
  2856. class compat_Struct(struct.Struct):
  2857. def unpack(self, string):
  2858. if not isinstance(string, buffer): # noqa: F821
  2859. string = buffer(string) # noqa: F821
  2860. return super(compat_Struct, self).unpack(string)
  2861. else:
  2862. compat_Struct = struct.Struct
  2863. # compat_map/filter() returning an iterator, supposedly the
  2864. # same versioning as for zip below
  2865. try:
  2866. from future_builtins import map as compat_map
  2867. except ImportError:
  2868. try:
  2869. from itertools import imap as compat_map
  2870. except ImportError:
  2871. compat_map = map
  2872. try:
  2873. from future_builtins import filter as compat_filter
  2874. except ImportError:
  2875. try:
  2876. from itertools import ifilter as compat_filter
  2877. except ImportError:
  2878. compat_filter = filter
  2879. try:
  2880. from future_builtins import zip as compat_zip
  2881. except ImportError: # not 2.6+ or is 3.x
  2882. try:
  2883. from itertools import izip as compat_zip # < 2.5 or 3.x
  2884. except ImportError:
  2885. compat_zip = zip
  2886. # method renamed between Py2/3
  2887. try:
  2888. from itertools import zip_longest as compat_itertools_zip_longest
  2889. except ImportError:
  2890. from itertools import izip_longest as compat_itertools_zip_longest
  2891. # new class in collections
  2892. try:
  2893. from collections import ChainMap as compat_collections_chain_map
  2894. # Py3.3's ChainMap is deficient
  2895. if sys.version_info < (3, 4):
  2896. raise ImportError
  2897. except ImportError:
  2898. # Py <= 3.3
  2899. class compat_collections_chain_map(compat_collections_abc.MutableMapping):
  2900. maps = [{}]
  2901. def __init__(self, *maps):
  2902. self.maps = list(maps) or [{}]
  2903. def __getitem__(self, k):
  2904. for m in self.maps:
  2905. if k in m:
  2906. return m[k]
  2907. raise KeyError(k)
  2908. def __setitem__(self, k, v):
  2909. self.maps[0].__setitem__(k, v)
  2910. return
  2911. def __contains__(self, k):
  2912. return any((k in m) for m in self.maps)
  2913. def __delitem(self, k):
  2914. if k in self.maps[0]:
  2915. del self.maps[0][k]
  2916. return
  2917. raise KeyError(k)
  2918. def __delitem__(self, k):
  2919. self.__delitem(k)
  2920. def __iter__(self):
  2921. return itertools.chain(*reversed(self.maps))
  2922. def __len__(self):
  2923. return len(iter(self))
  2924. # to match Py3, don't del directly
  2925. def pop(self, k, *args):
  2926. if self.__contains__(k):
  2927. off = self.__getitem__(k)
  2928. self.__delitem(k)
  2929. return off
  2930. elif len(args) > 0:
  2931. return args[0]
  2932. raise KeyError(k)
  2933. def new_child(self, m=None, **kwargs):
  2934. m = m or {}
  2935. m.update(kwargs)
  2936. return compat_collections_chain_map(m, *self.maps)
  2937. @property
  2938. def parents(self):
  2939. return compat_collections_chain_map(*(self.maps[1:]))
  2940. # Pythons disagree on the type of a pattern (RegexObject, _sre.SRE_Pattern, Pattern, ...?)
  2941. compat_re_Pattern = type(re.compile(''))
  2942. # and on the type of a match
  2943. compat_re_Match = type(re.match('a', 'a'))
  2944. if sys.version_info < (3, 3):
  2945. def compat_b64decode(s, *args, **kwargs):
  2946. if isinstance(s, compat_str):
  2947. s = s.encode('ascii')
  2948. return base64.b64decode(s, *args, **kwargs)
  2949. else:
  2950. compat_b64decode = base64.b64decode
  2951. if platform.python_implementation() == 'PyPy' and sys.pypy_version_info < (5, 4, 0):
  2952. # PyPy2 prior to version 5.4.0 expects byte strings as Windows function
  2953. # names, see the original PyPy issue [1] and the youtube-dl one [2].
  2954. # 1. https://bitbucket.org/pypy/pypy/issues/2360/windows-ctypescdll-typeerror-function-name
  2955. # 2. https://github.com/ytdl-org/youtube-dl/pull/4392
  2956. def compat_ctypes_WINFUNCTYPE(*args, **kwargs):
  2957. real = ctypes.WINFUNCTYPE(*args, **kwargs)
  2958. def resf(tpl, *args, **kwargs):
  2959. funcname, dll = tpl
  2960. return real((str(funcname), dll), *args, **kwargs)
  2961. return resf
  2962. else:
  2963. def compat_ctypes_WINFUNCTYPE(*args, **kwargs):
  2964. return ctypes.WINFUNCTYPE(*args, **kwargs)
  2965. __all__ = [
  2966. 'compat_HTMLParseError',
  2967. 'compat_HTMLParser',
  2968. 'compat_HTTPError',
  2969. 'compat_Struct',
  2970. 'compat_b64decode',
  2971. 'compat_basestring',
  2972. 'compat_casefold',
  2973. 'compat_chr',
  2974. 'compat_collections_abc',
  2975. 'compat_collections_chain_map',
  2976. 'compat_cookiejar',
  2977. 'compat_cookiejar_Cookie',
  2978. 'compat_cookies',
  2979. 'compat_cookies_SimpleCookie',
  2980. 'compat_ctypes_WINFUNCTYPE',
  2981. 'compat_etree_Element',
  2982. 'compat_etree_fromstring',
  2983. 'compat_etree_register_namespace',
  2984. 'compat_expanduser',
  2985. 'compat_filter',
  2986. 'compat_get_terminal_size',
  2987. 'compat_getenv',
  2988. 'compat_getpass',
  2989. 'compat_html_entities',
  2990. 'compat_html_entities_html5',
  2991. 'compat_http_client',
  2992. 'compat_http_server',
  2993. 'compat_input',
  2994. 'compat_integer_types',
  2995. 'compat_itertools_count',
  2996. 'compat_itertools_zip_longest',
  2997. 'compat_kwargs',
  2998. 'compat_map',
  2999. 'compat_numeric_types',
  3000. 'compat_ord',
  3001. 'compat_os_name',
  3002. 'compat_parse_qs',
  3003. 'compat_print',
  3004. 'compat_re_Match',
  3005. 'compat_re_Pattern',
  3006. 'compat_realpath',
  3007. 'compat_setenv',
  3008. 'compat_shlex_quote',
  3009. 'compat_shlex_split',
  3010. 'compat_socket_create_connection',
  3011. 'compat_str',
  3012. 'compat_struct_pack',
  3013. 'compat_struct_unpack',
  3014. 'compat_subprocess_get_DEVNULL',
  3015. 'compat_tokenize_tokenize',
  3016. 'compat_urllib_error',
  3017. 'compat_urllib_parse',
  3018. 'compat_urllib_parse_unquote',
  3019. 'compat_urllib_parse_unquote_plus',
  3020. 'compat_urllib_parse_unquote_to_bytes',
  3021. 'compat_urllib_parse_urlencode',
  3022. 'compat_urllib_parse_urlparse',
  3023. 'compat_urllib_request',
  3024. 'compat_urllib_request_DataHandler',
  3025. 'compat_urllib_response',
  3026. 'compat_urlparse',
  3027. 'compat_urlretrieve',
  3028. 'compat_xml_parse_error',
  3029. 'compat_xpath',
  3030. 'compat_zip',
  3031. 'workaround_optparse_bug9161',
  3032. ]