How to use unknown method in Slash

Best Python code snippet using slash

rl_codecs.py

Source:rl_codecs.py Github

copy

Full Screen

1#codecs support2__all__=['RL_Codecs']3from collections import namedtuple4StdCodecData=namedtuple('StdCodecData','exceptions rexceptions')5ExtCodecData=namedtuple('ExtCodecData','baseName exceptions rexceptions')6class RL_Codecs:7 __rl_codecs_data = {8 'winansi':StdCodecData({9 0x007f: 0x2022, # BULLET10 0x0080: 0x20ac, # EURO SIGN11 0x0081: 0x2022, # BULLET12 0x0082: 0x201a, # SINGLE LOW-9 QUOTATION MARK13 0x0083: 0x0192, # LATIN SMALL LETTER F WITH HOOK14 0x0084: 0x201e, # DOUBLE LOW-9 QUOTATION MARK15 0x0085: 0x2026, # HORIZONTAL ELLIPSIS16 0x0086: 0x2020, # DAGGER17 0x0087: 0x2021, # DOUBLE DAGGER18 0x0088: 0x02c6, # MODIFIER LETTER CIRCUMFLEX ACCENT19 0x0089: 0x2030, # PER MILLE SIGN20 0x008a: 0x0160, # LATIN CAPITAL LETTER S WITH CARON21 0x008b: 0x2039, # SINGLE LEFT-POINTING ANGLE QUOTATION MARK22 0x008c: 0x0152, # LATIN CAPITAL LIGATURE OE23 0x008d: 0x2022, # BULLET24 0x008e: 0x017d, # LATIN CAPITAL LETTER Z WITH CARON25 0x008f: 0x2022, # BULLET26 0x0090: 0x2022, # BULLET27 0x0091: 0x2018, # LEFT SINGLE QUOTATION MARK28 0x0092: 0x2019, # RIGHT SINGLE QUOTATION MARK29 0x0093: 0x201c, # LEFT DOUBLE QUOTATION MARK30 0x0094: 0x201d, # RIGHT DOUBLE QUOTATION MARK31 0x0095: 0x2022, # BULLET32 0x0096: 0x2013, # EN DASH33 0x0097: 0x2014, # EM DASH34 0x0098: 0x02dc, # SMALL TILDE35 0x0099: 0x2122, # TRADE MARK SIGN36 0x009a: 0x0161, # LATIN SMALL LETTER S WITH CARON37 0x009b: 0x203a, # SINGLE RIGHT-POINTING ANGLE QUOTATION MARK38 0x009c: 0x0153, # LATIN SMALL LIGATURE OE39 0x009d: 0x2022, # BULLET40 0x009e: 0x017e, # LATIN SMALL LETTER Z WITH CARON41 0x009f: 0x0178, # LATIN CAPITAL LETTER Y WITH DIAERESIS42 0x00a0: 0x0020, # SPACE43 }, {0x2022:0x7f,0x20:0x20,0xa0:0x20}),44 'macroman':StdCodecData({45 0x007f: None, # UNDEFINED46 0x0080: 0x00c4, # LATIN CAPITAL LETTER A WITH DIAERESIS47 0x0081: 0x00c5, # LATIN CAPITAL LETTER A WITH RING ABOVE48 0x0082: 0x00c7, # LATIN CAPITAL LETTER C WITH CEDILLA49 0x0083: 0x00c9, # LATIN CAPITAL LETTER E WITH ACUTE50 0x0084: 0x00d1, # LATIN CAPITAL LETTER N WITH TILDE51 0x0085: 0x00d6, # LATIN CAPITAL LETTER O WITH DIAERESIS52 0x0086: 0x00dc, # LATIN CAPITAL LETTER U WITH DIAERESIS53 0x0087: 0x00e1, # LATIN SMALL LETTER A WITH ACUTE54 0x0088: 0x00e0, # LATIN SMALL LETTER A WITH GRAVE55 0x0089: 0x00e2, # LATIN SMALL LETTER A WITH CIRCUMFLEX56 0x008a: 0x00e4, # LATIN SMALL LETTER A WITH DIAERESIS57 0x008b: 0x00e3, # LATIN SMALL LETTER A WITH TILDE58 0x008c: 0x00e5, # LATIN SMALL LETTER A WITH RING ABOVE59 0x008d: 0x00e7, # LATIN SMALL LETTER C WITH CEDILLA60 0x008e: 0x00e9, # LATIN SMALL LETTER E WITH ACUTE61 0x008f: 0x00e8, # LATIN SMALL LETTER E WITH GRAVE62 0x0090: 0x00ea, # LATIN SMALL LETTER E WITH CIRCUMFLEX63 0x0091: 0x00eb, # LATIN SMALL LETTER E WITH DIAERESIS64 0x0092: 0x00ed, # LATIN SMALL LETTER I WITH ACUTE65 0x0093: 0x00ec, # LATIN SMALL LETTER I WITH GRAVE66 0x0094: 0x00ee, # LATIN SMALL LETTER I WITH CIRCUMFLEX67 0x0095: 0x00ef, # LATIN SMALL LETTER I WITH DIAERESIS68 0x0096: 0x00f1, # LATIN SMALL LETTER N WITH TILDE69 0x0097: 0x00f3, # LATIN SMALL LETTER O WITH ACUTE70 0x0098: 0x00f2, # LATIN SMALL LETTER O WITH GRAVE71 0x0099: 0x00f4, # LATIN SMALL LETTER O WITH CIRCUMFLEX72 0x009a: 0x00f6, # LATIN SMALL LETTER O WITH DIAERESIS73 0x009b: 0x00f5, # LATIN SMALL LETTER O WITH TILDE74 0x009c: 0x00fa, # LATIN SMALL LETTER U WITH ACUTE75 0x009d: 0x00f9, # LATIN SMALL LETTER U WITH GRAVE76 0x009e: 0x00fb, # LATIN SMALL LETTER U WITH CIRCUMFLEX77 0x009f: 0x00fc, # LATIN SMALL LETTER U WITH DIAERESIS78 0x00a0: 0x2020, # DAGGER79 0x00a1: 0x00b0, # DEGREE SIGN80 0x00a4: 0x00a7, # SECTION SIGN81 0x00a5: 0x2022, # BULLET82 0x00a6: 0x00b6, # PILCROW SIGN83 0x00a7: 0x00df, # LATIN SMALL LETTER SHARP S84 0x00a8: 0x00ae, # REGISTERED SIGN85 0x00aa: 0x2122, # TRADE MARK SIGN86 0x00ab: 0x00b4, # ACUTE ACCENT87 0x00ac: 0x00a8, # DIAERESIS88 0x00ad: None, # UNDEFINED89 0x00ae: 0x00c6, # LATIN CAPITAL LETTER AE90 0x00af: 0x00d8, # LATIN CAPITAL LETTER O WITH STROKE91 0x00b0: None, # UNDEFINED92 0x00b2: None, # UNDEFINED93 0x00b3: None, # UNDEFINED94 0x00b4: 0x00a5, # YEN SIGN95 0x00b6: None, # UNDEFINED96 0x00b7: None, # UNDEFINED97 0x00b8: None, # UNDEFINED98 0x00b9: None, # UNDEFINED99 0x00ba: None, # UNDEFINED100 0x00bb: 0x00aa, # FEMININE ORDINAL INDICATOR101 0x00bc: 0x00ba, # MASCULINE ORDINAL INDICATOR102 0x00bd: None, # UNDEFINED103 0x00be: 0x00e6, # LATIN SMALL LETTER AE104 0x00bf: 0x00f8, # LATIN SMALL LETTER O WITH STROKE105 0x00c0: 0x00bf, # INVERTED QUESTION MARK106 0x00c1: 0x00a1, # INVERTED EXCLAMATION MARK107 0x00c2: 0x00ac, # NOT SIGN108 0x00c3: None, # UNDEFINED109 0x00c4: 0x0192, # LATIN SMALL LETTER F WITH HOOK110 0x00c5: None, # UNDEFINED111 0x00c6: None, # UNDEFINED112 0x00c7: 0x00ab, # LEFT-POINTING DOUBLE ANGLE QUOTATION MARK113 0x00c8: 0x00bb, # RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK114 0x00c9: 0x2026, # HORIZONTAL ELLIPSIS115 0x00ca: 0x0020, # SPACE116 0x00cb: 0x00c0, # LATIN CAPITAL LETTER A WITH GRAVE117 0x00cc: 0x00c3, # LATIN CAPITAL LETTER A WITH TILDE118 0x00cd: 0x00d5, # LATIN CAPITAL LETTER O WITH TILDE119 0x00ce: 0x0152, # LATIN CAPITAL LIGATURE OE120 0x00cf: 0x0153, # LATIN SMALL LIGATURE OE121 0x00d0: 0x2013, # EN DASH122 0x00d1: 0x2014, # EM DASH123 0x00d2: 0x201c, # LEFT DOUBLE QUOTATION MARK124 0x00d3: 0x201d, # RIGHT DOUBLE QUOTATION MARK125 0x00d4: 0x2018, # LEFT SINGLE QUOTATION MARK126 0x00d5: 0x2019, # RIGHT SINGLE QUOTATION MARK127 0x00d6: 0x00f7, # DIVISION SIGN128 0x00d7: None, # UNDEFINED129 0x00d8: 0x00ff, # LATIN SMALL LETTER Y WITH DIAERESIS130 0x00d9: 0x0178, # LATIN CAPITAL LETTER Y WITH DIAERESIS131 0x00da: 0x2044, # FRACTION SLASH132 0x00db: 0x00a4, # CURRENCY SIGN133 0x00dc: 0x2039, # SINGLE LEFT-POINTING ANGLE QUOTATION MARK134 0x00dd: 0x203a, # SINGLE RIGHT-POINTING ANGLE QUOTATION MARK135 0x00de: 0xfb01, # LATIN SMALL LIGATURE FI136 0x00df: 0xfb02, # LATIN SMALL LIGATURE FL137 0x00e0: 0x2021, # DOUBLE DAGGER138 0x00e1: 0x00b7, # MIDDLE DOT139 0x00e2: 0x201a, # SINGLE LOW-9 QUOTATION MARK140 0x00e3: 0x201e, # DOUBLE LOW-9 QUOTATION MARK141 0x00e4: 0x2030, # PER MILLE SIGN142 0x00e5: 0x00c2, # LATIN CAPITAL LETTER A WITH CIRCUMFLEX143 0x00e6: 0x00ca, # LATIN CAPITAL LETTER E WITH CIRCUMFLEX144 0x00e7: 0x00c1, # LATIN CAPITAL LETTER A WITH ACUTE145 0x00e8: 0x00cb, # LATIN CAPITAL LETTER E WITH DIAERESIS146 0x00e9: 0x00c8, # LATIN CAPITAL LETTER E WITH GRAVE147 0x00ea: 0x00cd, # LATIN CAPITAL LETTER I WITH ACUTE148 0x00eb: 0x00ce, # LATIN CAPITAL LETTER I WITH CIRCUMFLEX149 0x00ec: 0x00cf, # LATIN CAPITAL LETTER I WITH DIAERESIS150 0x00ed: 0x00cc, # LATIN CAPITAL LETTER I WITH GRAVE151 0x00ee: 0x00d3, # LATIN CAPITAL LETTER O WITH ACUTE152 0x00ef: 0x00d4, # LATIN CAPITAL LETTER O WITH CIRCUMFLEX153 0x00f0: None, # UNDEFINED154 0x00f1: 0x00d2, # LATIN CAPITAL LETTER O WITH GRAVE155 0x00f2: 0x00da, # LATIN CAPITAL LETTER U WITH ACUTE156 0x00f3: 0x00db, # LATIN CAPITAL LETTER U WITH CIRCUMFLEX157 0x00f4: 0x00d9, # LATIN CAPITAL LETTER U WITH GRAVE158 0x00f5: 0x0131, # LATIN SMALL LETTER DOTLESS I159 0x00f6: 0x02c6, # MODIFIER LETTER CIRCUMFLEX ACCENT160 0x00f7: 0x02dc, # SMALL TILDE161 0x00f8: 0x00af, # MACRON162 0x00f9: 0x02d8, # BREVE163 0x00fa: 0x02d9, # DOT ABOVE164 0x00fb: 0x02da, # RING ABOVE165 0x00fc: 0x00b8, # CEDILLA166 0x00fd: 0x02dd, # DOUBLE ACUTE ACCENT167 0x00fe: 0x02db, # OGONEK168 0x00ff: 0x02c7, # CARON169 },None),170 'standard':StdCodecData({171 0x0027: 0x2019, # RIGHT SINGLE QUOTATION MARK172 0x0060: 0x2018, # LEFT SINGLE QUOTATION MARK173 0x007f: None, # UNDEFINED174 0x0080: None, # UNDEFINED175 0x0081: None, # UNDEFINED176 0x0082: None, # UNDEFINED177 0x0083: None, # UNDEFINED178 0x0084: None, # UNDEFINED179 0x0085: None, # UNDEFINED180 0x0086: None, # UNDEFINED181 0x0087: None, # UNDEFINED182 0x0088: None, # UNDEFINED183 0x0089: None, # UNDEFINED184 0x008a: None, # UNDEFINED185 0x008b: None, # UNDEFINED186 0x008c: None, # UNDEFINED187 0x008d: None, # UNDEFINED188 0x008e: None, # UNDEFINED189 0x008f: None, # UNDEFINED190 0x0090: None, # UNDEFINED191 0x0091: None, # UNDEFINED192 0x0092: None, # UNDEFINED193 0x0093: None, # UNDEFINED194 0x0094: None, # UNDEFINED195 0x0095: None, # UNDEFINED196 0x0096: None, # UNDEFINED197 0x0097: None, # UNDEFINED198 0x0098: None, # UNDEFINED199 0x0099: None, # UNDEFINED200 0x009a: None, # UNDEFINED201 0x009b: None, # UNDEFINED202 0x009c: None, # UNDEFINED203 0x009d: None, # UNDEFINED204 0x009e: None, # UNDEFINED205 0x009f: None, # UNDEFINED206 0x00a0: None, # UNDEFINED207 0x00a4: 0x2044, # FRACTION SLASH208 0x00a6: 0x0192, # LATIN SMALL LETTER F WITH HOOK209 0x00a8: 0x00a4, # CURRENCY SIGN210 0x00a9: 0x0027, # APOSTROPHE211 0x00aa: 0x201c, # LEFT DOUBLE QUOTATION MARK212 0x00ac: 0x2039, # SINGLE LEFT-POINTING ANGLE QUOTATION MARK213 0x00ad: 0x203a, # SINGLE RIGHT-POINTING ANGLE QUOTATION MARK214 0x00ae: 0xfb01, # LATIN SMALL LIGATURE FI215 0x00af: 0xfb02, # LATIN SMALL LIGATURE FL216 0x00b0: None, # UNDEFINED217 0x00b1: 0x2013, # EN DASH218 0x00b2: 0x2020, # DAGGER219 0x00b3: 0x2021, # DOUBLE DAGGER220 0x00b4: 0x00b7, # MIDDLE DOT221 0x00b5: None, # UNDEFINED222 0x00b7: 0x2022, # BULLET223 0x00b8: 0x201a, # SINGLE LOW-9 QUOTATION MARK224 0x00b9: 0x201e, # DOUBLE LOW-9 QUOTATION MARK225 0x00ba: 0x201d, # RIGHT DOUBLE QUOTATION MARK226 0x00bc: 0x2026, # HORIZONTAL ELLIPSIS227 0x00bd: 0x2030, # PER MILLE SIGN228 0x00be: None, # UNDEFINED229 0x00c0: None, # UNDEFINED230 0x00c1: 0x0060, # GRAVE ACCENT231 0x00c2: 0x00b4, # ACUTE ACCENT232 0x00c3: 0x02c6, # MODIFIER LETTER CIRCUMFLEX ACCENT233 0x00c4: 0x02dc, # SMALL TILDE234 0x00c5: 0x00af, # MACRON235 0x00c6: 0x02d8, # BREVE236 0x00c7: 0x02d9, # DOT ABOVE237 0x00c8: 0x00a8, # DIAERESIS238 0x00c9: None, # UNDEFINED239 0x00ca: 0x02da, # RING ABOVE240 0x00cb: 0x00b8, # CEDILLA241 0x00cc: None, # UNDEFINED242 0x00cd: 0x02dd, # DOUBLE ACUTE ACCENT243 0x00ce: 0x02db, # OGONEK244 0x00cf: 0x02c7, # CARON245 0x00d0: 0x2014, # EM DASH246 0x00d1: None, # UNDEFINED247 0x00d2: None, # UNDEFINED248 0x00d3: None, # UNDEFINED249 0x00d4: None, # UNDEFINED250 0x00d5: None, # UNDEFINED251 0x00d6: None, # UNDEFINED252 0x00d7: None, # UNDEFINED253 0x00d8: None, # UNDEFINED254 0x00d9: None, # UNDEFINED255 0x00da: None, # UNDEFINED256 0x00db: None, # UNDEFINED257 0x00dc: None, # UNDEFINED258 0x00dd: None, # UNDEFINED259 0x00de: None, # UNDEFINED260 0x00df: None, # UNDEFINED261 0x00e0: None, # UNDEFINED262 0x00e1: 0x00c6, # LATIN CAPITAL LETTER AE263 0x00e2: None, # UNDEFINED264 0x00e3: 0x00aa, # FEMININE ORDINAL INDICATOR265 0x00e4: None, # UNDEFINED266 0x00e5: None, # UNDEFINED267 0x00e6: None, # UNDEFINED268 0x00e7: None, # UNDEFINED269 0x00e8: 0x0141, # LATIN CAPITAL LETTER L WITH STROKE270 0x00e9: 0x00d8, # LATIN CAPITAL LETTER O WITH STROKE271 0x00ea: 0x0152, # LATIN CAPITAL LIGATURE OE272 0x00eb: 0x00ba, # MASCULINE ORDINAL INDICATOR273 0x00ec: None, # UNDEFINED274 0x00ed: None, # UNDEFINED275 0x00ee: None, # UNDEFINED276 0x00ef: None, # UNDEFINED277 0x00f0: None, # UNDEFINED278 0x00f1: 0x00e6, # LATIN SMALL LETTER AE279 0x00f2: None, # UNDEFINED280 0x00f3: None, # UNDEFINED281 0x00f4: None, # UNDEFINED282 0x00f5: 0x0131, # LATIN SMALL LETTER DOTLESS I283 0x00f6: None, # UNDEFINED284 0x00f7: None, # UNDEFINED285 0x00f8: 0x0142, # LATIN SMALL LETTER L WITH STROKE286 0x00f9: 0x00f8, # LATIN SMALL LETTER O WITH STROKE287 0x00fa: 0x0153, # LATIN SMALL LIGATURE OE288 0x00fb: 0x00df, # LATIN SMALL LETTER SHARP S289 0x00fc: None, # UNDEFINED290 0x00fd: None, # UNDEFINED291 0x00fe: None, # UNDEFINED292 0x00ff: None, # UNDEFINED293 },None),294 'symbol':StdCodecData({295 0x0022: 0x2200, # FOR ALL296 0x0024: 0x2203, # THERE EXISTS297 0x0027: 0x220b, # CONTAINS AS MEMBER298 0x002a: 0x2217, # ASTERISK OPERATOR299 0x002d: 0x2212, # MINUS SIGN300 0x0040: 0x2245, # APPROXIMATELY EQUAL TO301 0x0041: 0x0391, # GREEK CAPITAL LETTER ALPHA302 0x0042: 0x0392, # GREEK CAPITAL LETTER BETA303 0x0043: 0x03a7, # GREEK CAPITAL LETTER CHI304 0x0044: 0x2206, # INCREMENT305 0x0045: 0x0395, # GREEK CAPITAL LETTER EPSILON306 0x0046: 0x03a6, # GREEK CAPITAL LETTER PHI307 0x0047: 0x0393, # GREEK CAPITAL LETTER GAMMA308 0x0048: 0x0397, # GREEK CAPITAL LETTER ETA309 0x0049: 0x0399, # GREEK CAPITAL LETTER IOTA310 0x004a: 0x03d1, # GREEK THETA SYMBOL311 0x004b: 0x039a, # GREEK CAPITAL LETTER KAPPA312 0x004c: 0x039b, # GREEK CAPITAL LETTER LAMDA313 0x004d: 0x039c, # GREEK CAPITAL LETTER MU314 0x004e: 0x039d, # GREEK CAPITAL LETTER NU315 0x004f: 0x039f, # GREEK CAPITAL LETTER OMICRON316 0x0050: 0x03a0, # GREEK CAPITAL LETTER PI317 0x0051: 0x0398, # GREEK CAPITAL LETTER THETA318 0x0052: 0x03a1, # GREEK CAPITAL LETTER RHO319 0x0053: 0x03a3, # GREEK CAPITAL LETTER SIGMA320 0x0054: 0x03a4, # GREEK CAPITAL LETTER TAU321 0x0055: 0x03a5, # GREEK CAPITAL LETTER UPSILON322 0x0056: 0x03c2, # GREEK SMALL LETTER FINAL SIGMA323 0x0057: 0x2126, # OHM SIGN324 0x0058: 0x039e, # GREEK CAPITAL LETTER XI325 0x0059: 0x03a8, # GREEK CAPITAL LETTER PSI326 0x005a: 0x0396, # GREEK CAPITAL LETTER ZETA327 0x005c: 0x2234, # THEREFORE328 0x005e: 0x22a5, # UP TACK329 0x0060: 0xf8e5, # [unknown unicode name for radicalex]330 0x0061: 0x03b1, # GREEK SMALL LETTER ALPHA331 0x0062: 0x03b2, # GREEK SMALL LETTER BETA332 0x0063: 0x03c7, # GREEK SMALL LETTER CHI333 0x0064: 0x03b4, # GREEK SMALL LETTER DELTA334 0x0065: 0x03b5, # GREEK SMALL LETTER EPSILON335 0x0066: 0x03c6, # GREEK SMALL LETTER PHI336 0x0067: 0x03b3, # GREEK SMALL LETTER GAMMA337 0x0068: 0x03b7, # GREEK SMALL LETTER ETA338 0x0069: 0x03b9, # GREEK SMALL LETTER IOTA339 0x006a: 0x03d5, # GREEK PHI SYMBOL340 0x006b: 0x03ba, # GREEK SMALL LETTER KAPPA341 0x006c: 0x03bb, # GREEK SMALL LETTER LAMDA342 0x006d: 0x00b5, # MICRO SIGN343 0x006e: 0x03bd, # GREEK SMALL LETTER NU344 0x006f: 0x03bf, # GREEK SMALL LETTER OMICRON345 0x0070: 0x03c0, # GREEK SMALL LETTER PI346 0x0071: 0x03b8, # GREEK SMALL LETTER THETA347 0x0072: 0x03c1, # GREEK SMALL LETTER RHO348 0x0073: 0x03c3, # GREEK SMALL LETTER SIGMA349 0x0074: 0x03c4, # GREEK SMALL LETTER TAU350 0x0075: 0x03c5, # GREEK SMALL LETTER UPSILON351 0x0076: 0x03d6, # GREEK PI SYMBOL352 0x0077: 0x03c9, # GREEK SMALL LETTER OMEGA353 0x0078: 0x03be, # GREEK SMALL LETTER XI354 0x0079: 0x03c8, # GREEK SMALL LETTER PSI355 0x007a: 0x03b6, # GREEK SMALL LETTER ZETA356 0x007e: 0x223c, # TILDE OPERATOR357 0x007f: None, # UNDEFINED358 0x0080: None, # UNDEFINED359 0x0081: None, # UNDEFINED360 0x0082: None, # UNDEFINED361 0x0083: None, # UNDEFINED362 0x0084: None, # UNDEFINED363 0x0085: None, # UNDEFINED364 0x0086: None, # UNDEFINED365 0x0087: None, # UNDEFINED366 0x0088: None, # UNDEFINED367 0x0089: None, # UNDEFINED368 0x008a: None, # UNDEFINED369 0x008b: None, # UNDEFINED370 0x008c: None, # UNDEFINED371 0x008d: None, # UNDEFINED372 0x008e: None, # UNDEFINED373 0x008f: None, # UNDEFINED374 0x0090: None, # UNDEFINED375 0x0091: None, # UNDEFINED376 0x0092: None, # UNDEFINED377 0x0093: None, # UNDEFINED378 0x0094: None, # UNDEFINED379 0x0095: None, # UNDEFINED380 0x0096: None, # UNDEFINED381 0x0097: None, # UNDEFINED382 0x0098: None, # UNDEFINED383 0x0099: None, # UNDEFINED384 0x009a: None, # UNDEFINED385 0x009b: None, # UNDEFINED386 0x009c: None, # UNDEFINED387 0x009d: None, # UNDEFINED388 0x009e: None, # UNDEFINED389 0x009f: None, # UNDEFINED390 0x00a0: 0x20ac, # EURO SIGN391 0x00a1: 0x03d2, # GREEK UPSILON WITH HOOK SYMBOL392 0x00a2: 0x2032, # PRIME393 0x00a3: 0x2264, # LESS-THAN OR EQUAL TO394 0x00a4: 0x2044, # FRACTION SLASH395 0x00a5: 0x221e, # INFINITY396 0x00a6: 0x0192, # LATIN SMALL LETTER F WITH HOOK397 0x00a7: 0x2663, # BLACK CLUB SUIT398 0x00a8: 0x2666, # BLACK DIAMOND SUIT399 0x00a9: 0x2665, # BLACK HEART SUIT400 0x00aa: 0x2660, # BLACK SPADE SUIT401 0x00ab: 0x2194, # LEFT RIGHT ARROW402 0x00ac: 0x2190, # LEFTWARDS ARROW403 0x00ad: 0x2191, # UPWARDS ARROW404 0x00ae: 0x2192, # RIGHTWARDS ARROW405 0x00af: 0x2193, # DOWNWARDS ARROW406 0x00b2: 0x2033, # DOUBLE PRIME407 0x00b3: 0x2265, # GREATER-THAN OR EQUAL TO408 0x00b4: 0x00d7, # MULTIPLICATION SIGN409 0x00b5: 0x221d, # PROPORTIONAL TO410 0x00b6: 0x2202, # PARTIAL DIFFERENTIAL411 0x00b7: 0x2022, # BULLET412 0x00b8: 0x00f7, # DIVISION SIGN413 0x00b9: 0x2260, # NOT EQUAL TO414 0x00ba: 0x2261, # IDENTICAL TO415 0x00bb: 0x2248, # ALMOST EQUAL TO416 0x00bc: 0x2026, # HORIZONTAL ELLIPSIS417 0x00bd: 0xf8e6, # [unknown unicode name for arrowvertex]418 0x00be: 0xf8e7, # [unknown unicode name for arrowhorizex]419 0x00bf: 0x21b5, # DOWNWARDS ARROW WITH CORNER LEFTWARDS420 0x00c0: 0x2135, # ALEF SYMBOL421 0x00c1: 0x2111, # BLACK-LETTER CAPITAL I422 0x00c2: 0x211c, # BLACK-LETTER CAPITAL R423 0x00c3: 0x2118, # SCRIPT CAPITAL P424 0x00c4: 0x2297, # CIRCLED TIMES425 0x00c5: 0x2295, # CIRCLED PLUS426 0x00c6: 0x2205, # EMPTY SET427 0x00c7: 0x2229, # INTERSECTION428 0x00c8: 0x222a, # UNION429 0x00c9: 0x2283, # SUPERSET OF430 0x00ca: 0x2287, # SUPERSET OF OR EQUAL TO431 0x00cb: 0x2284, # NOT A SUBSET OF432 0x00cc: 0x2282, # SUBSET OF433 0x00cd: 0x2286, # SUBSET OF OR EQUAL TO434 0x00ce: 0x2208, # ELEMENT OF435 0x00cf: 0x2209, # NOT AN ELEMENT OF436 0x00d0: 0x2220, # ANGLE437 0x00d1: 0x2207, # NABLA438 0x00d2: 0xf6da, # [unknown unicode name for registerserif]439 0x00d3: 0xf6d9, # [unknown unicode name for copyrightserif]440 0x00d4: 0xf6db, # [unknown unicode name for trademarkserif]441 0x00d5: 0x220f, # N-ARY PRODUCT442 0x00d6: 0x221a, # SQUARE ROOT443 0x00d7: 0x22c5, # DOT OPERATOR444 0x00d8: 0x00ac, # NOT SIGN445 0x00d9: 0x2227, # LOGICAL AND446 0x00da: 0x2228, # LOGICAL OR447 0x00db: 0x21d4, # LEFT RIGHT DOUBLE ARROW448 0x00dc: 0x21d0, # LEFTWARDS DOUBLE ARROW449 0x00dd: 0x21d1, # UPWARDS DOUBLE ARROW450 0x00de: 0x21d2, # RIGHTWARDS DOUBLE ARROW451 0x00df: 0x21d3, # DOWNWARDS DOUBLE ARROW452 0x00e0: 0x25ca, # LOZENGE453 0x00e1: 0x2329, # LEFT-POINTING ANGLE BRACKET454 0x00e2: 0xf8e8, # [unknown unicode name for registersans]455 0x00e3: 0xf8e9, # [unknown unicode name for copyrightsans]456 0x00e4: 0xf8ea, # [unknown unicode name for trademarksans]457 0x00e5: 0x2211, # N-ARY SUMMATION458 0x00e6: 0xf8eb, # [unknown unicode name for parenlefttp]459 0x00e7: 0xf8ec, # [unknown unicode name for parenleftex]460 0x00e8: 0xf8ed, # [unknown unicode name for parenleftbt]461 0x00e9: 0xf8ee, # [unknown unicode name for bracketlefttp]462 0x00ea: 0xf8ef, # [unknown unicode name for bracketleftex]463 0x00eb: 0xf8f0, # [unknown unicode name for bracketleftbt]464 0x00ec: 0xf8f1, # [unknown unicode name for bracelefttp]465 0x00ed: 0xf8f2, # [unknown unicode name for braceleftmid]466 0x00ee: 0xf8f3, # [unknown unicode name for braceleftbt]467 0x00ef: 0xf8f4, # [unknown unicode name for braceex]468 0x00f0: None, # UNDEFINED469 0x00f1: 0x232a, # RIGHT-POINTING ANGLE BRACKET470 0x00f2: 0x222b, # INTEGRAL471 0x00f3: 0x2320, # TOP HALF INTEGRAL472 0x00f4: 0xf8f5, # [unknown unicode name for integralex]473 0x00f5: 0x2321, # BOTTOM HALF INTEGRAL474 0x00f6: 0xf8f6, # [unknown unicode name for parenrighttp]475 0x00f7: 0xf8f7, # [unknown unicode name for parenrightex]476 0x00f8: 0xf8f8, # [unknown unicode name for parenrightbt]477 0x00f9: 0xf8f9, # [unknown unicode name for bracketrighttp]478 0x00fa: 0xf8fa, # [unknown unicode name for bracketrightex]479 0x00fb: 0xf8fb, # [unknown unicode name for bracketrightbt]480 0x00fc: 0xf8fc, # [unknown unicode name for bracerighttp]481 0x00fd: 0xf8fd, # [unknown unicode name for bracerightmid]482 0x00fe: 0xf8fe, # [unknown unicode name for bracerightbt]483 0x00ff: None, # UNDEFINED484 },485 {486 0x0394:0x0044, # GREEK CAPITAL LETTER DELTA487 0x03a9:0x0057, # GREEK CAPITAL LETTER OMEGA488 0x03bc:0x006d, # GREEK SMALL LETTER MU489 }490 ),491 'zapfdingbats':StdCodecData({492 0x0021: 0x2701, # UPPER BLADE SCISSORS493 0x0022: 0x2702, # BLACK SCISSORS494 0x0023: 0x2703, # LOWER BLADE SCISSORS495 0x0024: 0x2704, # WHITE SCISSORS496 0x0025: 0x260e, # BLACK TELEPHONE497 0x0026: 0x2706, # TELEPHONE LOCATION SIGN498 0x0027: 0x2707, # TAPE DRIVE499 0x0028: 0x2708, # AIRPLANE500 0x0029: 0x2709, # ENVELOPE501 0x002a: 0x261b, # BLACK RIGHT POINTING INDEX502 0x002b: 0x261e, # WHITE RIGHT POINTING INDEX503 0x002c: 0x270c, # VICTORY HAND504 0x002d: 0x270d, # WRITING HAND505 0x002e: 0x270e, # LOWER RIGHT PENCIL506 0x002f: 0x270f, # PENCIL507 0x0030: 0x2710, # UPPER RIGHT PENCIL508 0x0031: 0x2711, # WHITE NIB509 0x0032: 0x2712, # BLACK NIB510 0x0033: 0x2713, # CHECK MARK511 0x0034: 0x2714, # HEAVY CHECK MARK512 0x0035: 0x2715, # MULTIPLICATION X513 0x0036: 0x2716, # HEAVY MULTIPLICATION X514 0x0037: 0x2717, # BALLOT X515 0x0038: 0x2718, # HEAVY BALLOT X516 0x0039: 0x2719, # OUTLINED GREEK CROSS517 0x003a: 0x271a, # HEAVY GREEK CROSS518 0x003b: 0x271b, # OPEN CENTRE CROSS519 0x003c: 0x271c, # HEAVY OPEN CENTRE CROSS520 0x003d: 0x271d, # LATIN CROSS521 0x003e: 0x271e, # SHADOWED WHITE LATIN CROSS522 0x003f: 0x271f, # OUTLINED LATIN CROSS523 0x0040: 0x2720, # MALTESE CROSS524 0x0041: 0x2721, # STAR OF DAVID525 0x0042: 0x2722, # FOUR TEARDROP-SPOKED ASTERISK526 0x0043: 0x2723, # FOUR BALLOON-SPOKED ASTERISK527 0x0044: 0x2724, # HEAVY FOUR BALLOON-SPOKED ASTERISK528 0x0045: 0x2725, # FOUR CLUB-SPOKED ASTERISK529 0x0046: 0x2726, # BLACK FOUR POINTED STAR530 0x0047: 0x2727, # WHITE FOUR POINTED STAR531 0x0048: 0x2605, # BLACK STAR532 0x0049: 0x2729, # STRESS OUTLINED WHITE STAR533 0x004a: 0x272a, # CIRCLED WHITE STAR534 0x004b: 0x272b, # OPEN CENTRE BLACK STAR535 0x004c: 0x272c, # BLACK CENTRE WHITE STAR536 0x004d: 0x272d, # OUTLINED BLACK STAR537 0x004e: 0x272e, # HEAVY OUTLINED BLACK STAR538 0x004f: 0x272f, # PINWHEEL STAR539 0x0050: 0x2730, # SHADOWED WHITE STAR540 0x0051: 0x2731, # HEAVY ASTERISK541 0x0052: 0x2732, # OPEN CENTRE ASTERISK542 0x0053: 0x2733, # EIGHT SPOKED ASTERISK543 0x0054: 0x2734, # EIGHT POINTED BLACK STAR544 0x0055: 0x2735, # EIGHT POINTED PINWHEEL STAR545 0x0056: 0x2736, # SIX POINTED BLACK STAR546 0x0057: 0x2737, # EIGHT POINTED RECTILINEAR BLACK STAR547 0x0058: 0x2738, # HEAVY EIGHT POINTED RECTILINEAR BLACK STAR548 0x0059: 0x2739, # TWELVE POINTED BLACK STAR549 0x005a: 0x273a, # SIXTEEN POINTED ASTERISK550 0x005b: 0x273b, # TEARDROP-SPOKED ASTERISK551 0x005c: 0x273c, # OPEN CENTRE TEARDROP-SPOKED ASTERISK552 0x005d: 0x273d, # HEAVY TEARDROP-SPOKED ASTERISK553 0x005e: 0x273e, # SIX PETALLED BLACK AND WHITE FLORETTE554 0x005f: 0x273f, # BLACK FLORETTE555 0x0060: 0x2740, # WHITE FLORETTE556 0x0061: 0x2741, # EIGHT PETALLED OUTLINED BLACK FLORETTE557 0x0062: 0x2742, # CIRCLED OPEN CENTRE EIGHT POINTED STAR558 0x0063: 0x2743, # HEAVY TEARDROP-SPOKED PINWHEEL ASTERISK559 0x0064: 0x2744, # SNOWFLAKE560 0x0065: 0x2745, # TIGHT TRIFOLIATE SNOWFLAKE561 0x0066: 0x2746, # HEAVY CHEVRON SNOWFLAKE562 0x0067: 0x2747, # SPARKLE563 0x0068: 0x2748, # HEAVY SPARKLE564 0x0069: 0x2749, # BALLOON-SPOKED ASTERISK565 0x006a: 0x274a, # EIGHT TEARDROP-SPOKED PROPELLER ASTERISK566 0x006b: 0x274b, # HEAVY EIGHT TEARDROP-SPOKED PROPELLER ASTERISK567 0x006c: 0x25cf, # BLACK CIRCLE568 0x006d: 0x274d, # SHADOWED WHITE CIRCLE569 0x006e: 0x25a0, # BLACK SQUARE570 0x006f: 0x274f, # LOWER RIGHT DROP-SHADOWED WHITE SQUARE571 0x0070: 0x2750, # UPPER RIGHT DROP-SHADOWED WHITE SQUARE572 0x0071: 0x2751, # LOWER RIGHT SHADOWED WHITE SQUARE573 0x0072: 0x2752, # UPPER RIGHT SHADOWED WHITE SQUARE574 0x0073: 0x25b2, # BLACK UP-POINTING TRIANGLE575 0x0074: 0x25bc, # BLACK DOWN-POINTING TRIANGLE576 0x0075: 0x25c6, # BLACK DIAMOND577 0x0076: 0x2756, # BLACK DIAMOND MINUS WHITE X578 0x0077: 0x25d7, # RIGHT HALF BLACK CIRCLE579 0x0078: 0x2758, # LIGHT VERTICAL BAR580 0x0079: 0x2759, # MEDIUM VERTICAL BAR581 0x007a: 0x275a, # HEAVY VERTICAL BAR582 0x007b: 0x275b, # HEAVY SINGLE TURNED COMMA QUOTATION MARK ORNAMENT583 0x007c: 0x275c, # HEAVY SINGLE COMMA QUOTATION MARK ORNAMENT584 0x007d: 0x275d, # HEAVY DOUBLE TURNED COMMA QUOTATION MARK ORNAMENT585 0x007e: 0x275e, # HEAVY DOUBLE COMMA QUOTATION MARK ORNAMENT586 0x007f: None, # UNDEFINED587 0x0080: 0x2768, # MEDIUM LEFT PARENTHESIS ORNAMENT588 0x0081: 0x2769, # MEDIUM RIGHT PARENTHESIS ORNAMENT589 0x0082: 0x276a, # MEDIUM FLATTENED LEFT PARENTHESIS ORNAMENT590 0x0083: 0x276b, # MEDIUM FLATTENED RIGHT PARENTHESIS ORNAMENT591 0x0084: 0x276c, # MEDIUM LEFT-POINTING ANGLE BRACKET ORNAMENT592 0x0085: 0x276d, # MEDIUM RIGHT-POINTING ANGLE BRACKET ORNAMENT593 0x0086: 0x276e, # HEAVY LEFT-POINTING ANGLE QUOTATION MARK ORNAMENT594 0x0087: 0x276f, # HEAVY RIGHT-POINTING ANGLE QUOTATION MARK ORNAMENT595 0x0088: 0x2770, # HEAVY LEFT-POINTING ANGLE BRACKET ORNAMENT596 0x0089: 0x2771, # HEAVY RIGHT-POINTING ANGLE BRACKET ORNAMENT597 0x008a: 0x2772, # LIGHT LEFT TORTOISE SHELL BRACKET ORNAMENT598 0x008b: 0x2773, # LIGHT RIGHT TORTOISE SHELL BRACKET ORNAMENT599 0x008c: 0x2774, # MEDIUM LEFT CURLY BRACKET ORNAMENT600 0x008d: 0x2775, # MEDIUM RIGHT CURLY BRACKET ORNAMENT601 0x008e: None, # UNDEFINED602 0x008f: None, # UNDEFINED603 0x0090: None, # UNDEFINED604 0x0091: None, # UNDEFINED605 0x0092: None, # UNDEFINED606 0x0093: None, # UNDEFINED607 0x0094: None, # UNDEFINED608 0x0095: None, # UNDEFINED609 0x0096: None, # UNDEFINED610 0x0097: None, # UNDEFINED611 0x0098: None, # UNDEFINED612 0x0099: None, # UNDEFINED613 0x009a: None, # UNDEFINED614 0x009b: None, # UNDEFINED615 0x009c: None, # UNDEFINED616 0x009d: None, # UNDEFINED617 0x009e: None, # UNDEFINED618 0x009f: None, # UNDEFINED619 0x00a0: None, # UNDEFINED620 0x00a1: 0x2761, # CURVED STEM PARAGRAPH SIGN ORNAMENT621 0x00a2: 0x2762, # HEAVY EXCLAMATION MARK ORNAMENT622 0x00a3: 0x2763, # HEAVY HEART EXCLAMATION MARK ORNAMENT623 0x00a4: 0x2764, # HEAVY BLACK HEART624 0x00a5: 0x2765, # ROTATED HEAVY BLACK HEART BULLET625 0x00a6: 0x2766, # FLORAL HEART626 0x00a7: 0x2767, # ROTATED FLORAL HEART BULLET627 0x00a8: 0x2663, # BLACK CLUB SUIT628 0x00a9: 0x2666, # BLACK DIAMOND SUIT629 0x00aa: 0x2665, # BLACK HEART SUIT630 0x00ab: 0x2660, # BLACK SPADE SUIT631 0x00ac: 0x2460, # CIRCLED DIGIT ONE632 0x00ad: 0x2461, # CIRCLED DIGIT TWO633 0x00ae: 0x2462, # CIRCLED DIGIT THREE634 0x00af: 0x2463, # CIRCLED DIGIT FOUR635 0x00b0: 0x2464, # CIRCLED DIGIT FIVE636 0x00b1: 0x2465, # CIRCLED DIGIT SIX637 0x00b2: 0x2466, # CIRCLED DIGIT SEVEN638 0x00b3: 0x2467, # CIRCLED DIGIT EIGHT639 0x00b4: 0x2468, # CIRCLED DIGIT NINE640 0x00b5: 0x2469, # CIRCLED NUMBER TEN641 0x00b6: 0x2776, # DINGBAT NEGATIVE CIRCLED DIGIT ONE642 0x00b7: 0x2777, # DINGBAT NEGATIVE CIRCLED DIGIT TWO643 0x00b8: 0x2778, # DINGBAT NEGATIVE CIRCLED DIGIT THREE644 0x00b9: 0x2779, # DINGBAT NEGATIVE CIRCLED DIGIT FOUR645 0x00ba: 0x277a, # DINGBAT NEGATIVE CIRCLED DIGIT FIVE646 0x00bb: 0x277b, # DINGBAT NEGATIVE CIRCLED DIGIT SIX647 0x00bc: 0x277c, # DINGBAT NEGATIVE CIRCLED DIGIT SEVEN648 0x00bd: 0x277d, # DINGBAT NEGATIVE CIRCLED DIGIT EIGHT649 0x00be: 0x277e, # DINGBAT NEGATIVE CIRCLED DIGIT NINE650 0x00bf: 0x277f, # DINGBAT NEGATIVE CIRCLED NUMBER TEN651 0x00c0: 0x2780, # DINGBAT CIRCLED SANS-SERIF DIGIT ONE652 0x00c1: 0x2781, # DINGBAT CIRCLED SANS-SERIF DIGIT TWO653 0x00c2: 0x2782, # DINGBAT CIRCLED SANS-SERIF DIGIT THREE654 0x00c3: 0x2783, # DINGBAT CIRCLED SANS-SERIF DIGIT FOUR655 0x00c4: 0x2784, # DINGBAT CIRCLED SANS-SERIF DIGIT FIVE656 0x00c5: 0x2785, # DINGBAT CIRCLED SANS-SERIF DIGIT SIX657 0x00c6: 0x2786, # DINGBAT CIRCLED SANS-SERIF DIGIT SEVEN658 0x00c7: 0x2787, # DINGBAT CIRCLED SANS-SERIF DIGIT EIGHT659 0x00c8: 0x2788, # DINGBAT CIRCLED SANS-SERIF DIGIT NINE660 0x00c9: 0x2789, # DINGBAT CIRCLED SANS-SERIF NUMBER TEN661 0x00ca: 0x278a, # DINGBAT NEGATIVE CIRCLED SANS-SERIF DIGIT ONE662 0x00cb: 0x278b, # DINGBAT NEGATIVE CIRCLED SANS-SERIF DIGIT TWO663 0x00cc: 0x278c, # DINGBAT NEGATIVE CIRCLED SANS-SERIF DIGIT THREE664 0x00cd: 0x278d, # DINGBAT NEGATIVE CIRCLED SANS-SERIF DIGIT FOUR665 0x00ce: 0x278e, # DINGBAT NEGATIVE CIRCLED SANS-SERIF DIGIT FIVE666 0x00cf: 0x278f, # DINGBAT NEGATIVE CIRCLED SANS-SERIF DIGIT SIX667 0x00d0: 0x2790, # DINGBAT NEGATIVE CIRCLED SANS-SERIF DIGIT SEVEN668 0x00d1: 0x2791, # DINGBAT NEGATIVE CIRCLED SANS-SERIF DIGIT EIGHT669 0x00d2: 0x2792, # DINGBAT NEGATIVE CIRCLED SANS-SERIF DIGIT NINE670 0x00d3: 0x2793, # DINGBAT NEGATIVE CIRCLED SANS-SERIF NUMBER TEN671 0x00d4: 0x2794, # HEAVY WIDE-HEADED RIGHTWARDS ARROW672 0x00d5: 0x2192, # RIGHTWARDS ARROW673 0x00d6: 0x2194, # LEFT RIGHT ARROW674 0x00d7: 0x2195, # UP DOWN ARROW675 0x00d8: 0x2798, # HEAVY SOUTH EAST ARROW676 0x00d9: 0x2799, # HEAVY RIGHTWARDS ARROW677 0x00da: 0x279a, # HEAVY NORTH EAST ARROW678 0x00db: 0x279b, # DRAFTING POINT RIGHTWARDS ARROW679 0x00dc: 0x279c, # HEAVY ROUND-TIPPED RIGHTWARDS ARROW680 0x00dd: 0x279d, # TRIANGLE-HEADED RIGHTWARDS ARROW681 0x00de: 0x279e, # HEAVY TRIANGLE-HEADED RIGHTWARDS ARROW682 0x00df: 0x279f, # DASHED TRIANGLE-HEADED RIGHTWARDS ARROW683 0x00e0: 0x27a0, # HEAVY DASHED TRIANGLE-HEADED RIGHTWARDS ARROW684 0x00e1: 0x27a1, # BLACK RIGHTWARDS ARROW685 0x00e2: 0x27a2, # THREE-D TOP-LIGHTED RIGHTWARDS ARROWHEAD686 0x00e3: 0x27a3, # THREE-D BOTTOM-LIGHTED RIGHTWARDS ARROWHEAD687 0x00e4: 0x27a4, # BLACK RIGHTWARDS ARROWHEAD688 0x00e5: 0x27a5, # HEAVY BLACK CURVED DOWNWARDS AND RIGHTWARDS ARROW689 0x00e6: 0x27a6, # HEAVY BLACK CURVED UPWARDS AND RIGHTWARDS ARROW690 0x00e7: 0x27a7, # SQUAT BLACK RIGHTWARDS ARROW691 0x00e8: 0x27a8, # HEAVY CONCAVE-POINTED BLACK RIGHTWARDS ARROW692 0x00e9: 0x27a9, # RIGHT-SHADED WHITE RIGHTWARDS ARROW693 0x00ea: 0x27aa, # LEFT-SHADED WHITE RIGHTWARDS ARROW694 0x00eb: 0x27ab, # BACK-TILTED SHADOWED WHITE RIGHTWARDS ARROW695 0x00ec: 0x27ac, # FRONT-TILTED SHADOWED WHITE RIGHTWARDS ARROW696 0x00ed: 0x27ad, # HEAVY LOWER RIGHT-SHADOWED WHITE RIGHTWARDS ARROW697 0x00ee: 0x27ae, # HEAVY UPPER RIGHT-SHADOWED WHITE RIGHTWARDS ARROW698 0x00ef: 0x27af, # NOTCHED LOWER RIGHT-SHADOWED WHITE RIGHTWARDS ARROW699 0x00f0: None, # UNDEFINED700 0x00f1: 0x27b1, # NOTCHED UPPER RIGHT-SHADOWED WHITE RIGHTWARDS ARROW701 0x00f2: 0x27b2, # CIRCLED HEAVY WHITE RIGHTWARDS ARROW702 0x00f3: 0x27b3, # WHITE-FEATHERED RIGHTWARDS ARROW703 0x00f4: 0x27b4, # BLACK-FEATHERED SOUTH EAST ARROW704 0x00f5: 0x27b5, # BLACK-FEATHERED RIGHTWARDS ARROW705 0x00f6: 0x27b6, # BLACK-FEATHERED NORTH EAST ARROW706 0x00f7: 0x27b7, # HEAVY BLACK-FEATHERED SOUTH EAST ARROW707 0x00f8: 0x27b8, # HEAVY BLACK-FEATHERED RIGHTWARDS ARROW708 0x00f9: 0x27b9, # HEAVY BLACK-FEATHERED NORTH EAST ARROW709 0x00fa: 0x27ba, # TEARDROP-BARBED RIGHTWARDS ARROW710 0x00fb: 0x27bb, # HEAVY TEARDROP-SHANKED RIGHTWARDS ARROW711 0x00fc: 0x27bc, # WEDGE-TAILED RIGHTWARDS ARROW712 0x00fd: 0x27bd, # HEAVY WEDGE-TAILED RIGHTWARDS ARROW713 0x00fe: 0x27be, # OPEN-OUTLINED RIGHTWARDS ARROW714 0x00ff: None, # UNDEFINED715 },None),716 'pdfdoc':StdCodecData({717 0x007f: None, # UNDEFINED718 0x0080: 0x2022, # BULLET719 0x0081: 0x2020, # DAGGER720 0x0082: 0x2021, # DOUBLE DAGGER721 0x0083: 0x2026, # HORIZONTAL ELLIPSIS722 0x0084: 0x2014, # EM DASH723 0x0085: 0x2013, # EN DASH724 0x0086: 0x0192, # LATIN SMALL LETTER F WITH HOOK725 0x0087: 0x2044, # FRACTION SLASH726 0x0088: 0x2039, # SINGLE LEFT-POINTING ANGLE QUOTATION MARK727 0x0089: 0x203a, # SINGLE RIGHT-POINTING ANGLE QUOTATION MARK728 0x008a: 0x2212, # MINUS SIGN729 0x008b: 0x2030, # PER MILLE SIGN730 0x008c: 0x201e, # DOUBLE LOW-9 QUOTATION MARK731 0x008d: 0x201c, # LEFT DOUBLE QUOTATION MARK732 0x008e: 0x201d, # RIGHT DOUBLE QUOTATION MARK733 0x008f: 0x2018, # LEFT SINGLE QUOTATION MARK734 0x0090: 0x2019, # RIGHT SINGLE QUOTATION MARK735 0x0091: 0x201a, # SINGLE LOW-9 QUOTATION MARK736 0x0092: 0x2122, # TRADE MARK SIGN737 0x0093: 0xfb01, # LATIN SMALL LIGATURE FI738 0x0094: 0xfb02, # LATIN SMALL LIGATURE FL739 0x0095: 0x0141, # LATIN CAPITAL LETTER L WITH STROKE740 0x0096: 0x0152, # LATIN CAPITAL LIGATURE OE741 0x0097: 0x0160, # LATIN CAPITAL LETTER S WITH CARON742 0x0098: 0x0178, # LATIN CAPITAL LETTER Y WITH DIAERESIS743 0x0099: 0x017d, # LATIN CAPITAL LETTER Z WITH CARON744 0x009a: 0x0131, # LATIN SMALL LETTER DOTLESS I745 0x009b: 0x0142, # LATIN SMALL LETTER L WITH STROKE746 0x009c: 0x0153, # LATIN SMALL LIGATURE OE747 0x009d: 0x0161, # LATIN SMALL LETTER S WITH CARON748 0x009e: 0x017e, # LATIN SMALL LETTER Z WITH CARON749 0x009f: None, # UNDEFINED750 0x00a0: 0x20ac, # EURO SIGN751 0x00ad: None, # UNDEFINED752 24: 0x02d8, #breve753 25: 0x02c7, #caron754 26: 0x02c6, #circumflex755 27: 0x02d9, #dotaccent756 28: 0x02dd, #hungarumlaut757 29: 0x02db, #ogonek758 30: 0x02da, #ring759 31: 0x02dc, #tilde760 },None),761 'macexpert':StdCodecData({762 0x0021: 0xf721, # [unknown unicode name for exclamsmall]763 0x0022: 0xf6f8, # [unknown unicode name for Hungarumlautsmall]764 0x0023: 0xf7a2, # [unknown unicode name for centoldstyle]765 0x0024: 0xf724, # [unknown unicode name for dollaroldstyle]766 0x0025: 0xf6e4, # [unknown unicode name for dollarsuperior]767 0x0026: 0xf726, # [unknown unicode name for ampersandsmall]768 0x0027: 0xf7b4, # [unknown unicode name for Acutesmall]769 0x0028: 0x207d, # SUPERSCRIPT LEFT PARENTHESIS770 0x0029: 0x207e, # SUPERSCRIPT RIGHT PARENTHESIS771 0x002a: 0x2025, # TWO DOT LEADER772 0x002b: 0x2024, # ONE DOT LEADER773 0x002f: 0x2044, # FRACTION SLASH774 0x0030: 0xf730, # [unknown unicode name for zerooldstyle]775 0x0031: 0xf731, # [unknown unicode name for oneoldstyle]776 0x0032: 0xf732, # [unknown unicode name for twooldstyle]777 0x0033: 0xf733, # [unknown unicode name for threeoldstyle]778 0x0034: 0xf734, # [unknown unicode name for fouroldstyle]779 0x0035: 0xf735, # [unknown unicode name for fiveoldstyle]780 0x0036: 0xf736, # [unknown unicode name for sixoldstyle]781 0x0037: 0xf737, # [unknown unicode name for sevenoldstyle]782 0x0038: 0xf738, # [unknown unicode name for eightoldstyle]783 0x0039: 0xf739, # [unknown unicode name for nineoldstyle]784 0x003c: None, # UNDEFINED785 0x003d: 0xf6de, # [unknown unicode name for threequartersemdash]786 0x003e: None, # UNDEFINED787 0x003f: 0xf73f, # [unknown unicode name for questionsmall]788 0x0040: None, # UNDEFINED789 0x0041: None, # UNDEFINED790 0x0042: None, # UNDEFINED791 0x0043: None, # UNDEFINED792 0x0044: 0xf7f0, # [unknown unicode name for Ethsmall]793 0x0045: None, # UNDEFINED794 0x0046: None, # UNDEFINED795 0x0047: 0x00bc, # VULGAR FRACTION ONE QUARTER796 0x0048: 0x00bd, # VULGAR FRACTION ONE HALF797 0x0049: 0x00be, # VULGAR FRACTION THREE QUARTERS798 0x004a: 0x215b, # VULGAR FRACTION ONE EIGHTH799 0x004b: 0x215c, # VULGAR FRACTION THREE EIGHTHS800 0x004c: 0x215d, # VULGAR FRACTION FIVE EIGHTHS801 0x004d: 0x215e, # VULGAR FRACTION SEVEN EIGHTHS802 0x004e: 0x2153, # VULGAR FRACTION ONE THIRD803 0x004f: 0x2154, # VULGAR FRACTION TWO THIRDS804 0x0050: None, # UNDEFINED805 0x0051: None, # UNDEFINED806 0x0052: None, # UNDEFINED807 0x0053: None, # UNDEFINED808 0x0054: None, # UNDEFINED809 0x0055: None, # UNDEFINED810 0x0056: 0xfb00, # LATIN SMALL LIGATURE FF811 0x0057: 0xfb01, # LATIN SMALL LIGATURE FI812 0x0058: 0xfb02, # LATIN SMALL LIGATURE FL813 0x0059: 0xfb03, # LATIN SMALL LIGATURE FFI814 0x005a: 0xfb04, # LATIN SMALL LIGATURE FFL815 0x005b: 0x208d, # SUBSCRIPT LEFT PARENTHESIS816 0x005c: None, # UNDEFINED817 0x005d: 0x208e, # SUBSCRIPT RIGHT PARENTHESIS818 0x005e: 0xf6f6, # [unknown unicode name for Circumflexsmall]819 0x005f: 0xf6e5, # [unknown unicode name for hypheninferior]820 0x0060: 0xf760, # [unknown unicode name for Gravesmall]821 0x0061: 0xf761, # [unknown unicode name for Asmall]822 0x0062: 0xf762, # [unknown unicode name for Bsmall]823 0x0063: 0xf763, # [unknown unicode name for Csmall]824 0x0064: 0xf764, # [unknown unicode name for Dsmall]825 0x0065: 0xf765, # [unknown unicode name for Esmall]826 0x0066: 0xf766, # [unknown unicode name for Fsmall]827 0x0067: 0xf767, # [unknown unicode name for Gsmall]828 0x0068: 0xf768, # [unknown unicode name for Hsmall]829 0x0069: 0xf769, # [unknown unicode name for Ismall]830 0x006a: 0xf76a, # [unknown unicode name for Jsmall]831 0x006b: 0xf76b, # [unknown unicode name for Ksmall]832 0x006c: 0xf76c, # [unknown unicode name for Lsmall]833 0x006d: 0xf76d, # [unknown unicode name for Msmall]834 0x006e: 0xf76e, # [unknown unicode name for Nsmall]835 0x006f: 0xf76f, # [unknown unicode name for Osmall]836 0x0070: 0xf770, # [unknown unicode name for Psmall]837 0x0071: 0xf771, # [unknown unicode name for Qsmall]838 0x0072: 0xf772, # [unknown unicode name for Rsmall]839 0x0073: 0xf773, # [unknown unicode name for Ssmall]840 0x0074: 0xf774, # [unknown unicode name for Tsmall]841 0x0075: 0xf775, # [unknown unicode name for Usmall]842 0x0076: 0xf776, # [unknown unicode name for Vsmall]843 0x0077: 0xf777, # [unknown unicode name for Wsmall]844 0x0078: 0xf778, # [unknown unicode name for Xsmall]845 0x0079: 0xf779, # [unknown unicode name for Ysmall]846 0x007a: 0xf77a, # [unknown unicode name for Zsmall]847 0x007b: 0x20a1, # COLON SIGN848 0x007c: 0xf6dc, # [unknown unicode name for onefitted]849 0x007d: 0xf6dd, # [unknown unicode name for rupiah]850 0x007e: 0xf6fe, # [unknown unicode name for Tildesmall]851 0x007f: None, # UNDEFINED852 0x0080: None, # UNDEFINED853 0x0081: 0xf6e9, # [unknown unicode name for asuperior]854 0x0082: 0xf6e0, # [unknown unicode name for centsuperior]855 0x0083: None, # UNDEFINED856 0x0084: None, # UNDEFINED857 0x0085: None, # UNDEFINED858 0x0086: None, # UNDEFINED859 0x0087: 0xf7e1, # [unknown unicode name for Aacutesmall]860 0x0088: 0xf7e0, # [unknown unicode name for Agravesmall]861 0x0089: 0xf7e2, # [unknown unicode name for Acircumflexsmall]862 0x008a: 0xf7e4, # [unknown unicode name for Adieresissmall]863 0x008b: 0xf7e3, # [unknown unicode name for Atildesmall]864 0x008c: 0xf7e5, # [unknown unicode name for Aringsmall]865 0x008d: 0xf7e7, # [unknown unicode name for Ccedillasmall]866 0x008e: 0xf7e9, # [unknown unicode name for Eacutesmall]867 0x008f: 0xf7e8, # [unknown unicode name for Egravesmall]868 0x0090: 0xf7ea, # [unknown unicode name for Ecircumflexsmall]869 0x0091: 0xf7eb, # [unknown unicode name for Edieresissmall]870 0x0092: 0xf7ed, # [unknown unicode name for Iacutesmall]871 0x0093: 0xf7ec, # [unknown unicode name for Igravesmall]872 0x0094: 0xf7ee, # [unknown unicode name for Icircumflexsmall]873 0x0095: 0xf7ef, # [unknown unicode name for Idieresissmall]874 0x0096: 0xf7f1, # [unknown unicode name for Ntildesmall]875 0x0097: 0xf7f3, # [unknown unicode name for Oacutesmall]876 0x0098: 0xf7f2, # [unknown unicode name for Ogravesmall]877 0x0099: 0xf7f4, # [unknown unicode name for Ocircumflexsmall]878 0x009a: 0xf7f6, # [unknown unicode name for Odieresissmall]879 0x009b: 0xf7f5, # [unknown unicode name for Otildesmall]880 0x009c: 0xf7fa, # [unknown unicode name for Uacutesmall]881 0x009d: 0xf7f9, # [unknown unicode name for Ugravesmall]882 0x009e: 0xf7fb, # [unknown unicode name for Ucircumflexsmall]883 0x009f: 0xf7fc, # [unknown unicode name for Udieresissmall]884 0x00a0: None, # UNDEFINED885 0x00a1: 0x2078, # SUPERSCRIPT EIGHT886 0x00a2: 0x2084, # SUBSCRIPT FOUR887 0x00a3: 0x2083, # SUBSCRIPT THREE888 0x00a4: 0x2086, # SUBSCRIPT SIX889 0x00a5: 0x2088, # SUBSCRIPT EIGHT890 0x00a6: 0x2087, # SUBSCRIPT SEVEN891 0x00a7: 0xf6fd, # [unknown unicode name for Scaronsmall]892 0x00a8: None, # UNDEFINED893 0x00a9: 0xf6df, # [unknown unicode name for centinferior]894 0x00aa: 0x2082, # SUBSCRIPT TWO895 0x00ab: None, # UNDEFINED896 0x00ac: 0xf7a8, # [unknown unicode name for Dieresissmall]897 0x00ad: None, # UNDEFINED898 0x00ae: 0xf6f5, # [unknown unicode name for Caronsmall]899 0x00af: 0xf6f0, # [unknown unicode name for osuperior]900 0x00b0: 0x2085, # SUBSCRIPT FIVE901 0x00b1: None, # UNDEFINED902 0x00b2: 0xf6e1, # [unknown unicode name for commainferior]903 0x00b3: 0xf6e7, # [unknown unicode name for periodinferior]904 0x00b4: 0xf7fd, # [unknown unicode name for Yacutesmall]905 0x00b5: None, # UNDEFINED906 0x00b6: 0xf6e3, # [unknown unicode name for dollarinferior]907 0x00b7: None, # UNDEFINED908 0x00b8: None, # UNDEFINED909 0x00b9: 0xf7fe, # [unknown unicode name for Thornsmall]910 0x00ba: None, # UNDEFINED911 0x00bb: 0x2089, # SUBSCRIPT NINE912 0x00bc: 0x2080, # SUBSCRIPT ZERO913 0x00bd: 0xf6ff, # [unknown unicode name for Zcaronsmall]914 0x00be: 0xf7e6, # [unknown unicode name for AEsmall]915 0x00bf: 0xf7f8, # [unknown unicode name for Oslashsmall]916 0x00c0: 0xf7bf, # [unknown unicode name for questiondownsmall]917 0x00c1: 0x2081, # SUBSCRIPT ONE918 0x00c2: 0xf6f9, # [unknown unicode name for Lslashsmall]919 0x00c3: None, # UNDEFINED920 0x00c4: None, # UNDEFINED921 0x00c5: None, # UNDEFINED922 0x00c6: None, # UNDEFINED923 0x00c7: None, # UNDEFINED924 0x00c8: None, # UNDEFINED925 0x00c9: 0xf7b8, # [unknown unicode name for Cedillasmall]926 0x00ca: None, # UNDEFINED927 0x00cb: None, # UNDEFINED928 0x00cc: None, # UNDEFINED929 0x00cd: None, # UNDEFINED930 0x00ce: None, # UNDEFINED931 0x00cf: 0xf6fa, # [unknown unicode name for OEsmall]932 0x00d0: 0x2012, # FIGURE DASH933 0x00d1: 0xf6e6, # [unknown unicode name for hyphensuperior]934 0x00d2: None, # UNDEFINED935 0x00d3: None, # UNDEFINED936 0x00d4: None, # UNDEFINED937 0x00d5: None, # UNDEFINED938 0x00d6: 0xf7a1, # [unknown unicode name for exclamdownsmall]939 0x00d7: None, # UNDEFINED940 0x00d8: 0xf7ff, # [unknown unicode name for Ydieresissmall]941 0x00d9: None, # UNDEFINED942 0x00da: 0x00b9, # SUPERSCRIPT ONE943 0x00db: 0x00b2, # SUPERSCRIPT TWO944 0x00dc: 0x00b3, # SUPERSCRIPT THREE945 0x00dd: 0x2074, # SUPERSCRIPT FOUR946 0x00de: 0x2075, # SUPERSCRIPT FIVE947 0x00df: 0x2076, # SUPERSCRIPT SIX948 0x00e0: 0x2077, # SUPERSCRIPT SEVEN949 0x00e1: 0x2079, # SUPERSCRIPT NINE950 0x00e2: 0x2070, # SUPERSCRIPT ZERO951 0x00e3: None, # UNDEFINED952 0x00e4: 0xf6ec, # [unknown unicode name for esuperior]953 0x00e5: 0xf6f1, # [unknown unicode name for rsuperior]954 0x00e6: 0xf6f3, # [unknown unicode name for tsuperior]955 0x00e7: None, # UNDEFINED956 0x00e8: None, # UNDEFINED957 0x00e9: 0xf6ed, # [unknown unicode name for isuperior]958 0x00ea: 0xf6f2, # [unknown unicode name for ssuperior]959 0x00eb: 0xf6eb, # [unknown unicode name for dsuperior]960 0x00ec: None, # UNDEFINED961 0x00ed: None, # UNDEFINED962 0x00ee: None, # UNDEFINED963 0x00ef: None, # UNDEFINED964 0x00f0: None, # UNDEFINED965 0x00f1: 0xf6ee, # [unknown unicode name for lsuperior]966 0x00f2: 0xf6fb, # [unknown unicode name for Ogoneksmall]967 0x00f3: 0xf6f4, # [unknown unicode name for Brevesmall]968 0x00f4: 0xf7af, # [unknown unicode name for Macronsmall]969 0x00f5: 0xf6ea, # [unknown unicode name for bsuperior]970 0x00f6: 0x207f, # SUPERSCRIPT LATIN SMALL LETTER N971 0x00f7: 0xf6ef, # [unknown unicode name for msuperior]972 0x00f8: 0xf6e2, # [unknown unicode name for commasuperior]973 0x00f9: 0xf6e8, # [unknown unicode name for periodsuperior]974 0x00fa: 0xf6f7, # [unknown unicode name for Dotaccentsmall]975 0x00fb: 0xf6fc, # [unknown unicode name for Ringsmall]976 0x00fc: None, # UNDEFINED977 0x00fd: None, # UNDEFINED978 0x00fe: None, # UNDEFINED979 0x00ff: None, # UNDEFINED980 },None),981 }982 __rl_extension_codecs = {983 'extpdfdoc':ExtCodecData('pdfdoc',{0x000a:0x000a,0x000d:0x000d},None),984 }985 #for k,v in __rl_codecs_data.items():986 # __rl_codecs_data[k+'enc'] = __rl_codecs_data[k+'encoding'] = v987 #del k,v988 def __init__(self):989 raise NotImplementedError990 def _256_exception_codec(name,exceptions,rexceptions,baseRange=range(32,256)):991 import codecs992 decoding_map = codecs.make_identity_dict(baseRange)993 decoding_map.update(exceptions)994 encoding_map = codecs.make_encoding_map(decoding_map)995 if rexceptions: encoding_map.update(rexceptions)996 ### Codec APIs997 class Codec(codecs.Codec):998 def encode(self,input,errors='strict',charmap_encode=codecs.charmap_encode,encoding_map=encoding_map):999 return charmap_encode(input,errors,encoding_map)1000 def decode(self,input,errors='strict',charmap_decode=codecs.charmap_decode,decoding_map=decoding_map):1001 return charmap_decode(input,errors,decoding_map)1002 class StreamWriter(Codec,codecs.StreamWriter):1003 pass1004 class StreamReader(Codec,codecs.StreamReader):1005 pass1006 C = Codec()1007 return codecs.CodecInfo(C.encode,C.decode,streamreader=StreamReader,streamwriter=StreamWriter,name=name)1008 _256_exception_codec=staticmethod(_256_exception_codec)1009 __rl_codecs_cache = {}1010 def __rl_codecs(name,cache=__rl_codecs_cache,data=__rl_codecs_data,extension_codecs=__rl_extension_codecs):1011 try:1012 return cache[name]1013 except KeyError:1014 if name in extension_codecs:1015 x = extension_codecs[name]1016 e,r = data[x.baseName]1017 if x.exceptions:1018 if e:1019 e = e.copy()1020 e.update(x.exceptions)1021 else:1022 e = x.exceptions1023 if x.rexceptions:1024 if r:1025 r = r.copy()1026 r.update(x.rexceptions)1027 else:1028 r = x.exceptions1029 else:1030 e,r = data[name]1031 cache[name] = c = RL_Codecs._256_exception_codec(name,e,r)1032 return c1033 __rl_codecs=staticmethod(__rl_codecs)1034 def _rl_codecs(name):1035 name = name.lower()1036 from reportlab.pdfbase.pdfmetrics import standardEncodings1037 for e in standardEncodings+('ExtPdfdocEncoding',):1038 e = e[:-8].lower()1039 if name.startswith(e): return RL_Codecs.__rl_codecs(e)1040 return None1041 _rl_codecs=staticmethod(_rl_codecs)1042 def register():1043 import codecs1044 codecs.register(RL_Codecs._rl_codecs)...

Full Screen

Full Screen

cwss.py

Source:cwss.py Github

copy

Full Screen

1import sys, traceback2from xml.dom.minidom import Document3#CWSS.py includes the Common Weakness Scoring System4 5## Each metric is composed by: ["Value", "Code", Weight]6## Base Finding Metric Group:7 8TI = {"Critical":1.0,"High":0.9,"Medium":0.6,"Low":0.3,"None":0,"Default":0.6,"Unknown":0.5,"Not Applicable":1.0}9AP = {"Administrator":1.0,"Partially-Privileged User":0.9,"Regular User":0.7,"Guest":0.6,"None":0.1,"Default":0.7,"Unknown":1.0,"Not Applicable":1.0}10AL = {"Application":1.0,"System":0.9,"Network":0.7,"Enterprise":1.0,"Default":0.9,"Unknown":0.5,"Not Applicable":1.0}11IC = {"None":1.0,"Limited":0.9,"Moderate":0.7,"Indirect":0.5,"Best-Available":0.3,"Complete":0,"Default":0.6,"Unknown":0.5,"Not Applicable":1.0}12FC = {"Proven True":1.0,"Proven Locally True":0.8,"Proven False":0,"Default":0.8,"Unknown":0.5,"Not Applicable":1.0}13## Attack Surface Metric Group:14RP = {"None":1.0,"Guest":0.9,"Regular User":0.7,"Partially-Privileged User":0.6,"Administrator":0.1,"Default":0.7,"Unknown":0.5,"Not Applicable":1.0}15RL = {"System":0.9,"Application":1.0,"Network":0.7,"Enterprise":1.0,"Default":0.9,"Unknown":0.5,"Not Applicable":1.0}16AV = {"Internet":1.0,"Intranet":0.8,"Private Network":0.8,"Adjacent Network":0.7,"Local":0.5,"Physical":0.2,"Default":0.75,"Unknown":0.5,"Not Applicable":1.0}17AS = {"Strong":0.7,"Moderate":0.8,"Weak":0.9,"None":1.0,"Default":0.85,"Unknown":0.5,"Not Applicable":1.0}18AI = {"None":1.0,"Single":0.8,"Multiple":0.5,"Default":0.8,"Unknown":0.5,"Not Applicable":1.0}19IN = {"Automated":1.0,"Limited/Typical":0.9,"Opportunistic":0.3,"High":0.1,"No Interaction":0,"Default":0.55,"Unknown":0.5,"Not Applicable":1.0}20SC = {"All":1.0,"Moderate":0.9,"Rare":0.5,"Potentially Reachable":0.1,"Default":0.7,"Unknown":0.5,"Not Applicable":1.0}21## Environmental Metric Group:22 23BI = {"Critical":1.0,"High":0.9,"Medium":0.6,"Low":0.3,"None":0,"Default":0.6,"Unknown":0.5,"Not Applicable":1.0}24DI = {"High":1.0,"Medium":0.6,"Low":0.2,"Default":0.6,"Unknown":0.5,"Not Applicable":1.0}25EX = {"High":1.0,"Medium":0.6,"Low":0.2,"None":0,"Default":0.6,"Unknown":0.5,"Not Applicable":1.0}26EC = {"None":1.0,"Limited":0.9,"Moderate":0.7,"Indirect":0.5,"Best-Available":0.3,"Complete":0.1,"Default":0.6,"Unknown":0.5,"Not Applicable":1.0}27RE = {"Extensive":1.0,"Moderate":0.9,"Limited":0.8,"Default":0.9,"Unknown":0.5,"Not Applicable":1.0}28P = {"Widespread":1.0,"High":0.9,"Common":0.8,"Limited":0.7,"Default":0.85,"Unknown":0.5,"Not Applicable":1.0}29cweOwner = ["Administrator","Partially-Privileged User","Regular User","Guest","None","Default","Unknown","Not Applicable"]30cweUser = ["Administrator","Partially-Privileged User","Regular User","Guest","None","Default","Unknown","Not Applicable"]31#http://www.tiobe.com/index.php/content/paperinfo/tpci/index.html32cweLang = ["C/C++","Java","Visual Basic","C#",".NET","Fortran","PHP","Python","Bash","Ruby","Perl","Javascript","PL/SQL","Matlab"]33cweUIcom = ["Yes","No"]34cweSanit = ["Yes","No"]35cweTrans = ["Yes","No"]36cweTransf = ["Yes","No"]37cweTrust = ["Yes","No"]38cweDBint = ["Yes","No"]39cweTime = ["Yes","No"]40cweMaxmin = ["Yes","No"]41cweCalltpf = ["Yes","No"]42cweSpoof = ["Yes","No"]43cweTamper = ["Yes","No"]44cweEncryp = ["Yes","No"]45cweAttach = ["Yes","No"]46cweDataf = ["JDL","RSL","ClassAdd","Submit","SQL","XML","PDF","DOC","XLS","TXT","CSV","RTF","HTML","Binary"]47cweUError = ["Yes","No"]48cweRemote = ["Yes","No"]49cweClient = ["Yes","No"]50cwePrecedents = []51cweAtts = {"Owner":cweOwner,"User":cweUser,"Programming Language":cweLang,"User Interface":cweUIcom,"Sanitize":cweSanit,\52 "Transform Data":cweTrans,"Transfering Data":cweTransf,"Trust":cweTrust,"Database Interaction":cweDBint,\53 "Timeout Operations":cweTime,"Max/Min Operations":cweMaxmin,"Thirdparty Operations":cweCalltpf,"Spoofing":cweSpoof,\54 "Tampering":cweTamper,"Encryption":cweEncryp,"Attachment":cweAttach,"Data/File Format":cweDataf,\55 "Unexpected Error handling":cweUError,"Remote/External Operation":cweRemote,"Client/Server Installation":cweClient}56def reglas(attrib,value):57 ## Evaluating Owner attribute58 if (attrib=="Owner"):59 if (value=='Administrator'):60 metrics = [["Technical Impact","Critical", TI.get("Critical")], ["Acquired Privilege","Administrator",AP.get("Administrator")],["Acquired Privilege Layer","Enterprise",AL.get("Enterprise")],["Business Impact","Critical",BI.get("Critical")]]61 elif (value=='Partially-Privileged User'):62 metrics = [["Technical Impact","High", TI.get("High")], ["Acquired Privilege","Partially-Privileged User",AP.get("Partially-Privileged User")],["Acquired Privilege Layer","System",AL.get("System")],["Business Impact","High",BI.get("High")]]63 elif (value=='Regular User'):64 metrics = [["Technical Impact","Medium", TI.get("Medium")], ["Acquired Privilege","Regular User",AP.get("Regular User")],["Acquired Privilege Layer","Network",AL.get("Network")],["Business Impact","Medium",BI.get("Medium")]]65 elif (value=='Guest'):66 metrics = [["Technical Impact","Low", TI.get("Low")], ["Acquired Privilege","Guest",AP.get("Guest")],["Acquired Privilege Layer","Unknown",AL.get("Unknown")],["Business Impact","Low",BI.get("Low")]]67 elif (value=='None'):68 metrics = [["Technical Impact","None", TI.get("None")], ["Acquired Privilege","None",AP.get("None")],["Acquired Privilege Layer","Unknown",AL.get("Unknown")],["Business Impact","None",BI.get("None")]]69 elif (value=='Default'):70 metrics = [["Technical Impact","Default", TI.get("Default")], ["Acquired Privilege","Default",AP.get("Default")],["Acquired Privilege Layer","Default",AL.get("Default")],["Business Impact","Default",BI.get("Default")]]71 elif (value=='Unknown'):72 metrics = [["Technical Impact","Unknown", TI.get("Unknown")], ["Acquired Privilege","Unknown",AP.get("Unknown")],["Acquired Privilege Layer","Unknown",AL.get("Unknown")],["Business Impact","Unknown",BI.get("Unknown")]]73 elif (value=='Not Applicable'):74 metrics = [["Technical Impact","Not Applicable", TI.get("Not Applicable")], ["Acquired Privilege","Not Applicable",AP.get("Not Applicable")],["Acquired Privilege Layer","Not Applicable",AL.get("Not Applicable")],["Business Impact","Not Applicable",BI.get("Not Applicable")]]75 76 ## Evaluating User attribute77 78 #if (value=='Administrator'):79# print RP.get("Administrator"), AV.get("Physical"), BI.get("Critical")80# elif (value=='Partially-Privileged User'):81 # print RP.get("Partially-Privileged User"), AV.get("Local"), BI.get("High") 82 # elif (value=='Regular User'):83 # print RP.get("Regular User"), AV.get("Private Network"), AV.get("Adjacent Network"), BI.get("Medium")84 #elif (value=='Guest'):85 # print RP.get("Guest"), AV.get("Internet"), AV.get("Intranet"), BI.get("Low") 86 #elif (value=='None'):87 # print RP.get("None"), AV.get("Unknown"), BI.get("None") 88 #elif (value=='Default'):89 # print RP.get("Default"), AV.get("Default"), BI.get("Default") 90 #elif (value=='Unknown'):91 # print RP.get("Unknown"), AV.get("Unknown"), BI.get("Unknown")92 #elif (value=='Not Applicable'):93 # print RP.get("Not Applicable"), AV.get("Not Applicable"), BI.get("Not Applicable")94 95 ## Required Layer should be always set up to "Application"96 #print RL.get("Application")97 print 'reglas'98 raw_input()99 return metrics100#create the minidom document101doc = Document()102#create the <static> base element103rules = doc.createElement("rules")104doc.appendChild(rules)105for i in cweAtts.keys():106 safetyatt = doc.createElement("SafetyAttribute")107 nameatt = doc.createElement("Name")108 nameatt.setAttribute("name",i) 109 safetyatt.appendChild(nameatt)110 111 aux = cweAtts.get(i)112 113 for j in range(0,len(aux)):114 tmp=""115 tmp += aux[j]116 valueatt = doc.createElement("Value") 117 valueatt.setAttribute("value",tmp)118 if (i=="Owner"):119 metricas=reglas(i,tmp)120 for k in range(0,len(metricas)):121 metrics = doc.createElement("Metric")122 metrics.setAttribute("metric",metricas[k][0])123 metrics.setAttribute("value",metricas[k][1])124 metrics.setAttribute("score",str(metricas[k][2]))125 valueatt.appendChild(metrics)126 127 safetyatt.appendChild(valueatt)128 rules.appendChild(safetyatt)129file = open("rules.xml","wb")130try:131 file.write(doc.toprettyxml(indent=" ",encoding="UTF-8"))132finally:...

Full Screen

Full Screen

vocab.py

Source:vocab.py Github

copy

Full Screen

1# Licensed to the Apache Software Foundation (ASF) under one2# or more contributor license agreements. See the NOTICE file3# distributed with this work for additional information4# regarding copyright ownership. The ASF licenses this file5# to you under the Apache License, Version 2.0 (the6# "License"); you may not use this file except in compliance7# with the License. You may obtain a copy of the License at8#9# http://www.apache.org/licenses/LICENSE-2.010#11# Unless required by applicable law or agreed to in writing,12# software distributed under the License is distributed on an13# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY14# KIND, either express or implied. See the License for the15# specific language governing permissions and limitations16# under the License.17# coding: utf-818# pylint: disable=consider-iterating-dictionary19"""Text token indexer."""20from __future__ import absolute_import21from __future__ import print_function22import collections23from . import _constants as C24class Vocabulary(object):25 """Indexing for text tokens.26 Build indices for the unknown token, reserved tokens, and input counter keys. Indexed tokens can27 be used by token embeddings.28 Parameters29 ----------30 counter : collections.Counter or None, default None31 Counts text token frequencies in the text data. Its keys will be indexed according to32 frequency thresholds such as `most_freq_count` and `min_freq`. Keys of `counter`,33 `unknown_token`, and values of `reserved_tokens` must be of the same hashable type.34 Examples: str, int, and tuple.35 most_freq_count : None or int, default None36 The maximum possible number of the most frequent tokens in the keys of `counter` that can be37 indexed. Note that this argument does not count any token from `reserved_tokens`. Suppose38 that there are different keys of `counter` whose frequency are the same, if indexing all of39 them will exceed this argument value, such keys will be indexed one by one according to40 their __cmp__() order until the frequency threshold is met. If this argument is None or41 larger than its largest possible value restricted by `counter` and `reserved_tokens`, this42 argument has no effect.43 min_freq : int, default 144 The minimum frequency required for a token in the keys of `counter` to be indexed.45 unknown_token : hashable object, default '&lt;unk&gt;'46 The representation for any unknown token. In other words, any unknown token will be indexed47 as the same representation. Keys of `counter`, `unknown_token`, and values of48 `reserved_tokens` must be of the same hashable type. Examples: str, int, and tuple.49 reserved_tokens : list of hashable objects or None, default None50 A list of reserved tokens that will always be indexed, such as special symbols representing51 padding, beginning of sentence, and end of sentence. It cannot contain `unknown_token`, or52 duplicate reserved tokens. Keys of `counter`, `unknown_token`, and values of53 `reserved_tokens` must be of the same hashable type. Examples: str, int, and tuple.54 Properties55 ----------56 token_to_idx : dict mapping str to int57 A dict mapping each token to its index integer.58 idx_to_token : list of strs59 A list of indexed tokens where the list indices and the token indices are aligned.60 unknown_token : hashable object61 The representation for any unknown token. In other words, any unknown token will be indexed62 as the same representation.63 reserved_tokens : list of strs or None64 A list of reserved tokens that will always be indexed.65 """66 def __init__(self, counter=None, most_freq_count=None, min_freq=1, unknown_token='<unk>',67 reserved_tokens=None):68 # Sanity checks.69 assert min_freq > 0, '`min_freq` must be set to a positive value.'70 if reserved_tokens is not None:71 reserved_token_set = set(reserved_tokens)72 assert unknown_token not in reserved_token_set, \73 '`reserved_token` cannot contain `unknown_token`.'74 assert len(reserved_token_set) == len(reserved_tokens), \75 '`reserved_tokens` cannot contain duplicate reserved tokens.'76 self._index_unknown_and_reserved_tokens(unknown_token, reserved_tokens)77 if counter is not None:78 self._index_counter_keys(counter, unknown_token, reserved_tokens, most_freq_count,79 min_freq)80 def _index_unknown_and_reserved_tokens(self, unknown_token, reserved_tokens):81 """Indexes unknown and reserved tokens."""82 self._unknown_token = unknown_token83 # Thus, constants.UNKNOWN_IDX must be 0.84 self._idx_to_token = [unknown_token]85 if reserved_tokens is None:86 self._reserved_tokens = None87 else:88 self._reserved_tokens = reserved_tokens[:]89 self._idx_to_token.extend(reserved_tokens)90 self._token_to_idx = {token: idx for idx, token in enumerate(self._idx_to_token)}91 def _index_counter_keys(self, counter, unknown_token, reserved_tokens, most_freq_count,92 min_freq):93 """Indexes keys of `counter`.94 Indexes keys of `counter` according to frequency thresholds such as `most_freq_count` and95 `min_freq`.96 """97 assert isinstance(counter, collections.Counter), \98 '`counter` must be an instance of collections.Counter.'99 unknown_and_reserved_tokens = set(reserved_tokens) if reserved_tokens is not None else set()100 unknown_and_reserved_tokens.add(unknown_token)101 token_freqs = sorted(counter.items(), key=lambda x: x[0])102 token_freqs.sort(key=lambda x: x[1], reverse=True)103 token_cap = len(unknown_and_reserved_tokens) + (104 len(counter) if most_freq_count is None else most_freq_count)105 for token, freq in token_freqs:106 if freq < min_freq or len(self._idx_to_token) == token_cap:107 break108 if token not in unknown_and_reserved_tokens:109 self._idx_to_token.append(token)110 self._token_to_idx[token] = len(self._idx_to_token) - 1111 def __len__(self):112 return len(self.idx_to_token)113 @property114 def token_to_idx(self):115 return self._token_to_idx116 @property117 def idx_to_token(self):118 return self._idx_to_token119 @property120 def unknown_token(self):121 return self._unknown_token122 @property123 def reserved_tokens(self):124 return self._reserved_tokens125 def to_indices(self, tokens):126 """Converts tokens to indices according to the vocabulary.127 Parameters128 ----------129 tokens : str or list of strs130 A source token or tokens to be converted.131 Returns132 -------133 int or list of ints134 A token index or a list of token indices according to the vocabulary.135 """136 to_reduce = False137 if not isinstance(tokens, list):138 tokens = [tokens]139 to_reduce = True140 indices = [self.token_to_idx[token] if token in self.token_to_idx141 else C.UNKNOWN_IDX for token in tokens]142 return indices[0] if to_reduce else indices143 def to_tokens(self, indices):144 """Converts token indices to tokens according to the vocabulary.145 Parameters146 ----------147 indices : int or list of ints148 A source token index or token indices to be converted.149 Returns150 -------151 str or list of strs152 A token or a list of tokens according to the vocabulary.153 """154 to_reduce = False155 if not isinstance(indices, list):156 indices = [indices]157 to_reduce = True158 max_idx = len(self.idx_to_token) - 1159 tokens = []160 for idx in indices:161 if not isinstance(idx, int) or idx > max_idx:162 raise ValueError('Token index %d in the provided `indices` is invalid.' % idx)163 else:164 tokens.append(self.idx_to_token[idx])...

Full Screen

Full Screen

Automation Testing Tutorials

Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run Slash automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful