compat.py 99 KB

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