import sys import base64 __all__ = [ "BytesIO", "MAXSIZE", "PY2", "StringIO", "b", "b2s", "builtins", "byte_chr", "byte_mask", "byte_ord", "bytes", "bytes_types", "decodebytes", "encodebytes", "input", "integer_types", "is_callable", "long", "next", "string_types", "text_type", "u", ] PY2 = sys.version_info[0] < 3 if PY2: string_types = basestring # NOQA text_type = unicode # NOQA bytes_types = str bytes = str integer_types = (int, long) # NOQA long = long # NOQA input = raw_input # NOQA decodebytes = base64.decodestring encodebytes = base64.encodestring import __builtin__ as builtins byte_ord = ord # NOQA byte_chr = chr # NOQA def byte_mask(c, mask): return chr(ord(c) & mask) def b(s, encoding="utf8"): # NOQA """cast unicode or bytes to bytes""" if isinstance(s, str): return s elif isinstance(s, unicode): # NOQA return s.encode(encoding) elif isinstance(s, buffer): # NOQA return s else: raise TypeError("Expected unicode or bytes, got {!r}".format(s)) def u(s, encoding="utf8"): # NOQA """cast bytes or unicode to unicode""" if isinstance(s, str): return s.decode(encoding) elif isinstance(s, unicode): # NOQA return s elif isinstance(s, buffer): # NOQA return s.decode(encoding) else: raise TypeError("Expected unicode or bytes, got {!r}".format(s)) def b2s(s): return s import cStringIO StringIO = cStringIO.StringIO BytesIO = StringIO def is_callable(c): # NOQA return callable(c) def get_next(c): # NOQA return c.next def next(c): return c.next() # It's possible to have sizeof(long) != sizeof(Py_ssize_t). class X(object): def __len__(self): return 1 << 31 try: len(X()) except OverflowError: # 32-bit MAXSIZE = int((1 << 31) - 1) # NOQA else: # 64-bit MAXSIZE = int((1 << 63) - 1) # NOQA del X else: import collections import struct import builtins string_types = str text_type = str bytes = bytes bytes_types = bytes integer_types = int class long(int): pass input = input decodebytes = base64.decodebytes encodebytes = base64.encodebytes def byte_ord(c): # In case we're handed a string instead of an int. if not isinstance(c, int): c = ord(c) return c def byte_chr(c): assert isinstance(c, int) return struct.pack("B", c) def byte_mask(c, mask): assert isinstance(c, int) return struct.pack("B", c & mask) def b(s, encoding="utf8"): """cast unicode or bytes to bytes""" if isinstance(s, bytes): return s elif isinstance(s, str): return s.encode(encoding) else: raise TypeError("Expected unicode or bytes, got {!r}".format(s)) def u(s, encoding="utf8"): """cast bytes or unicode to unicode""" if isinstance(s, bytes): return s.decode(encoding) elif isinstance(s, str): return s else: raise TypeError("Expected unicode or bytes, got {!r}".format(s)) def b2s(s): return s.decode() if isinstance(s, bytes) else s import io StringIO = io.StringIO # NOQA BytesIO = io.BytesIO # NOQA def is_callable(c): return isinstance(c, collections.Callable) def get_next(c): return c.__next__ next = next MAXSIZE = sys.maxsize # NOQA
Name | Type | Size | Permission | Actions |
---|---|---|---|---|
__pycache__ | Folder | 0755 |
|
|
__init__.py | File | 3.76 KB | 0644 |
|
_version.py | File | 80 B | 0644 |
|
_winapi.py | File | 11.09 KB | 0644 |
|
agent.py | File | 12.46 KB | 0644 |
|
auth_handler.py | File | 31.19 KB | 0644 |
|
ber.py | File | 4.25 KB | 0644 |
|
buffered_pipe.py | File | 7.29 KB | 0644 |
|
channel.py | File | 48.18 KB | 0644 |
|
client.py | File | 31.32 KB | 0644 |
|
common.py | File | 8.04 KB | 0644 |
|
compress.py | File | 1.26 KB | 0644 |
|
config.py | File | 13.17 KB | 0644 |
|
dsskey.py | File | 7.65 KB | 0644 |
|
ecdsakey.py | File | 10.1 KB | 0644 |
|
ed25519key.py | File | 7.84 KB | 0644 |
|
file.py | File | 19.13 KB | 0644 |
|
hostkeys.py | File | 12.95 KB | 0644 |
|
kex_curve25519.py | File | 4.3 KB | 0644 |
|
kex_ecdh_nist.py | File | 4.86 KB | 0644 |
|
kex_gex.py | File | 10.06 KB | 0644 |
|
kex_group1.py | File | 5.6 KB | 0644 |
|
kex_group14.py | File | 1.79 KB | 0644 |
|
kex_group16.py | File | 2.23 KB | 0644 |
|
kex_gss.py | File | 24 KB | 0644 |
|
message.py | File | 8.8 KB | 0644 |
|
packet.py | File | 22.13 KB | 0644 |
|
pipe.py | File | 3.83 KB | 0644 |
|
pkey.py | File | 21.04 KB | 0644 |
|
primes.py | File | 5 KB | 0644 |
|
proxy.py | File | 4.34 KB | 0644 |
|
py3compat.py | File | 3.71 KB | 0644 |
|
rsakey.py | File | 5.84 KB | 0644 |
|
server.py | File | 29.7 KB | 0644 |
|
sftp.py | File | 5.89 KB | 0644 |
|
sftp_attr.py | File | 8.15 KB | 0644 |
|
sftp_client.py | File | 33.4 KB | 0644 |
|
sftp_file.py | File | 20.1 KB | 0644 |
|
sftp_handle.py | File | 7.26 KB | 0644 |
|
sftp_server.py | File | 19.14 KB | 0644 |
|
sftp_si.py | File | 12.28 KB | 0644 |
|
ssh_exception.py | File | 6.24 KB | 0644 |
|
ssh_gss.py | File | 28.22 KB | 0644 |
|
transport.py | File | 117.68 KB | 0644 |
|
util.py | File | 8.37 KB | 0644 |
|
win_pageant.py | File | 4.17 KB | 0644 |
|