id
int64
0
328k
repository_name
stringlengths
7
58
file_path
stringlengths
9
302
class_name
stringlengths
5
256
human_written_code
stringlengths
16
2.16M
class_skeleton
stringlengths
18
1.49M
⌀
total_program_units
int64
1
1.76k
total_doc_str
int64
0
771
AvgCountLine
float64
0
7.89k
AvgCountLineBlank
float64
0
297
AvgCountLineCode
float64
0
7.89k
AvgCountLineComment
float64
0
7.89k
AvgCyclomatic
float64
0
130
CommentToCodeRatio
float64
0
168
CountClassBase
float64
0
40
CountClassCoupled
float64
0
583
CountClassCoupledModified
float64
0
575
CountClassDerived
float64
0
5.35k
CountDeclInstanceMethod
float64
0
529
CountDeclInstanceVariable
float64
0
296
CountDeclMethod
float64
0
599
CountDeclMethodAll
float64
0
1.12k
CountLine
float64
1
40.4k
CountLineBlank
float64
0
8.16k
CountLineCode
float64
1
25.7k
CountLineCodeDecl
float64
1
8.15k
CountLineCodeExe
float64
0
24.2k
CountLineComment
float64
0
16.5k
CountStmt
float64
1
9.71k
CountStmtDecl
float64
1
8.15k
CountStmtExe
float64
0
9.69k
MaxCyclomatic
float64
0
759
MaxInheritanceTree
float64
0
16
MaxNesting
float64
0
34
SumCyclomatic
float64
0
2.9k
30,500
secdev/scapy
secdev_scapy/scapy/utils.py
scapy.utils.RawPcapWriter
from typing import cast, Any, AnyStr, Callable, Dict, IO, Iterator, List, Optional, TYPE_CHECKING, Tuple, Type, Union, overload import time import struct from scapy.data import MTU, DLT_EN10MB, DLT_RAW import gzip class RawPcapWriter(GenericRawPcapWriter): """A stream PCAP writer with more control than wrpcap()"""...
class RawPcapWriter(GenericRawPcapWriter): '''A stream PCAP writer with more control than wrpcap()''' def __init__(self, filename, linktype=None, gz=False, endianness='', append=False, sync=False, nano=False, snaplen=MTU, bufsz=4096): ''' :param filename: the name of the file to write packets ...
4
3
43
3
27
20
6
0.76
1
4
0
1
3
10
3
14
135
11
82
37
58
62
49
17
45
8
3
3
19
30,501
secdev/scapy
secdev_scapy/scapy/utils.py
scapy.utils.SingleConversationSocket
import threading class SingleConversationSocket(object): def __init__(self, o): self._inner = o self._tx_mutex = threading.RLock() @property def __dict__(self): return self._inner.__dict__ def __getattr__(self, name): return getattr(self._inner, name) def sr1(sel...
class SingleConversationSocket(object): def __init__(self, o): pass @property def __dict__(self): pass def __getattr__(self, name): pass def sr1(self, *args, **kargs): pass def sr1(self, *args, **kargs): pass def send(self, x): pass
8
0
4
0
3
1
1
0.27
1
2
0
0
6
2
6
6
32
5
22
11
14
6
21
9
14
2
1
2
7
30,502
secdev/scapy
secdev_scapy/scapy/utils6.py
scapy.utils6.Net6
from scapy.pton_ntop import inet_pton, inet_ntop from scapy.base_classes import Net import socket import struct from typing import Iterator, List, Optional, Tuple, Union, cast class Net6(Net): """Network object from an IP address or hostname and mask""" name = 'Net6' family = socket.AF_INET6 max_mask =...
class Net6(Net): '''Network object from an IP address or hostname and mask''' @classmethod def ip2int(cls, addr): pass @staticmethod def int2ip(val): pass
5
1
6
0
5
1
1
0.44
1
1
0
0
0
0
2
20
21
2
16
9
11
7
9
7
6
1
3
0
2
30,503
secdev/scapy
secdev_scapy/scapy/volatile.py
scapy.volatile.AutoTime
import time class AutoTime(_AutoTime[float]): def _fix(self): return time.time() - self.diff
class AutoTime(_AutoTime[float]): def _fix(self): pass
2
0
3
0
2
1
1
0.33
1
0
0
0
1
0
1
30
4
0
3
2
1
1
3
2
1
1
5
0
1
30,504
secdev/scapy
secdev_scapy/scapy/volatile.py
scapy.volatile.CorruptedBits
from scapy.utils import corrupt_bits, corrupt_bytes class CorruptedBits(CorruptedBytes): def _fix(self): return corrupt_bits(self.s, self.p, self.n)
class CorruptedBits(CorruptedBytes): def _fix(self): pass
2
0
3
0
2
1
1
0.33
1
0
0
0
1
0
1
17
4
0
3
2
1
1
3
2
1
1
3
0
1
30,505
secdev/scapy
secdev_scapy/scapy/volatile.py
scapy.volatile.CorruptedBytes
from scapy.utils import corrupt_bits, corrupt_bytes class CorruptedBytes(VolatileValue[bytes]): def __init__(self, s, p=0.01, n=None): self.s = s self.p = p self.n = n def _command_args(self): ret = [] ret.append('s=%r' % self.s) if self.p != 0.01: ...
class CorruptedBytes(VolatileValue[bytes]): def __init__(self, s, p=0.01, n=None): pass def _command_args(self): pass def _fix(self): pass
4
0
6
0
5
1
2
0.2
1
0
0
1
3
3
3
16
20
2
15
8
11
3
15
8
11
3
2
1
5
30,506
secdev/scapy
secdev_scapy/scapy/volatile.py
scapy.volatile.DelayedEval
from typing import List, TypeVar, Generic, Set, Union, Any, Dict, Optional, Tuple, cast class DelayedEval(VolatileValue[Any]): """ Example of usage: DelayedEval("time.time()") """ def __init__(self, expr): self.expr = expr def _command_args(self): return 'expr=%r' % self.expr def _fi...
class DelayedEval(VolatileValue[Any]): ''' Example of usage: DelayedEval("time.time()") ''' def __init__(self, expr): pass def _command_args(self): pass def _fix(self): pass
4
1
3
0
2
1
1
0.57
1
0
0
0
3
1
3
16
14
3
7
5
3
4
7
5
3
1
2
0
3
30,507
secdev/scapy
secdev_scapy/scapy/volatile.py
scapy.volatile.GeneralizedTime
import time class GeneralizedTime(_AutoTime[str]): def __init__(self, diff=0): super(GeneralizedTime, self).__init__(diff=diff) def _fix(self): return time.strftime('%Y%m%d%H%M%SZ', time.gmtime(time.time() + self.diff))
class GeneralizedTime(_AutoTime[str]): def __init__(self, diff=0): pass def _fix(self): pass
3
0
4
0
3
1
1
0.33
1
1
0
0
2
0
2
31
9
1
6
3
3
2
5
3
2
1
5
0
2
30,508
secdev/scapy
secdev_scapy/scapy/volatile.py
scapy.volatile.IncrementalValue
class IncrementalValue(VolatileValue[int]): def __init__(self, start=0, step=1, restart=-1): self.start = self.val = start self.step = step self.restart = restart def _command_args(self): ret = [] if self.start: ret.append('start=%r' % self.start) if...
class IncrementalValue(VolatileValue[int]): def __init__(self, start=0, step=1, restart=-1): pass def _command_args(self): pass def _fix(self): pass
4
0
8
0
7
1
2
0.14
1
0
0
0
3
4
3
16
26
2
21
9
17
3
20
9
16
4
2
1
7
30,509
secdev/scapy
secdev_scapy/scapy/volatile.py
scapy.volatile.IntAutoTime
import time class IntAutoTime(_AutoTime[int]): def _fix(self): return int(time.time() - self.diff)
class IntAutoTime(_AutoTime[int]): def _fix(self): pass
2
0
3
0
2
1
1
0.33
1
1
0
0
1
0
1
30
4
0
3
2
1
1
3
2
1
1
5
0
1
30,510
secdev/scapy
secdev_scapy/scapy/volatile.py
scapy.volatile.RandBin
from scapy.compat import bytes_encode, chb, plain_str import random import struct class RandBin(_RandString[bytes]): _DEFAULT_CHARS = b''.join((chb(c) for c in range(256))) def __init__(self, size=None, chars=_DEFAULT_CHARS): if size is None: size = RandNumExpo(0.01) self.size = si...
class RandBin(_RandString[bytes]): def __init__(self, size=None, chars=_DEFAULT_CHARS): pass def _command_args(self): pass def _fix(self): pass
4
0
7
0
6
1
2
0.21
1
3
1
1
3
2
3
19
27
4
19
9
15
4
18
9
14
3
4
1
7
30,511
secdev/scapy
secdev_scapy/scapy/volatile.py
scapy.volatile.RandBinFloat
from typing import List, TypeVar, Generic, Set, Union, Any, Dict, Optional, Tuple, cast import struct class RandBinFloat(RandFloat): def _fix(self): return cast(float, struct.unpack('!f', bytes(RandBin(4)))[0])
class RandBinFloat(RandFloat): def _fix(self): pass
2
0
6
0
5
1
1
0.17
1
3
1
0
1
0
1
30
7
0
6
2
4
1
3
2
1
1
5
0
1
30,512
secdev/scapy
secdev_scapy/scapy/volatile.py
scapy.volatile.RandChoice
import random from typing import List, TypeVar, Generic, Set, Union, Any, Dict, Optional, Tuple, cast class RandChoice(RandField[Any]): def __init__(self, *args): if not args: raise TypeError('RandChoice needs at least one choice') self._choice = list(args) def _command_args(self)...
class RandChoice(RandField[Any]): def __init__(self, *args): pass def _command_args(self): pass def _fix(self): pass
4
0
4
0
3
1
1
0.33
1
2
0
1
3
1
3
16
14
2
9
5
5
3
9
5
5
2
3
1
4
30,513
secdev/scapy
secdev_scapy/scapy/volatile.py
scapy.volatile.RandEnum
class RandEnum(RandNum): """Instances evaluate to integer sampling without replacement from the given interval""" def __init__(self, min, max, seed=None): self._seed = seed self.seq = RandomEnumeration(min, max, seed) super(RandEnum, self).__init__(min, max) def _command_args(self)...
class RandEnum(RandNum): '''Instances evaluate to integer sampling without replacement from the given interval''' def __init__(self, min, max, seed=None): pass def _command_args(self): pass def _fix(self): pass
4
1
5
0
4
1
1
0.33
1
2
1
9
3
2
3
39
19
3
12
7
8
4
12
7
8
2
5
1
4
30,514
secdev/scapy
secdev_scapy/scapy/volatile.py
scapy.volatile.RandEnumKeys
class RandEnumKeys(RandEnum): """Picks a random value from dict keys list. """ def __init__(self, enum, seed=None): self.enum = list(enum) RandEnum.__init__(self, 0, len(self.enum) - 1, seed) def _command_args(self): ret = 'enum=%r' % self.enum if self._seed: re...
class RandEnumKeys(RandEnum): '''Picks a random value from dict keys list. ''' def __init__(self, enum, seed=None): pass def _command_args(self): pass def _fix(self): pass
4
1
5
0
3
1
1
0.45
1
1
0
0
3
1
3
42
19
3
11
6
7
5
11
6
7
2
6
1
4
30,515
secdev/scapy
secdev_scapy/scapy/volatile.py
scapy.volatile.RandField
from typing import List, TypeVar, Generic, Set, Union, Any, Dict, Optional, Tuple, cast class RandField(VolatileValue[_T], Generic[_T]): pass
class RandField(VolatileValue[_T], Generic[_T]): pass
1
0
0
0
0
0
0
0
2
0
0
11
0
0
0
13
2
0
2
1
1
0
2
1
1
0
2
0
0
30,516
secdev/scapy
secdev_scapy/scapy/volatile.py
scapy.volatile.RandFloat
import random class RandFloat(_RandNumeral[float]): def __init__(self, min, max): self.min = min self.max = max def _fix(self): return random.uniform(self.min, self.max)
class RandFloat(_RandNumeral[float]): def __init__(self, min, max): pass def _fix(self): pass
3
0
4
0
3
1
1
0.33
1
0
0
1
2
2
2
29
9
1
6
5
3
2
6
5
3
1
4
0
2
30,517
secdev/scapy
secdev_scapy/scapy/volatile.py
scapy.volatile.RandIP
from scapy.base_classes import Net class RandIP(_RandString[str]): _DEFAULT_IPTEMPLATE = '0.0.0.0/0' def __init__(self, iptemplate=_DEFAULT_IPTEMPLATE): super(RandIP, self).__init__() self.ip = Net(iptemplate) def _command_args(self): rep = '%s/%s' % (self.ip.net, self.ip.mask) ...
class RandIP(_RandString[str]): def __init__(self, iptemplate=_DEFAULT_IPTEMPLATE): pass def _command_args(self): pass def _fix(self): pass
4
0
4
0
3
1
1
0.25
1
2
1
0
3
1
3
19
18
3
12
7
8
3
12
7
8
2
4
1
4
30,518
secdev/scapy
secdev_scapy/scapy/volatile.py
scapy.volatile.RandIP6
import random class RandIP6(_RandString[str]): def __init__(self, ip6template='**'): super(RandIP6, self).__init__() self.tmpl = ip6template self.sp = [] for v in self.tmpl.split(':'): if not v or v == '**': self.sp.append(v) continue ...
class RandIP6(_RandString[str]): def __init__(self, ip6template='**'): pass def _command_args(self): pass def _fix(self): pass
4
0
19
0
18
2
7
0.09
1
5
1
0
3
4
3
19
61
3
55
15
51
5
48
15
44
11
4
3
21
30,519
secdev/scapy
secdev_scapy/scapy/volatile.py
scapy.volatile.RandMAC
class RandMAC(_RandString[str]): def __init__(self, _template='*'): super(RandMAC, self).__init__() self._template = _template _template += ':*:*:*:*:*' template = _template.split(':') self.mac = () for i in range(6): v = 0 if template[i] == '...
class RandMAC(_RandString[str]): def __init__(self, _template='*'): pass def _command_args(self): pass def _fix(self): pass
4
0
8
0
7
2
2
0.26
1
5
2
0
3
2
3
19
28
2
23
10
19
6
21
10
17
4
4
2
7
30,520
secdev/scapy
secdev_scapy/scapy/volatile.py
scapy.volatile.RandNum
import random class RandNum(_RandNumeral[int]): """Instances evaluate to random integers in selected range""" min = 0 max = 0 def __init__(self, min, max): self.min = min self.max = max def _command_args(self): if self.__class__.__name__ == 'RandNum': return 'm...
class RandNum(_RandNumeral[int]): '''Instances evaluate to random integers in selected range''' def __init__(self, min, max): pass def _command_args(self): pass def _fix(self): pass def __lshift__(self, other): pass def __rshift__(self, other): pass ...
10
1
3
0
2
1
1
0.42
1
1
0
14
9
2
9
36
43
9
24
12
14
10
24
12
14
2
4
1
10
30,521
secdev/scapy
secdev_scapy/scapy/volatile.py
scapy.volatile.RandNumExpo
import random class RandNumExpo(RandNum): def __init__(self, lambd, base=0): self.lambd = lambd self.base = base def _command_args(self): ret = 'lambd=%r' % self.lambd if self.base != 0: ret += ', base=%r' % self.base return ret def _fix(self): ...
class RandNumExpo(RandNum): def __init__(self, lambd, base=0): pass def _command_args(self): pass def _fix(self): pass
4
0
4
0
3
1
1
0.27
1
1
0
0
3
2
3
39
16
2
11
7
7
3
11
7
7
2
5
1
4
30,522
secdev/scapy
secdev_scapy/scapy/volatile.py
scapy.volatile.RandNumGamma
import random class RandNumGamma(RandNum): def __init__(self, alpha, beta): self.alpha = alpha self.beta = beta def _command_args(self): return 'alpha=%r, beta=%r' % (self.alpha, self.beta) def _fix(self): return int(round(random.gammavariate(self.alpha, self.beta)))
class RandNumGamma(RandNum): def __init__(self, alpha, beta): pass def _command_args(self): pass def _fix(self): pass
4
0
3
0
2
1
1
0.38
1
1
0
0
3
2
3
39
13
2
8
6
4
3
8
6
4
1
5
0
3
30,523
secdev/scapy
secdev_scapy/scapy/volatile.py
scapy.volatile.RandNumGauss
import random class RandNumGauss(RandNum): def __init__(self, mu, sigma): self.mu = mu self.sigma = sigma def _command_args(self): return 'mu=%r, sigma=%r' % (self.mu, self.sigma) def _fix(self): return int(round(random.gauss(self.mu, self.sigma)))
class RandNumGauss(RandNum): def __init__(self, mu, sigma): pass def _command_args(self): pass def _fix(self): pass
4
0
3
0
2
1
1
0.38
1
1
0
0
3
2
3
39
13
2
8
6
4
3
8
6
4
1
5
0
3
30,524
secdev/scapy
secdev_scapy/scapy/volatile.py
scapy.volatile.RandOID
import random class RandOID(_RandString[str]): def __init__(self, fmt=None, depth=RandNumExpo(0.1), idnum=RandNumExpo(0.01)): super(RandOID, self).__init__() self.ori_fmt = fmt self.fmt = None if fmt is not None: self.fmt = [tuple(map(int, x.split('-'))) if '-' in x els...
class RandOID(_RandString[str]): def __init__(self, fmt=None, depth=RandNumExpo(0.1), idnum=RandNumExpo(0.01)): pass def _command_args(self): pass def __repr__(self): pass def _fix(self): pass
5
0
13
1
12
2
4
0.13
1
7
1
0
4
4
4
20
57
6
47
13
42
6
35
12
30
6
4
3
17
30,525
secdev/scapy
secdev_scapy/scapy/volatile.py
scapy.volatile.RandPool
import random from typing import List, TypeVar, Generic, Set, Union, Any, Dict, Optional, Tuple, cast class RandPool(RandField[VolatileValue[Any]]): def __init__(self, *args): """Each parameter is a volatile object or a couple (volatile object, weight)""" self._args = args pool = [] ...
class RandPool(RandField[VolatileValue[Any]]): def __init__(self, *args): '''Each parameter is a volatile object or a couple (volatile object, weight)''' pass def _command_args(self): pass def _fix(self): pass
4
1
8
0
7
2
2
0.29
1
2
0
0
3
2
3
16
27
2
21
12
17
6
20
12
16
3
3
2
7
30,526
secdev/scapy
secdev_scapy/scapy/volatile.py
scapy.volatile.RandRegExp
import random class RandRegExp(RandField[str]): def __init__(self, regexp, lambda_=0.3): self._regexp = regexp self._lambda = lambda_ def _command_args(self): ret = 'regexp=%r' % self._regexp if self._lambda != 0.3: ret += ', lambda_=%r' % self._lambda retu...
class RandRegExp(RandField[str]): def __init__(self, regexp, lambda_=0.3): pass def _command_args(self): pass @staticmethod def choice_expand(s): pass @staticmethod def stack_fix(lst, index): pass def _fix(self): pass def __repr__(self): ...
9
0
27
1
25
2
8
0.07
1
10
3
0
4
2
6
19
184
9
167
43
158
12
125
41
118
24
3
4
46
30,527
secdev/scapy
secdev_scapy/scapy/volatile.py
scapy.volatile.RandSingNum
import math class RandSingNum(RandSingularity): @staticmethod def make_power_of_two(end): sign = 1 if end == 0: end = 1 if end < 0: end = -end sign = -1 end_n = int(math.log(end) / math.log(2)) + 1 return {sign * 2 ** i for i in range...
class RandSingNum(RandSingularity): @staticmethod def make_power_of_two(end): pass def __init__(self, mn, mx): pass def _command_args(self): pass
5
0
10
0
9
1
3
0.1
1
3
0
8
2
2
3
19
34
2
29
11
24
3
28
10
24
4
5
2
9
30,528
secdev/scapy
secdev_scapy/scapy/volatile.py
scapy.volatile.RandSingString
from scapy.compat import bytes_encode, chb, plain_str class RandSingString(RandSingularity): def __init__(self): choices_list = ['', '%x', '%%', '%s', '%i', '%n', '%x%x%x%x%x%x%x%x%x', '%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s', '%', '%%%', 'A' * 4096, b'\x00' * 4096, b'\xff' * 4096, b'\x7f' * 4096, b'\...
class RandSingString(RandSingularity): def __init__(self): pass def _command_args(self): pass def __str__(self): pass def __bytes__(self): pass
5
0
17
0
16
2
1
0.13
1
2
0
0
4
0
4
20
70
3
63
6
58
8
10
6
5
1
5
0
4
30,529
secdev/scapy
secdev_scapy/scapy/volatile.py
scapy.volatile.RandString
import string import random class RandString(_RandString[str]): _DEFAULT_CHARS = string.ascii_uppercase + string.ascii_lowercase + string.digits def __init__(self, size=None, chars=_DEFAULT_CHARS): if size is None: size = RandNumExpo(0.01) self.size = size self.chars = char...
class RandString(_RandString[str]): def __init__(self, size=None, chars=_DEFAULT_CHARS): pass def _command_args(self): pass def _fix(self): pass
4
0
8
0
7
1
3
0.13
1
3
1
1
3
2
3
19
30
4
23
10
19
3
21
10
17
4
4
2
8
30,530
secdev/scapy
secdev_scapy/scapy/volatile.py
scapy.volatile.RandTermString
from scapy.compat import bytes_encode, chb, plain_str class RandTermString(RandBin): def __init__(self, size, term): self.term = bytes_encode(term) super(RandTermString, self).__init__(size=size) self.chars = self.chars.replace(self.term, b'') def _command_args(self): return '...
class RandTermString(RandBin): def __init__(self, size, term): pass def _command_args(self): pass def _fix(self): pass
4
0
4
0
3
1
1
0.3
1
1
0
0
3
2
3
22
15
2
10
6
6
3
9
6
5
1
5
0
3
30,531
secdev/scapy
secdev_scapy/scapy/volatile.py
scapy.volatile.RandUUID
import re import uuid class RandUUID(RandField[uuid.UUID]): """Generates a random UUID. By default, this generates a RFC 4122 version 4 UUID (totally random). See Python's ``uuid`` module documentation for more information. Args: template (optional): A template to build the UUID from. Not va...
class RandUUID(RandField[uuid.UUID]): '''Generates a random UUID. By default, this generates a RFC 4122 version 4 UUID (totally random). See Python's ``uuid`` module documentation for more information. Args: template (optional): A template to build the UUID from. Not valid with ...
4
1
38
2
34
5
11
0.32
1
9
4
0
3
8
3
16
153
13
111
28
100
36
75
21
71
17
3
3
32
30,532
secdev/scapy
secdev_scapy/scapy/volatile.py
scapy.volatile.RandomEnumeration
import random class RandomEnumeration: """iterate through a sequence in random order. When all the values have been drawn, if forever=1, the drawing is done again. # noqa: E501 If renewkeys=0, the draw will be in the same order, guaranteeing that the same # noqa: E501 number will be drawn in...
class RandomEnumeration: '''iterate through a sequence in random order. When all the values have been drawn, if forever=1, the drawing is done again. # noqa: E501 If renewkeys=0, the draw will be in the same order, guaranteeing that the same # noqa: E501 number will be drawn in not less than...
4
1
15
1
13
1
3
0.2
0
3
0
0
3
14
3
3
54
7
40
23
36
8
39
22
35
7
0
3
10
30,533
secdev/scapy
secdev_scapy/scapy/volatile.py
scapy.volatile.VolatileValue
from scapy.compat import bytes_encode, chb, plain_str from typing import List, TypeVar, Generic, Set, Union, Any, Dict, Optional, Tuple, cast import copy class VolatileValue(Generic[_T]): def __repr__(self): return '<%s>' % self.__class__.__name__ def _command_args(self): return '' def c...
class VolatileValue(Generic[_T]): def __repr__(self): pass def _command_args(self): pass def command(self, json=False): pass def __eq__(self, other): pass def __ne__(self, other): pass def __getattr__(self, attr): pass def __str__(self)...
12
0
4
0
3
1
1
0.45
1
4
0
5
11
0
11
13
57
11
33
15
21
15
32
15
20
3
1
1
15
30,534
secdev/scapy
secdev_scapy/scapy/volatile.py
scapy.volatile.ZuluTime
import time class ZuluTime(_AutoTime[str]): def __init__(self, diff=0): super(ZuluTime, self).__init__(diff=diff) def _fix(self): return time.strftime('%y%m%d%H%M%SZ', time.gmtime(time.time() + self.diff))
class ZuluTime(_AutoTime[str]): def __init__(self, diff=0): pass def _fix(self): pass
3
0
4
0
3
1
1
0.33
1
1
0
0
2
0
2
31
9
1
6
3
3
2
5
3
2
1
5
0
2
30,535
secdev/scapy
secdev_scapy/scapy/volatile.py
scapy.volatile._AutoTime
import time from typing import List, TypeVar, Generic, Set, Union, Any, Dict, Optional, Tuple, cast class _AutoTime(_RandNumeral[_T], Generic[_T]): def __init__(self, base=None, diff=None): self._base = base self._ori_diff = diff if diff is not None: self.diff = diff el...
class _AutoTime(_RandNumeral[_T], Generic[_T]): def __init__(self, base=None, diff=None): pass def _command_args(self): pass
3
0
10
1
8
1
3
0.17
2
0
0
4
2
3
2
29
22
2
18
8
14
3
15
7
12
3
4
1
6
30,536
secdev/scapy
secdev_scapy/scapy/volatile.py
scapy.volatile._RandNumeral
class _RandNumeral(RandField[_I]): """Implements integer management in RandField""" def __int__(self): return int(self._fix()) def __index__(self): return int(self) def __nonzero__(self): return bool(self._fix()) __bool__ = __nonzero__ def __add__(self, other): ...
class _RandNumeral(RandField[_I]): '''Implements integer management in RandField''' def __int__(self): pass def __index__(self): pass def __nonzero__(self): pass def __add__(self, other): pass def __radd__(self, other): pass def __sub__(self, oth...
15
1
3
0
2
1
1
0.48
1
2
0
3
14
0
14
27
60
14
31
17
16
15
31
17
16
1
3
0
14
30,537
secdev/scapy
secdev_scapy/scapy/volatile.py
scapy.volatile._RandString
from typing import List, TypeVar, Generic, Set, Union, Any, Dict, Optional, Tuple, cast from scapy.compat import bytes_encode, chb, plain_str class _RandString(RandField[_S], Generic[_S]): def __str__(self): return plain_str(self._fix()) def __bytes__(self): return bytes_encode(self._fix()) ...
class _RandString(RandField[_S], Generic[_S]): def __str__(self): pass def __bytes__(self): pass def __mul__(self, n): pass
4
0
3
0
2
1
1
0.43
2
0
0
6
3
0
3
16
12
2
7
4
3
3
7
4
3
1
3
0
3
30,538
secdev/scapy
secdev_scapy/doc/scapy/_ext/scapy_doc.py
scapy_doc.AttrsDocumenter
from sphinx.ext.autodoc import AttributeDocumenter from scapy.packet import Packet, _pkt_ls, rfc class AttrsDocumenter(AttributeDocumenter): """ Mock of AttributeDocumenter to handle Scapy settings """ def add_directive_header(self, *args, **kwargs): def call_parent(): """Calls th...
class AttrsDocumenter(AttributeDocumenter): ''' Mock of AttributeDocumenter to handle Scapy settings ''' def add_directive_header(self, *args, **kwargs): pass def call_parent(): '''Calls the super.super.add_directive_header''' pass
3
2
23
0
19
4
5
0.29
1
4
1
0
1
1
1
1
46
1
35
9
32
10
25
8
22
9
1
4
10
30,539
secdev/scapy
secdev_scapy/setup.py
setup.BuildPy
class BuildPy(build_py): """ Modified build_py to create scapy/VERSION file """ def build_package_data(self): super(BuildPy, self).build_package_data() _build_version(self.build_lib)
class BuildPy(build_py): ''' Modified build_py to create scapy/VERSION file ''' def build_package_data(self): pass
2
1
4
0
3
1
1
1
1
1
0
0
1
0
1
71
8
0
4
2
2
4
4
2
2
1
3
0
1
30,540
secdev/scapy
secdev_scapy/setup.py
setup.SDist
class SDist(sdist): """ Modified sdist to create scapy/VERSION file """ def make_release_tree(self, base_dir, *args, **kwargs): super(SDist, self).make_release_tree(base_dir, *args, **kwargs) _build_version(base_dir)
class SDist(sdist): ''' Modified sdist to create scapy/VERSION file ''' def make_release_tree(self, base_dir, *args, **kwargs): pass
2
1
4
0
3
1
1
1
1
1
0
0
1
0
1
70
8
0
4
2
2
4
4
2
2
1
3
0
1
30,541
coleifer/peewee
coleifer_peewee/examples/adjacency_list.py
adjacency_list.Node
class Node(Model): name = TextField() parent = ForeignKeyField('self', backref='children', null=True) class Meta: database = db def __str__(self): return self.name def dump(self, _indent=0): return ' ' * _indent + self.name + '\n' + ''.join((child.dump(_indent + 1) for ch...
class Node(Model): class Meta: def __str__(self): pass def dump(self, _indent=0): pass
4
0
3
0
3
0
1
0
1
0
0
0
2
0
2
49
13
3
10
7
6
0
9
7
5
1
2
0
2
30,542
coleifer/peewee
coleifer_peewee/examples/anomaly_detection.py
anomaly_detection.StdDev
import math @db.aggregate('stddev') class StdDev(object): def __init__(self): self.n = 0 self.values = [] def step(self, value): self.n += 1 self.values.append(value) def finalize(self): if self.n < 2: return 0 mean = sum(self.values) / self.n ...
@db.aggregate('stddev') class StdDev(object): def __init__(self): pass def step(self, value): pass def finalize(self): pass
5
0
4
0
4
0
1
0
1
0
0
0
3
2
3
3
15
2
13
8
9
0
13
8
9
2
1
1
4
30,543
coleifer/peewee
coleifer_peewee/examples/analytics/app.py
app.Account
from urllib.parse import parse_qsl, urlparse class Account(BaseModel): domain = CharField() def verify_url(self, url): netloc = urlparse(url).netloc url_domain = '.'.join(netloc.split('.')[-2:]) return self.domain == url_domain
class Account(BaseModel): def verify_url(self, url): pass
2
0
4
0
4
1
1
0.17
1
0
0
0
1
0
1
48
7
1
6
5
4
1
6
5
4
1
3
0
1
30,544
coleifer/peewee
coleifer_peewee/examples/blog/app.py
app.Entry
from markdown.extensions.extra import ExtraExtension import datetime from markdown.extensions.codehilite import CodeHiliteExtension from markdown import markdown from markupsafe import Markup import re from micawber import bootstrap_basic, parse_html class Entry(flask_db.Model): title = CharField() slug = Char...
class Entry(flask_db.Model): @property def html_content(self): ''' Generate HTML representation of the markdown-formatted blog entry, and also convert any media URLs into rich media objects such as video players or images. ''' pass def save(self, *args, **k...
11
1
11
0
8
2
2
0.24
1
4
2
0
3
0
6
6
80
8
58
25
47
14
34
21
27
2
1
1
9
30,545
coleifer/peewee
coleifer_peewee/examples/twitter/app.py
app.Message
class Message(BaseModel): user = ForeignKeyField(User, backref='messages') content = TextField() pub_date = DateTimeField()
class Message(BaseModel): pass
1
0
0
0
0
0
0
0
1
0
0
0
0
0
0
47
4
0
4
4
3
0
4
4
3
0
3
0
0
30,546
coleifer/peewee
coleifer_peewee/examples/analytics/app.py
app.PageView
import datetime from playhouse.postgres_ext import BinaryJSONField, PostgresqlExtDatabase from flask import Flask, Response, abort, g, request from urllib.parse import parse_qsl, urlparse class PageView(BaseModel): account = ForeignKeyField(Account, backref='pageviews') url = TextField() timestamp = DateTi...
class PageView(BaseModel): @classmethod def create_from_request(cls, account, request): pass
3
0
12
1
11
0
1
0
1
1
0
0
0
0
1
48
23
2
21
13
18
0
13
12
11
1
3
0
1
30,547
coleifer/peewee
coleifer_peewee/examples/twitter/app.py
app.User
from hashlib import md5 class User(BaseModel): username = CharField(unique=True) password = CharField() email = CharField() join_date = DateTimeField() def following(self): return User.select().join(Relationship, on=Relationship.to_user).where(Relationship.from_user == self).order_by(User....
class User(BaseModel): def following(self): pass def followers(self): pass def is_following(self, user): pass def gravatar_url(self, size=80): pass
5
0
6
0
6
0
1
0.11
1
1
1
0
4
0
4
51
34
4
27
9
22
3
13
9
8
1
3
0
4
30,548
coleifer/peewee
coleifer_peewee/bench.py
bench.Collection
class Collection(Base): name = TextField()
class Collection(Base): pass
1
0
0
0
0
0
0
0
1
0
0
0
0
0
0
47
2
0
2
2
1
0
2
2
1
0
3
0
0
30,549
coleifer/peewee
coleifer_peewee/bench.py
bench.Item
class Item(Base): collection = ForeignKeyField(Collection, backref='items') name = TextField()
class Item(Base): pass
1
0
0
0
0
0
0
0
1
0
0
0
0
0
0
47
3
0
3
3
2
0
3
3
2
0
3
0
0
30,550
coleifer/peewee
coleifer_peewee/bench.py
bench.Register
class Register(Base): value = IntegerField()
class Register(Base): pass
1
0
0
0
0
0
0
0
1
0
0
0
0
0
0
47
2
0
2
2
1
0
2
2
1
0
3
0
0
30,551
coleifer/peewee
coleifer_peewee/examples/graph.py
graph.Edge
class Edge(Base): src = ForeignKeyField(Node, backref='outgoing_edges') dest = ForeignKeyField(Node, backref='incoming_edges') weight = FloatField()
class Edge(Base): pass
1
0
0
0
0
0
0
0
1
0
0
0
0
0
0
47
4
0
4
4
3
0
4
4
3
0
3
0
0
30,552
coleifer/peewee
coleifer_peewee/examples/graph.py
graph.Node
class Node(Base): name = TextField(primary_key=True) def outgoing(self): return Node.select(Node, Edge.weight).join(Edge, on=Edge.dest).where(Edge.src == self).objects() def incoming(self): return Node.select(Node, Edge.weight).join(Edge, on=Edge.src).where(Edge.dest == self).objects()
class Node(Base): def outgoing(self): pass def incoming(self): pass
3
0
6
0
6
0
1
0
1
2
2
0
2
0
2
49
16
2
14
4
11
0
6
4
3
1
3
0
2
30,553
coleifer/peewee
coleifer_peewee/examples/hexastore.py
hexastore.Hexastore
import operator class Hexastore(object): def __init__(self, database=':memory:', **options): if isinstance(database, str): self.db = SqliteDatabase(database, **options) elif isinstance(database, Database): self.db = database else: raise ValueError('Expec...
class Hexastore(object): def __init__(self, database=':memory:', **options): pass def get_model(self): pass class Graph(Model): class Meta: def store(self, s, p, o): pass def store_many(self, items): pass def delete(self, s, p, o): ...
10
0
11
1
10
0
2
0
1
13
5
0
7
3
7
7
82
13
69
33
59
0
54
33
44
7
1
3
15
30,554
coleifer/peewee
coleifer_peewee/examples/hexastore.py
hexastore.Variable
class Variable(object): __slots__ = ('name',) def __init__(self, name): self.name = name def __hash__(self): return hash(self.name) def __repr__(self): return '<Variable: %s>' % self.name
class Variable(object): def __init__(self, name): pass def __hash__(self): pass def __repr__(self): pass
4
0
2
0
2
0
1
0
1
0
0
0
3
1
3
3
11
3
8
6
4
0
8
6
4
1
1
0
3
30,555
coleifer/peewee
coleifer_peewee/examples/hexastore.py
hexastore._VariableFactory
class _VariableFactory(object): def __getattr__(self, name): return Variable(name) __call__ = __getattr__
class _VariableFactory(object): def __getattr__(self, name): pass
2
0
2
0
2
0
1
0
1
1
1
0
1
0
1
1
4
0
4
3
2
0
4
3
2
1
1
0
1
30,556
coleifer/peewee
coleifer_peewee/peewee.py
peewee.Alias
class Alias(WrappedNode): c = _DynamicEntity() def __init__(self, node, alias): super(Alias, self).__init__(node) self._alias = alias def __hash__(self): return hash(self._alias) @property def name(self): return self._alias @name.setter def name(self, valu...
class Alias(WrappedNode): def __init__(self, node, alias): pass def __hash__(self): pass @property def name(self): pass @name.setter def name(self): pass def alias(self, alias=None): pass def unalias(self): pass def is_alias(self):...
11
0
3
0
3
0
1
0
1
2
1
0
8
1
8
39
37
7
30
13
19
0
23
11
14
2
4
1
10
30,557
coleifer/peewee
coleifer_peewee/peewee.py
peewee.AliasManager
class AliasManager(object): __slots__ = ('_counter', '_current_index', '_mapping') def __init__(self): self._counter = 0 self._current_index = 0 self._mapping = [] self.push() @property def mapping(self): return self._mapping[self._current_index - 1] def ad...
class AliasManager(object): def __init__(self): pass @property def mapping(self): pass def add(self, source): pass def get(self, source, any_depth=False): pass def __getitem__(self, source): pass def __setitem__(self, source, alias): pass ...
10
0
4
0
4
0
2
0.03
1
3
0
0
8
3
8
8
42
8
33
15
23
1
32
14
23
4
1
3
14
30,558
coleifer/peewee
coleifer_peewee/peewee.py
peewee.AnyField
class AnyField(Field): field_type = 'ANY'
class AnyField(Field): pass
1
0
0
0
0
0
0
0
1
0
0
0
0
0
0
42
2
0
2
2
1
0
2
2
1
0
4
0
0
30,559
coleifer/peewee
coleifer_peewee/peewee.py
peewee.AutoField
class AutoField(IntegerField): auto_increment = True field_type = 'AUTO' def __init__(self, *args, **kwargs): if kwargs.get('primary_key') is False: raise ValueError('%s must always be a primary key.' % type(self)) kwargs['primary_key'] = True super(AutoField, self).__in...
class AutoField(IntegerField): def __init__(self, *args, **kwargs): pass
2
0
5
0
5
0
2
0
1
3
0
6
1
0
1
44
9
1
8
4
6
0
8
4
6
2
5
1
2
30,560
coleifer/peewee
coleifer_peewee/peewee.py
peewee.BackrefAccessor
class BackrefAccessor(object): def __init__(self, field): self.field = field self.model = field.rel_model self.rel_model = field.model def __get__(self, instance, instance_type=None): if instance is not None: dest = self.field.rel_field.name return self....
class BackrefAccessor(object): def __init__(self, field): pass def __get__(self, instance, instance_type=None): pass
3
0
6
0
6
0
2
0
1
0
0
0
2
3
2
2
13
1
12
7
9
0
10
7
7
2
1
1
3
30,561
coleifer/peewee
coleifer_peewee/peewee.py
peewee.BareField
class BareField(Field): def __init__(self, adapt=None, *args, **kwargs): super(BareField, self).__init__(*args, **kwargs) if adapt is not None: self.adapt = adapt def ddl_datatype(self, ctx): return
class BareField(Field): def __init__(self, adapt=None, *args, **kwargs): pass def ddl_datatype(self, ctx): pass
3
0
3
0
3
0
2
0
1
1
0
0
2
1
2
44
8
1
7
4
4
0
7
4
4
2
4
1
3
30,562
coleifer/peewee
coleifer_peewee/peewee.py
peewee.BaseModelCursorWrapper
class BaseModelCursorWrapper(DictCursorWrapper): def __init__(self, cursor, model, columns): super(BaseModelCursorWrapper, self).__init__(cursor) self.model = model self.select = columns or [] def _initialize_columns(self): combined = self.model._meta.combined table = s...
class BaseModelCursorWrapper(DictCursorWrapper): def __init__(self, cursor, model, columns): pass def _initialize_columns(self): pass def process_row(self, row): pass
4
0
26
2
19
6
7
0.29
1
10
6
2
3
6
3
14
83
9
58
22
54
17
53
21
49
18
3
4
20
30,563
coleifer/peewee
coleifer_peewee/peewee.py
peewee.BaseModelSelect
class BaseModelSelect(_ModelQueryHelper): def union_all(self, rhs): return ModelCompoundSelectQuery(self.model, self, 'UNION ALL', rhs) __add__ = union_all def union(self, rhs): return ModelCompoundSelectQuery(self.model, self, 'UNION', rhs) __or__ = union def intersect(self, rhs)...
class BaseModelSelect(_ModelQueryHelper): def union_all(self, rhs): pass def union_all(self, rhs): pass def intersect(self, rhs): pass def except_(self, rhs): pass def __iter__(self): pass def prefetch(self, *subqueries, **kwargs): pass ...
11
0
5
0
5
0
2
0
1
4
2
2
9
1
9
13
58
8
50
20
39
0
42
19
32
5
2
3
16
30,564
coleifer/peewee
coleifer_peewee/peewee.py
peewee.BaseQuery
class BaseQuery(Node): default_row_type = ROW.DICT def __init__(self, _database=None, **kwargs): self._database = _database self._cursor_wrapper = None self._row_type = None self._constructor = None super(BaseQuery, self).__init__(**kwargs) def bind(self, database=N...
class BaseQuery(Node): def __init__(self, _database=None, **kwargs): pass def bind(self, database=None): pass def clone(self): pass @Node.copy def dicts(self, as_dict=True): pass @Node.copy def tuples(self, as_tuple=True): pass @Node.copy de...
24
0
4
0
4
0
2
0
1
9
5
2
18
4
18
24
101
19
82
33
58
0
71
28
52
5
2
2
32
30,565
coleifer/peewee
coleifer_peewee/peewee.py
peewee.BaseTable
class BaseTable(Source): __and__ = __join__(JOIN.INNER) __add__ = __join__(JOIN.LEFT_OUTER) __sub__ = __join__(JOIN.RIGHT_OUTER) __or__ = __join__(JOIN.FULL_OUTER) __mul__ = __join__(JOIN.CROSS) __rand__ = __join__(JOIN.INNER, inverted=True) __radd__ = __join__(JOIN.LEFT_OUTER, inverted=True...
class BaseTable(Source): pass
1
0
0
0
0
0
0
0
1
0
0
3
0
0
0
16
11
0
11
11
10
0
11
11
10
0
3
0
0
30,566
coleifer/peewee
coleifer_peewee/peewee.py
peewee.BigAutoField
class BigAutoField(AutoField): field_type = 'BIGAUTO'
class BigAutoField(AutoField): pass
1
0
0
0
0
0
0
0
1
0
0
0
0
0
0
44
2
0
2
2
1
0
2
2
1
0
6
0
0
30,567
coleifer/peewee
coleifer_peewee/peewee.py
peewee.BigBitField
class BigBitField(BlobField): accessor_class = BigBitFieldAccessor def __init__(self, *args, **kwargs): kwargs.setdefault('default', bytes_type) super(BigBitField, self).__init__(*args, **kwargs) def db_value(self, value): return bytes_type(value) if value is not None else value
class BigBitField(BlobField): def __init__(self, *args, **kwargs): pass def db_value(self, value): pass
3
0
3
0
3
0
2
0
1
1
0
0
2
0
2
47
9
2
7
4
4
0
7
4
4
2
5
0
3
30,568
coleifer/peewee
coleifer_peewee/peewee.py
peewee.BigBitFieldAccessor
class BigBitFieldAccessor(FieldAccessor): def __get__(self, instance, instance_type=None): if instance is None: return self.field return BigBitFieldData(instance, self.name) def __set__(self, instance, value): if isinstance(value, memoryview): value = value.toby...
class BigBitFieldAccessor(FieldAccessor): def __get__(self, instance, instance_type=None): pass def __set__(self, instance, value): pass
3
0
10
0
10
0
5
0
1
6
1
0
2
0
2
5
20
0
20
3
17
0
14
3
11
7
2
1
9
30,569
coleifer/peewee
coleifer_peewee/peewee.py
peewee.BigBitFieldData
import operator import sys import itertools class BigBitFieldData(object): def __init__(self, instance, name): self.instance = instance self.name = name value = self.instance.__data__.get(self.name) if not value: value = bytearray() elif not isinstance(value, by...
class BigBitFieldData(object): def __init__(self, instance, name): pass def clear(self): pass def _ensure_length(self, idx): pass def set_bit(self, idx): pass def clear_bit(self, idx): pass def toggle_bit(self, idx): pass def is_set(sel...
19
0
4
0
4
0
2
0
1
7
0
0
18
3
18
18
93
13
80
40
61
0
75
40
56
4
1
2
32
30,570
coleifer/peewee
coleifer_peewee/peewee.py
peewee.BigIntegerField
class BigIntegerField(IntegerField): field_type = 'BIGINT'
class BigIntegerField(IntegerField): pass
1
0
0
0
0
0
0
0
1
0
0
3
0
0
0
43
2
0
2
2
1
0
2
2
1
0
5
0
0
30,571
coleifer/peewee
coleifer_peewee/peewee.py
peewee.BinaryUUIDField
import uuid class BinaryUUIDField(BlobField): field_type = 'UUIDB' def db_value(self, value): if isinstance(value, bytes) and len(value) == 16: return self._constructor(value) elif isinstance(value, basestring) and len(value) == 32: value = uuid.UUID(hex=value) ...
class BinaryUUIDField(BlobField): def db_value(self, value): pass def python_value(self, value): pass
3
0
10
0
9
1
5
0.1
1
4
0
0
2
0
2
47
24
2
20
4
17
2
15
4
12
5
5
1
10
30,572
coleifer/peewee
coleifer_peewee/peewee.py
peewee.BindTo
class BindTo(WrappedNode): def __init__(self, node, dest): super(BindTo, self).__init__(node) self.dest = dest def __sql__(self, ctx): return ctx.sql(self.node)
class BindTo(WrappedNode): def __init__(self, node, dest): pass def __sql__(self, ctx): pass
3
0
3
0
3
0
1
0
1
1
0
0
2
1
2
33
7
1
6
4
3
0
6
4
3
1
4
0
2
30,573
coleifer/peewee
coleifer_peewee/peewee.py
peewee.BitField
class BitField(BitwiseMixin, BigIntegerField): def __init__(self, *args, **kwargs): kwargs.setdefault('default', 0) super(BitField, self).__init__(*args, **kwargs) self.__current_flag = 1 def flag(self, value=None): if value is None: value = self.__current_flag ...
class BitField(BitwiseMixin, BigIntegerField): def __init__(self, *args, **kwargs): pass def flag(self, value=None): pass class FlagDescriptor(ColumnBase): def __init__(self, *args, **kwargs): pass def clear(self): pass de...
10
0
8
0
8
0
2
0
2
2
1
0
2
1
2
49
39
2
37
15
27
0
35
15
25
3
6
1
12
30,574
coleifer/peewee
coleifer_peewee/peewee.py
peewee.BitwiseMixin
class BitwiseMixin(object): def __and__(self, other): return self.bin_and(other) def __or__(self, other): return self.bin_or(other) def __sub__(self, other): return self.bin_and(other.bin_negated()) def __invert__(self): return BitwiseNegated(self)
class BitwiseMixin(object): def __and__(self, other): pass def __or__(self, other): pass def __sub__(self, other): pass def __invert__(self): pass
5
0
2
0
2
0
1
0
1
1
1
2
4
0
4
4
12
3
9
5
4
0
9
5
4
1
1
0
4
30,575
coleifer/peewee
coleifer_peewee/peewee.py
peewee.BitwiseNegated
class BitwiseNegated(BitwiseMixin, WrappedNode): def __invert__(self): return self.node def __sql__(self, ctx): if ctx.state.operations: op_sql = ctx.state.operations.get(self.op, self.op) else: op_sql = self.op return ctx.literal(op_sql).sql(self.node)
class BitwiseNegated(BitwiseMixin, WrappedNode): def __invert__(self): pass def __sql__(self, ctx): pass
3
0
4
0
4
0
2
0
2
0
0
0
2
0
2
37
10
1
9
4
6
0
8
4
5
2
4
1
3
30,576
coleifer/peewee
coleifer_peewee/peewee.py
peewee.BlobField
class BlobField(Field): field_type = 'BLOB' def _db_hook(self, database): if database is None: self._constructor = bytearray else: self._constructor = database.get_binary_type() def bind(self, model, name, set_attribute=True): self._constructor = bytearray ...
class BlobField(Field): def _db_hook(self, database): pass def bind(self, model, name, set_attribute=True): pass def db_value(self, value): pass
4
0
8
0
7
1
3
0.14
1
3
1
4
3
1
3
45
29
4
22
6
18
3
20
6
16
3
4
2
8
30,577
coleifer/peewee
coleifer_peewee/peewee.py
peewee.BooleanField
class BooleanField(Field): field_type = 'BOOL' adapt = bool
class BooleanField(Field): pass
1
0
0
0
0
0
0
0
1
0
0
1
0
0
0
42
3
0
3
3
2
0
3
3
2
0
4
0
0
30,578
coleifer/peewee
coleifer_peewee/peewee.py
peewee.CTE
class CTE(_HashableSource, Source): def __init__(self, name, query, recursive=False, columns=None, materialized=None): self._alias = name self._query = query self._recursive = recursive self._materialized = materialized if columns is not None: columns = [Entity(c...
class CTE(_HashableSource, Source): def __init__(self, name, query, recursive=False, columns=None, materialized=None): pass def select_from(self, *columns): pass def _get_hash(self): pass def union_all(self, rhs): pass def union_all(self, rhs): pass ...
7
0
9
1
8
0
2
0
2
5
2
0
6
5
6
30
61
10
51
18
43
0
45
17
38
5
3
2
14
30,579
coleifer/peewee
coleifer_peewee/peewee.py
peewee.Cast
class Cast(WrappedNode): def __init__(self, node, cast): super(Cast, self).__init__(node) self._cast = cast self._coerce = False def __sql__(self, ctx): return ctx.literal('CAST(').sql(self.node).literal(' AS %s)' % self._cast)
class Cast(WrappedNode): def __init__(self, node, cast): pass def __sql__(self, ctx): pass
3
0
5
0
5
0
1
0
1
1
0
0
2
2
2
33
11
1
10
5
7
0
7
5
4
1
4
0
2
30,580
coleifer/peewee
coleifer_peewee/peewee.py
peewee.CharField
class CharField(_StringField): field_type = 'VARCHAR' def __init__(self, max_length=255, *args, **kwargs): self.max_length = max_length super(CharField, self).__init__(*args, **kwargs) def get_modifiers(self): return self.max_length and [self.max_length] or None
class CharField(_StringField): def __init__(self, max_length=255, *args, **kwargs): pass def get_modifiers(self): pass
3
0
3
0
3
0
1
0
1
1
0
3
2
1
2
47
9
2
7
5
4
0
7
5
4
1
5
0
2
30,581
coleifer/peewee
coleifer_peewee/peewee.py
peewee.Column
class Column(ColumnBase): def __init__(self, source, name): self.source = source self.name = name def get_sort_key(self, ctx): if ctx.scope == SCOPE_VALUES: return (self.name,) else: return self.source.get_sort_key(ctx) + (self.name,) def __hash__(s...
class Column(ColumnBase): def __init__(self, source, name): pass def get_sort_key(self, ctx): pass def __hash__(self): pass def __sql__(self, ctx): pass
5
0
4
0
4
0
2
0
1
1
1
0
4
2
4
32
20
3
17
7
12
0
15
7
10
2
3
2
6
30,582
coleifer/peewee
coleifer_peewee/peewee.py
peewee.ColumnBase
class ColumnBase(Node): _converter = None @Node.copy def converter(self, converter=None): self._converter = converter def alias(self, alias): if alias: return Alias(self, alias) return self def unalias(self): return self def bind_to(self, dest): ...
class ColumnBase(Node): @Node.copy def converter(self, converter=None): pass def alias(self, alias): pass def unalias(self): pass def bind_to(self, dest): pass def cast(self, as_type): pass def asc(self, collation=None, nulls=None): pass ...
25
1
4
0
4
0
1
0.08
1
11
9
15
22
0
22
28
140
19
113
62
88
9
104
61
80
3
2
2
34
30,583
coleifer/peewee
coleifer_peewee/peewee.py
peewee.ColumnFactory
class ColumnFactory(object): __slots__ = ('node',) def __init__(self, node): self.node = node def __getattr__(self, attr): return Column(self.node, attr) __getitem__ = __getattr__
class ColumnFactory(object): def __init__(self, node): pass def __getattr__(self, attr): pass
3
0
2
0
2
0
1
0
1
1
1
0
2
1
2
2
9
2
7
6
4
0
7
6
4
1
1
0
2
30,584
coleifer/peewee
coleifer_peewee/peewee.py
peewee.CompositeKey
import operator class CompositeKey(MetaField): sequence = None def __init__(self, *field_names): self.field_names = field_names self._safe_field_names = None @property def safe_field_names(self): if self._safe_field_names is None: if self.model is None: ...
class CompositeKey(MetaField): def __init__(self, *field_names): pass @property def safe_field_names(self): pass def __get__(self, instance, instance_type=None): pass def __set__(self, instance, value): pass def __eq__(self, other): pass def __ne...
11
0
5
0
4
0
2
0.07
1
7
1
0
9
6
9
51
55
10
42
19
31
3
36
18
26
4
5
2
15
30,585
coleifer/peewee
coleifer_peewee/peewee.py
peewee.CompoundSelectQuery
class CompoundSelectQuery(SelectBase): def __init__(self, lhs, op, rhs): super(CompoundSelectQuery, self).__init__() self.lhs = lhs self.op = op self.rhs = rhs @property def _returning(self): return self.lhs._returning @database_required def exists(self, da...
class CompoundSelectQuery(SelectBase): def __init__(self, lhs, op, rhs): pass @property def _returning(self): pass @database_required def exists(self, database): pass def _get_query_key(self): pass def _wrap_parens(self, ctx, subq): pass def __...
9
0
10
1
7
2
2
0.29
1
4
2
1
6
3
6
69
65
11
42
17
33
12
38
15
31
5
6
3
11
30,586
coleifer/peewee
coleifer_peewee/peewee.py
peewee.ConnectionContext
from functools import wraps class ConnectionContext(object): __slots__ = ('db',) def __init__(self, db): self.db = db def __enter__(self): if self.db.is_closed(): self.db.connect() def __exit__(self, exc_type, exc_val, exc_tb): self.db.close() def __call__(se...
class ConnectionContext(object): def __init__(self, db): pass def __enter__(self): pass def __exit__(self, exc_type, exc_val, exc_tb): pass def __call__(self, fn): pass @wraps(fn) def inner(*args, **kwargs): pass
7
0
3
0
3
0
1
0
1
0
0
0
4
1
4
4
13
0
13
8
8
0
14
8
8
2
1
1
6
30,587
coleifer/peewee
coleifer_peewee/peewee.py
peewee.Context
from contextlib import contextmanager class Context(object): __slots__ = ('stack', '_sql', '_values', 'alias_manager', 'state') def __init__(self, **settings): self.stack = [] self._sql = [] self._values = [] self.alias_manager = AliasManager() self.state = State(**sett...
class Context(object): def __init__(self, **settings): pass def as_new(self): pass def column_sort_key(self, item): pass @property def scope(self): pass @property def parentheses(self): pass @property def subquery(self): pass d...
21
0
5
0
4
0
2
0.08
1
4
4
0
16
5
16
16
105
21
78
32
57
6
70
28
53
7
1
2
27
30,588
coleifer/peewee
coleifer_peewee/peewee.py
peewee.CursorWrapper
class CursorWrapper(object): def __init__(self, cursor): self.cursor = cursor self.count = 0 self.index = 0 self.initialized = False self.populated = False self.row_cache = [] def __iter__(self): if self.populated: return iter(self.row_cache)...
null
10
1
7
0
7
0
2
0.03
1
6
1
2
9
6
9
9
74
9
64
20
54
2
59
20
49
5
1
2
22
30,589
coleifer/peewee
coleifer_peewee/peewee.py
peewee.DQ
class DQ(ColumnBase): def __init__(self, **query): super(DQ, self).__init__() self.query = query self._negated = False @Node.copy def __invert__(self): self._negated = not self._negated def clone(self): node = DQ(**self.query) node._negated = self._nega...
class DQ(ColumnBase): def __init__(self, **query): pass @Node.copy def __invert__(self): pass def clone(self): pass
5
0
3
0
3
0
1
0
1
1
0
0
3
2
3
31
14
2
12
8
7
0
11
7
7
1
3
0
3
30,590
coleifer/peewee
coleifer_peewee/peewee.py
peewee.Database
import threading class Database(_callable_context_manager): context_class = Context field_types = {} operations = {} param = '?' quote = '""' server_version = None compound_select_parentheses = CSQ_PARENTHESES_NEVER for_update = False index_schema_prefix = False index_using_prec...
class Database(_callable_context_manager): def __init__(self, database, thread_safe=True, autorollback=False, field_types=None, operations=None, autocommit=None, autoconnect=True, **kwargs): pass def init(self, database, **kwargs): pass def __enter__(self): pass def __exit__...
62
0
5
0
5
0
2
0.01
1
25
20
8
59
10
59
60
382
70
309
114
246
3
270
112
209
13
2
4
104
30,591
coleifer/peewee
coleifer_peewee/peewee.py
peewee.DatabaseError
class DatabaseError(PeeweeException): pass
class DatabaseError(PeeweeException): pass
1
0
0
0
0
0
0
0
1
0
0
6
0
0
0
11
1
0
1
1
1
0
2
1
1
0
4
0
0
30,592
coleifer/peewee
coleifer_peewee/peewee.py
peewee.DatabaseProxy
class DatabaseProxy(Proxy): """ Proxy implementation specifically for proxying `Database` objects. """ __slots__ = ('obj', '_callbacks', '_Model') def connection_context(self): return ConnectionContext(self) def atomic(self, *args, **kwargs): return _atomic(self, *args, **kwarg...
class DatabaseProxy(Proxy): ''' Proxy implementation specifically for proxying `Database` objects. ''' def connection_context(self): pass def atomic(self, *args, **kwargs): pass def manual_commit(self): pass def transaction(self, *args, **kwargs): pass ...
9
1
3
0
3
0
1
0.17
1
7
6
0
6
1
6
12
22
1
18
11
10
3
18
11
10
2
2
1
7
30,593
coleifer/peewee
coleifer_peewee/peewee.py
peewee.DateField
import datetime class DateField(_BaseFormattedField): field_type = 'DATE' formats = ['%Y-%m-%d', '%Y-%m-%d %H:%M:%S', '%Y-%m-%d %H:%M:%S.%f'] def adapt(self, value): if value and isinstance(value, basestring): def pp(x): return x.date() return format_date_t...
class DateField(_BaseFormattedField): def adapt(self, value): pass def pp(x): pass def to_timestamp(self): pass def truncate(self, part): pass
5
0
4
0
4
0
2
0
1
1
0
1
3
0
3
46
25
4
21
10
17
0
16
10
12
3
5
1
5
30,594
coleifer/peewee
coleifer_peewee/peewee.py
peewee.DateTimeField
class DateTimeField(_BaseFormattedField): field_type = 'DATETIME' formats = ['%Y-%m-%d %H:%M:%S.%f', '%Y-%m-%d %H:%M:%S', '%Y-%m-%d'] def adapt(self, value): if value and isinstance(value, basestring): return format_date_time(value, self.formats) return value def to_timesta...
class DateTimeField(_BaseFormattedField): def adapt(self, value): pass def to_timestamp(self): pass def truncate(self, part): pass
4
0
3
0
3
0
1
0
1
0
0
2
3
0
3
46
25
4
21
12
17
0
17
12
13
2
5
1
4
30,595
coleifer/peewee
coleifer_peewee/peewee.py
peewee.DecimalField
import decimal class DecimalField(Field): field_type = 'DECIMAL' def __init__(self, max_digits=10, decimal_places=5, auto_round=False, rounding=None, *args, **kwargs): self.max_digits = max_digits self.decimal_places = decimal_places self.auto_round = auto_round self.rounding =...
class DecimalField(Field): def __init__(self, max_digits=10, decimal_places=5, auto_round=False, rounding=None, *args, **kwargs): pass def get_modifiers(self): pass def db_value(self, value): pass def python_value(self, value): pass
5
0
6
0
6
0
2
0
1
2
0
2
4
5
4
46
29
4
25
14
19
0
24
13
19
4
4
2
9
30,596
coleifer/peewee
coleifer_peewee/peewee.py
peewee.DeferredForeignKey
import operator class DeferredForeignKey(Field): _unresolved = set() def __init__(self, rel_model_name, **kwargs): self.field_kwargs = kwargs self.rel_model_name = rel_model_name.lower() DeferredForeignKey._unresolved.add(self) super(DeferredForeignKey, self).__init__(column_na...
class DeferredForeignKey(Field): def __init__(self, rel_model_name, **kwargs): pass def __deepcopy__(self, memo=None): pass def set_model(self, rel_model): pass @staticmethod def resolve(model_cls): pass
6
0
6
0
6
0
2
0.04
1
3
1
0
3
2
4
46
33
5
27
13
21
1
21
12
16
3
4
2
7
30,597
coleifer/peewee
coleifer_peewee/peewee.py
peewee.DeferredThroughModel
class DeferredThroughModel(object): def __init__(self): self._refs = [] def set_field(self, model, field, name): self._refs.append((model, field, name)) def set_model(self, through_model): for src_model, m2mfield, name in self._refs: m2mfield.through_model = through_mo...
class DeferredThroughModel(object): def __init__(self): pass def set_field(self, model, field, name): pass def set_model(self, through_model): pass
4
0
3
0
3
0
1
0
1
0
0
0
3
1
3
3
11
2
9
6
5
0
9
6
5
2
1
1
4
30,598
coleifer/peewee
coleifer_peewee/peewee.py
peewee.Delete
class Delete(_WriteQuery): def __sql__(self, ctx): super(Delete, self).__sql__(ctx) with ctx.scope_values(subquery=True): ctx.literal('DELETE FROM ').sql(self.table) if self._where is not None: with ctx.scope_normal(): ctx.literal(' WHERE ...
class Delete(_WriteQuery): def __sql__(self, ctx): pass
2
0
11
2
9
0
2
0
1
1
0
1
1
0
1
45
12
2
10
2
8
0
10
2
8
2
5
3
2
30,599
coleifer/peewee
coleifer_peewee/peewee.py
peewee.DictCursorWrapper
class DictCursorWrapper(CursorWrapper): def _initialize_columns(self): description = self.cursor.description self.columns = [t[0][t[0].rfind('.') + 1:].strip('()"`') for t in description] self.ncols = len(description) initialize = _initialize_columns def _row_to_dict(self, row): ...
class DictCursorWrapper(CursorWrapper): def _initialize_columns(self): pass def _row_to_dict(self, row): pass
3
0
5
0
5
1
2
0.08
1
1
0
2
2
2
2
11
16
3
13
10
10
1
12
10
9
2
2
1
3