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

Generated by cgit