compat.py 100 KB

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