diff --git a/.vscode/launch.json b/.vscode/launch.json index 950409db..60c627f8 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -5,7 +5,7 @@ "name": "Listen for XDebug", "type": "php", "request": "launch", - "port": 9000 + "port": 9002 }, { "name": "Launch currently open script", diff --git a/Caddyfile b/Caddyfile new file mode 100644 index 00000000..4a46d614 --- /dev/null +++ b/Caddyfile @@ -0,0 +1,5 @@ +localhost:80 { + fastcgi / 127.0.0.1:9001 { + index index.php + } +} diff --git a/TL.php b/TL.php index d8c08536..0655f563 100644 --- a/TL.php +++ b/TL.php @@ -105,28 +105,37 @@ class TL public function serialize_param($bytes_io, $type_, $value) { - if (($type_ == 'int')) { - assert(is_numeric($value)); - assert(strlen(decbin($value)) <= 32); - fwrite($bytes_io, $this->struct->pack('struct->pack('struct->pack('struct->pack('struct->pack('struct->pack('struct->pack('struct->pack('struct->unpack('struct->unpack('struct->unpack('struct->unpack('struct->unpack('struct->unpack('struct->unpack('deserialize($bytes_io, $subtype); - } - } else { - if (isset($this->constructor_type[$type_])) { - $tl_elem = $this->constructor_type[$type_]; - } else { - $Idata = fread($bytes_io, 4); - $i = $this->struct->unpack('constructor_id[$i])) { - $tl_elem = $this->constructor_id[$i]; + switch ($type_) { + case 'int': + $x = $this->struct->unpack('struct->unpack('struct->unpack('struct->unpack('struct->unpack('struct->unpack('struct->unpack('deserialize($bytes_io, $subtype); + } + break; + default: + if (isset($this->constructor_type[$type_])) { + $tl_elem = $this->constructor_type[$type_]; + } else { + $Idata = fread($bytes_io, 4); + $i = $this->struct->unpack('constructor_id[$i])) { + $tl_elem = $this->constructor_id[$i]; + } else { + throw new Exception(sprintf('Could not extract type: %s', $type_)); + } } - } - $base_boxed_types = ['Vector t', 'Int', 'Long', 'Double', 'String', 'Int128', 'Int256']; - if (in_array($tl_elem->type, $base_boxed_types)) { - $x = $this->deserialize($bytes_io, $tl_elem->predicate, $subtype); - } else { - $x = new TLObject($tl_elem); - foreach ($tl_elem->params as $arg) { - $x[$arg['name']] = $this->deserialize($bytes_io, $arg['type'], $arg['subtype']); + $base_boxed_types = ['Vector t', 'Int', 'Long', 'Double', 'String', 'Int128', 'Int256']; + if (in_array($tl_elem->type, $base_boxed_types)) { + $x = $this->deserialize($bytes_io, $tl_elem->predicate, $subtype); + } else { + $x = new TLObject($tl_elem); + foreach ($tl_elem->params as $arg) { + $x[$arg['name']] = $this->deserialize($bytes_io, $arg['type'], $arg['subtype']); + } } - } + break; } return $x; diff --git a/TL.py b/TL.py index 47f029c8..3d6fab52 100644 --- a/TL.py +++ b/TL.py @@ -152,7 +152,6 @@ def deserialize(bytes_io, type_=None, subtype=None): # Boxed types Idata = bytes_io.read(4) i = struct.unpack('struct->unpack('I', array_slice($s, $i, ($i + 4) - $i))[0]); - } - - return $acc; +function posmod($a, $b) { + $resto = $a % $b; + if($resto < 0) $resto += abs($b); + return $resto; } function fread_all($handle) @@ -117,29 +105,49 @@ function fopen_and_write($filename, $mode, $data) */ function long_to_bytes($n, $blocksize = 0) { - $s = $b(''); + $s = null; $n = long($n); while (($n > 0)) { - $s = ($this->struct->pack('I', $n & 4294967295) + $s); + $s = $GLOBALS["struct"]->pack('I', $n & 4294967295) . $s; $n = $n >> 32; } foreach (pyjslib_range(strlen($s)) as $i) { - if (($s[$i] != $b('')[0])) { + if (($s[$i] != string2bin('\000')[0])) { break; } } - $s = array_slice($s, $i); - if (($blocksize > 0) && (strlen($s) % $blocksize)) { - $s = ((($blocksize - (strlen($s) % $blocksize)) * $b('')) + $s); + $s = substr($s, $i); + if ($blocksize > 0 && strlen($s) % $blocksize) { + $s = pack("@" . $blocksize - (strlen($s) % $blocksize)) . $s; } return $s; } +/** + * bytes_to_long(string) : long + * Convert a byte string to a long integer. + * This is (essentially) the inverse of long_to_bytes(). + */ +function bytes_to_long($s) +{ + //return $GLOBALS["struct"]->unpack('>Q', $s)[0]; + $acc = 0; + $length = strlen($s); + if ($length % 4) { + $extra = (4 - ($length % 4)); + $s = pack("@" . $extra) . $s; + $length += $extra; + } + foreach (pyjslib_range(0, $length, 4) as $i) { + $acc = ($acc << 32) + $GLOBALS["struct"]->unpack('>I', substr($s, $i, 4))[0]; + } + return $acc; +} function string2bin($string) { $res = null; foreach (explode('\\', $string) as $s) { - if ($s != null && $s[0] == 'x') { + if ($s != null && strlen($s) == 3) { $res .= hex2bin(substr($s, 1)); } } @@ -192,7 +200,7 @@ class Session $encrypted_data = $this->server_salt.$this->session_id.$message_id.$this->struct->pack('number, strlen($message_data)).$message_data; $message_key = substr(sha1($encrypted_data, true), -16); - $padding = random_bytes((-strlen($encrypted_data) % 16)); + $padding = random_bytes(posmod(-strlen($encrypted_data), 16)); echo strlen($encrypted_data.$padding).PHP_EOL; list($aes_key, $aes_iv) = $this->aes_calculate($message_key); $message = $this->auth_key_id.$message_key.crypt::ige_encrypt($encrypted_data.$padding, $aes_key, $aes_iv); @@ -266,7 +274,7 @@ class Session $pq_bytes = $ResPQ['pq']; $pq = bytes_to_long($pq_bytes); list($p, $q) = primefactors($pq); - if (($p > $q)) { + if ($p > $q) { list($p, $q) = [$q, $p]; } assert((($p * $q) == $pq) && ($p < $q)); @@ -310,7 +318,7 @@ class Session $g_b_str = new long_to_bytes($g_b); $data = py2php_kwargs_function_call('serialize_obj', ['client_DH_inner_data'], ['nonce' => $nonce, 'server_nonce' => $server_nonce, 'retry_id' => $retry_id, 'g_b' => $g_b_str]); $data_with_sha = (sha1($data, true) + $data); - $data_with_sha_padded = ($data_with_sha + random_bytes((-strlen($data_with_sha) % 16))); + $data_with_sha_padded = ($data_with_sha + random_bytes(posmod(-strlen($data_with_sha), 16))); $encrypted_data = crypt::ige_encrypt($data_with_sha_padded, $tmp_aes_key, $tmp_aes_iv); foreach (pyjslib_range(1, $this->AUTH_MAX_RETRY) as $i) { $Set_client_DH_params_answer = $this->method_call('set_client_DH_params', ['nonce' => $nonce, 'server_nonce' => $server_nonce, 'encrypted_data' => $encrypted_data]); diff --git a/mtproto.py b/mtproto.py index 67cecbf1..4e6b932c 100644 --- a/mtproto.py +++ b/mtproto.py @@ -80,7 +80,6 @@ class Session: message_data) message_key = SHA.new(encrypted_data).digest()[-16:] padding = os.urandom((-len(encrypted_data)) % 16) - print(len(encrypted_data+padding)) aes_key, aes_iv = self.aes_calculate(message_key) message = (self.auth_key_id + message_key + @@ -109,7 +108,6 @@ class Session: if auth_key_id == b'\x00\x00\x00\x00\x00\x00\x00\x00': # No encryption - Plain text (message_id, message_length) = struct.unpack("<8sI", packet[12:24]) - print(len(packet[12:24])) data = packet[24:24+message_length] elif auth_key_id == self.auth_key_id: message_key = packet[12:28] @@ -143,13 +141,12 @@ class Session: ResPQ = self.method_call('req_pq', nonce=nonce) server_nonce = ResPQ['server_nonce'] - exit() # TODO: selecting RSA public key based on this fingerprint public_key_fingerprint = ResPQ['server_public_key_fingerprints'][0] pq_bytes = ResPQ['pq'] + vis(pq_bytes) pq = bytes_to_long(pq_bytes) - [p, q] = prime.primefactors(pq) if p > q: (p, q) = (q, p) assert p*q == pq and p < q diff --git a/prime.php b/prime.php index a65d54e0..98296003 100644 --- a/prime.php +++ b/prime.php @@ -36,9 +36,13 @@ function primesbelow($N) $N = [0 => $N, 1 => ($N - 1), 2 => ($N + 4), 3 => ($N + 3), 4 => ($N + 2), 5 => ($N + 1)][($N % 6)]; $sieve = array_fill(0, floor($N / 3), true); $sieve[0] = false; - foreach (pyjslib_range((floor(pyjslib_int(pow($N, 0.5)) / 3) + 1)) as $i) { + foreach (pyjslib_range(floor((int)(pow($N, 0.5)) / 3) + 1) as $i) { if ($sieve[$i]) { $k = ((3 * $i) + 1) | 1; + foreach (pyjslib_range(floor(($k*$k) / 3), 2*$k) as $key) { + + } + array_fill(0, floor((floor($N / 6) - floor(($k * $k) / 6) - 1) / $k) + 1, false) $sieve = array_merge( $sieve, array_merge( everynth( @@ -51,34 +55,13 @@ function primesbelow($N) ), 2 * $k ), ( - array_fill( - 0, - ( - floor( - ( - ( - floor( - $N / 6 - ) - floor( - ( - ( - ($k * $k) + (4 * $k) - ) - ( - (2 * $k) * ($i % 2) - ) - ) / 6 - ) - ) - 1 - ) / $k - ) + 1 - ), - false - ) + ) ) ); } } + var_dump($sieve); return [2, 3] + array_map(function ($i, $sieve) { if ($sieve[$i]) { diff --git a/prime.py b/prime.py index 1ed5a7f0..e1e1ceed 100644 --- a/prime.py +++ b/prime.py @@ -14,6 +14,7 @@ def primesbelow(N): k = (3 * i + 1) | 1 sieve[k*k // 3::2*k] = [False] * ((N//6 - (k*k)//6 - 1)//k + 1) sieve[(k*k + 4*k - 2*k*(i%2)) // 3::2*k] = [False] * ((N // 6 - (k*k + 4*k - 2*k*(i%2))//6 - 1) // k + 1) + exit() return [2, 3] + [(3 * i + 1) | 1 for i in range(1, N//3 - correction) if sieve[i]] smallprimeset = set(primesbelow(100000)) diff --git a/testing.php b/testing.php index 8a4c1512..843fd4d9 100644 --- a/testing.php +++ b/testing.php @@ -5,7 +5,7 @@ require_once 'libpy2php.php'; require_once 'os.php'; require_once 'mtproto.php'; $config = parse_ini_file('credentials', true); -if (!($config)) { +if (!$config) { pyjslib_printnl('File \'credentials\' seems to not exist.'); $exit(-1); } diff --git a/trace.txt b/trace.txt new file mode 100644 index 00000000..a0f1e688 --- /dev/null +++ b/trace.txt @@ -0,0 +1,77034 @@ + --- modulename: testing, funcname: +testing.py(2): import os +testing.py(3): import io + --- modulename: io, funcname: +io.py(34): """ +io.py(37): __author__ = ("Guido van Rossum , " +io.py(44): __all__ = ["BlockingIOError", "open", "IOBase", "RawIOBase", "FileIO", +io.py(45): "BytesIO", "StringIO", "BufferedIOBase", +io.py(46): "BufferedReader", "BufferedWriter", "BufferedRWPair", +io.py(47): "BufferedRandom", "TextIOBase", "TextIOWrapper", +io.py(48): "UnsupportedOperation", "SEEK_SET", "SEEK_CUR", "SEEK_END"] +io.py(51): import _io +io.py(52): import abc +io.py(54): from _io import (DEFAULT_BUFFER_SIZE, BlockingIOError, UnsupportedOperation, +io.py(59): OpenWrapper = _io.open # for compatibility with _pyio +io.py(62): SEEK_SET = 0 +io.py(63): SEEK_CUR = 1 +io.py(64): SEEK_END = 2 +io.py(69): class IOBase(_io._IOBase): + --- modulename: io, funcname: IOBase +io.py(69): class IOBase(_io._IOBase): +io.py(70): __metaclass__ = abc.ABCMeta + --- modulename: abc, funcname: __new__ +abc.py(87): cls = super(ABCMeta, mcls).__new__(mcls, name, bases, namespace) +abc.py(89): abstracts = set(name +abc.py(90): for name, value in namespace.items() + --- modulename: abc, funcname: +abc.py(89): abstracts = set(name +abc.py(91): if getattr(value, "__isabstractmethod__", False)) +abc.py(89): abstracts = set(name +abc.py(91): if getattr(value, "__isabstractmethod__", False)) +abc.py(89): abstracts = set(name +abc.py(92): for base in bases: +abc.py(93): for name in getattr(base, "__abstractmethods__", set()): +abc.py(92): for base in bases: +abc.py(97): cls.__abstractmethods__ = frozenset(abstracts) +abc.py(99): cls._abc_registry = WeakSet() + --- modulename: _weakrefset, funcname: __init__ +_weakrefset.py(37): self.data = set() +_weakrefset.py(38): def _remove(item, selfref=ref(self)): +_weakrefset.py(45): self._remove = _remove +_weakrefset.py(47): self._pending_removals = [] +_weakrefset.py(48): self._iterating = set() +_weakrefset.py(49): if data is not None: +abc.py(100): cls._abc_cache = WeakSet() + --- modulename: _weakrefset, funcname: __init__ +_weakrefset.py(37): self.data = set() +_weakrefset.py(38): def _remove(item, selfref=ref(self)): +_weakrefset.py(45): self._remove = _remove +_weakrefset.py(47): self._pending_removals = [] +_weakrefset.py(48): self._iterating = set() +_weakrefset.py(49): if data is not None: +abc.py(101): cls._abc_negative_cache = WeakSet() + --- modulename: _weakrefset, funcname: __init__ +_weakrefset.py(37): self.data = set() +_weakrefset.py(38): def _remove(item, selfref=ref(self)): +_weakrefset.py(45): self._remove = _remove +_weakrefset.py(47): self._pending_removals = [] +_weakrefset.py(48): self._iterating = set() +_weakrefset.py(49): if data is not None: +abc.py(102): cls._abc_negative_cache_version = ABCMeta._abc_invalidation_counter +abc.py(103): return cls +io.py(72): class RawIOBase(_io._RawIOBase, IOBase): + --- modulename: io, funcname: RawIOBase +io.py(72): class RawIOBase(_io._RawIOBase, IOBase): +io.py(73): pass + --- modulename: abc, funcname: __new__ +abc.py(87): cls = super(ABCMeta, mcls).__new__(mcls, name, bases, namespace) +abc.py(89): abstracts = set(name +abc.py(90): for name, value in namespace.items() + --- modulename: abc, funcname: +abc.py(89): abstracts = set(name +abc.py(91): if getattr(value, "__isabstractmethod__", False)) +abc.py(89): abstracts = set(name +abc.py(92): for base in bases: +abc.py(93): for name in getattr(base, "__abstractmethods__", set()): +abc.py(92): for base in bases: +abc.py(93): for name in getattr(base, "__abstractmethods__", set()): +abc.py(92): for base in bases: +abc.py(97): cls.__abstractmethods__ = frozenset(abstracts) +abc.py(99): cls._abc_registry = WeakSet() + --- modulename: _weakrefset, funcname: __init__ +_weakrefset.py(37): self.data = set() +_weakrefset.py(38): def _remove(item, selfref=ref(self)): +_weakrefset.py(45): self._remove = _remove +_weakrefset.py(47): self._pending_removals = [] +_weakrefset.py(48): self._iterating = set() +_weakrefset.py(49): if data is not None: +abc.py(100): cls._abc_cache = WeakSet() + --- modulename: _weakrefset, funcname: __init__ +_weakrefset.py(37): self.data = set() +_weakrefset.py(38): def _remove(item, selfref=ref(self)): +_weakrefset.py(45): self._remove = _remove +_weakrefset.py(47): self._pending_removals = [] +_weakrefset.py(48): self._iterating = set() +_weakrefset.py(49): if data is not None: +abc.py(101): cls._abc_negative_cache = WeakSet() + --- modulename: _weakrefset, funcname: __init__ +_weakrefset.py(37): self.data = set() +_weakrefset.py(38): def _remove(item, selfref=ref(self)): +_weakrefset.py(45): self._remove = _remove +_weakrefset.py(47): self._pending_removals = [] +_weakrefset.py(48): self._iterating = set() +_weakrefset.py(49): if data is not None: +abc.py(102): cls._abc_negative_cache_version = ABCMeta._abc_invalidation_counter +abc.py(103): return cls +io.py(75): class BufferedIOBase(_io._BufferedIOBase, IOBase): + --- modulename: io, funcname: BufferedIOBase +io.py(75): class BufferedIOBase(_io._BufferedIOBase, IOBase): +io.py(76): pass + --- modulename: abc, funcname: __new__ +abc.py(87): cls = super(ABCMeta, mcls).__new__(mcls, name, bases, namespace) +abc.py(89): abstracts = set(name +abc.py(90): for name, value in namespace.items() + --- modulename: abc, funcname: +abc.py(89): abstracts = set(name +abc.py(91): if getattr(value, "__isabstractmethod__", False)) +abc.py(89): abstracts = set(name +abc.py(92): for base in bases: +abc.py(93): for name in getattr(base, "__abstractmethods__", set()): +abc.py(92): for base in bases: +abc.py(93): for name in getattr(base, "__abstractmethods__", set()): +abc.py(92): for base in bases: +abc.py(97): cls.__abstractmethods__ = frozenset(abstracts) +abc.py(99): cls._abc_registry = WeakSet() + --- modulename: _weakrefset, funcname: __init__ +_weakrefset.py(37): self.data = set() +_weakrefset.py(38): def _remove(item, selfref=ref(self)): +_weakrefset.py(45): self._remove = _remove +_weakrefset.py(47): self._pending_removals = [] +_weakrefset.py(48): self._iterating = set() +_weakrefset.py(49): if data is not None: +abc.py(100): cls._abc_cache = WeakSet() + --- modulename: _weakrefset, funcname: __init__ +_weakrefset.py(37): self.data = set() +_weakrefset.py(38): def _remove(item, selfref=ref(self)): +_weakrefset.py(45): self._remove = _remove +_weakrefset.py(47): self._pending_removals = [] +_weakrefset.py(48): self._iterating = set() +_weakrefset.py(49): if data is not None: +abc.py(101): cls._abc_negative_cache = WeakSet() + --- modulename: _weakrefset, funcname: __init__ +_weakrefset.py(37): self.data = set() +_weakrefset.py(38): def _remove(item, selfref=ref(self)): +_weakrefset.py(45): self._remove = _remove +_weakrefset.py(47): self._pending_removals = [] +_weakrefset.py(48): self._iterating = set() +_weakrefset.py(49): if data is not None: +abc.py(102): cls._abc_negative_cache_version = ABCMeta._abc_invalidation_counter +abc.py(103): return cls +io.py(78): class TextIOBase(_io._TextIOBase, IOBase): + --- modulename: io, funcname: TextIOBase +io.py(78): class TextIOBase(_io._TextIOBase, IOBase): +io.py(79): pass + --- modulename: abc, funcname: __new__ +abc.py(87): cls = super(ABCMeta, mcls).__new__(mcls, name, bases, namespace) +abc.py(89): abstracts = set(name +abc.py(90): for name, value in namespace.items() + --- modulename: abc, funcname: +abc.py(89): abstracts = set(name +abc.py(91): if getattr(value, "__isabstractmethod__", False)) +abc.py(89): abstracts = set(name +abc.py(92): for base in bases: +abc.py(93): for name in getattr(base, "__abstractmethods__", set()): +abc.py(92): for base in bases: +abc.py(93): for name in getattr(base, "__abstractmethods__", set()): +abc.py(92): for base in bases: +abc.py(97): cls.__abstractmethods__ = frozenset(abstracts) +abc.py(99): cls._abc_registry = WeakSet() + --- modulename: _weakrefset, funcname: __init__ +_weakrefset.py(37): self.data = set() +_weakrefset.py(38): def _remove(item, selfref=ref(self)): +_weakrefset.py(45): self._remove = _remove +_weakrefset.py(47): self._pending_removals = [] +_weakrefset.py(48): self._iterating = set() +_weakrefset.py(49): if data is not None: +abc.py(100): cls._abc_cache = WeakSet() + --- modulename: _weakrefset, funcname: __init__ +_weakrefset.py(37): self.data = set() +_weakrefset.py(38): def _remove(item, selfref=ref(self)): +_weakrefset.py(45): self._remove = _remove +_weakrefset.py(47): self._pending_removals = [] +_weakrefset.py(48): self._iterating = set() +_weakrefset.py(49): if data is not None: +abc.py(101): cls._abc_negative_cache = WeakSet() + --- modulename: _weakrefset, funcname: __init__ +_weakrefset.py(37): self.data = set() +_weakrefset.py(38): def _remove(item, selfref=ref(self)): +_weakrefset.py(45): self._remove = _remove +_weakrefset.py(47): self._pending_removals = [] +_weakrefset.py(48): self._iterating = set() +_weakrefset.py(49): if data is not None: +abc.py(102): cls._abc_negative_cache_version = ABCMeta._abc_invalidation_counter +abc.py(103): return cls +io.py(81): RawIOBase.register(FileIO) + --- modulename: abc, funcname: register +abc.py(107): if not isinstance(subclass, (type, types.ClassType)): +abc.py(109): if issubclass(subclass, cls): + --- modulename: abc, funcname: __subclasscheck__ +abc.py(151): if subclass in cls._abc_cache: + --- modulename: _weakrefset, funcname: __contains__ +_weakrefset.py(71): try: +_weakrefset.py(72): wr = ref(item) +_weakrefset.py(75): return wr in self.data +abc.py(154): if cls._abc_negative_cache_version < ABCMeta._abc_invalidation_counter: +abc.py(158): elif subclass in cls._abc_negative_cache: + --- modulename: _weakrefset, funcname: __contains__ +_weakrefset.py(71): try: +_weakrefset.py(72): wr = ref(item) +_weakrefset.py(75): return wr in self.data +abc.py(161): ok = cls.__subclasshook__(subclass) +abc.py(162): if ok is not NotImplemented: +abc.py(170): if cls in getattr(subclass, '__mro__', ()): +abc.py(174): for rcls in cls._abc_registry: + --- modulename: _weakrefset, funcname: __iter__ +_weakrefset.py(59): with _IterationGuard(self): + --- modulename: _weakrefset, funcname: __init__ +_weakrefset.py(18): self.weakcontainer = ref(weakcontainer) + --- modulename: _weakrefset, funcname: __enter__ +_weakrefset.py(21): w = self.weakcontainer() +_weakrefset.py(22): if w is not None: +_weakrefset.py(23): w._iterating.add(self) +_weakrefset.py(24): return self +_weakrefset.py(60): for itemref in self.data: + --- modulename: _weakrefset, funcname: __exit__ +_weakrefset.py(27): w = self.weakcontainer() +_weakrefset.py(28): if w is not None: +_weakrefset.py(29): s = w._iterating +_weakrefset.py(30): s.remove(self) +_weakrefset.py(31): if not s: +_weakrefset.py(32): w._commit_removals() + --- modulename: _weakrefset, funcname: _commit_removals +_weakrefset.py(53): l = self._pending_removals +_weakrefset.py(54): discard = self.data.discard +_weakrefset.py(55): while l: +abc.py(179): for scls in cls.__subclasses__(): +abc.py(184): cls._abc_negative_cache.add(subclass) + --- modulename: _weakrefset, funcname: add +_weakrefset.py(84): if self._pending_removals: +_weakrefset.py(86): self.data.add(ref(item, self._remove)) +abc.py(185): return False +abc.py(113): if issubclass(cls, subclass): +abc.py(116): cls._abc_registry.add(subclass) + --- modulename: _weakrefset, funcname: add +_weakrefset.py(84): if self._pending_removals: +_weakrefset.py(86): self.data.add(ref(item, self._remove)) +abc.py(117): ABCMeta._abc_invalidation_counter += 1 # Invalidate negative cache +io.py(83): for klass in (BytesIO, BufferedReader, BufferedWriter, BufferedRandom, +io.py(84): BufferedRWPair): +io.py(85): BufferedIOBase.register(klass) + --- modulename: abc, funcname: register +abc.py(107): if not isinstance(subclass, (type, types.ClassType)): +abc.py(109): if issubclass(subclass, cls): + --- modulename: abc, funcname: __subclasscheck__ +abc.py(151): if subclass in cls._abc_cache: + --- modulename: _weakrefset, funcname: __contains__ +_weakrefset.py(71): try: +_weakrefset.py(72): wr = ref(item) +_weakrefset.py(75): return wr in self.data +abc.py(154): if cls._abc_negative_cache_version < ABCMeta._abc_invalidation_counter: +abc.py(156): cls._abc_negative_cache = WeakSet() + --- modulename: _weakrefset, funcname: __init__ +_weakrefset.py(37): self.data = set() +_weakrefset.py(38): def _remove(item, selfref=ref(self)): +_weakrefset.py(45): self._remove = _remove +_weakrefset.py(47): self._pending_removals = [] +_weakrefset.py(48): self._iterating = set() +_weakrefset.py(49): if data is not None: +abc.py(157): cls._abc_negative_cache_version = ABCMeta._abc_invalidation_counter +abc.py(161): ok = cls.__subclasshook__(subclass) +abc.py(162): if ok is not NotImplemented: +abc.py(170): if cls in getattr(subclass, '__mro__', ()): +abc.py(174): for rcls in cls._abc_registry: + --- modulename: _weakrefset, funcname: __iter__ +_weakrefset.py(59): with _IterationGuard(self): + --- modulename: _weakrefset, funcname: __init__ +_weakrefset.py(18): self.weakcontainer = ref(weakcontainer) + --- modulename: _weakrefset, funcname: __enter__ +_weakrefset.py(21): w = self.weakcontainer() +_weakrefset.py(22): if w is not None: +_weakrefset.py(23): w._iterating.add(self) +_weakrefset.py(24): return self +_weakrefset.py(60): for itemref in self.data: + --- modulename: _weakrefset, funcname: __exit__ +_weakrefset.py(27): w = self.weakcontainer() +_weakrefset.py(28): if w is not None: +_weakrefset.py(29): s = w._iterating +_weakrefset.py(30): s.remove(self) +_weakrefset.py(31): if not s: +_weakrefset.py(32): w._commit_removals() + --- modulename: _weakrefset, funcname: _commit_removals +_weakrefset.py(53): l = self._pending_removals +_weakrefset.py(54): discard = self.data.discard +_weakrefset.py(55): while l: +abc.py(179): for scls in cls.__subclasses__(): +abc.py(184): cls._abc_negative_cache.add(subclass) + --- modulename: _weakrefset, funcname: add +_weakrefset.py(84): if self._pending_removals: +_weakrefset.py(86): self.data.add(ref(item, self._remove)) +abc.py(185): return False +abc.py(113): if issubclass(cls, subclass): +abc.py(116): cls._abc_registry.add(subclass) + --- modulename: _weakrefset, funcname: add +_weakrefset.py(84): if self._pending_removals: +_weakrefset.py(86): self.data.add(ref(item, self._remove)) +abc.py(117): ABCMeta._abc_invalidation_counter += 1 # Invalidate negative cache +io.py(84): BufferedRWPair): +io.py(85): BufferedIOBase.register(klass) + --- modulename: abc, funcname: register +abc.py(107): if not isinstance(subclass, (type, types.ClassType)): +abc.py(109): if issubclass(subclass, cls): + --- modulename: abc, funcname: __subclasscheck__ +abc.py(151): if subclass in cls._abc_cache: + --- modulename: _weakrefset, funcname: __contains__ +_weakrefset.py(71): try: +_weakrefset.py(72): wr = ref(item) +_weakrefset.py(75): return wr in self.data +abc.py(154): if cls._abc_negative_cache_version < ABCMeta._abc_invalidation_counter: +abc.py(156): cls._abc_negative_cache = WeakSet() + --- modulename: _weakrefset, funcname: __init__ +_weakrefset.py(37): self.data = set() +_weakrefset.py(38): def _remove(item, selfref=ref(self)): +_weakrefset.py(45): self._remove = _remove +_weakrefset.py(47): self._pending_removals = [] +_weakrefset.py(48): self._iterating = set() +_weakrefset.py(49): if data is not None: +abc.py(157): cls._abc_negative_cache_version = ABCMeta._abc_invalidation_counter +abc.py(161): ok = cls.__subclasshook__(subclass) +abc.py(162): if ok is not NotImplemented: +abc.py(170): if cls in getattr(subclass, '__mro__', ()): +abc.py(174): for rcls in cls._abc_registry: + --- modulename: _weakrefset, funcname: __iter__ +_weakrefset.py(59): with _IterationGuard(self): + --- modulename: _weakrefset, funcname: __init__ +_weakrefset.py(18): self.weakcontainer = ref(weakcontainer) + --- modulename: _weakrefset, funcname: __enter__ +_weakrefset.py(21): w = self.weakcontainer() +_weakrefset.py(22): if w is not None: +_weakrefset.py(23): w._iterating.add(self) +_weakrefset.py(24): return self +_weakrefset.py(60): for itemref in self.data: +_weakrefset.py(61): item = itemref() +_weakrefset.py(62): if item is not None: +_weakrefset.py(65): yield item +abc.py(175): if issubclass(subclass, rcls): +abc.py(174): for rcls in cls._abc_registry: + --- modulename: _weakrefset, funcname: __iter__ +_weakrefset.py(60): for itemref in self.data: + --- modulename: _weakrefset, funcname: __exit__ +_weakrefset.py(27): w = self.weakcontainer() +_weakrefset.py(28): if w is not None: +_weakrefset.py(29): s = w._iterating +_weakrefset.py(30): s.remove(self) +_weakrefset.py(31): if not s: +_weakrefset.py(32): w._commit_removals() + --- modulename: _weakrefset, funcname: _commit_removals +_weakrefset.py(53): l = self._pending_removals +_weakrefset.py(54): discard = self.data.discard +_weakrefset.py(55): while l: +abc.py(179): for scls in cls.__subclasses__(): +abc.py(184): cls._abc_negative_cache.add(subclass) + --- modulename: _weakrefset, funcname: add +_weakrefset.py(84): if self._pending_removals: +_weakrefset.py(86): self.data.add(ref(item, self._remove)) +abc.py(185): return False +abc.py(113): if issubclass(cls, subclass): +abc.py(116): cls._abc_registry.add(subclass) + --- modulename: _weakrefset, funcname: add +_weakrefset.py(84): if self._pending_removals: +_weakrefset.py(86): self.data.add(ref(item, self._remove)) +abc.py(117): ABCMeta._abc_invalidation_counter += 1 # Invalidate negative cache +io.py(84): BufferedRWPair): +io.py(85): BufferedIOBase.register(klass) + --- modulename: abc, funcname: register +abc.py(107): if not isinstance(subclass, (type, types.ClassType)): +abc.py(109): if issubclass(subclass, cls): + --- modulename: abc, funcname: __subclasscheck__ +abc.py(151): if subclass in cls._abc_cache: + --- modulename: _weakrefset, funcname: __contains__ +_weakrefset.py(71): try: +_weakrefset.py(72): wr = ref(item) +_weakrefset.py(75): return wr in self.data +abc.py(154): if cls._abc_negative_cache_version < ABCMeta._abc_invalidation_counter: +abc.py(156): cls._abc_negative_cache = WeakSet() + --- modulename: _weakrefset, funcname: __init__ +_weakrefset.py(37): self.data = set() +_weakrefset.py(38): def _remove(item, selfref=ref(self)): +_weakrefset.py(45): self._remove = _remove +_weakrefset.py(47): self._pending_removals = [] +_weakrefset.py(48): self._iterating = set() +_weakrefset.py(49): if data is not None: +abc.py(157): cls._abc_negative_cache_version = ABCMeta._abc_invalidation_counter +abc.py(161): ok = cls.__subclasshook__(subclass) +abc.py(162): if ok is not NotImplemented: +abc.py(170): if cls in getattr(subclass, '__mro__', ()): +abc.py(174): for rcls in cls._abc_registry: + --- modulename: _weakrefset, funcname: __iter__ +_weakrefset.py(59): with _IterationGuard(self): + --- modulename: _weakrefset, funcname: __init__ +_weakrefset.py(18): self.weakcontainer = ref(weakcontainer) + --- modulename: _weakrefset, funcname: __enter__ +_weakrefset.py(21): w = self.weakcontainer() +_weakrefset.py(22): if w is not None: +_weakrefset.py(23): w._iterating.add(self) +_weakrefset.py(24): return self +_weakrefset.py(60): for itemref in self.data: +_weakrefset.py(61): item = itemref() +_weakrefset.py(62): if item is not None: +_weakrefset.py(65): yield item +abc.py(175): if issubclass(subclass, rcls): +abc.py(174): for rcls in cls._abc_registry: + --- modulename: _weakrefset, funcname: __iter__ +_weakrefset.py(60): for itemref in self.data: +_weakrefset.py(61): item = itemref() +_weakrefset.py(62): if item is not None: +_weakrefset.py(65): yield item +abc.py(175): if issubclass(subclass, rcls): +abc.py(174): for rcls in cls._abc_registry: + --- modulename: _weakrefset, funcname: __iter__ +_weakrefset.py(60): for itemref in self.data: + --- modulename: _weakrefset, funcname: __exit__ +_weakrefset.py(27): w = self.weakcontainer() +_weakrefset.py(28): if w is not None: +_weakrefset.py(29): s = w._iterating +_weakrefset.py(30): s.remove(self) +_weakrefset.py(31): if not s: +_weakrefset.py(32): w._commit_removals() + --- modulename: _weakrefset, funcname: _commit_removals +_weakrefset.py(53): l = self._pending_removals +_weakrefset.py(54): discard = self.data.discard +_weakrefset.py(55): while l: +abc.py(179): for scls in cls.__subclasses__(): +abc.py(184): cls._abc_negative_cache.add(subclass) + --- modulename: _weakrefset, funcname: add +_weakrefset.py(84): if self._pending_removals: +_weakrefset.py(86): self.data.add(ref(item, self._remove)) +abc.py(185): return False +abc.py(113): if issubclass(cls, subclass): +abc.py(116): cls._abc_registry.add(subclass) + --- modulename: _weakrefset, funcname: add +_weakrefset.py(84): if self._pending_removals: +_weakrefset.py(86): self.data.add(ref(item, self._remove)) +abc.py(117): ABCMeta._abc_invalidation_counter += 1 # Invalidate negative cache +io.py(84): BufferedRWPair): +io.py(85): BufferedIOBase.register(klass) + --- modulename: abc, funcname: register +abc.py(107): if not isinstance(subclass, (type, types.ClassType)): +abc.py(109): if issubclass(subclass, cls): + --- modulename: abc, funcname: __subclasscheck__ +abc.py(151): if subclass in cls._abc_cache: + --- modulename: _weakrefset, funcname: __contains__ +_weakrefset.py(71): try: +_weakrefset.py(72): wr = ref(item) +_weakrefset.py(75): return wr in self.data +abc.py(154): if cls._abc_negative_cache_version < ABCMeta._abc_invalidation_counter: +abc.py(156): cls._abc_negative_cache = WeakSet() + --- modulename: _weakrefset, funcname: __init__ +_weakrefset.py(37): self.data = set() +_weakrefset.py(38): def _remove(item, selfref=ref(self)): +_weakrefset.py(45): self._remove = _remove +_weakrefset.py(47): self._pending_removals = [] +_weakrefset.py(48): self._iterating = set() +_weakrefset.py(49): if data is not None: +abc.py(157): cls._abc_negative_cache_version = ABCMeta._abc_invalidation_counter +abc.py(161): ok = cls.__subclasshook__(subclass) +abc.py(162): if ok is not NotImplemented: +abc.py(170): if cls in getattr(subclass, '__mro__', ()): +abc.py(174): for rcls in cls._abc_registry: + --- modulename: _weakrefset, funcname: __iter__ +_weakrefset.py(59): with _IterationGuard(self): + --- modulename: _weakrefset, funcname: __init__ +_weakrefset.py(18): self.weakcontainer = ref(weakcontainer) + --- modulename: _weakrefset, funcname: __enter__ +_weakrefset.py(21): w = self.weakcontainer() +_weakrefset.py(22): if w is not None: +_weakrefset.py(23): w._iterating.add(self) +_weakrefset.py(24): return self +_weakrefset.py(60): for itemref in self.data: +_weakrefset.py(61): item = itemref() +_weakrefset.py(62): if item is not None: +_weakrefset.py(65): yield item +abc.py(175): if issubclass(subclass, rcls): +abc.py(174): for rcls in cls._abc_registry: + --- modulename: _weakrefset, funcname: __iter__ +_weakrefset.py(60): for itemref in self.data: +_weakrefset.py(61): item = itemref() +_weakrefset.py(62): if item is not None: +_weakrefset.py(65): yield item +abc.py(175): if issubclass(subclass, rcls): +abc.py(174): for rcls in cls._abc_registry: + --- modulename: _weakrefset, funcname: __iter__ +_weakrefset.py(60): for itemref in self.data: +_weakrefset.py(61): item = itemref() +_weakrefset.py(62): if item is not None: +_weakrefset.py(65): yield item +abc.py(175): if issubclass(subclass, rcls): +abc.py(174): for rcls in cls._abc_registry: + --- modulename: _weakrefset, funcname: __iter__ +_weakrefset.py(60): for itemref in self.data: + --- modulename: _weakrefset, funcname: __exit__ +_weakrefset.py(27): w = self.weakcontainer() +_weakrefset.py(28): if w is not None: +_weakrefset.py(29): s = w._iterating +_weakrefset.py(30): s.remove(self) +_weakrefset.py(31): if not s: +_weakrefset.py(32): w._commit_removals() + --- modulename: _weakrefset, funcname: _commit_removals +_weakrefset.py(53): l = self._pending_removals +_weakrefset.py(54): discard = self.data.discard +_weakrefset.py(55): while l: +abc.py(179): for scls in cls.__subclasses__(): +abc.py(184): cls._abc_negative_cache.add(subclass) + --- modulename: _weakrefset, funcname: add +_weakrefset.py(84): if self._pending_removals: +_weakrefset.py(86): self.data.add(ref(item, self._remove)) +abc.py(185): return False +abc.py(113): if issubclass(cls, subclass): +abc.py(116): cls._abc_registry.add(subclass) + --- modulename: _weakrefset, funcname: add +_weakrefset.py(84): if self._pending_removals: +_weakrefset.py(86): self.data.add(ref(item, self._remove)) +abc.py(117): ABCMeta._abc_invalidation_counter += 1 # Invalidate negative cache +io.py(84): BufferedRWPair): +io.py(85): BufferedIOBase.register(klass) + --- modulename: abc, funcname: register +abc.py(107): if not isinstance(subclass, (type, types.ClassType)): +abc.py(109): if issubclass(subclass, cls): + --- modulename: abc, funcname: __subclasscheck__ +abc.py(151): if subclass in cls._abc_cache: + --- modulename: _weakrefset, funcname: __contains__ +_weakrefset.py(71): try: +_weakrefset.py(72): wr = ref(item) +_weakrefset.py(75): return wr in self.data +abc.py(154): if cls._abc_negative_cache_version < ABCMeta._abc_invalidation_counter: +abc.py(156): cls._abc_negative_cache = WeakSet() + --- modulename: _weakrefset, funcname: __init__ +_weakrefset.py(37): self.data = set() +_weakrefset.py(38): def _remove(item, selfref=ref(self)): +_weakrefset.py(45): self._remove = _remove +_weakrefset.py(47): self._pending_removals = [] +_weakrefset.py(48): self._iterating = set() +_weakrefset.py(49): if data is not None: +abc.py(157): cls._abc_negative_cache_version = ABCMeta._abc_invalidation_counter +abc.py(161): ok = cls.__subclasshook__(subclass) +abc.py(162): if ok is not NotImplemented: +abc.py(170): if cls in getattr(subclass, '__mro__', ()): +abc.py(174): for rcls in cls._abc_registry: + --- modulename: _weakrefset, funcname: __iter__ +_weakrefset.py(59): with _IterationGuard(self): + --- modulename: _weakrefset, funcname: __init__ +_weakrefset.py(18): self.weakcontainer = ref(weakcontainer) + --- modulename: _weakrefset, funcname: __enter__ +_weakrefset.py(21): w = self.weakcontainer() +_weakrefset.py(22): if w is not None: +_weakrefset.py(23): w._iterating.add(self) +_weakrefset.py(24): return self +_weakrefset.py(60): for itemref in self.data: +_weakrefset.py(61): item = itemref() +_weakrefset.py(62): if item is not None: +_weakrefset.py(65): yield item +abc.py(175): if issubclass(subclass, rcls): +abc.py(174): for rcls in cls._abc_registry: + --- modulename: _weakrefset, funcname: __iter__ +_weakrefset.py(60): for itemref in self.data: +_weakrefset.py(61): item = itemref() +_weakrefset.py(62): if item is not None: +_weakrefset.py(65): yield item +abc.py(175): if issubclass(subclass, rcls): +abc.py(174): for rcls in cls._abc_registry: + --- modulename: _weakrefset, funcname: __iter__ +_weakrefset.py(60): for itemref in self.data: +_weakrefset.py(61): item = itemref() +_weakrefset.py(62): if item is not None: +_weakrefset.py(65): yield item +abc.py(175): if issubclass(subclass, rcls): +abc.py(174): for rcls in cls._abc_registry: + --- modulename: _weakrefset, funcname: __iter__ +_weakrefset.py(60): for itemref in self.data: +_weakrefset.py(61): item = itemref() +_weakrefset.py(62): if item is not None: +_weakrefset.py(65): yield item +abc.py(175): if issubclass(subclass, rcls): +abc.py(174): for rcls in cls._abc_registry: + --- modulename: _weakrefset, funcname: __iter__ +_weakrefset.py(60): for itemref in self.data: + --- modulename: _weakrefset, funcname: __exit__ +_weakrefset.py(27): w = self.weakcontainer() +_weakrefset.py(28): if w is not None: +_weakrefset.py(29): s = w._iterating +_weakrefset.py(30): s.remove(self) +_weakrefset.py(31): if not s: +_weakrefset.py(32): w._commit_removals() + --- modulename: _weakrefset, funcname: _commit_removals +_weakrefset.py(53): l = self._pending_removals +_weakrefset.py(54): discard = self.data.discard +_weakrefset.py(55): while l: +abc.py(179): for scls in cls.__subclasses__(): +abc.py(184): cls._abc_negative_cache.add(subclass) + --- modulename: _weakrefset, funcname: add +_weakrefset.py(84): if self._pending_removals: +_weakrefset.py(86): self.data.add(ref(item, self._remove)) +abc.py(185): return False +abc.py(113): if issubclass(cls, subclass): +abc.py(116): cls._abc_registry.add(subclass) + --- modulename: _weakrefset, funcname: add +_weakrefset.py(84): if self._pending_removals: +_weakrefset.py(86): self.data.add(ref(item, self._remove)) +abc.py(117): ABCMeta._abc_invalidation_counter += 1 # Invalidate negative cache +io.py(84): BufferedRWPair): +io.py(87): for klass in (StringIO, TextIOWrapper): +io.py(88): TextIOBase.register(klass) + --- modulename: abc, funcname: register +abc.py(107): if not isinstance(subclass, (type, types.ClassType)): +abc.py(109): if issubclass(subclass, cls): + --- modulename: abc, funcname: __subclasscheck__ +abc.py(151): if subclass in cls._abc_cache: + --- modulename: _weakrefset, funcname: __contains__ +_weakrefset.py(71): try: +_weakrefset.py(72): wr = ref(item) +_weakrefset.py(75): return wr in self.data +abc.py(154): if cls._abc_negative_cache_version < ABCMeta._abc_invalidation_counter: +abc.py(156): cls._abc_negative_cache = WeakSet() + --- modulename: _weakrefset, funcname: __init__ +_weakrefset.py(37): self.data = set() +_weakrefset.py(38): def _remove(item, selfref=ref(self)): +_weakrefset.py(45): self._remove = _remove +_weakrefset.py(47): self._pending_removals = [] +_weakrefset.py(48): self._iterating = set() +_weakrefset.py(49): if data is not None: +abc.py(157): cls._abc_negative_cache_version = ABCMeta._abc_invalidation_counter +abc.py(161): ok = cls.__subclasshook__(subclass) +abc.py(162): if ok is not NotImplemented: +abc.py(170): if cls in getattr(subclass, '__mro__', ()): +abc.py(174): for rcls in cls._abc_registry: + --- modulename: _weakrefset, funcname: __iter__ +_weakrefset.py(59): with _IterationGuard(self): + --- modulename: _weakrefset, funcname: __init__ +_weakrefset.py(18): self.weakcontainer = ref(weakcontainer) + --- modulename: _weakrefset, funcname: __enter__ +_weakrefset.py(21): w = self.weakcontainer() +_weakrefset.py(22): if w is not None: +_weakrefset.py(23): w._iterating.add(self) +_weakrefset.py(24): return self +_weakrefset.py(60): for itemref in self.data: + --- modulename: _weakrefset, funcname: __exit__ +_weakrefset.py(27): w = self.weakcontainer() +_weakrefset.py(28): if w is not None: +_weakrefset.py(29): s = w._iterating +_weakrefset.py(30): s.remove(self) +_weakrefset.py(31): if not s: +_weakrefset.py(32): w._commit_removals() + --- modulename: _weakrefset, funcname: _commit_removals +_weakrefset.py(53): l = self._pending_removals +_weakrefset.py(54): discard = self.data.discard +_weakrefset.py(55): while l: +abc.py(179): for scls in cls.__subclasses__(): +abc.py(184): cls._abc_negative_cache.add(subclass) + --- modulename: _weakrefset, funcname: add +_weakrefset.py(84): if self._pending_removals: +_weakrefset.py(86): self.data.add(ref(item, self._remove)) +abc.py(185): return False +abc.py(113): if issubclass(cls, subclass): +abc.py(116): cls._abc_registry.add(subclass) + --- modulename: _weakrefset, funcname: add +_weakrefset.py(84): if self._pending_removals: +_weakrefset.py(86): self.data.add(ref(item, self._remove)) +abc.py(117): ABCMeta._abc_invalidation_counter += 1 # Invalidate negative cache +io.py(87): for klass in (StringIO, TextIOWrapper): +io.py(88): TextIOBase.register(klass) + --- modulename: abc, funcname: register +abc.py(107): if not isinstance(subclass, (type, types.ClassType)): +abc.py(109): if issubclass(subclass, cls): + --- modulename: abc, funcname: __subclasscheck__ +abc.py(151): if subclass in cls._abc_cache: + --- modulename: _weakrefset, funcname: __contains__ +_weakrefset.py(71): try: +_weakrefset.py(72): wr = ref(item) +_weakrefset.py(75): return wr in self.data +abc.py(154): if cls._abc_negative_cache_version < ABCMeta._abc_invalidation_counter: +abc.py(156): cls._abc_negative_cache = WeakSet() + --- modulename: _weakrefset, funcname: __init__ +_weakrefset.py(37): self.data = set() +_weakrefset.py(38): def _remove(item, selfref=ref(self)): +_weakrefset.py(45): self._remove = _remove +_weakrefset.py(47): self._pending_removals = [] +_weakrefset.py(48): self._iterating = set() +_weakrefset.py(49): if data is not None: +abc.py(157): cls._abc_negative_cache_version = ABCMeta._abc_invalidation_counter +abc.py(161): ok = cls.__subclasshook__(subclass) +abc.py(162): if ok is not NotImplemented: +abc.py(170): if cls in getattr(subclass, '__mro__', ()): +abc.py(174): for rcls in cls._abc_registry: + --- modulename: _weakrefset, funcname: __iter__ +_weakrefset.py(59): with _IterationGuard(self): + --- modulename: _weakrefset, funcname: __init__ +_weakrefset.py(18): self.weakcontainer = ref(weakcontainer) + --- modulename: _weakrefset, funcname: __enter__ +_weakrefset.py(21): w = self.weakcontainer() +_weakrefset.py(22): if w is not None: +_weakrefset.py(23): w._iterating.add(self) +_weakrefset.py(24): return self +_weakrefset.py(60): for itemref in self.data: +_weakrefset.py(61): item = itemref() +_weakrefset.py(62): if item is not None: +_weakrefset.py(65): yield item +abc.py(175): if issubclass(subclass, rcls): +abc.py(174): for rcls in cls._abc_registry: + --- modulename: _weakrefset, funcname: __iter__ +_weakrefset.py(60): for itemref in self.data: + --- modulename: _weakrefset, funcname: __exit__ +_weakrefset.py(27): w = self.weakcontainer() +_weakrefset.py(28): if w is not None: +_weakrefset.py(29): s = w._iterating +_weakrefset.py(30): s.remove(self) +_weakrefset.py(31): if not s: +_weakrefset.py(32): w._commit_removals() + --- modulename: _weakrefset, funcname: _commit_removals +_weakrefset.py(53): l = self._pending_removals +_weakrefset.py(54): discard = self.data.discard +_weakrefset.py(55): while l: +abc.py(179): for scls in cls.__subclasses__(): +abc.py(184): cls._abc_negative_cache.add(subclass) + --- modulename: _weakrefset, funcname: add +_weakrefset.py(84): if self._pending_removals: +_weakrefset.py(86): self.data.add(ref(item, self._remove)) +abc.py(185): return False +abc.py(113): if issubclass(cls, subclass): +abc.py(116): cls._abc_registry.add(subclass) + --- modulename: _weakrefset, funcname: add +_weakrefset.py(84): if self._pending_removals: +_weakrefset.py(86): self.data.add(ref(item, self._remove)) +abc.py(117): ABCMeta._abc_invalidation_counter += 1 # Invalidate negative cache +io.py(87): for klass in (StringIO, TextIOWrapper): +io.py(89): del klass +testing.py(4): import struct + --- modulename: struct, funcname: +struct.py(1): from _struct import * +struct.py(2): from _struct import _clearcache +struct.py(3): from _struct import __doc__ +testing.py(6): try: # this only works in py2.7 +testing.py(7): import configparser +testing.py(8): except ImportError: +testing.py(9): import ConfigParser as configparser + --- modulename: ConfigParser, funcname: +ConfigParser.py(88): """ +ConfigParser.py(90): try: +ConfigParser.py(91): from collections import OrderedDict as _default_dict +ConfigParser.py(96): import re +ConfigParser.py(98): __all__ = ["NoSectionError", "DuplicateSectionError", "NoOptionError", +ConfigParser.py(99): "InterpolationError", "InterpolationDepthError", +ConfigParser.py(100): "InterpolationSyntaxError", "ParsingError", +ConfigParser.py(101): "MissingSectionHeaderError", +ConfigParser.py(102): "ConfigParser", "SafeConfigParser", "RawConfigParser", +ConfigParser.py(103): "DEFAULTSECT", "MAX_INTERPOLATION_DEPTH"] +ConfigParser.py(105): DEFAULTSECT = "DEFAULT" +ConfigParser.py(107): MAX_INTERPOLATION_DEPTH = 10 +ConfigParser.py(112): class Error(Exception): + --- modulename: ConfigParser, funcname: Error +ConfigParser.py(112): class Error(Exception): +ConfigParser.py(113): """Base class for ConfigParser exceptions.""" +ConfigParser.py(115): def _get_message(self): +ConfigParser.py(120): def _set_message(self, value): +ConfigParser.py(128): message = property(_get_message, _set_message) +ConfigParser.py(130): def __init__(self, msg=''): +ConfigParser.py(134): def __repr__(self): +ConfigParser.py(137): __str__ = __repr__ +ConfigParser.py(139): class NoSectionError(Error): + --- modulename: ConfigParser, funcname: NoSectionError +ConfigParser.py(139): class NoSectionError(Error): +ConfigParser.py(140): """Raised when no section matches a requested option.""" +ConfigParser.py(142): def __init__(self, section): +ConfigParser.py(147): class DuplicateSectionError(Error): + --- modulename: ConfigParser, funcname: DuplicateSectionError +ConfigParser.py(147): class DuplicateSectionError(Error): +ConfigParser.py(148): """Raised when a section is multiply-created.""" +ConfigParser.py(150): def __init__(self, section): +ConfigParser.py(155): class NoOptionError(Error): + --- modulename: ConfigParser, funcname: NoOptionError +ConfigParser.py(155): class NoOptionError(Error): +ConfigParser.py(156): """A requested option was not found.""" +ConfigParser.py(158): def __init__(self, option, section): +ConfigParser.py(165): class InterpolationError(Error): + --- modulename: ConfigParser, funcname: InterpolationError +ConfigParser.py(165): class InterpolationError(Error): +ConfigParser.py(166): """Base class for interpolation-related exceptions.""" +ConfigParser.py(168): def __init__(self, option, section, msg): +ConfigParser.py(174): class InterpolationMissingOptionError(InterpolationError): + --- modulename: ConfigParser, funcname: InterpolationMissingOptionError +ConfigParser.py(174): class InterpolationMissingOptionError(InterpolationError): +ConfigParser.py(175): """A string substitution required a setting which was not available.""" +ConfigParser.py(177): def __init__(self, option, section, rawval, reference): +ConfigParser.py(188): class InterpolationSyntaxError(InterpolationError): + --- modulename: ConfigParser, funcname: InterpolationSyntaxError +ConfigParser.py(188): class InterpolationSyntaxError(InterpolationError): +ConfigParser.py(190): does not conform to the required syntax.""" +ConfigParser.py(192): class InterpolationDepthError(InterpolationError): + --- modulename: ConfigParser, funcname: InterpolationDepthError +ConfigParser.py(192): class InterpolationDepthError(InterpolationError): +ConfigParser.py(193): """Raised when substitutions are nested too deeply.""" +ConfigParser.py(195): def __init__(self, option, section, rawval): +ConfigParser.py(204): class ParsingError(Error): + --- modulename: ConfigParser, funcname: ParsingError +ConfigParser.py(204): class ParsingError(Error): +ConfigParser.py(205): """Raised when a configuration file does not follow legal syntax.""" +ConfigParser.py(207): def __init__(self, filename): +ConfigParser.py(213): def append(self, lineno, line): +ConfigParser.py(217): class MissingSectionHeaderError(ParsingError): + --- modulename: ConfigParser, funcname: MissingSectionHeaderError +ConfigParser.py(217): class MissingSectionHeaderError(ParsingError): +ConfigParser.py(218): """Raised when a key-value pair is found before any section header.""" +ConfigParser.py(220): def __init__(self, filename, lineno, line): +ConfigParser.py(231): class RawConfigParser: + --- modulename: ConfigParser, funcname: RawConfigParser +ConfigParser.py(231): class RawConfigParser: +ConfigParser.py(232): def __init__(self, defaults=None, dict_type=_default_dict, +ConfigParser.py(233): allow_no_value=False): +ConfigParser.py(245): def defaults(self): +ConfigParser.py(248): def sections(self): +ConfigParser.py(253): def add_section(self, section): +ConfigParser.py(267): def has_section(self, section): +ConfigParser.py(274): def options(self, section): +ConfigParser.py(285): def read(self, filenames): +ConfigParser.py(310): def readfp(self, fp, filename=None): +ConfigParser.py(326): def get(self, section, option): +ConfigParser.py(342): def items(self, section): +ConfigParser.py(355): def _get(self, section, conv, option): +ConfigParser.py(358): def getint(self, section, option): +ConfigParser.py(361): def getfloat(self, section, option): +ConfigParser.py(364): _boolean_states = {'1': True, 'yes': True, 'true': True, 'on': True, +ConfigParser.py(365): '0': False, 'no': False, 'false': False, 'off': False} +ConfigParser.py(367): def getboolean(self, section, option): +ConfigParser.py(373): def optionxform(self, optionstr): +ConfigParser.py(376): def has_option(self, section, option): +ConfigParser.py(388): def set(self, section, option, value=None): +ConfigParser.py(399): def write(self, fp): +ConfigParser.py(416): def remove_option(self, section, option): +ConfigParser.py(431): def remove_section(self, section): +ConfigParser.py(441): SECTCRE = re.compile( +ConfigParser.py(442): r'\[' # [ + --- modulename: re, funcname: compile +re.py(190): return _compile(pattern, flags) + --- modulename: re, funcname: _compile +re.py(228): pattern, flags = key +re.py(229): bypass_cache = flags & DEBUG +re.py(230): if not bypass_cache: +re.py(231): cachekey = (type(key[0]),) + key +re.py(232): p = _cache.get(cachekey) +re.py(233): if p is not None: +re.py(235): if isinstance(pattern, _pattern_type): +re.py(239): if not sre_compile.isstring(pattern): + --- modulename: sre_compile, funcname: isstring +sre_compile.py(473): for tp in STRING_TYPES: +sre_compile.py(474): if isinstance(obj, tp): +sre_compile.py(475): return 1 +re.py(241): try: +re.py(242): p = sre_compile.compile(pattern, flags) + --- modulename: sre_compile, funcname: compile +sre_compile.py(496): if isstring(p): + --- modulename: sre_compile, funcname: isstring +sre_compile.py(473): for tp in STRING_TYPES: +sre_compile.py(474): if isinstance(obj, tp): +sre_compile.py(475): return 1 +sre_compile.py(497): pattern = p +sre_compile.py(498): p = sre_parse.parse(p, flags) + --- modulename: sre_parse, funcname: parse +sre_parse.py(678): source = Tokenizer(str) + --- modulename: sre_parse, funcname: __init__ +sre_parse.py(179): self.string = string +sre_parse.py(180): self.index = 0 +sre_parse.py(181): self.__next() + --- modulename: sre_parse, funcname: __next +sre_parse.py(183): if self.index >= len(self.string): +sre_parse.py(186): char = self.string[self.index] +sre_parse.py(187): if char[0] == "\\": +sre_parse.py(188): try: +sre_parse.py(189): c = self.string[self.index + 1] +sre_parse.py(192): char = char + c +sre_parse.py(193): self.index = self.index + len(char) +sre_parse.py(194): self.next = char +sre_parse.py(680): if pattern is None: +sre_parse.py(681): pattern = Pattern() + --- modulename: sre_parse, funcname: __init__ +sre_parse.py(68): self.flags = 0 +sre_parse.py(69): self.open = [] +sre_parse.py(70): self.groups = 1 +sre_parse.py(71): self.groupdict = {} +sre_parse.py(682): pattern.flags = flags +sre_parse.py(683): pattern.str = str +sre_parse.py(685): p = _parse_sub(source, pattern, 0) + --- modulename: sre_parse, funcname: _parse_sub +sre_parse.py(304): items = [] +sre_parse.py(305): itemsappend = items.append +sre_parse.py(306): sourcematch = source.match +sre_parse.py(307): while 1: +sre_parse.py(308): itemsappend(_parse(source, state)) + --- modulename: sre_parse, funcname: _parse +sre_parse.py(381): subpattern = SubPattern(state) + --- modulename: sre_parse, funcname: __init__ +sre_parse.py(91): self.pattern = pattern +sre_parse.py(92): if data is None: +sre_parse.py(93): data = [] +sre_parse.py(94): self.data = data +sre_parse.py(95): self.width = None +sre_parse.py(384): subpatternappend = subpattern.append +sre_parse.py(385): sourceget = source.get +sre_parse.py(386): sourcematch = source.match +sre_parse.py(387): _len = len +sre_parse.py(388): PATTERNENDERS = _PATTERNENDERS +sre_parse.py(389): ASSERTCHARS = _ASSERTCHARS +sre_parse.py(390): LOOKBEHINDASSERTCHARS = _LOOKBEHINDASSERTCHARS +sre_parse.py(391): REPEATCODES = _REPEATCODES +sre_parse.py(393): while 1: +sre_parse.py(395): if source.next in PATTERNENDERS: +sre_parse.py(397): this = sourceget() + --- modulename: sre_parse, funcname: get +sre_parse.py(202): this = self.next +sre_parse.py(203): self.__next() + --- modulename: sre_parse, funcname: __next +sre_parse.py(183): if self.index >= len(self.string): +sre_parse.py(186): char = self.string[self.index] +sre_parse.py(187): if char[0] == "\\": +sre_parse.py(193): self.index = self.index + len(char) +sre_parse.py(194): self.next = char +sre_parse.py(204): return this +sre_parse.py(398): if this is None: +sre_parse.py(401): if state.flags & SRE_FLAG_VERBOSE: +sre_parse.py(412): if this and this[0] not in SPECIAL_CHARS: +sre_parse.py(415): elif this == "[": +sre_parse.py(472): elif this and this[0] in REPEAT_CHARS: +sre_parse.py(525): elif this == ".": +sre_parse.py(528): elif this == "(": +sre_parse.py(660): elif this == "^": +sre_parse.py(663): elif this == "$": +sre_parse.py(666): elif this and this[0] == "\\": +sre_parse.py(667): code = _escape(source, this, state) + --- modulename: sre_parse, funcname: _escape +sre_parse.py(259): code = CATEGORIES.get(escape) +sre_parse.py(260): if code: +sre_parse.py(262): code = ESCAPES.get(escape) +sre_parse.py(263): if code: +sre_parse.py(265): try: +sre_parse.py(266): c = escape[1:2] +sre_parse.py(267): if c == "x": +sre_parse.py(274): elif c == "0": +sre_parse.py(279): elif c in DIGITS: +sre_parse.py(295): if len(escape) == 2: +sre_parse.py(296): return LITERAL, ord(escape[1]) +sre_parse.py(668): subpatternappend(code) + --- modulename: sre_parse, funcname: append +sre_parse.py(139): self.data.append(code) +sre_parse.py(395): if source.next in PATTERNENDERS: +sre_parse.py(397): this = sourceget() + --- modulename: sre_parse, funcname: get +sre_parse.py(202): this = self.next +sre_parse.py(203): self.__next() + --- modulename: sre_parse, funcname: __next +sre_parse.py(183): if self.index >= len(self.string): +sre_parse.py(186): char = self.string[self.index] +sre_parse.py(187): if char[0] == "\\": +sre_parse.py(193): self.index = self.index + len(char) +sre_parse.py(194): self.next = char +sre_parse.py(204): return this +sre_parse.py(398): if this is None: +sre_parse.py(401): if state.flags & SRE_FLAG_VERBOSE: +sre_parse.py(412): if this and this[0] not in SPECIAL_CHARS: +sre_parse.py(415): elif this == "[": +sre_parse.py(472): elif this and this[0] in REPEAT_CHARS: +sre_parse.py(525): elif this == ".": +sre_parse.py(528): elif this == "(": +sre_parse.py(529): group = 1 +sre_parse.py(530): name = None +sre_parse.py(531): condgroup = None +sre_parse.py(532): if sourcematch("?"): + --- modulename: sre_parse, funcname: match +sre_parse.py(196): if char == self.next: +sre_parse.py(197): if skip: +sre_parse.py(198): self.__next() + --- modulename: sre_parse, funcname: __next +sre_parse.py(183): if self.index >= len(self.string): +sre_parse.py(186): char = self.string[self.index] +sre_parse.py(187): if char[0] == "\\": +sre_parse.py(193): self.index = self.index + len(char) +sre_parse.py(194): self.next = char +sre_parse.py(199): return 1 +sre_parse.py(533): group = 0 +sre_parse.py(535): if sourcematch("P"): + --- modulename: sre_parse, funcname: match +sre_parse.py(196): if char == self.next: +sre_parse.py(197): if skip: +sre_parse.py(198): self.__next() + --- modulename: sre_parse, funcname: __next +sre_parse.py(183): if self.index >= len(self.string): +sre_parse.py(186): char = self.string[self.index] +sre_parse.py(187): if char[0] == "\\": +sre_parse.py(193): self.index = self.index + len(char) +sre_parse.py(194): self.next = char +sre_parse.py(199): return 1 +sre_parse.py(537): if sourcematch("<"): + --- modulename: sre_parse, funcname: match +sre_parse.py(196): if char == self.next: +sre_parse.py(197): if skip: +sre_parse.py(198): self.__next() + --- modulename: sre_parse, funcname: __next +sre_parse.py(183): if self.index >= len(self.string): +sre_parse.py(186): char = self.string[self.index] +sre_parse.py(187): if char[0] == "\\": +sre_parse.py(193): self.index = self.index + len(char) +sre_parse.py(194): self.next = char +sre_parse.py(199): return 1 +sre_parse.py(539): name = "" +sre_parse.py(540): while 1: +sre_parse.py(541): char = sourceget() + --- modulename: sre_parse, funcname: get +sre_parse.py(202): this = self.next +sre_parse.py(203): self.__next() + --- modulename: sre_parse, funcname: __next +sre_parse.py(183): if self.index >= len(self.string): +sre_parse.py(186): char = self.string[self.index] +sre_parse.py(187): if char[0] == "\\": +sre_parse.py(193): self.index = self.index + len(char) +sre_parse.py(194): self.next = char +sre_parse.py(204): return this +sre_parse.py(542): if char is None: +sre_parse.py(544): if char == ">": +sre_parse.py(546): name = name + char +sre_parse.py(541): char = sourceget() + --- modulename: sre_parse, funcname: get +sre_parse.py(202): this = self.next +sre_parse.py(203): self.__next() + --- modulename: sre_parse, funcname: __next +sre_parse.py(183): if self.index >= len(self.string): +sre_parse.py(186): char = self.string[self.index] +sre_parse.py(187): if char[0] == "\\": +sre_parse.py(193): self.index = self.index + len(char) +sre_parse.py(194): self.next = char +sre_parse.py(204): return this +sre_parse.py(542): if char is None: +sre_parse.py(544): if char == ">": +sre_parse.py(546): name = name + char +sre_parse.py(541): char = sourceget() + --- modulename: sre_parse, funcname: get +sre_parse.py(202): this = self.next +sre_parse.py(203): self.__next() + --- modulename: sre_parse, funcname: __next +sre_parse.py(183): if self.index >= len(self.string): +sre_parse.py(186): char = self.string[self.index] +sre_parse.py(187): if char[0] == "\\": +sre_parse.py(193): self.index = self.index + len(char) +sre_parse.py(194): self.next = char +sre_parse.py(204): return this +sre_parse.py(542): if char is None: +sre_parse.py(544): if char == ">": +sre_parse.py(546): name = name + char +sre_parse.py(541): char = sourceget() + --- modulename: sre_parse, funcname: get +sre_parse.py(202): this = self.next +sre_parse.py(203): self.__next() + --- modulename: sre_parse, funcname: __next +sre_parse.py(183): if self.index >= len(self.string): +sre_parse.py(186): char = self.string[self.index] +sre_parse.py(187): if char[0] == "\\": +sre_parse.py(193): self.index = self.index + len(char) +sre_parse.py(194): self.next = char +sre_parse.py(204): return this +sre_parse.py(542): if char is None: +sre_parse.py(544): if char == ">": +sre_parse.py(546): name = name + char +sre_parse.py(541): char = sourceget() + --- modulename: sre_parse, funcname: get +sre_parse.py(202): this = self.next +sre_parse.py(203): self.__next() + --- modulename: sre_parse, funcname: __next +sre_parse.py(183): if self.index >= len(self.string): +sre_parse.py(186): char = self.string[self.index] +sre_parse.py(187): if char[0] == "\\": +sre_parse.py(193): self.index = self.index + len(char) +sre_parse.py(194): self.next = char +sre_parse.py(204): return this +sre_parse.py(542): if char is None: +sre_parse.py(544): if char == ">": +sre_parse.py(546): name = name + char +sre_parse.py(541): char = sourceget() + --- modulename: sre_parse, funcname: get +sre_parse.py(202): this = self.next +sre_parse.py(203): self.__next() + --- modulename: sre_parse, funcname: __next +sre_parse.py(183): if self.index >= len(self.string): +sre_parse.py(186): char = self.string[self.index] +sre_parse.py(187): if char[0] == "\\": +sre_parse.py(193): self.index = self.index + len(char) +sre_parse.py(194): self.next = char +sre_parse.py(204): return this +sre_parse.py(542): if char is None: +sre_parse.py(544): if char == ">": +sre_parse.py(546): name = name + char +sre_parse.py(541): char = sourceget() + --- modulename: sre_parse, funcname: get +sre_parse.py(202): this = self.next +sre_parse.py(203): self.__next() + --- modulename: sre_parse, funcname: __next +sre_parse.py(183): if self.index >= len(self.string): +sre_parse.py(186): char = self.string[self.index] +sre_parse.py(187): if char[0] == "\\": +sre_parse.py(193): self.index = self.index + len(char) +sre_parse.py(194): self.next = char +sre_parse.py(204): return this +sre_parse.py(542): if char is None: +sre_parse.py(544): if char == ">": +sre_parse.py(545): break +sre_parse.py(547): group = 1 +sre_parse.py(548): if not name: +sre_parse.py(550): if not isname(name): + --- modulename: sre_parse, funcname: isname +sre_parse.py(218): if not isident(name[0]): + --- modulename: sre_parse, funcname: isident +sre_parse.py(211): return "a" <= char <= "z" or "A" <= char <= "Z" or char == "_" +sre_parse.py(220): for char in name[1:]: +sre_parse.py(221): if not isident(char) and not isdigit(char): + --- modulename: sre_parse, funcname: isident +sre_parse.py(211): return "a" <= char <= "z" or "A" <= char <= "Z" or char == "_" +sre_parse.py(220): for char in name[1:]: +sre_parse.py(221): if not isident(char) and not isdigit(char): + --- modulename: sre_parse, funcname: isident +sre_parse.py(211): return "a" <= char <= "z" or "A" <= char <= "Z" or char == "_" +sre_parse.py(220): for char in name[1:]: +sre_parse.py(221): if not isident(char) and not isdigit(char): + --- modulename: sre_parse, funcname: isident +sre_parse.py(211): return "a" <= char <= "z" or "A" <= char <= "Z" or char == "_" +sre_parse.py(220): for char in name[1:]: +sre_parse.py(221): if not isident(char) and not isdigit(char): + --- modulename: sre_parse, funcname: isident +sre_parse.py(211): return "a" <= char <= "z" or "A" <= char <= "Z" or char == "_" +sre_parse.py(220): for char in name[1:]: +sre_parse.py(221): if not isident(char) and not isdigit(char): + --- modulename: sre_parse, funcname: isident +sre_parse.py(211): return "a" <= char <= "z" or "A" <= char <= "Z" or char == "_" +sre_parse.py(220): for char in name[1:]: +sre_parse.py(223): return True +sre_parse.py(635): if group: +sre_parse.py(637): if group == 2: +sre_parse.py(641): group = state.opengroup(name) + --- modulename: sre_parse, funcname: opengroup +sre_parse.py(73): gid = self.groups +sre_parse.py(74): self.groups = gid + 1 +sre_parse.py(75): if name is not None: +sre_parse.py(76): ogid = self.groupdict.get(name, None) +sre_parse.py(77): if ogid is not None: +sre_parse.py(80): self.groupdict[name] = gid +sre_parse.py(81): self.open.append(gid) +sre_parse.py(82): return gid +sre_parse.py(642): if condgroup: +sre_parse.py(645): p = _parse_sub(source, state) + --- modulename: sre_parse, funcname: _parse_sub +sre_parse.py(304): items = [] +sre_parse.py(305): itemsappend = items.append +sre_parse.py(306): sourcematch = source.match +sre_parse.py(307): while 1: +sre_parse.py(308): itemsappend(_parse(source, state)) + --- modulename: sre_parse, funcname: _parse +sre_parse.py(381): subpattern = SubPattern(state) + --- modulename: sre_parse, funcname: __init__ +sre_parse.py(91): self.pattern = pattern +sre_parse.py(92): if data is None: +sre_parse.py(93): data = [] +sre_parse.py(94): self.data = data +sre_parse.py(95): self.width = None +sre_parse.py(384): subpatternappend = subpattern.append +sre_parse.py(385): sourceget = source.get +sre_parse.py(386): sourcematch = source.match +sre_parse.py(387): _len = len +sre_parse.py(388): PATTERNENDERS = _PATTERNENDERS +sre_parse.py(389): ASSERTCHARS = _ASSERTCHARS +sre_parse.py(390): LOOKBEHINDASSERTCHARS = _LOOKBEHINDASSERTCHARS +sre_parse.py(391): REPEATCODES = _REPEATCODES +sre_parse.py(393): while 1: +sre_parse.py(395): if source.next in PATTERNENDERS: +sre_parse.py(397): this = sourceget() + --- modulename: sre_parse, funcname: get +sre_parse.py(202): this = self.next +sre_parse.py(203): self.__next() + --- modulename: sre_parse, funcname: __next +sre_parse.py(183): if self.index >= len(self.string): +sre_parse.py(186): char = self.string[self.index] +sre_parse.py(187): if char[0] == "\\": +sre_parse.py(193): self.index = self.index + len(char) +sre_parse.py(194): self.next = char +sre_parse.py(204): return this +sre_parse.py(398): if this is None: +sre_parse.py(401): if state.flags & SRE_FLAG_VERBOSE: +sre_parse.py(412): if this and this[0] not in SPECIAL_CHARS: +sre_parse.py(415): elif this == "[": +sre_parse.py(417): set = [] +sre_parse.py(418): setappend = set.append +sre_parse.py(421): if sourcematch("^"): + --- modulename: sre_parse, funcname: match +sre_parse.py(196): if char == self.next: +sre_parse.py(197): if skip: +sre_parse.py(198): self.__next() + --- modulename: sre_parse, funcname: __next +sre_parse.py(183): if self.index >= len(self.string): +sre_parse.py(186): char = self.string[self.index] +sre_parse.py(187): if char[0] == "\\": +sre_parse.py(193): self.index = self.index + len(char) +sre_parse.py(194): self.next = char +sre_parse.py(199): return 1 +sre_parse.py(422): setappend((NEGATE, None)) +sre_parse.py(424): start = set[:] +sre_parse.py(425): while 1: +sre_parse.py(426): this = sourceget() + --- modulename: sre_parse, funcname: get +sre_parse.py(202): this = self.next +sre_parse.py(203): self.__next() + --- modulename: sre_parse, funcname: __next +sre_parse.py(183): if self.index >= len(self.string): +sre_parse.py(186): char = self.string[self.index] +sre_parse.py(187): if char[0] == "\\": +sre_parse.py(193): self.index = self.index + len(char) +sre_parse.py(194): self.next = char +sre_parse.py(204): return this +sre_parse.py(427): if this == "]" and set != start: +sre_parse.py(429): elif this and this[0] == "\\": +sre_parse.py(431): elif this: +sre_parse.py(432): code1 = LITERAL, ord(this) +sre_parse.py(435): if sourcematch("-"): + --- modulename: sre_parse, funcname: match +sre_parse.py(196): if char == self.next: +sre_parse.py(200): return 0 +sre_parse.py(459): if code1[0] is IN: +sre_parse.py(461): setappend(code1) +sre_parse.py(426): this = sourceget() + --- modulename: sre_parse, funcname: get +sre_parse.py(202): this = self.next +sre_parse.py(203): self.__next() + --- modulename: sre_parse, funcname: __next +sre_parse.py(183): if self.index >= len(self.string): +sre_parse.py(186): char = self.string[self.index] +sre_parse.py(187): if char[0] == "\\": +sre_parse.py(193): self.index = self.index + len(char) +sre_parse.py(194): self.next = char +sre_parse.py(204): return this +sre_parse.py(427): if this == "]" and set != start: +sre_parse.py(428): break +sre_parse.py(464): if _len(set)==1 and set[0][0] is LITERAL: +sre_parse.py(466): elif _len(set)==2 and set[0][0] is NEGATE and set[1][0] is LITERAL: +sre_parse.py(467): subpatternappend((NOT_LITERAL, set[1][1])) # optimization + --- modulename: sre_parse, funcname: append +sre_parse.py(139): self.data.append(code) +sre_parse.py(395): if source.next in PATTERNENDERS: +sre_parse.py(397): this = sourceget() + --- modulename: sre_parse, funcname: get +sre_parse.py(202): this = self.next +sre_parse.py(203): self.__next() + --- modulename: sre_parse, funcname: __next +sre_parse.py(183): if self.index >= len(self.string): +sre_parse.py(186): char = self.string[self.index] +sre_parse.py(187): if char[0] == "\\": +sre_parse.py(193): self.index = self.index + len(char) +sre_parse.py(194): self.next = char +sre_parse.py(204): return this +sre_parse.py(398): if this is None: +sre_parse.py(401): if state.flags & SRE_FLAG_VERBOSE: +sre_parse.py(412): if this and this[0] not in SPECIAL_CHARS: +sre_parse.py(415): elif this == "[": +sre_parse.py(472): elif this and this[0] in REPEAT_CHARS: +sre_parse.py(474): if this == "?": +sre_parse.py(476): elif this == "*": +sre_parse.py(479): elif this == "+": +sre_parse.py(480): min, max = 1, MAXREPEAT +sre_parse.py(512): if subpattern: + --- modulename: sre_parse, funcname: __len__ +sre_parse.py(127): return len(self.data) +sre_parse.py(513): item = subpattern[-1:] + --- modulename: sre_parse, funcname: __len__ +sre_parse.py(127): return len(self.data) + --- modulename: sre_parse, funcname: __getitem__ +sre_parse.py(131): if isinstance(index, slice): +sre_parse.py(132): return SubPattern(self.pattern, self.data[index]) + --- modulename: sre_parse, funcname: __init__ +sre_parse.py(91): self.pattern = pattern +sre_parse.py(92): if data is None: +sre_parse.py(94): self.data = data +sre_parse.py(95): self.width = None +sre_parse.py(516): if not item or (_len(item) == 1 and item[0][0] == AT): + --- modulename: sre_parse, funcname: __len__ +sre_parse.py(127): return len(self.data) + --- modulename: sre_parse, funcname: __len__ +sre_parse.py(127): return len(self.data) + --- modulename: sre_parse, funcname: __getitem__ +sre_parse.py(131): if isinstance(index, slice): +sre_parse.py(133): return self.data[index] +sre_parse.py(518): if item[0][0] in REPEATCODES: + --- modulename: sre_parse, funcname: __getitem__ +sre_parse.py(131): if isinstance(index, slice): +sre_parse.py(133): return self.data[index] +sre_parse.py(520): if sourcematch("?"): + --- modulename: sre_parse, funcname: match +sre_parse.py(196): if char == self.next: +sre_parse.py(200): return 0 +sre_parse.py(523): subpattern[-1] = (MAX_REPEAT, (min, max, item)) + --- modulename: sre_parse, funcname: __setitem__ +sre_parse.py(135): self.data[index] = code +sre_parse.py(395): if source.next in PATTERNENDERS: +sre_parse.py(396): break # end of subpattern +sre_parse.py(673): return subpattern +sre_parse.py(309): if sourcematch("|"): + --- modulename: sre_parse, funcname: match +sre_parse.py(196): if char == self.next: +sre_parse.py(200): return 0 +sre_parse.py(311): if not nested: +sre_parse.py(313): if not source.next or sourcematch(")", 0): + --- modulename: sre_parse, funcname: match +sre_parse.py(196): if char == self.next: +sre_parse.py(197): if skip: +sre_parse.py(199): return 1 +sre_parse.py(314): break +sre_parse.py(318): if len(items) == 1: +sre_parse.py(319): return items[0] +sre_parse.py(646): if not sourcematch(")"): + --- modulename: sre_parse, funcname: match +sre_parse.py(196): if char == self.next: +sre_parse.py(197): if skip: +sre_parse.py(198): self.__next() + --- modulename: sre_parse, funcname: __next +sre_parse.py(183): if self.index >= len(self.string): +sre_parse.py(186): char = self.string[self.index] +sre_parse.py(187): if char[0] == "\\": +sre_parse.py(188): try: +sre_parse.py(189): c = self.string[self.index + 1] +sre_parse.py(192): char = char + c +sre_parse.py(193): self.index = self.index + len(char) +sre_parse.py(194): self.next = char +sre_parse.py(199): return 1 +sre_parse.py(648): if group is not None: +sre_parse.py(649): state.closegroup(group) + --- modulename: sre_parse, funcname: closegroup +sre_parse.py(84): self.open.remove(gid) +sre_parse.py(650): subpatternappend((SUBPATTERN, (group, p))) + --- modulename: sre_parse, funcname: append +sre_parse.py(139): self.data.append(code) +sre_parse.py(395): if source.next in PATTERNENDERS: +sre_parse.py(397): this = sourceget() + --- modulename: sre_parse, funcname: get +sre_parse.py(202): this = self.next +sre_parse.py(203): self.__next() + --- modulename: sre_parse, funcname: __next +sre_parse.py(183): if self.index >= len(self.string): +sre_parse.py(184): self.next = None +sre_parse.py(185): return +sre_parse.py(204): return this +sre_parse.py(398): if this is None: +sre_parse.py(401): if state.flags & SRE_FLAG_VERBOSE: +sre_parse.py(412): if this and this[0] not in SPECIAL_CHARS: +sre_parse.py(415): elif this == "[": +sre_parse.py(472): elif this and this[0] in REPEAT_CHARS: +sre_parse.py(525): elif this == ".": +sre_parse.py(528): elif this == "(": +sre_parse.py(660): elif this == "^": +sre_parse.py(663): elif this == "$": +sre_parse.py(666): elif this and this[0] == "\\": +sre_parse.py(667): code = _escape(source, this, state) + --- modulename: sre_parse, funcname: _escape +sre_parse.py(259): code = CATEGORIES.get(escape) +sre_parse.py(260): if code: +sre_parse.py(262): code = ESCAPES.get(escape) +sre_parse.py(263): if code: +sre_parse.py(265): try: +sre_parse.py(266): c = escape[1:2] +sre_parse.py(267): if c == "x": +sre_parse.py(274): elif c == "0": +sre_parse.py(279): elif c in DIGITS: +sre_parse.py(295): if len(escape) == 2: +sre_parse.py(296): return LITERAL, ord(escape[1]) +sre_parse.py(668): subpatternappend(code) + --- modulename: sre_parse, funcname: append +sre_parse.py(139): self.data.append(code) +sre_parse.py(395): if source.next in PATTERNENDERS: +sre_parse.py(397): this = sourceget() + --- modulename: sre_parse, funcname: get +sre_parse.py(202): this = self.next +sre_parse.py(203): self.__next() + --- modulename: sre_parse, funcname: __next +sre_parse.py(183): if self.index >= len(self.string): +sre_parse.py(184): self.next = None +sre_parse.py(185): return +sre_parse.py(204): return this +sre_parse.py(398): if this is None: +sre_parse.py(399): break # end of pattern +sre_parse.py(673): return subpattern +sre_parse.py(309): if sourcematch("|"): + --- modulename: sre_parse, funcname: match +sre_parse.py(196): if char == self.next: +sre_parse.py(200): return 0 +sre_parse.py(311): if not nested: +sre_parse.py(312): break +sre_parse.py(318): if len(items) == 1: +sre_parse.py(319): return items[0] +sre_parse.py(687): tail = source.get() + --- modulename: sre_parse, funcname: get +sre_parse.py(202): this = self.next +sre_parse.py(203): self.__next() + --- modulename: sre_parse, funcname: __next +sre_parse.py(183): if self.index >= len(self.string): +sre_parse.py(184): self.next = None +sre_parse.py(185): return +sre_parse.py(204): return this +sre_parse.py(688): if tail == ")": +sre_parse.py(690): elif tail: +sre_parse.py(693): if flags & SRE_FLAG_DEBUG: +sre_parse.py(696): if not (flags & SRE_FLAG_VERBOSE) and p.pattern.flags & SRE_FLAG_VERBOSE: +sre_parse.py(701): return p +sre_compile.py(502): code = _code(p, flags) + --- modulename: sre_compile, funcname: _code +sre_compile.py(480): flags = p.pattern.flags | flags +sre_compile.py(481): code = [] +sre_compile.py(484): _compile_info(code, p, flags) + --- modulename: sre_compile, funcname: _compile_info +sre_compile.py(363): lo, hi = pattern.getwidth() + --- modulename: sre_parse, funcname: getwidth +sre_parse.py(142): if self.width: +sre_parse.py(144): lo = hi = 0 +sre_parse.py(145): UNITCODES = (ANY, RANGE, IN, LITERAL, NOT_LITERAL, CATEGORY) +sre_parse.py(146): REPEATCODES = (MIN_REPEAT, MAX_REPEAT) +sre_parse.py(147): for op, av in self.data: +sre_parse.py(148): if op is BRANCH: +sre_parse.py(157): elif op is CALL: +sre_parse.py(161): elif op is SUBPATTERN: +sre_parse.py(165): elif op in REPEATCODES: +sre_parse.py(169): elif op in UNITCODES: +sre_parse.py(170): lo = lo + 1 +sre_parse.py(171): hi = hi + 1 +sre_parse.py(147): for op, av in self.data: +sre_parse.py(148): if op is BRANCH: +sre_parse.py(157): elif op is CALL: +sre_parse.py(161): elif op is SUBPATTERN: +sre_parse.py(162): i, j = av[1].getwidth() + --- modulename: sre_parse, funcname: getwidth +sre_parse.py(142): if self.width: +sre_parse.py(144): lo = hi = 0 +sre_parse.py(145): UNITCODES = (ANY, RANGE, IN, LITERAL, NOT_LITERAL, CATEGORY) +sre_parse.py(146): REPEATCODES = (MIN_REPEAT, MAX_REPEAT) +sre_parse.py(147): for op, av in self.data: +sre_parse.py(148): if op is BRANCH: +sre_parse.py(157): elif op is CALL: +sre_parse.py(161): elif op is SUBPATTERN: +sre_parse.py(165): elif op in REPEATCODES: +sre_parse.py(166): i, j = av[2].getwidth() + --- modulename: sre_parse, funcname: getwidth +sre_parse.py(142): if self.width: +sre_parse.py(144): lo = hi = 0 +sre_parse.py(145): UNITCODES = (ANY, RANGE, IN, LITERAL, NOT_LITERAL, CATEGORY) +sre_parse.py(146): REPEATCODES = (MIN_REPEAT, MAX_REPEAT) +sre_parse.py(147): for op, av in self.data: +sre_parse.py(148): if op is BRANCH: +sre_parse.py(157): elif op is CALL: +sre_parse.py(161): elif op is SUBPATTERN: +sre_parse.py(165): elif op in REPEATCODES: +sre_parse.py(169): elif op in UNITCODES: +sre_parse.py(170): lo = lo + 1 +sre_parse.py(171): hi = hi + 1 +sre_parse.py(147): for op, av in self.data: +sre_parse.py(174): self.width = min(lo, MAXREPEAT - 1), min(hi, MAXREPEAT) +sre_parse.py(175): return self.width +sre_parse.py(167): lo = lo + i * av[0] +sre_parse.py(168): hi = hi + j * av[1] +sre_parse.py(147): for op, av in self.data: +sre_parse.py(174): self.width = min(lo, MAXREPEAT - 1), min(hi, MAXREPEAT) +sre_parse.py(175): return self.width +sre_parse.py(163): lo = lo + i +sre_parse.py(164): hi = hi + j +sre_parse.py(147): for op, av in self.data: +sre_parse.py(148): if op is BRANCH: +sre_parse.py(157): elif op is CALL: +sre_parse.py(161): elif op is SUBPATTERN: +sre_parse.py(165): elif op in REPEATCODES: +sre_parse.py(169): elif op in UNITCODES: +sre_parse.py(170): lo = lo + 1 +sre_parse.py(171): hi = hi + 1 +sre_parse.py(147): for op, av in self.data: +sre_parse.py(174): self.width = min(lo, MAXREPEAT - 1), min(hi, MAXREPEAT) +sre_parse.py(175): return self.width +sre_compile.py(364): if lo == 0: +sre_compile.py(367): prefix = [] +sre_compile.py(368): prefixappend = prefix.append +sre_compile.py(369): prefix_skip = 0 +sre_compile.py(370): charset = [] # not used +sre_compile.py(371): charsetappend = charset.append +sre_compile.py(372): if not (flags & SRE_FLAG_IGNORECASE): +sre_compile.py(374): for op, av in pattern.data: +sre_compile.py(375): if op is LITERAL: +sre_compile.py(376): if len(prefix) == prefix_skip: +sre_compile.py(377): prefix_skip = prefix_skip + 1 +sre_compile.py(378): prefixappend(av) +sre_compile.py(374): for op, av in pattern.data: +sre_compile.py(375): if op is LITERAL: +sre_compile.py(379): elif op is SUBPATTERN and len(av[1]) == 1: + --- modulename: sre_parse, funcname: __len__ +sre_parse.py(127): return len(self.data) +sre_compile.py(380): op, av = av[1][0] + --- modulename: sre_parse, funcname: __getitem__ +sre_parse.py(131): if isinstance(index, slice): +sre_parse.py(133): return self.data[index] +sre_compile.py(381): if op is LITERAL: +sre_compile.py(384): break +sre_compile.py(388): if not prefix and pattern.data: +sre_compile.py(427): emit = code.append +sre_compile.py(428): emit(OPCODES[INFO]) +sre_compile.py(429): skip = len(code); emit(0) +sre_compile.py(431): mask = 0 +sre_compile.py(432): if prefix: +sre_compile.py(433): mask = SRE_INFO_PREFIX +sre_compile.py(434): if len(prefix) == prefix_skip == len(pattern.data): +sre_compile.py(438): emit(mask) +sre_compile.py(440): if lo < MAXCODE: +sre_compile.py(441): emit(lo) +sre_compile.py(445): if hi < MAXCODE: +sre_compile.py(448): emit(0) +sre_compile.py(450): if prefix: +sre_compile.py(451): emit(len(prefix)) # length +sre_compile.py(452): emit(prefix_skip) # skip +sre_compile.py(453): code.extend(prefix) +sre_compile.py(455): table = [-1] + ([0]*len(prefix)) +sre_compile.py(456): for i in xrange(len(prefix)): +sre_compile.py(457): table[i+1] = table[i]+1 +sre_compile.py(458): while table[i+1] > 0 and prefix[i] != prefix[table[i+1]-1]: +sre_compile.py(456): for i in xrange(len(prefix)): +sre_compile.py(460): code.extend(table[1:]) # don't store first entry +sre_compile.py(463): code[skip] = len(code) - skip +sre_compile.py(487): _compile(code, p.data, flags) + --- modulename: sre_compile, funcname: _compile +sre_compile.py(34): emit = code.append +sre_compile.py(35): _len = len +sre_compile.py(36): LITERAL_CODES = _LITERAL_CODES +sre_compile.py(37): REPEATING_CODES = _REPEATING_CODES +sre_compile.py(38): SUCCESS_CODES = _SUCCESS_CODES +sre_compile.py(39): ASSERT_CODES = _ASSERT_CODES +sre_compile.py(40): for op, av in pattern: +sre_compile.py(41): if op in LITERAL_CODES: +sre_compile.py(42): if flags & SRE_FLAG_IGNORECASE: +sre_compile.py(46): emit(OPCODES[op]) +sre_compile.py(47): emit(av) +sre_compile.py(40): for op, av in pattern: +sre_compile.py(41): if op in LITERAL_CODES: +sre_compile.py(48): elif op is IN: +sre_compile.py(59): elif op is ANY: +sre_compile.py(64): elif op in REPEATING_CODES: +sre_compile.py(96): elif op is SUBPATTERN: +sre_compile.py(97): if av[0]: +sre_compile.py(98): emit(OPCODES[MARK]) +sre_compile.py(99): emit((av[0]-1)*2) +sre_compile.py(101): _compile(code, av[1], flags) + --- modulename: sre_compile, funcname: _compile +sre_compile.py(34): emit = code.append +sre_compile.py(35): _len = len +sre_compile.py(36): LITERAL_CODES = _LITERAL_CODES +sre_compile.py(37): REPEATING_CODES = _REPEATING_CODES +sre_compile.py(38): SUCCESS_CODES = _SUCCESS_CODES +sre_compile.py(39): ASSERT_CODES = _ASSERT_CODES +sre_compile.py(40): for op, av in pattern: + --- modulename: sre_parse, funcname: __getitem__ +sre_parse.py(131): if isinstance(index, slice): +sre_parse.py(133): return self.data[index] +sre_compile.py(41): if op in LITERAL_CODES: +sre_compile.py(48): elif op is IN: +sre_compile.py(59): elif op is ANY: +sre_compile.py(64): elif op in REPEATING_CODES: +sre_compile.py(65): if flags & SRE_FLAG_TEMPLATE: +sre_compile.py(74): elif _simple(av) and op is not REPEAT: + --- modulename: sre_compile, funcname: _simple +sre_compile.py(356): lo, hi = av[2].getwidth() + --- modulename: sre_parse, funcname: getwidth +sre_parse.py(142): if self.width: +sre_parse.py(143): return self.width +sre_compile.py(357): return lo == hi == 1 and av[2][0][0] != SUBPATTERN + --- modulename: sre_parse, funcname: __getitem__ +sre_parse.py(131): if isinstance(index, slice): +sre_parse.py(133): return self.data[index] +sre_compile.py(75): if op is MAX_REPEAT: +sre_compile.py(76): emit(OPCODES[REPEAT_ONE]) +sre_compile.py(79): skip = _len(code); emit(0) +sre_compile.py(80): emit(av[0]) +sre_compile.py(81): emit(av[1]) +sre_compile.py(82): _compile(code, av[2], flags) + --- modulename: sre_compile, funcname: _compile +sre_compile.py(34): emit = code.append +sre_compile.py(35): _len = len +sre_compile.py(36): LITERAL_CODES = _LITERAL_CODES +sre_compile.py(37): REPEATING_CODES = _REPEATING_CODES +sre_compile.py(38): SUCCESS_CODES = _SUCCESS_CODES +sre_compile.py(39): ASSERT_CODES = _ASSERT_CODES +sre_compile.py(40): for op, av in pattern: + --- modulename: sre_parse, funcname: __getitem__ +sre_parse.py(131): if isinstance(index, slice): +sre_parse.py(133): return self.data[index] +sre_compile.py(41): if op in LITERAL_CODES: +sre_compile.py(42): if flags & SRE_FLAG_IGNORECASE: +sre_compile.py(46): emit(OPCODES[op]) +sre_compile.py(47): emit(av) +sre_compile.py(40): for op, av in pattern: + --- modulename: sre_parse, funcname: __getitem__ +sre_parse.py(131): if isinstance(index, slice): +sre_parse.py(133): return self.data[index] +sre_compile.py(83): emit(OPCODES[SUCCESS]) +sre_compile.py(84): code[skip] = _len(code) - skip +sre_compile.py(40): for op, av in pattern: + --- modulename: sre_parse, funcname: __getitem__ +sre_parse.py(131): if isinstance(index, slice): +sre_parse.py(133): return self.data[index] +sre_compile.py(102): if av[0]: +sre_compile.py(103): emit(OPCODES[MARK]) +sre_compile.py(104): emit((av[0]-1)*2+1) +sre_compile.py(40): for op, av in pattern: +sre_compile.py(41): if op in LITERAL_CODES: +sre_compile.py(42): if flags & SRE_FLAG_IGNORECASE: +sre_compile.py(46): emit(OPCODES[op]) +sre_compile.py(47): emit(av) +sre_compile.py(40): for op, av in pattern: +sre_compile.py(489): code.append(OPCODES[SUCCESS]) +sre_compile.py(491): return code +sre_compile.py(507): if p.pattern.groups > 100: +sre_compile.py(513): groupindex = p.pattern.groupdict +sre_compile.py(514): indexgroup = [None] * p.pattern.groups +sre_compile.py(515): for k, i in groupindex.items(): +sre_compile.py(516): indexgroup[i] = k +sre_compile.py(515): for k, i in groupindex.items(): +sre_compile.py(518): return _sre.compile( +sre_compile.py(519): pattern, flags | p.pattern.flags, code, +sre_compile.py(520): p.pattern.groups-1, +sre_compile.py(521): groupindex, indexgroup +re.py(245): if not bypass_cache: +re.py(246): if len(_cache) >= _MAXCACHE: +re.py(248): _cache[cachekey] = p +re.py(249): return p +ConfigParser.py(446): OPTCRE = re.compile( +ConfigParser.py(447): r'(?P