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,600
coleifer/peewee
coleifer_peewee/peewee.py
peewee.DoubleField
class DoubleField(FloatField): field_type = 'DOUBLE'
class DoubleField(FloatField): pass
1
0
0
0
0
0
0
0
1
0
0
0
0
0
0
43
2
0
2
2
1
0
2
2
1
0
5
0
0
30,601
coleifer/peewee
coleifer_peewee/peewee.py
peewee.Entity
class Entity(ColumnBase): def __init__(self, *path): self._path = [part.replace('"', '""') for part in path if part] def __getattr__(self, attr): return Entity(*self._path + [attr]) def get_sort_key(self, ctx): return tuple(self._path) def __hash__(self): return hash(...
class Entity(ColumnBase): def __init__(self, *path): pass def __getattr__(self, attr): pass def get_sort_key(self, ctx): pass def __hash__(self): pass def __sql__(self, ctx): pass
6
0
2
0
2
0
1
0
1
1
0
0
5
1
5
33
15
4
11
7
5
0
11
7
5
1
3
0
5
30,602
coleifer/peewee
coleifer_peewee/peewee.py
peewee.EntityFactory
class EntityFactory(object): __slots__ = ('node',) def __init__(self, node): self.node = node def __getattr__(self, attr): return Entity(self.node, attr)
class EntityFactory(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
6
0
6
5
3
0
6
5
3
1
1
0
2
30,603
coleifer/peewee
coleifer_peewee/peewee.py
peewee.ExceptionWrapper
class ExceptionWrapper(object): __slots__ = ('exceptions',) def __init__(self, exceptions): self.exceptions = exceptions def __enter__(self): pass def __exit__(self, exc_type, exc_value, traceback): if exc_type is None: return if pg_errors is not None and e...
class ExceptionWrapper(object): def __init__(self, exceptions): pass def __enter__(self): pass def __exit__(self, exc_type, exc_value, traceback): pass
4
0
6
0
6
0
2
0.05
1
0
0
0
3
1
3
3
20
0
19
8
16
1
16
8
12
5
1
1
7
30,604
coleifer/peewee
coleifer_peewee/peewee.py
peewee.Expression
class Expression(ColumnBase): def __init__(self, lhs, op, rhs, flat=False): self.lhs = lhs self.op = op self.rhs = rhs self.flat = flat def __sql__(self, ctx): overrides = {'parentheses': not self.flat, 'in_expr': True} node = raw_node = self.lhs if isin...
class Expression(ColumnBase): def __init__(self, lhs, op, rhs, flat=False): pass def __sql__(self, ctx): pass
3
0
20
3
15
3
4
0.16
1
4
4
1
2
4
2
30
42
6
31
12
28
5
26
12
23
7
3
2
8
30,605
coleifer/peewee
coleifer_peewee/peewee.py
peewee.Field
class Field(ColumnBase): _field_counter = 0 _order = 0 accessor_class = FieldAccessor auto_increment = False default_index_type = None field_type = 'DEFAULT' unpack = True def __init__(self, null=False, index=False, unique=False, column_name=None, default=None, primary_key=False, constr...
class Field(ColumnBase): def __init__(self, null=False, index=False, unique=False, column_name=None, default=None, primary_key=False, constraints=None, sequence=None, collation=None, unindexed=False, choices=None, help_text=None, verbose_name=None, index_type=None, db_column=None, _hidden=False): pass ...
16
0
7
0
6
0
2
0.04
1
7
5
20
14
19
14
42
115
17
96
50
76
4
85
45
70
8
3
1
28
30,606
coleifer/peewee
coleifer_peewee/peewee.py
peewee.FieldAccessor
class FieldAccessor(object): def __init__(self, model, field, name): self.model = model self.field = field self.name = name def __get__(self, instance, instance_type=None): if instance is not None: return instance.__data__.get(self.name) return self.field ...
class FieldAccessor(object): def __init__(self, model, field, name): pass def __get__(self, instance, instance_type=None): pass def __set__(self, instance, value): pass
4
0
4
0
4
0
1
0
1
0
0
3
3
3
3
3
14
2
12
7
8
0
12
7
8
2
1
1
4
30,607
coleifer/peewee
coleifer_peewee/peewee.py
peewee.FieldAlias
class FieldAlias(Field): def __init__(self, source, field): self.source = source self.model = source.model self.field = field @classmethod def create(cls, source, field): class _FieldAlias(cls, type(field)): pass return _FieldAlias(source, field) d...
class FieldAlias(Field): def __init__(self, source, field): pass @classmethod def create(cls, source, field): pass class _FieldAlias(cls, type(field)): def clone(self): pass def adapt(self, value): pass def python_value(self, value): pass ...
11
0
2
0
2
0
1
0
1
2
2
0
7
3
8
50
23
4
19
14
11
0
21
13
11
2
4
0
9
30,608
coleifer/peewee
coleifer_peewee/peewee.py
peewee.FixedCharField
class FixedCharField(CharField): field_type = 'CHAR' def python_value(self, value): value = super(FixedCharField, self).python_value(value) if value: value = value.strip() return value
class FixedCharField(CharField): def python_value(self, value): pass
2
0
5
0
5
0
2
0
1
1
0
0
1
0
1
48
8
1
7
3
5
0
7
3
5
2
6
1
2
30,609
coleifer/peewee
coleifer_peewee/peewee.py
peewee.FloatField
class FloatField(Field): field_type = 'FLOAT' def adapt(self, value): try: return float(value) except ValueError: return value
class FloatField(Field): def adapt(self, value): pass
2
0
5
0
5
0
2
0
1
2
0
1
1
0
1
43
8
1
7
3
5
0
7
3
5
2
4
1
2
30,610
coleifer/peewee
coleifer_peewee/peewee.py
peewee.ForUpdate
class ForUpdate(Node): def __init__(self, expr, of=None, nowait=None): expr = 'FOR UPDATE' if expr is True else expr if expr.lower().endswith('nowait'): expr = expr[:-7] nowait = True self._expr = expr if of is not None and (not isinstance(of, (list, set, tup...
class ForUpdate(Node): def __init__(self, expr, of=None, nowait=None): pass def __sql__(self, ctx): pass
3
0
9
1
9
1
4
0.06
1
3
0
0
2
3
2
8
20
2
18
6
15
1
18
6
15
4
2
1
7
30,611
coleifer/peewee
coleifer_peewee/peewee.py
peewee.ForeignKeyAccessor
class ForeignKeyAccessor(FieldAccessor): def __init__(self, model, field, name): super(ForeignKeyAccessor, self).__init__(model, field, name) self.rel_model = field.rel_model def get_rel_instance(self, instance): value = instance.__data__.get(self.name) if value is not None or ...
class ForeignKeyAccessor(FieldAccessor): def __init__(self, model, field, name): pass def get_rel_instance(self, instance): pass def __get__(self, instance, instance_type=None): pass def __set__(self, instance, obj): pass
5
0
7
0
7
0
3
0
1
1
0
0
4
2
4
7
32
3
29
10
24
0
26
9
21
4
2
2
10
30,612
coleifer/peewee
coleifer_peewee/peewee.py
peewee.ForeignKeyField
class ForeignKeyField(Field): accessor_class = ForeignKeyAccessor backref_accessor_class = BackrefAccessor def __init__(self, model, field=None, backref=None, on_delete=None, on_update=None, deferrable=None, _deferred=None, rel_model=None, to_field=None, object_id_name=None, lazy_load=True, constraint_name...
class ForeignKeyField(Field): def __init__(self, model, field=None, backref=None, on_delete=None, on_update=None, deferrable=None, _deferred=None, rel_model=None, to_field=None, object_id_name=None, lazy_load=True, constraint_name=None, related_name=None, *args, **kwargs): pass @property def field_...
12
0
12
1
11
0
4
0.03
1
11
8
0
10
14
10
52
137
17
117
34
101
3
91
29
80
13
4
2
36
30,613
coleifer/peewee
coleifer_peewee/peewee.py
peewee.Function
class Function(ColumnBase): no_coerce_functions = set(('sum', 'count', 'avg', 'cast', 'array_agg')) def __init__(self, name, arguments, coerce=True, python_value=None): self.name = name self.arguments = arguments self._filter = None self._order_by = None self._python_val...
class Function(ColumnBase): def __init__(self, name, arguments, coerce=True, python_value=None): pass def __getattr__(self, attr): pass def decorator(*args, **kwargs): pass @Node.copy def filter(self, where=None): pass @Node.copy def order_by(se...
12
0
7
1
6
1
2
0.08
1
6
5
0
7
6
7
35
68
11
53
22
40
4
41
18
32
5
3
2
15
30,614
coleifer/peewee
coleifer_peewee/peewee.py
peewee.IPField
import struct import socket class IPField(BigIntegerField): def db_value(self, val): if val is not None: return struct.unpack('!I', socket.inet_aton(val))[0] def python_value(self, val): if val is not None: return socket.inet_ntoa(struct.pack('!I', val))
class IPField(BigIntegerField): def db_value(self, val): pass def python_value(self, val): pass
3
0
3
0
3
0
2
0
1
0
0
0
2
0
2
45
8
1
7
3
4
0
7
3
4
2
6
1
4
30,615
coleifer/peewee
coleifer_peewee/peewee.py
peewee.IdentityField
class IdentityField(AutoField): field_type = 'INT GENERATED BY DEFAULT AS IDENTITY' def __init__(self, generate_always=False, **kwargs): if generate_always: self.field_type = 'INT GENERATED ALWAYS AS IDENTITY' super(IdentityField, self).__init__(**kwargs)
class IdentityField(AutoField): def __init__(self, generate_always=False, **kwargs): pass
2
0
4
0
4
0
2
0
1
1
0
0
1
0
1
45
7
1
6
3
4
0
6
3
4
2
6
1
2
30,616
coleifer/peewee
coleifer_peewee/peewee.py
peewee.ImproperlyConfigured
class ImproperlyConfigured(PeeweeException): pass
class ImproperlyConfigured(PeeweeException): pass
1
0
0
0
0
0
0
0
1
0
0
0
0
0
0
11
1
0
1
1
1
0
2
1
1
0
4
0
0
30,617
coleifer/peewee
coleifer_peewee/peewee.py
peewee.Index
import operator class Index(Node): def __init__(self, name, table, expressions, unique=False, safe=False, where=None, using=None): self._name = name self._table = Entity(table) if not isinstance(table, Table) else table self._expressions = expressions self._where = where se...
class Index(Node): def __init__(self, name, table, expressions, unique=False, safe=False, where=None, using=None): pass @Node.copy def safe(self, _safe=True): pass @Node.copy def where(self, *expressions): pass @Node.copy def using(self, _using=None): pass ...
9
0
11
1
9
1
3
0.08
1
3
3
1
5
7
5
11
63
10
51
20
41
4
38
16
32
8
2
2
14
30,618
coleifer/peewee
coleifer_peewee/peewee.py
peewee.Insert
import itertools class Insert(_WriteQuery): SIMPLE = 0 QUERY = 1 MULTI = 2 class DefaultValuesException(Exception): pass def __init__(self, table, insert=None, columns=None, on_conflict=None, **kwargs): super(Insert, self).__init__(table, **kwargs) self._insert = insert ...
class Insert(_WriteQuery): class DefaultValuesException(Exception): def __init__(self, table, insert=None, columns=None, on_conflict=None, **kwargs): pass def where(self, *expressions): pass @Node.copy def as_rowcount(self, _as_rowcount=True): pass @Node.copy def ...
21
0
13
1
11
1
4
0.06
1
18
8
1
15
6
15
59
221
32
178
55
157
11
155
50
138
26
5
6
56
30,619
coleifer/peewee
coleifer_peewee/peewee.py
peewee.IntegerField
class IntegerField(Field): field_type = 'INT' def adapt(self, value): try: return int(value) except ValueError: return value
class IntegerField(Field): def adapt(self, value): pass
2
0
5
0
5
0
2
0
1
2
0
3
1
0
1
43
8
1
7
3
5
0
7
3
5
2
4
1
2
30,620
coleifer/peewee
coleifer_peewee/peewee.py
peewee.InterfaceError
class InterfaceError(PeeweeException): pass
class InterfaceError(PeeweeException): pass
1
0
0
0
0
0
0
0
1
0
0
0
0
0
0
11
1
0
1
1
1
0
2
1
1
0
4
0
0
30,621
coleifer/peewee
coleifer_peewee/peewee.py
peewee.Join
class Join(BaseTable): def __init__(self, lhs, rhs, join_type=JOIN.INNER, on=None, alias=None): super(Join, self).__init__(alias=alias) self.lhs = lhs self.rhs = rhs self.join_type = join_type self._on = on def on(self, predicate): self._on = predicate r...
class Join(BaseTable): def __init__(self, lhs, rhs, join_type=JOIN.INNER, on=None, alias=None): pass def on(self, predicate): pass def __sql__(self, ctx): pass
4
0
6
0
6
0
1
0
1
1
0
0
3
4
3
19
20
2
18
8
14
0
15
8
11
2
4
1
4
30,622
coleifer/peewee
coleifer_peewee/peewee.py
peewee.ManyToManyField
class ManyToManyField(MetaField): accessor_class = ManyToManyFieldAccessor def __init__(self, model, backref=None, through_model=None, on_delete=None, on_update=None, prevent_unsaved=True, _is_backref=False): if through_model is not None: if not (isinstance(through_model, DeferredThroughMod...
class ManyToManyField(MetaField): def __init__(self, model, backref=None, through_model=None, on_delete=None, on_update=None, prevent_unsaved=True, _is_backref=False): pass def _get_descriptor(self): pass def bind(self, model, name, set_attribute=True): pass def get_models(se...
12
0
9
1
8
0
2
0.01
1
9
5
0
8
8
8
50
81
13
67
33
54
1
48
28
38
4
5
2
14
30,623
coleifer/peewee
coleifer_peewee/peewee.py
peewee.ManyToManyFieldAccessor
class ManyToManyFieldAccessor(FieldAccessor): def __init__(self, model, field, name): super(ManyToManyFieldAccessor, self).__init__(model, field, name) self.model = field.model self.rel_model = field.rel_model self.through_model = field.through_model src_fks = self.through_m...
class ManyToManyFieldAccessor(FieldAccessor): def __init__(self, model, field, name): pass def __get__(self, instance, instance_type=None, force_query=False): pass def __set__(self, instance, value): pass
4
0
13
1
12
0
3
0
1
4
1
0
3
5
3
6
42
4
38
15
34
0
30
15
26
5
2
3
10
30,624
coleifer/peewee
coleifer_peewee/peewee.py
peewee.ManyToManyQuery
class ManyToManyQuery(ModelSelect): def __init__(self, instance, accessor, rel, *args, **kwargs): self._instance = instance self._accessor = accessor self._src_attr = accessor.src_fk.rel_field.name self._dest_attr = accessor.dest_fk.rel_field.name super(ManyToManyQuery, self...
class ManyToManyQuery(ModelSelect): def __init__(self, instance, accessor, rel, *args, **kwargs): pass def _id_list(self, model_or_id_list): pass def add(self, value, clear_existing=False): pass def remove(self, value): pass def clear(self): pass
6
0
12
0
11
0
2
0
1
3
2
0
5
4
5
117
64
6
58
18
52
0
37
18
31
4
8
2
11
30,625
coleifer/peewee
coleifer_peewee/peewee.py
peewee.MetaField
class MetaField(Field): column_name = default = model = name = None primary_key = False
class MetaField(Field): pass
1
0
0
0
0
0
0
0
1
0
0
3
0
0
0
42
3
0
3
3
2
0
3
3
2
0
4
0
0
30,626
coleifer/peewee
coleifer_peewee/peewee.py
peewee.Metadata
import re import collections class Metadata(object): def __init__(self, model, database=None, table_name=None, indexes=None, primary_key=None, constraints=None, schema=None, only_save_dirty=False, depends_on=None, options=None, db_table=None, table_function=None, table_settings=None, without_rowid=False, temporar...
class Metadata(object): def __init__(self, model, database=None, table_name=None, indexes=None, primary_key=None, constraints=None, schema=None, only_save_dirty=False, depends_on=None, options=None, db_table=None, table_function=None, table_settings=None, without_rowid=False, temporary=False, strict_tables=None, ...
30
0
11
1
10
0
3
0.03
1
19
11
2
23
38
23
23
292
45
239
94
204
8
205
83
181
10
1
4
68
30,627
coleifer/peewee
coleifer_peewee/peewee.py
peewee.Model
class Model(with_metaclass(ModelBase, Node)): def __init__(self, *args, **kwargs): if kwargs.pop('__no_default__', None): self.__data__ = {} else: self.__data__ = self._meta.get_default_dict() self._dirty = set(self.__data__) self.__rel__ = {} for k i...
class Model(with_metaclass(ModelBase, Node)): def __init__(self, *args, **kwargs): pass def __str__(self): pass @classmethod def validate_model(cls): pass @classmethod def alias(cls, alias=None): pass @classmethod def select(cls, *fields): pass ...
81
0
8
0
7
0
3
0.06
1
31
19
88
16
3
47
47
458
66
372
147
291
21
297
113
249
12
1
4
129
30,628
coleifer/peewee
coleifer_peewee/peewee.py
peewee.ModelAlias
class ModelAlias(Node): """Provide a separate reference to a model in a query.""" def __init__(self, model, alias=None): self.__dict__['model'] = model self.__dict__['alias'] = alias def __getattr__(self, attr): for b in (self.model,) + self.model.__bases__: try: ...
class ModelAlias(Node): '''Provide a separate reference to a model in a query.''' def __init__(self, model, alias=None): pass def __getattr__(self, attr): pass def __setattr__(self, attr, value): pass def get_field_aliases(self): pass def select(self, *select...
8
1
7
0
5
1
2
0.21
1
7
5
0
7
0
7
13
56
9
39
11
31
8
35
11
27
5
2
3
15
30,629
coleifer/peewee
coleifer_peewee/peewee.py
peewee.ModelBase
from copy import deepcopy class ModelBase(type): inheritable = set(['constraints', 'database', 'indexes', 'primary_key', 'options', 'schema', 'table_function', 'temporary', 'only_save_dirty', 'legacy_table_names', 'table_settings', 'strict_tables']) def __new__(cls, name, bases, attrs, **kwargs): if n...
class ModelBase(type): def __new__(cls, name, bases, attrs, **kwargs): pass def __repr__(self): pass def __iter__(self): pass def __getitem__(self, key): pass def __setitem__(self, key, value): pass def __delitem__(self, key): pass def ...
11
0
11
2
9
1
3
0.07
1
10
8
0
10
0
10
23
127
25
96
30
86
7
87
30
76
24
2
3
34
30,630
coleifer/peewee
coleifer_peewee/peewee.py
peewee.ModelCompoundSelectQuery
class ModelCompoundSelectQuery(BaseModelSelect, CompoundSelectQuery): def __init__(self, model, *args, **kwargs): self.model = model super(ModelCompoundSelectQuery, self).__init__(*args, **kwargs) def _get_model_cursor_wrapper(self, cursor): return self.lhs._get_model_cursor_wrapper(cu...
class ModelCompoundSelectQuery(BaseModelSelect, CompoundSelectQuery): def __init__(self, model, *args, **kwargs): pass def _get_model_cursor_wrapper(self, cursor): pass
3
0
3
0
3
0
1
0
2
1
0
0
2
1
2
84
7
1
6
4
3
0
6
4
3
1
7
0
2
30,631
coleifer/peewee
coleifer_peewee/peewee.py
peewee.ModelCursorWrapper
import collections class ModelCursorWrapper(BaseModelCursorWrapper): def __init__(self, cursor, model, select, from_list, joins): super(ModelCursorWrapper, self).__init__(cursor, model, select) self.from_list = from_list self.joins = joins def initialize(self): self._initializ...
class ModelCursorWrapper(BaseModelCursorWrapper): def __init__(self, cursor, model, select, from_list, joins): pass def initialize(self): pass def process_row(self, row): pass
4
0
43
6
33
4
11
0.11
1
13
7
0
3
6
3
17
132
20
101
31
97
11
88
31
84
18
4
3
32
30,632
coleifer/peewee
coleifer_peewee/peewee.py
peewee.ModelDelete
class ModelDelete(_ModelWriteQueryHelper, Delete): pass
class ModelDelete(_ModelWriteQueryHelper, Delete): pass
1
0
0
0
0
0
0
0
2
0
0
0
0
0
0
52
2
0
2
1
1
0
2
1
1
0
6
0
0
30,633
coleifer/peewee
coleifer_peewee/peewee.py
peewee.ModelDescriptor
class ModelDescriptor(object): pass
class ModelDescriptor(object): pass
1
0
0
0
0
0
0
0
1
0
0
2
0
0
0
0
1
0
1
1
1
0
2
1
1
0
1
0
0
30,634
coleifer/peewee
coleifer_peewee/peewee.py
peewee.ModelDictCursorWrapper
class ModelDictCursorWrapper(BaseModelCursorWrapper): def process_row(self, row): result = {} columns, converters = (self.columns, self.converters) fields = self.fields for i in range(self.ncols): attr = columns[i] if attr in result: continue ...
class ModelDictCursorWrapper(BaseModelCursorWrapper): def process_row(self, row): pass
2
0
14
2
12
1
4
0.08
1
1
0
2
1
0
1
15
15
2
13
7
11
1
13
7
11
4
4
2
4
30,635
coleifer/peewee
coleifer_peewee/peewee.py
peewee.ModelIndex
import re class ModelIndex(Index): def __init__(self, model, fields, unique=False, safe=True, where=None, using=None, name=None): self._model = model if name is None: name = self._generate_name_from_fields(model, fields) if using is None: for field in fields: ...
class ModelIndex(Index): def __init__(self, model, fields, unique=False, safe=True, where=None, using=None, name=None): pass def _generate_name_from_fields(self, model, fields): pass
3
0
18
1
17
0
6
0
1
3
1
0
2
1
2
13
38
3
35
11
31
0
25
10
22
7
3
3
12
30,636
coleifer/peewee
coleifer_peewee/peewee.py
peewee.ModelInsert
class ModelInsert(_ModelWriteQueryHelper, Insert): default_row_type = ROW.TUPLE def __init__(self, *args, **kwargs): super(ModelInsert, self).__init__(*args, **kwargs) if self._returning is None and self.model._meta.database is not None: if self.model._meta.database.returning_clause...
class ModelInsert(_ModelWriteQueryHelper, Insert): def __init__(self, *args, **kwargs): pass def returning(self, *returning): pass def get_default_data(self): pass def get_default_columns(self): pass
5
0
5
0
4
1
2
0.25
2
1
0
0
4
2
4
70
24
4
16
9
11
4
16
9
11
3
6
2
8
30,637
coleifer/peewee
coleifer_peewee/peewee.py
peewee.ModelNamedTupleCursorWrapper
import collections class ModelNamedTupleCursorWrapper(ModelTupleCursorWrapper): def initialize(self): self._initialize_columns() attributes = [] for i in range(self.ncols): attributes.append(self.columns[i]) self.tuple_class = collections.namedtuple('Row', attributes) ...
class ModelNamedTupleCursorWrapper(ModelTupleCursorWrapper): def initialize(self): pass
2
0
7
0
7
0
2
0
1
1
0
0
1
2
1
17
8
0
8
6
6
0
8
6
6
2
6
1
2
30,638
coleifer/peewee
coleifer_peewee/peewee.py
peewee.ModelObjectCursorWrapper
class ModelObjectCursorWrapper(ModelDictCursorWrapper): def __init__(self, cursor, model, select, constructor): self.constructor = constructor self.is_model = is_model(constructor) super(ModelObjectCursorWrapper, self).__init__(cursor, model, select) def process_row(self, row): ...
class ModelObjectCursorWrapper(ModelDictCursorWrapper): def __init__(self, cursor, model, select, constructor): pass def process_row(self, row): pass
3
0
7
0
6
1
2
0.08
1
1
0
0
2
2
2
17
15
1
13
7
10
1
12
7
9
2
5
1
3
30,639
coleifer/peewee
coleifer_peewee/peewee.py
peewee.ModelRaw
class ModelRaw(_ModelQueryHelper, RawQuery): def __init__(self, model, sql, params, **kwargs): self.model = model self._returning = () super(ModelRaw, self).__init__(sql=sql, params=params, **kwargs) def get(self): try: return self.execute()[0] except IndexE...
class ModelRaw(_ModelQueryHelper, RawQuery): def __init__(self, model, sql, params, **kwargs): pass def get(self): pass
3
0
6
0
6
0
2
0
2
2
0
0
2
2
2
33
14
1
13
6
10
0
11
6
8
2
4
1
3
30,640
coleifer/peewee
coleifer_peewee/peewee.py
peewee.ModelSelect
import operator import collections class ModelSelect(BaseModelSelect, Select): def __init__(self, model, fields_or_models, is_default=False): self.model = self._join_ctx = model self._joins = {} self._is_default = is_default fields = _normalize_model_select(fields_or_models) ...
class ModelSelect(BaseModelSelect, Select): def __init__(self, model, fields_or_models, is_default=False): pass def clone(self): pass def select(self, *fields_or_models): pass def select_extend(self, *columns): pass def switch(self, ctx=None): pass ...
19
0
17
1
14
1
5
0.1
2
20
15
2
17
4
17
112
307
40
242
69
223
25
200
68
182
18
7
5
88
30,641
coleifer/peewee
coleifer_peewee/peewee.py
peewee.ModelTupleCursorWrapper
class ModelTupleCursorWrapper(ModelDictCursorWrapper): constructor = tuple def process_row(self, row): columns, converters = (self.columns, self.converters) return self.constructor([converters[i](row[i]) if converters[i] is not None else row[i] for i in range(self.ncols)])
class ModelTupleCursorWrapper(ModelDictCursorWrapper): def process_row(self, row): pass
2
0
5
0
5
0
2
0
1
1
0
1
1
0
1
16
8
1
7
4
5
0
5
4
3
2
5
0
2
30,642
coleifer/peewee
coleifer_peewee/peewee.py
peewee.ModelUpdate
class ModelUpdate(_ModelWriteQueryHelper, Update): pass
class ModelUpdate(_ModelWriteQueryHelper, Update): pass
1
0
0
0
0
0
0
0
2
0
0
0
0
0
0
54
2
0
2
1
1
0
2
1
1
0
6
0
0
30,643
coleifer/peewee
coleifer_peewee/peewee.py
peewee.MySQLDatabase
import warnings import re class MySQLDatabase(Database): field_types = {'AUTO': 'INTEGER AUTO_INCREMENT', 'BIGAUTO': 'BIGINT AUTO_INCREMENT', 'BOOL': 'BOOL', 'DECIMAL': 'NUMERIC', 'DOUBLE': 'DOUBLE PRECISION', 'FLOAT': 'FLOAT', 'UUID': 'VARCHAR(40)', 'UUIDB': 'VARBINARY(16)'} operations = {'LIKE': 'LIKE BINARY...
class MySQLDatabase(Database): def init(self, database, **kwargs): pass def _connect(self): pass def _set_server_version(self, conn): pass def _extract_server_version(self, version): pass def is_connection_usable(self): pass def default_values_inser...
23
0
8
0
7
0
2
0.03
1
14
6
4
22
2
22
82
222
30
187
63
164
6
136
63
113
11
3
4
49
30,644
coleifer/peewee
coleifer_peewee/peewee.py
peewee.NamedTupleCursorWrapper
import collections class NamedTupleCursorWrapper(CursorWrapper): def initialize(self): description = self.cursor.description self.tuple_class = collections.namedtuple('Row', [t[0][t[0].rfind('.') + 1:].strip('()"`') for t in description]) def process_row(self, row): return self.tuple_...
class NamedTupleCursorWrapper(CursorWrapper): def initialize(self): pass def process_row(self, row): pass
3
0
3
0
3
0
1
0
1
0
0
0
2
1
2
11
8
1
7
5
4
0
6
5
3
1
2
0
2
30,645
coleifer/peewee
coleifer_peewee/peewee.py
peewee.NamespaceAttribute
class NamespaceAttribute(ColumnBase): def __init__(self, namespace, attribute): self._namespace = namespace self._attribute = attribute def __sql__(self, ctx): return ctx.literal(self._namespace._name + '.').sql(Entity(self._attribute))
class NamespaceAttribute(ColumnBase): def __init__(self, namespace, attribute): pass def __sql__(self, ctx): pass
3
0
4
0
4
0
1
0
1
1
1
0
2
2
2
30
9
1
8
5
5
0
6
5
3
1
3
0
2
30,646
coleifer/peewee
coleifer_peewee/peewee.py
peewee.Negated
class Negated(WrappedNode): def __invert__(self): return self.node def __sql__(self, ctx): return ctx.literal('NOT ').sql(self.node)
class Negated(WrappedNode): def __invert__(self): pass def __sql__(self, ctx): pass
3
0
2
0
2
0
1
0
1
0
0
0
2
0
2
33
6
1
5
3
2
0
5
3
2
1
4
0
2
30,647
coleifer/peewee
coleifer_peewee/peewee.py
peewee.Node
class Node(object): _coerce = True __isabstractmethod__ = False def clone(self): obj = self.__class__.__new__(self.__class__) obj.__dict__ = self.__dict__.copy() return obj def __sql__(self, ctx): raise NotImplementedError @staticmethod def copy(method): ...
class Node(object): def clone(self): pass def __sql__(self, ctx): pass @staticmethod def copy(method): pass def inner(self, *args, **kwargs): pass def coerce(self, _coerce=True): pass def is_alias(self): pass def unwrap(se...
9
0
4
0
4
0
1
0.04
1
1
0
14
5
0
6
6
32
6
26
14
17
1
25
13
17
2
1
1
8
30,648
coleifer/peewee
coleifer_peewee/peewee.py
peewee.NodeList
class NodeList(ColumnBase): def __init__(self, nodes, glue=' ', parens=False): self.nodes = nodes self.glue = glue self.parens = parens if parens and len(self.nodes) == 1 and isinstance(self.nodes[0], Expression) and (not self.nodes[0].flat): self.nodes = (self.nodes[0]....
class NodeList(ColumnBase): def __init__(self, nodes, glue=' ', parens=False): pass def __sql__(self, ctx): pass
3
0
10
0
10
1
3
0.05
1
2
1
0
2
3
2
30
22
1
20
8
17
1
18
8
15
4
3
2
6
30,649
coleifer/peewee
coleifer_peewee/peewee.py
peewee.NoopModelSelect
class NoopModelSelect(ModelSelect): def __sql__(self, ctx): return self.model._meta.database.get_noop_select(ctx) def _get_cursor_wrapper(self, cursor): return CursorWrapper(cursor)
class NoopModelSelect(ModelSelect): def __sql__(self, ctx): pass def _get_cursor_wrapper(self, cursor): pass
3
0
2
0
2
0
1
0
1
1
1
0
2
0
2
114
6
1
5
3
2
0
5
3
2
1
8
0
2
30,650
coleifer/peewee
coleifer_peewee/peewee.py
peewee.ObjectCursorWrapper
class ObjectCursorWrapper(DictCursorWrapper): def __init__(self, cursor, constructor): super(ObjectCursorWrapper, self).__init__(cursor) self.constructor = constructor def process_row(self, row): row_dict = self._row_to_dict(row) return self.constructor(**row_dict)
class ObjectCursorWrapper(DictCursorWrapper): def __init__(self, cursor, constructor): pass def process_row(self, row): pass
3
0
3
0
3
0
1
0
1
1
0
0
2
1
2
13
8
1
7
5
4
0
7
5
4
1
3
0
2
30,651
coleifer/peewee
coleifer_peewee/peewee.py
peewee.ObjectIdAccessor
class ObjectIdAccessor(object): """Gives direct access to the underlying id""" def __init__(self, field): self.field = field def __get__(self, instance, instance_type=None): if instance is not None: value = instance.__data__.get(self.field.name) if value is None and...
class ObjectIdAccessor(object): '''Gives direct access to the underlying id''' def __init__(self, field): pass def __get__(self, instance, instance_type=None): pass def __set__(self, instance, value): pass
4
1
4
0
4
0
2
0.15
1
0
0
0
3
1
3
3
17
2
13
7
9
2
13
7
9
3
1
2
5
30,652
coleifer/peewee
coleifer_peewee/peewee.py
peewee.OnConflict
import operator class OnConflict(Node): def __init__(self, action=None, update=None, preserve=None, where=None, conflict_target=None, conflict_where=None, conflict_constraint=None): self._action = action self._update = update self._preserve = ensure_tuple(preserve) self._where = wh...
class OnConflict(Node): def __init__(self, action=None, update=None, preserve=None, where=None, conflict_target=None, conflict_where=None, conflict_constraint=None): pass def get_conflict_statement(self, ctx, query): pass def get_conflict_update(self, ctx, query): pass @Node....
16
0
5
0
5
0
2
0
1
2
0
0
9
7
9
15
56
8
48
25
30
0
38
17
28
3
2
1
14
30,653
coleifer/peewee
coleifer_peewee/peewee.py
peewee.Ordering
class Ordering(WrappedNode): def __init__(self, node, direction, collation=None, nulls=None): super(Ordering, self).__init__(node) self.direction = direction self.collation = collation self.nulls = nulls if nulls and nulls.lower() not in ('first', 'last'): raise ...
class Ordering(WrappedNode): def __init__(self, node, direction, collation=None, nulls=None): pass def collate(self, collation=None): pass def _null_ordering_case(self, nulls): pass def __sql__(self, ctx): pass
5
0
7
0
7
0
3
0
1
3
1
0
4
3
4
35
32
4
28
9
23
0
25
9
20
4
4
1
10
30,654
coleifer/peewee
coleifer_peewee/peewee.py
peewee.PeeweeException
class PeeweeException(Exception): def __init__(self, *args): if args and isinstance(args[0], Exception): self.orig, args = (args[0], args[1:]) super(PeeweeException, self).__init__(*args)
class PeeweeException(Exception): def __init__(self, *args): pass
2
0
4
0
4
0
2
0
1
1
0
3
1
1
1
11
5
0
5
3
3
0
5
3
3
2
3
1
2
30,655
coleifer/peewee
coleifer_peewee/peewee.py
peewee.PostgresqlDatabase
class PostgresqlDatabase(Database): field_types = {'AUTO': 'SERIAL', 'BIGAUTO': 'BIGSERIAL', 'BLOB': 'BYTEA', 'BOOL': 'BOOLEAN', 'DATETIME': 'TIMESTAMP', 'DECIMAL': 'NUMERIC', 'DOUBLE': 'DOUBLE PRECISION', 'UUID': 'UUID', 'UUIDB': 'BYTEA'} operations = {'REGEXP': '~', 'IREGEXP': '~*'} param = '%s' compo...
class PostgresqlDatabase(Database): def init(self, database, register_unicode=True, encoding=None, isolation_level=None, **kwargs): pass def _connect(self): pass def _set_server_version(self, conn): pass def is_connection_usable(self): pass def last_insert_id(sel...
24
0
8
0
8
0
2
0.03
1
14
6
4
23
4
23
83
226
28
192
59
167
6
116
58
92
8
3
2
42
30,656
coleifer/peewee
coleifer_peewee/peewee.py
peewee.PrefetchQuery
import collections class PrefetchQuery(collections.namedtuple('_PrefetchQuery', ('query', 'fields', 'is_backref', 'rel_models', 'field_to_name', 'model'))): def __new__(cls, query, fields=None, is_backref=None, rel_models=None, field_to_name=None, model=None): if fields: if is_backref: ...
class PrefetchQuery(collections.namedtuple('_PrefetchQuery', ('query', 'fields', 'is_backref', 'rel_models', 'field_to_name', 'model'))): def __new__(cls, query, fields=None, is_backref=None, rel_models=None, field_to_name=None, model=None): pass def populate_instance(self, instance, id_map): ...
4
0
13
0
13
0
5
0
1
3
0
0
3
0
3
8
44
2
42
16
36
0
36
14
32
6
1
3
14
30,657
coleifer/peewee
coleifer_peewee/peewee.py
peewee.PrimaryKeyField
class PrimaryKeyField(AutoField): def __init__(self, *args, **kwargs): __deprecated__('"PrimaryKeyField" has been renamed to "AutoField". Please update your code accordingly as this will be completely removed in a subsequent release.') super(PrimaryKeyField, self).__init__(*args, **kwargs)
class PrimaryKeyField(AutoField): def __init__(self, *args, **kwargs): pass
2
0
5
0
5
0
1
0
1
1
0
0
1
0
1
45
6
0
6
2
4
0
4
2
2
1
6
0
1
30,658
coleifer/peewee
coleifer_peewee/peewee.py
peewee.Proxy
class Proxy(object): """ Create a proxy or placeholder for another object. """ __slots__ = ('obj', '_callbacks') def __init__(self): self._callbacks = [] self.initialize(None) def initialize(self, obj): self.obj = obj for callback in self._callbacks: ...
null
8
1
4
0
4
0
2
0.14
1
2
0
1
6
2
6
6
39
7
28
14
20
4
28
14
20
2
1
1
11
30,659
coleifer/peewee
coleifer_peewee/peewee.py
peewee.QualifiedNames
class QualifiedNames(WrappedNode): def __sql__(self, ctx): with ctx.scope_column(): return ctx.sql(self.node)
class QualifiedNames(WrappedNode): def __sql__(self, ctx): pass
2
0
3
0
3
0
1
0
1
0
0
0
1
0
1
32
4
0
4
2
2
0
4
2
2
1
4
1
1
30,660
coleifer/peewee
coleifer_peewee/peewee.py
peewee.Query
import operator class Query(BaseQuery): def __init__(self, where=None, order_by=None, limit=None, offset=None, **kwargs): super(Query, self).__init__(**kwargs) self._where = where self._order_by = order_by self._limit = limit self._offset = offset self._cte_list = N...
class Query(BaseQuery): def __init__(self, where=None, order_by=None, limit=None, offset=None, **kwargs): pass @Node.copy def with_cte(self, *cte_list): pass @Node.copy def where(self, *expressions): pass @Node.copy def orwhere(self, *expressions): pass ...
20
0
5
0
5
0
2
0.07
1
1
0
2
11
5
11
35
77
12
61
28
40
4
46
19
34
5
3
2
20
30,661
coleifer/peewee
coleifer_peewee/peewee.py
peewee.RawQuery
class RawQuery(BaseQuery): def __init__(self, sql=None, params=None, **kwargs): super(RawQuery, self).__init__(**kwargs) self._sql = sql self._params = params def __sql__(self, ctx): ctx.literal(self._sql) if self._params: for param in self._params: ...
class RawQuery(BaseQuery): def __init__(self, sql=None, params=None, **kwargs): pass def __sql__(self, ctx): pass def _execute(self, database): pass
4
0
5
0
5
0
2
0
1
1
0
1
3
3
3
27
18
2
16
9
12
0
16
9
12
3
3
2
6
30,662
coleifer/peewee
coleifer_peewee/peewee.py
peewee.ResultIterator
class ResultIterator(object): def __init__(self, cursor_wrapper): self.cursor_wrapper = cursor_wrapper self.index = 0 def __iter__(self): return self def next(self): if self.index < self.cursor_wrapper.count: obj = self.cursor_wrapper.row_cache[self.index] ...
class ResultIterator(object): def __init__(self, cursor_wrapper): pass def __iter__(self): pass def next(self): pass
4
0
5
0
5
0
2
0
1
1
0
0
3
2
3
3
20
3
17
8
13
0
15
8
11
3
1
1
5
30,663
coleifer/peewee
coleifer_peewee/peewee.py
peewee.SQL
class SQL(ColumnBase): def __init__(self, sql, params=None): self.sql = sql self.params = params def __sql__(self, ctx): ctx.literal(self.sql) if self.params: for param in self.params: ctx.value(param, False, add_param=False) return ctx
class SQL(ColumnBase): def __init__(self, sql, params=None): pass def __sql__(self, ctx): pass
3
0
5
0
5
0
2
0
1
0
0
0
2
2
2
30
11
1
10
6
7
0
10
6
7
3
3
2
4
30,664
coleifer/peewee
coleifer_peewee/peewee.py
peewee.SchemaManager
class SchemaManager(object): def __init__(self, model, database=None, **context_options): self.model = model self._database = database context_options.setdefault('scope', SCOPE_VALUES) self.context_options = context_options @property def database(self): db = self._d...
class SchemaManager(object): def __init__(self, model, database=None, **context_options): pass @property def database(self): pass @database.setter def database(self): pass def _create_context(self): pass def _create_table(self, safe=True, **options): ...
34
0
7
0
6
0
2
0.01
1
12
10
1
31
3
31
31
237
38
197
63
163
2
163
61
131
13
1
3
77
30,665
coleifer/peewee
coleifer_peewee/peewee.py
peewee.Select
import operator class Select(SelectBase): def __init__(self, from_list=None, columns=None, group_by=None, having=None, distinct=None, windows=None, for_update=None, for_update_of=None, nowait=None, lateral=None, **kwargs): super(Select, self).__init__(**kwargs) self._from_list = (list(from_list) i...
class Select(SelectBase): def __init__(self, from_list=None, columns=None, group_by=None, having=None, distinct=None, windows=None, for_update=None, for_update_of=None, nowait=None, lateral=None, **kwargs): pass def clone(self): pass @Node.copy def columns(self, *columns, **kwargs): ...
32
1
8
1
7
0
2
0.06
1
8
3
1
19
12
19
82
188
33
147
53
113
9
115
39
95
14
6
3
44
30,666
coleifer/peewee
coleifer_peewee/peewee.py
peewee.SelectBase
class SelectBase(_HashableSource, Source, SelectQuery): def _get_hash(self): return hash((self.__class__, self._alias or id(self))) def _execute(self, database): if self._cursor_wrapper is None: cursor = database.execute(self) self._cursor_wrapper = self._get_cursor_wra...
class SelectBase(_HashableSource, Source, SelectQuery): def _get_hash(self): pass def _execute(self, database): pass @database_required def peek(self, database, n=1): pass @database_required def first(self, database, n=1): pass @database_required def sca...
17
0
5
0
5
0
2
0
3
5
2
2
9
2
9
63
63
8
55
25
38
0
46
18
36
4
5
2
20
30,667
coleifer/peewee
coleifer_peewee/peewee.py
peewee.SelectQuery
class SelectQuery(Query): union_all = __add__ = __compound_select__('UNION ALL') union = __or__ = __compound_select__('UNION') intersect = __and__ = __compound_select__('INTERSECT') except_ = __sub__ = __compound_select__('EXCEPT') __radd__ = __compound_select__('UNION ALL', inverted=True) __ror...
class SelectQuery(Query): def select_from(self, *columns): pass
2
0
10
1
8
1
3
0.06
1
2
1
1
1
0
1
36
20
2
17
11
15
1
16
11
14
3
4
1
3
30,668
coleifer/peewee
coleifer_peewee/peewee.py
peewee.SmallIntegerField
class SmallIntegerField(IntegerField): field_type = 'SMALLINT'
class SmallIntegerField(IntegerField): pass
1
0
0
0
0
0
0
0
1
0
0
0
0
0
0
43
2
0
2
2
1
0
2
2
1
0
5
0
0
30,669
coleifer/peewee
coleifer_peewee/peewee.py
peewee.Source
class Source(Node): c = _DynamicColumn() def __init__(self, alias=None): super(Source, self).__init__() self._alias = alias @Node.copy def alias(self, name): self._alias = name def select(self, *columns): if not columns: columns = (SQL('*'),) re...
class Source(Node): def __init__(self, alias=None): pass @Node.copy def alias(self, name): pass def select(self, *columns): pass @property def __star__(self): pass def join(self, dest, join_type=JOIN.INNER, on=None): pass def left_outer_join(se...
13
0
3
0
3
0
2
0.06
1
7
6
3
10
1
10
16
48
10
36
15
23
2
33
13
22
3
2
2
15
30,670
coleifer/peewee
coleifer_peewee/peewee.py
peewee.SqliteDatabase
import warnings class SqliteDatabase(Database): field_types = {'BIGAUTO': FIELD.AUTO, 'BIGINT': FIELD.INT, 'BOOL': FIELD.INT, 'DOUBLE': FIELD.FLOAT, 'SMALLINT': FIELD.INT, 'UUID': FIELD.TEXT} operations = {'LIKE': 'GLOB', 'ILIKE': 'LIKE'} index_schema_prefix = True limit_max = -1 server_version = _...
class SqliteDatabase(Database): def __init__(self, database, *args, **kwargs): pass def init(self, database, pragmas=None, timeout=5, returning_clause=None, **kwargs): pass def _set_server_version(self, conn): pass def _connect(self): pass def _add_conn_hooks(se...
61
0
6
0
6
0
2
0.02
1
18
5
10
52
12
52
112
404
62
337
127
274
6
293
123
234
8
3
2
116
30,671
coleifer/peewee
coleifer_peewee/peewee.py
peewee.Star
class Star(Node): def __init__(self, source): self.source = source def __sql__(self, ctx): return ctx.sql(QualifiedNames(self.source)).literal('.*')
class Star(Node): def __init__(self, source): pass def __sql__(self, ctx): pass
3
0
2
0
2
0
1
0
1
1
1
0
2
1
2
8
5
0
5
4
2
0
5
4
2
1
2
0
2
30,672
coleifer/peewee
coleifer_peewee/peewee.py
peewee.State
import collections class State(collections.namedtuple('_State', ('scope', 'parentheses', 'settings'))): def __new__(cls, scope=SCOPE_NORMAL, parentheses=False, **kwargs): return super(State, cls).__new__(cls, scope, parentheses, kwargs) def __call__(self, scope=None, parentheses=None, **kwargs): ...
class State(collections.namedtuple('_State', ('scope', 'parentheses', 'settings'))): def __new__(cls, scope=SCOPE_NORMAL, parentheses=False, **kwargs): pass def __call__(self, scope=None, parentheses=None, **kwargs): pass def __getattr__(self, attr_name): pass
4
0
6
0
5
1
2
0.25
1
1
0
0
3
0
3
8
21
3
16
6
11
4
13
5
9
4
1
1
6
30,673
coleifer/peewee
coleifer_peewee/peewee.py
peewee.StringExpression
class StringExpression(Expression): def __add__(self, rhs): return self.concat(rhs) def __radd__(self, lhs): return StringExpression(lhs, OP.CONCAT, self)
class StringExpression(Expression): def __add__(self, rhs): pass def __radd__(self, lhs): pass
3
0
2
0
2
0
1
0
1
0
0
0
2
0
2
32
5
0
5
3
2
0
5
3
2
1
4
0
2
30,674
coleifer/peewee
coleifer_peewee/peewee.py
peewee.SubclassAwareMetadata
class SubclassAwareMetadata(Metadata): models = [] def __init__(self, model, *args, **kwargs): super(SubclassAwareMetadata, self).__init__(model, *args, **kwargs) self.models.append(model) def map_models(self, fn): for model in self.models: fn(model)
class SubclassAwareMetadata(Metadata): def __init__(self, model, *args, **kwargs): pass def map_models(self, fn): pass
3
0
3
0
3
0
2
0
1
1
0
1
2
0
2
25
10
2
8
5
5
0
8
5
5
2
2
1
3
30,675
coleifer/peewee
coleifer_peewee/peewee.py
peewee.Table
class Table(_HashableSource, BaseTable): def __init__(self, name, columns=None, primary_key=None, schema=None, alias=None, _model=None, _database=None): self.__name__ = name self._columns = columns self._primary_key = primary_key self._schema = schema self._path = (schema, n...
class Table(_HashableSource, BaseTable): def __init__(self, name, columns=None, primary_key=None, schema=None, alias=None, _model=None, _database=None): pass def clone(self): pass def bind(self, database=None): pass def bind_ctx(self, database=None): pass def _ge...
17
0
7
0
6
0
3
0.07
2
9
8
0
11
10
11
35
93
14
74
34
56
5
57
27
45
6
4
2
28
30,676
coleifer/peewee
coleifer_peewee/peewee.py
peewee.TextField
class TextField(_StringField): field_type = 'TEXT'
class TextField(_StringField): pass
1
0
0
0
0
0
0
0
1
0
0
8
0
0
0
45
2
0
2
2
1
0
2
2
1
0
5
0
0
30,677
coleifer/peewee
coleifer_peewee/peewee.py
peewee.TimeField
import datetime class TimeField(_BaseFormattedField): field_type = 'TIME' formats = ['%H:%M:%S.%f', '%H:%M:%S', '%H:%M', '%Y-%m-%d %H:%M:%S.%f', '%Y-%m-%d %H:%M:%S'] def adapt(self, value): if value: if isinstance(value, basestring): def pp(x): retu...
class TimeField(_BaseFormattedField): def adapt(self, value): pass def pp(x): pass
3
0
10
0
10
0
5
0
1
2
0
1
1
0
1
44
24
2
22
8
20
0
15
8
13
5
5
2
5
30,678
coleifer/peewee
coleifer_peewee/peewee.py
peewee.TimestampField
import datetime import calendar import time class TimestampField(BigIntegerField): valid_resolutions = [10 ** i for i in range(7)] def __init__(self, *args, **kwargs): self.resolution = kwargs.pop('resolution', None) if not self.resolution: self.resolution = 1 elif self.res...
class TimestampField(BigIntegerField): def __init__(self, *args, **kwargs): pass def local_to_utc(self, dt): pass def utc_to_local(self, dt): pass def get_timestamp(self, value): pass def db_value(self, value): pass def python_value(self, value): ...
8
0
10
1
8
1
3
0.16
1
9
1
0
7
3
7
50
89
15
64
24
56
10
55
24
47
5
6
2
21
30,679
coleifer/peewee
coleifer_peewee/peewee.py
peewee.UUIDField
import uuid class UUIDField(Field): field_type = 'UUID' def db_value(self, value): if isinstance(value, basestring) and len(value) == 32: return value elif isinstance(value, bytes) and len(value) == 16: value = uuid.UUID(bytes=value) if isinstance(value, uuid.UU...
class UUIDField(Field): def db_value(self, value): pass def python_value(self, value): pass
3
0
9
0
8
1
4
0.12
1
2
0
1
2
0
2
44
21
2
17
4
14
2
16
4
13
5
4
1
8
30,680
coleifer/peewee
coleifer_peewee/peewee.py
peewee.Update
class Update(_WriteQuery): def __init__(self, table, update=None, **kwargs): super(Update, self).__init__(table, **kwargs) self._update = update self._from = None @Node.copy def from_(self, *sources): self._from = sources def __sql__(self, ctx): super(Update, s...
class Update(_WriteQuery): def __init__(self, table, update=None, **kwargs): pass @Node.copy def from_(self, *sources): pass def __sql__(self, ctx): pass
5
0
15
2
11
1
3
0.08
1
7
6
1
3
2
3
47
48
9
36
9
31
3
30
8
26
8
5
4
10
30,681
coleifer/peewee
coleifer_peewee/peewee.py
peewee.Value
class Value(ColumnBase): def __init__(self, value, converter=None, unpack=True): self.value = value self.converter = converter self.multi = unpack and isinstance(self.value, multi_types) if self.multi: self.values = [] for item in self.value: ...
class Value(ColumnBase): def __init__(self, value, converter=None, unpack=True): pass def __sql__(self, ctx): pass
3
0
9
1
8
1
3
0.06
1
0
0
0
2
4
2
30
19
2
16
8
13
1
15
8
12
4
3
3
6
30,682
coleifer/peewee
coleifer_peewee/peewee.py
peewee.ValueLiterals
class ValueLiterals(WrappedNode): def __sql__(self, ctx): with ctx(value_literals=True): return ctx.sql(self.node)
class ValueLiterals(WrappedNode): def __sql__(self, ctx): pass
2
0
3
0
3
0
1
0
1
0
0
0
1
0
1
32
4
0
4
2
2
0
4
2
2
1
4
1
1
30,683
coleifer/peewee
coleifer_peewee/peewee.py
peewee.ValuesList
class ValuesList(_HashableSource, BaseTable): def __init__(self, values, columns=None, alias=None): self._values = values self._columns = columns super(ValuesList, self).__init__(alias=alias) def _get_hash(self): return hash((self.__class__, id(self._values), self._alias)) ...
class ValuesList(_HashableSource, BaseTable): def __init__(self, values, columns=None, alias=None): pass def _get_hash(self): pass @Node.copy def columns(self, *names): pass def __sql__(self, ctx): pass
6
0
7
1
6
0
2
0
2
2
1
0
4
2
4
28
33
6
27
9
21
0
22
8
17
5
4
3
8
30,684
coleifer/peewee
coleifer_peewee/peewee.py
peewee.VirtualField
class VirtualField(MetaField): field_class = None def __init__(self, field_class=None, *args, **kwargs): Field = field_class if field_class is not None else self.field_class self.field_instance = Field() if Field is not None else None super(VirtualField, self).__init__(*args, **kwargs) ...
class VirtualField(MetaField): def __init__(self, field_class=None, *args, **kwargs): pass def db_value(self, value): pass def python_value(self, value): pass def bind(self, model, name, set_attribute=True): pass
5
0
4
0
4
0
2
0
1
1
0
0
4
5
4
46
22
4
18
10
13
0
18
10
13
3
5
1
8
30,685
coleifer/peewee
coleifer_peewee/peewee.py
peewee.Window
class Window(Node): CURRENT_ROW = SQL('CURRENT ROW') GROUP = SQL('GROUP') TIES = SQL('TIES') NO_OTHERS = SQL('NO OTHERS') GROUPS = 'GROUPS' RANGE = 'RANGE' ROWS = 'ROWS' def __init__(self, partition_by=None, order_by=None, start=None, end=None, frame_type=None, extends=None, exclude=Non...
class Window(Node): def __init__(self, partition_by=None, order_by=None, start=None, end=None, frame_type=None, extends=None, exclude=None, alias=None, _inline=False): pass def alias(self, alias=None): pass @Node.copy def as_range(self): pass @Node.copy def as_rows(self...
18
0
8
0
8
0
3
0.02
1
4
2
0
8
9
10
16
108
13
93
39
73
2
73
30
62
11
2
3
26
30,686
coleifer/peewee
coleifer_peewee/peewee.py
peewee.WindowAlias
class WindowAlias(Node): def __init__(self, window): self.window = window def alias(self, window_alias): self.window._alias = window_alias return self def __sql__(self, ctx): return ctx.literal(self.window._alias or 'w')
class WindowAlias(Node): def __init__(self, window): pass def alias(self, window_alias): pass def __sql__(self, ctx): pass
4
0
2
0
2
0
1
0
1
0
0
0
3
1
3
9
10
2
8
5
4
0
8
5
4
1
2
0
3
30,687
coleifer/peewee
coleifer_peewee/peewee.py
peewee.WrappedNode
class WrappedNode(ColumnBase): def __init__(self, node): self.node = node self._coerce = getattr(node, '_coerce', True) self._converter = getattr(node, '_converter', None) def is_alias(self): return self.node.is_alias() def unwrap(self): return self.node.unwrap()
class WrappedNode(ColumnBase): def __init__(self, node): pass def is_alias(self): pass def unwrap(self): pass
4
0
3
0
3
0
1
0
1
0
0
8
3
3
3
31
11
2
9
7
5
0
9
7
5
1
3
0
3
30,688
coleifer/peewee
coleifer_peewee/peewee.py
peewee._BaseFormattedField
class _BaseFormattedField(Field): formats = None def __init__(self, formats=None, *args, **kwargs): if formats is not None: self.formats = formats super(_BaseFormattedField, self).__init__(*args, **kwargs)
class _BaseFormattedField(Field): def __init__(self, formats=None, *args, **kwargs): pass
2
0
4
0
4
0
2
0
1
1
0
3
1
0
1
43
7
1
6
3
4
0
6
3
4
2
4
1
2
30,689
coleifer/peewee
coleifer_peewee/peewee.py
peewee._BoundModelsContext
class _BoundModelsContext(object): def __init__(self, models, database, bind_refs, bind_backrefs): self.models = models self.database = database self.bind_refs = bind_refs self.bind_backrefs = bind_backrefs def __enter__(self): self._orig_database = [] for model...
class _BoundModelsContext(object): def __init__(self, models, database, bind_refs, bind_backrefs): pass def __enter__(self): pass def __exit__(self, exc_type, exc_val, exc_tb): pass
4
0
5
0
5
0
2
0
1
2
0
0
3
5
3
3
19
2
17
11
13
0
15
11
11
2
1
1
5
30,690
coleifer/peewee
coleifer_peewee/peewee.py
peewee._BoundTableContext
from functools import wraps class _BoundTableContext(object): def __init__(self, table, database): self.table = table self.database = database def __call__(self, fn): @wraps(fn) def inner(*args, **kwargs): with _BoundTableContext(self.table, self.database): ...
class _BoundTableContext(object): def __init__(self, table, database): pass def __call__(self, fn): pass @wraps(fn) def inner(*args, **kwargs): pass def __enter__(self): pass def __exit__(self, exc_type, exc_val, exc_tb): pass
7
0
4
0
4
0
1
0
1
0
0
0
4
3
4
4
23
3
20
10
13
0
19
9
13
2
1
1
7
30,691
coleifer/peewee
coleifer_peewee/peewee.py
peewee._ConnectionState
class _ConnectionState(object): def __init__(self, **kwargs): super(_ConnectionState, self).__init__(**kwargs) self.reset() def reset(self): self.closed = True self.conn = None self.ctx = [] self.transactions = [] def set_connection(self, conn): sel...
class _ConnectionState(object): def __init__(self, **kwargs): pass def reset(self): pass def set_connection(self, conn): pass
4
0
4
0
4
0
1
0
1
1
0
1
3
4
3
3
16
2
14
8
10
0
14
8
10
1
1
0
3
30,692
coleifer/peewee
coleifer_peewee/peewee.py
peewee._DynamicColumn
class _DynamicColumn(object): __slots__ = () def __get__(self, instance, instance_type=None): if instance is not None: return ColumnFactory(instance) return self
class _DynamicColumn(object): def __get__(self, instance, instance_type=None): pass
2
0
4
0
4
1
2
0.17
1
1
1
0
1
0
1
1
7
1
6
3
4
1
6
3
4
2
1
1
2
30,693
coleifer/peewee
coleifer_peewee/peewee.py
peewee._DynamicEntity
class _DynamicEntity(object): __slots__ = () def __get__(self, instance, instance_type=None): if instance is not None: return EntityFactory(instance._alias) return self
class _DynamicEntity(object): def __get__(self, instance, instance_type=None): pass
2
0
4
0
4
1
2
0.17
1
1
1
0
1
0
1
1
6
0
6
3
4
1
6
3
4
2
1
1
2
30,694
coleifer/peewee
coleifer_peewee/peewee.py
peewee._ExplicitColumn
class _ExplicitColumn(object): __slots__ = () def __get__(self, instance, instance_type=None): if instance is not None: raise AttributeError('%s specifies columns explicitly, and does not support dynamic column lookups.' % instance) return self
class _ExplicitColumn(object): def __get__(self, instance, instance_type=None): pass
2
0
6
0
6
0
2
0
1
1
0
0
1
0
1
1
9
1
8
3
6
0
6
3
4
2
1
1
2
30,695
coleifer/peewee
coleifer_peewee/peewee.py
peewee._HashableSource
class _HashableSource(object): def __init__(self, *args, **kwargs): super(_HashableSource, self).__init__(*args, **kwargs) self._update_hash() @Node.copy def alias(self, name): self._alias = name self._update_hash() def _update_hash(self): self._hash = self._ge...
class _HashableSource(object): def __init__(self, *args, **kwargs): pass @Node.copy def alias(self, name): pass def _update_hash(self): pass def _get_hash(self): pass def __hash__(self): pass def __eq__(self, other): pass def __ne__(s...
11
0
3
0
3
0
1
0
1
2
1
4
8
2
8
8
37
7
30
17
19
0
29
16
19
2
1
1
11
30,696
coleifer/peewee
coleifer_peewee/peewee.py
peewee._InFunction
class _InFunction(Node): def __init__(self, node, in_function=True): self.node = node self.in_function = in_function def __sql__(self, ctx): with ctx(in_function=self.in_function): return ctx.sql(self.node)
class _InFunction(Node): def __init__(self, node, in_function=True): pass def __sql__(self, ctx): pass
3
0
3
0
3
0
1
0
1
0
0
0
2
2
2
8
8
1
7
5
4
0
7
5
4
1
2
1
2
30,697
coleifer/peewee
coleifer_peewee/peewee.py
peewee._ModelQueryHelper
class _ModelQueryHelper(object): default_row_type = ROW.MODEL def __init__(self, *args, **kwargs): super(_ModelQueryHelper, self).__init__(*args, **kwargs) if not self._database: self._database = self.model._meta.database @Node.copy def objects(self, constructor=None): ...
class _ModelQueryHelper(object): def __init__(self, *args, **kwargs): pass @Node.copy def objects(self, constructor=None): pass def _get_cursor_wrapper(self, cursor): pass def _get_model_cursor_wrapper(self, cursor): pass
6
0
6
0
6
0
3
0
1
6
4
3
4
3
4
4
32
4
28
11
22
0
20
10
15
6
1
1
11
30,698
coleifer/peewee
coleifer_peewee/peewee.py
peewee._ModelWriteQueryHelper
class _ModelWriteQueryHelper(_ModelQueryHelper): def __init__(self, model, *args, **kwargs): self.model = model super(_ModelWriteQueryHelper, self).__init__(model, *args, **kwargs) def returning(self, *returning): accum = [] for item in returning: if is_model(item):...
class _ModelWriteQueryHelper(_ModelQueryHelper): def __init__(self, model, *args, **kwargs): pass def returning(self, *returning): pass def _set_table_alias(self, ctx): pass
4
0
5
0
5
0
2
0
1
1
0
3
3
1
3
7
17
2
15
8
11
0
14
8
10
3
2
2
5
30,699
coleifer/peewee
coleifer_peewee/peewee.py
peewee._Namespace
class _Namespace(Node): __slots__ = ('_name',) def __init__(self, name): self._name = name def __getattr__(self, attr): return NamespaceAttribute(self, attr) __getitem__ = __getattr__
class _Namespace(Node): def __init__(self, name): pass def __getattr__(self, attr): pass
3
0
2
0
2
0
1
0
1
1
1
0
2
1
2
8
7
0
7
6
4
0
7
6
4
1
2
0
2