Because you can't get the docs.
Create a transliterator:
greek2latin = icu.Transliterator.createInstance('Greek-Latin')| """ | |
| McCarthy's amb operator (kind of) implemented in Python | |
| ᚾᚪᚻᛏ᛫ᛁᛋ᛫ᚦᚱᚫᛞᛋᛁᚳᚩᚱ | |
| very unoptimized, much slow, wow | |
| """ | |
| class amb: | |
| def __init__(self, *values): | |
| self.values = tuple(values) | |
| if len(self.values) < 2: |
| # jslen -- find the JavaScript length of a string (Python 3) | |
| # | |
| # Note to Python developers: since you know it as of Python 3.3, it'd | |
| # be nice to have a way to find out in O(1) if a string contains any | |
| # wide characters. | |
| # find the preferred (i.e. faster) byte order | |
| if ''.encode('utf-16') == b'\xFE\xFF': | |
| preferred_encoding = 'utf-16le' | |
| else: |
| import os | |
| import os.path | |
| import fcntl | |
| import ctypes | |
| from ctypes.util import find_library | |
| import re | |
| libc = None | |
| F_CLOSEM = None | |
| strategy = None |
| def primes(): | |
| prime_multiple_factors = {} | |
| def add_factor(composite, factor): | |
| if composite not in prime_multiple_factors: | |
| prime_multiple_factors[composite] = set([factor]) | |
| else: | |
| prime_multiple_factors[composite].add(factor) | |
| x = 2 | |
| while True: |
| module Rubinius | |
| class CompiledCode | |
| def _dump(depth) | |
| Marshal.dump([@scope, Rubinius::ToolSets::Runtime::CompiledFile::Marshal.new.marshal(self)]) | |
| end | |
| def self._load(string) | |
| scope, dump = Marshal.load(string) | |
| cm = Rubinius::ToolSets::Runtime::CompiledFile::Marshal.new.unmarshal(dump) | |
| cm.scope = scope |
| import requests | |
| import json | |
| import sys | |
| from collections import deque | |
| from concurrent.futures import ThreadPoolExecutor as Pool | |
| from datetime import datetime | |
| from os import mkdir | |
| from os.path import isdir | |
| def debug(*args, **kwargs): |
| #!/usr/bin/env python3 | |
| from lxml.html import html5parser as html | |
| import requests | |
| import os, os.path | |
| import sys | |
| class ImgurAlbumError(Exception): pass | |
| def imgur_album_get(url): |
| import base64 | |
| import struct | |
| from uuid import getnode as get_mac | |
| import os | |
| from threading import Lock | |
| import time | |
| from ssl import RAND_bytes as random_bytes | |
| mac = struct.pack('>Q', get_mac())[2:] # do this now in case it is slow (see Python manual) |
| import unicodedata as u | |
| def itergraphemes(str): | |
| def modifierp(char): return u.category(char)[0] == 'M' | |
| start = 0 | |
| for end, char in enumerate(str): | |
| if not modifierp(char) and not start == end: | |
| yield str[start:end] | |
| start = end | |
| yield str[start:] |