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,700 | coleifer/peewee | coleifer_peewee/peewee.py | peewee._NoopLock | class _NoopLock(object):
__slots__ = ()
def __enter__(self):
return self
def __exit__(self, exc_type, exc_val, exc_tb):
pass | class _NoopLock(object):
def __enter__(self):
pass
def __exit__(self, exc_type, exc_val, exc_tb):
pass | 3 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 2 | 0 | 2 | 2 | 4 | 0 | 4 | 4 | 3 | 0 | 6 | 4 | 3 | 1 | 1 | 0 | 2 |
30,701 | coleifer/peewee | coleifer_peewee/peewee.py | peewee._SortedFieldList | from bisect import bisect_left
from bisect import bisect_right
class _SortedFieldList(object):
__slots__ = ('_keys', '_items')
def __init__(self):
self._keys = []
self._items = []
def __getitem__(self, i):
return self._items[i]
def __iter__(self):
return iter(self._it... |
class _SortedFieldList(object):
def __init__(self):
pass
def __getitem__(self, i):
pass
def __iter__(self):
pass
def __contains__(self, item):
pass
def index(self, field):
pass
def insert(self, item):
pass
def remove(self, item):
... | 8 | 0 | 3 | 0 | 3 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 7 | 2 | 7 | 7 | 32 | 7 | 25 | 17 | 17 | 0 | 25 | 17 | 17 | 1 | 1 | 0 | 7 |
30,702 | coleifer/peewee | coleifer_peewee/peewee.py | peewee._StringField | class _StringField(Field):
def adapt(self, value):
if isinstance(value, text_type):
return value
elif isinstance(value, bytes_type):
return value.decode('utf-8')
return text_type(value)
def __add__(self, other):
return StringExpression(self, OP.CONCAT, o... | class _StringField(Field):
def adapt(self, value):
pass
def __add__(self, other):
pass
def __radd__(self, other):
pass | 4 | 0 | 3 | 0 | 3 | 0 | 2 | 0 | 1 | 1 | 1 | 2 | 3 | 0 | 3 | 45 | 10 | 1 | 9 | 4 | 7 | 0 | 10 | 4 | 6 | 3 | 4 | 1 | 5 |
30,703 | coleifer/peewee | coleifer_peewee/peewee.py | peewee._WriteQuery | class _WriteQuery(Query):
def __init__(self, table, returning=None, **kwargs):
self.table = table
self._returning = returning
self._return_cursor = True if returning else False
super(_WriteQuery, self).__init__(**kwargs)
def cte(self, name, recursive=False, columns=None, materi... | class _WriteQuery(Query):
def __init__(self, table, returning=None, **kwargs):
pass
def cte(self, name, recursive=False, columns=None, materialized=None):
pass
@Node.copy
def returning(self, *returning):
pass
def apply_returning(self, ctx):
pass
def _execute(s... | 11 | 0 | 4 | 0 | 4 | 0 | 2 | 0.08 | 1 | 2 | 1 | 3 | 9 | 4 | 9 | 44 | 50 | 8 | 39 | 17 | 28 | 3 | 36 | 16 | 26 | 2 | 4 | 2 | 15 |
30,704 | coleifer/peewee | coleifer_peewee/peewee.py | peewee._atomic | from functools import wraps
class _atomic(object):
def __init__(self, db, *args, **kwargs):
self.db = db
self._transaction_args = (args, kwargs)
def __call__(self, fn):
@wraps(fn)
def inner(*args, **kwargs):
a, k = self._transaction_args
with _atomic(s... |
class _atomic(object):
def __init__(self, db, *args, **kwargs):
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 | 5 | 0 | 5 | 0 | 1 | 0 | 1 | 2 | 1 | 1 | 4 | 3 | 4 | 4 | 26 | 3 | 23 | 12 | 16 | 0 | 19 | 11 | 13 | 3 | 1 | 1 | 7 |
30,705 | coleifer/peewee | coleifer_peewee/peewee.py | peewee._callable_context_manager | from functools import wraps
class _callable_context_manager(object):
def __call__(self, fn):
@wraps(fn)
def inner(*args, **kwargs):
with self:
return fn(*args, **kwargs)
return inner |
class _callable_context_manager(object):
def __call__(self, fn):
pass
@wraps(fn)
def inner(*args, **kwargs):
pass | 4 | 0 | 5 | 0 | 5 | 0 | 1 | 0 | 1 | 0 | 0 | 1 | 1 | 0 | 1 | 1 | 7 | 0 | 7 | 4 | 3 | 0 | 6 | 3 | 3 | 1 | 1 | 1 | 2 |
30,706 | coleifer/peewee | coleifer_peewee/peewee.py | peewee._manual | from functools import wraps
class _manual(object):
def __init__(self, db):
self.db = db
def __call__(self, fn):
@wraps(fn)
def inner(*args, **kwargs):
with _manual(self.db):
return fn(*args, **kwargs)
return inner
def __enter__(self):
... |
class _manual(object):
def __init__(self, db):
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 | 1 | 0 | 0 | 4 | 1 | 4 | 4 | 22 | 3 | 19 | 9 | 12 | 0 | 16 | 8 | 10 | 2 | 1 | 1 | 7 |
30,707 | coleifer/peewee | coleifer_peewee/peewee.py | peewee._savepoint | from functools import wraps
import uuid
class _savepoint(object):
def __init__(self, db, sid=None):
self.db = db
self.sid = sid or 's' + uuid.uuid4().hex
self.quoted_sid = self.sid.join(self.db.quote)
def __call__(self, fn):
@wraps(fn)
def inner(*args, **kwargs):
... |
class _savepoint(object):
def __init__(self, db, sid=None):
pass
def __call__(self, fn):
pass
@wraps(fn)
def inner(*args, **kwargs):
pass
def _begin(self):
pass
def commit(self, begin=True):
pass
def rollback(self):
pass
... | 10 | 0 | 4 | 0 | 4 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 7 | 3 | 7 | 7 | 36 | 6 | 30 | 13 | 20 | 0 | 29 | 12 | 20 | 3 | 1 | 2 | 11 |
30,708 | coleifer/peewee | coleifer_peewee/peewee.py | peewee._transaction | from functools import wraps
class _transaction(object):
def __init__(self, db, *args, **kwargs):
self.db = db
self._begin_args = (args, kwargs)
def __call__(self, fn):
@wraps(fn)
def inner(*args, **kwargs):
a, k = self._begin_args
with _transaction(sel... |
class _transaction(object):
def __init__(self, db, *args, **kwargs):
pass
def __call__(self, fn):
pass
@wraps(fn)
def inner(*args, **kwargs):
pass
def _begin(self):
pass
def commit(self, begin=True):
pass
def rollback(self, begin=... | 10 | 0 | 5 | 0 | 5 | 0 | 2 | 0 | 1 | 0 | 0 | 1 | 7 | 2 | 7 | 7 | 46 | 6 | 40 | 15 | 30 | 0 | 37 | 14 | 28 | 4 | 1 | 3 | 14 |
30,709 | coleifer/peewee | coleifer_peewee/peewee.py | peewee.attrdict | class attrdict(dict):
def __getattr__(self, attr):
try:
return self[attr]
except KeyError:
raise AttributeError(attr)
def __setattr__(self, attr, value):
self[attr] = value
def __iadd__(self, rhs):
self.update(rhs)
return self
def __add... | class attrdict(dict):
def __getattr__(self, attr):
pass
def __setattr__(self, attr, value):
pass
def __iadd__(self, rhs):
pass
def __add__(self, rhs):
pass | 5 | 0 | 2 | 0 | 2 | 0 | 1 | 0 | 1 | 2 | 0 | 0 | 4 | 0 | 4 | 31 | 9 | 0 | 9 | 5 | 7 | 0 | 15 | 6 | 10 | 2 | 2 | 1 | 5 |
30,710 | coleifer/peewee | coleifer_peewee/playhouse/apsw_ext.py | playhouse.apsw_ext.APSWDatabase | from playhouse.sqlite_ext import SqliteExtDatabase
from peewee import Insert
import apsw
from peewee import logger
from peewee import __exception_wrapper__
class APSWDatabase(SqliteExtDatabase):
server_version = tuple((int(i) for i in apsw.sqlitelibversion().split('.')))
def __init__(self, database, **kwargs)... |
class APSWDatabase(SqliteExtDatabase):
def __init__(self, database, **kwargs):
pass
def register_module(self, mod_name, mod_inst):
pass
def unregister_module(self, mod_name):
pass
def _connect(self):
pass
def _add_conn_hooks(self, conn):
pass
def _l... | 19 | 0 | 5 | 0 | 5 | 0 | 2 | 0.02 | 1 | 5 | 1 | 0 | 17 | 1 | 17 | 132 | 103 | 17 | 86 | 32 | 67 | 2 | 85 | 32 | 66 | 4 | 5 | 2 | 34 |
30,711 | coleifer/peewee | coleifer_peewee/playhouse/apsw_ext.py | playhouse.apsw_ext.BooleanField | from peewee import BooleanField as _BooleanField
class BooleanField(_BooleanField):
def db_value(self, v):
v = super(BooleanField, self).db_value(v)
if v is not None:
return v and 1 or 0 |
class BooleanField(_BooleanField):
def db_value(self, v):
pass | 2 | 0 | 4 | 0 | 4 | 0 | 2 | 0 | 1 | 1 | 0 | 0 | 1 | 0 | 1 | 43 | 5 | 0 | 5 | 2 | 3 | 0 | 5 | 2 | 3 | 2 | 5 | 1 | 2 |
30,712 | coleifer/peewee | coleifer_peewee/playhouse/apsw_ext.py | playhouse.apsw_ext.DateField | from peewee import DateField as _DateField
class DateField(_DateField):
db_value = nh |
class DateField(_DateField):
pass | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 46 | 2 | 0 | 2 | 2 | 1 | 0 | 2 | 2 | 1 | 0 | 6 | 0 | 0 |
30,713 | coleifer/peewee | coleifer_peewee/playhouse/apsw_ext.py | playhouse.apsw_ext.DateTimeField | from peewee import DateTimeField as _DateTimeField
class DateTimeField(_DateTimeField):
db_value = nh |
class DateTimeField(_DateTimeField):
pass | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 46 | 2 | 0 | 2 | 2 | 1 | 0 | 2 | 2 | 1 | 0 | 6 | 0 | 0 |
30,714 | coleifer/peewee | coleifer_peewee/playhouse/apsw_ext.py | playhouse.apsw_ext.DecimalField | from peewee import DecimalField as _DecimalField
class DecimalField(_DecimalField):
db_value = nh |
class DecimalField(_DecimalField):
pass | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 46 | 2 | 0 | 2 | 2 | 1 | 0 | 2 | 2 | 1 | 0 | 5 | 0 | 0 |
30,715 | coleifer/peewee | coleifer_peewee/playhouse/apsw_ext.py | playhouse.apsw_ext.TimeField | from peewee import TimeField as _TimeField
class TimeField(_TimeField):
db_value = nh |
class TimeField(_TimeField):
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,716 | coleifer/peewee | coleifer_peewee/playhouse/cockroachdb.py | playhouse.cockroachdb.CockroachDatabase | from peewee import NodeList
from peewee import Entity
import re
from peewee import EnclosedNodeList
import functools
class CockroachDatabase(PostgresqlDatabase):
field_types = PostgresqlDatabase.field_types.copy()
field_types.update({'BLOB': 'BYTES'})
release_after_rollback = True
def __init__(self, d... |
class CockroachDatabase(PostgresqlDatabase):
def __init__(self, database, *args, **kwargs):
pass
def _set_server_version(self, conn):
pass
def _get_pk_constraint(self, table, schema=None):
pass
def get_indexes(self, table, schema=None):
pass
def conflict_stateme... | 17 | 0 | 7 | 0 | 7 | 1 | 2 | 0.13 | 1 | 9 | 4 | 1 | 13 | 1 | 13 | 96 | 121 | 16 | 96 | 34 | 77 | 12 | 78 | 31 | 62 | 7 | 4 | 2 | 33 |
30,717 | coleifer/peewee | coleifer_peewee/playhouse/cockroachdb.py | playhouse.cockroachdb.ExceededMaxAttempts | class ExceededMaxAttempts(OperationalError):
pass | class ExceededMaxAttempts(OperationalError):
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 | 6 | 0 | 0 |
30,718 | coleifer/peewee | coleifer_peewee/playhouse/cockroachdb.py | playhouse.cockroachdb.PooledCockroachDatabase | from playhouse.pool import _PooledPostgresqlDatabase
class PooledCockroachDatabase(_PooledPostgresqlDatabase, CockroachDatabase):
pass |
class PooledCockroachDatabase(_PooledPostgresqlDatabase, CockroachDatabase):
pass | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 | 0 | 0 | 0 | 0 | 0 | 0 | 110 | 2 | 0 | 2 | 1 | 1 | 0 | 2 | 1 | 1 | 0 | 5 | 0 | 0 |
30,719 | coleifer/peewee | coleifer_peewee/playhouse/cockroachdb.py | playhouse.cockroachdb.RowIDField | class RowIDField(AutoField):
field_type = 'INT'
def __init__(self, *args, **kwargs):
if kwargs.get('constraints'):
raise ValueError('%s cannot specify constraints.' % type(self))
kwargs['constraints'] = [SQL('DEFAULT unique_rowid()')]
super(RowIDField, self).__init__(*args, ... | class RowIDField(AutoField):
def __init__(self, *args, **kwargs):
pass | 2 | 0 | 5 | 0 | 5 | 0 | 2 | 0 | 1 | 4 | 1 | 0 | 1 | 0 | 1 | 45 | 8 | 1 | 7 | 3 | 5 | 0 | 7 | 3 | 5 | 2 | 6 | 1 | 2 |
30,720 | coleifer/peewee | coleifer_peewee/playhouse/cockroachdb.py | playhouse.cockroachdb.UUIDKeyField | class UUIDKeyField(UUIDField):
auto_increment = True
def __init__(self, *args, **kwargs):
if kwargs.get('constraints'):
raise ValueError('%s cannot specify constraints.' % type(self))
kwargs['constraints'] = [SQL('DEFAULT gen_random_uuid()')]
kwargs.setdefault('primary_key',... | class UUIDKeyField(UUIDField):
def __init__(self, *args, **kwargs):
pass | 2 | 0 | 6 | 0 | 6 | 0 | 2 | 0 | 1 | 4 | 1 | 0 | 1 | 0 | 1 | 45 | 9 | 1 | 8 | 3 | 6 | 0 | 8 | 3 | 6 | 2 | 5 | 1 | 2 |
30,721 | coleifer/peewee | coleifer_peewee/playhouse/cockroachdb.py | playhouse.cockroachdb._crdb_atomic | from peewee import _manual
from peewee import _atomic
class _crdb_atomic(_atomic):
def __enter__(self):
if self.db.transaction_depth() > 0:
if not isinstance(self.db.top_transaction(), _manual):
raise NotImplementedError(TXN_ERR_MSG)
return super(_crdb_atomic, self).__e... |
class _crdb_atomic(_atomic):
def __enter__(self):
pass | 2 | 0 | 5 | 0 | 5 | 0 | 3 | 0 | 1 | 3 | 1 | 0 | 1 | 0 | 1 | 5 | 6 | 0 | 6 | 2 | 4 | 0 | 6 | 2 | 4 | 3 | 2 | 2 | 3 |
30,722 | coleifer/peewee | coleifer_peewee/playhouse/dataset.py | playhouse.dataset.CSVExporter | import csv
class CSVExporter(Exporter):
def export(self, file_obj, header=True, **kwargs):
writer = csv.writer(file_obj, **kwargs)
tuples = self.query.tuples().execute()
tuples.initialize()
if header and getattr(tuples, 'columns', None):
writer.writerow([column for colu... |
class CSVExporter(Exporter):
def export(self, file_obj, header=True, **kwargs):
pass | 2 | 0 | 8 | 0 | 8 | 0 | 3 | 0 | 1 | 0 | 0 | 1 | 1 | 0 | 1 | 3 | 9 | 0 | 9 | 5 | 7 | 0 | 9 | 5 | 7 | 3 | 2 | 1 | 3 |
30,723 | coleifer/peewee | coleifer_peewee/playhouse/dataset.py | playhouse.dataset.CSVImporter | import csv
class CSVImporter(Importer):
def load(self, file_obj, header=True, **kwargs):
count = 0
reader = csv.reader(file_obj, **kwargs)
if header:
try:
header_keys = next(reader)
except StopIteration:
return count
if se... |
class CSVImporter(Importer):
def load(self, file_obj, header=True, **kwargs):
pass | 2 | 0 | 34 | 5 | 29 | 0 | 10 | 0 | 1 | 3 | 0 | 1 | 1 | 0 | 1 | 3 | 35 | 5 | 30 | 10 | 28 | 0 | 27 | 10 | 25 | 10 | 2 | 4 | 10 |
30,724 | coleifer/peewee | coleifer_peewee/playhouse/dataset.py | playhouse.dataset.DataSet | from playhouse.reflection import Introspector
from playhouse.migrate import SchemaMigrator
from playhouse.db_url import connect
class DataSet(object):
def __init__(self, url, include_views=False, **kwargs):
if isinstance(url, Database):
self._url = None
self._database = url
... |
class DataSet(object):
def __init__(self, url, include_views=False, **kwargs):
pass
class BaseModel(Model):
class Meta:
def __repr__(self):
pass
def get_export_formats(self):
pass
def get_import_formats(self):
pass
def __getitem__(self, tab... | 24 | 0 | 7 | 0 | 7 | 0 | 2 | 0.03 | 1 | 13 | 11 | 0 | 19 | 10 | 19 | 19 | 158 | 27 | 128 | 52 | 102 | 4 | 102 | 47 | 80 | 4 | 1 | 3 | 35 |
30,725 | coleifer/peewee | coleifer_peewee/playhouse/dataset.py | playhouse.dataset.Exporter | class Exporter(object):
def __init__(self, query):
self.query = query
def export(self, file_obj):
raise NotImplementedError | class Exporter(object):
def __init__(self, query):
pass
def export(self, file_obj):
pass | 3 | 0 | 2 | 0 | 2 | 0 | 1 | 0 | 1 | 1 | 0 | 2 | 2 | 1 | 2 | 2 | 6 | 1 | 5 | 4 | 2 | 0 | 5 | 4 | 2 | 1 | 1 | 0 | 2 |
30,726 | coleifer/peewee | coleifer_peewee/playhouse/dataset.py | playhouse.dataset.Importer | class Importer(object):
def __init__(self, table, strict=False):
self.table = table
self.strict = strict
model = self.table.model_class
self.columns = model._meta.columns
self.columns.update(model._meta.fields)
def load(self, file_obj):
raise NotImplementedError | class Importer(object):
def __init__(self, table, strict=False):
pass
def load(self, file_obj):
pass | 3 | 0 | 5 | 1 | 4 | 0 | 1 | 0 | 1 | 1 | 0 | 2 | 2 | 3 | 2 | 2 | 11 | 2 | 9 | 7 | 6 | 0 | 9 | 7 | 6 | 1 | 1 | 0 | 2 |
30,727 | coleifer/peewee | coleifer_peewee/playhouse/dataset.py | playhouse.dataset.JSONExporter | import uuid
from decimal import Decimal
import datetime
import json
class JSONExporter(Exporter):
def __init__(self, query, iso8601_datetimes=False):
super(JSONExporter, self).__init__(query)
self.iso8601_datetimes = iso8601_datetimes
def _make_default(self):
datetime_types = (datetim... |
class JSONExporter(Exporter):
def __init__(self, query, iso8601_datetimes=False):
pass
def _make_default(self):
pass
def default(o):
pass
def default(o):
pass
def export(self, file_obj, **kwargs):
pass | 6 | 0 | 7 | 0 | 7 | 0 | 2 | 0 | 1 | 9 | 0 | 0 | 3 | 2 | 3 | 5 | 28 | 3 | 25 | 9 | 19 | 0 | 19 | 8 | 13 | 3 | 2 | 1 | 9 |
30,728 | coleifer/peewee | coleifer_peewee/playhouse/dataset.py | playhouse.dataset.JSONImporter | import json
class JSONImporter(Importer):
def load(self, file_obj, **kwargs):
data = json.load(file_obj, **kwargs)
count = 0
for row in data:
if self.strict:
obj = {}
for key in row:
field = self.columns.get(key)
... |
class JSONImporter(Importer):
def load(self, file_obj, **kwargs):
pass | 2 | 0 | 19 | 3 | 16 | 0 | 6 | 0 | 1 | 0 | 0 | 0 | 1 | 0 | 1 | 3 | 20 | 3 | 17 | 8 | 15 | 0 | 16 | 8 | 14 | 6 | 2 | 4 | 6 |
30,729 | coleifer/peewee | coleifer_peewee/playhouse/dataset.py | playhouse.dataset.TSVExporter | class TSVExporter(CSVExporter):
def export(self, file_obj, header=True, **kwargs):
kwargs.setdefault('delimiter', '\t')
return super(TSVExporter, self).export(file_obj, header, **kwargs) | class TSVExporter(CSVExporter):
def export(self, file_obj, header=True, **kwargs):
pass | 2 | 0 | 3 | 0 | 3 | 0 | 1 | 0 | 1 | 1 | 0 | 0 | 1 | 0 | 1 | 4 | 4 | 0 | 4 | 2 | 2 | 0 | 4 | 2 | 2 | 1 | 3 | 0 | 1 |
30,730 | coleifer/peewee | coleifer_peewee/playhouse/dataset.py | playhouse.dataset.TSVImporter | class TSVImporter(CSVImporter):
def load(self, file_obj, header=True, **kwargs):
kwargs.setdefault('delimiter', '\t')
return super(TSVImporter, self).load(file_obj, header, **kwargs) | class TSVImporter(CSVImporter):
def load(self, file_obj, header=True, **kwargs):
pass | 2 | 0 | 3 | 0 | 3 | 0 | 1 | 0 | 1 | 1 | 0 | 0 | 1 | 0 | 1 | 4 | 4 | 0 | 4 | 2 | 2 | 0 | 4 | 2 | 2 | 1 | 3 | 0 | 1 |
30,731 | coleifer/peewee | coleifer_peewee/playhouse/dataset.py | playhouse.dataset.Table | import datetime
import operator
from playhouse.migrate import migrate
from decimal import Decimal
class Table(object):
def __init__(self, dataset, name, model_class):
self.dataset = dataset
self.name = name
if model_class is None:
model_class = self._create_model()
... |
class Table(object):
def __init__(self, dataset, name, model_class):
pass
@property
def model_class(self):
pass
def __repr__(self):
pass
def __len__(self):
pass
def __iter__(self):
pass
def _create_model(self):
pass
class Meta:
... | 27 | 0 | 5 | 0 | 5 | 0 | 2 | 0 | 1 | 19 | 9 | 0 | 23 | 2 | 23 | 23 | 141 | 27 | 114 | 41 | 87 | 0 | 99 | 38 | 74 | 7 | 1 | 2 | 39 |
30,732 | coleifer/peewee | coleifer_peewee/playhouse/fields.py | playhouse.fields.CompressedField | from peewee import BlobField
class CompressedField(BlobField):
ZLIB = 'zlib'
BZ2 = 'bz2'
algorithm_to_import = {ZLIB: zlib, BZ2: bz2}
def __init__(self, compression_level=6, algorithm=ZLIB, *args, **kwargs):
self.compression_level = compression_level
if algorithm not in self.algorithm_... |
class CompressedField(BlobField):
def __init__(self, compression_level=6, algorithm=ZLIB, *args, **kwargs):
pass
def python_value(self, value):
pass
def db_value(self, value):
pass | 4 | 0 | 7 | 0 | 6 | 0 | 2 | 0 | 1 | 2 | 0 | 0 | 3 | 4 | 3 | 48 | 30 | 4 | 26 | 13 | 21 | 0 | 21 | 12 | 17 | 3 | 5 | 1 | 7 |
30,733 | coleifer/peewee | coleifer_peewee/playhouse/fields.py | playhouse.fields.PickleField | from peewee import buffer_type
from peewee import BlobField
class PickleField(BlobField):
def python_value(self, value):
if value is not None:
if isinstance(value, buffer_type):
value = bytes(value)
return pickle.loads(value)
def db_value(self, value):
... |
class PickleField(BlobField):
def python_value(self, value):
pass
def db_value(self, value):
pass | 3 | 0 | 5 | 0 | 5 | 0 | 3 | 0 | 1 | 1 | 0 | 0 | 2 | 0 | 2 | 47 | 11 | 1 | 10 | 4 | 7 | 0 | 10 | 4 | 7 | 3 | 5 | 2 | 5 |
30,734 | coleifer/peewee | coleifer_peewee/playhouse/flask_utils.py | playhouse.flask_utils.FlaskDB | from playhouse.db_url import connect as db_url_connect
from peewee import Proxy
from peewee import Database
from flask import request
from peewee import Model
import sys
class FlaskDB(object):
"""
Convenience wrapper for configuring a Peewee database for use with a Flask
application. Provides a base `Model... |
class FlaskDB(object):
'''
Convenience wrapper for configuring a Peewee database for use with a Flask
application. Provides a base `Model` class and registers handlers to manage
the database connection during the request/response cycle.
Usage::
from flask import Flask
from peewee im... | 13 | 1 | 11 | 1 | 10 | 0 | 3 | 0.35 | 1 | 10 | 3 | 0 | 9 | 6 | 9 | 9 | 146 | 28 | 89 | 29 | 75 | 31 | 77 | 27 | 65 | 6 | 1 | 2 | 29 |
30,735 | coleifer/peewee | coleifer_peewee/playhouse/flask_utils.py | playhouse.flask_utils.PaginatedQuery | import math
from peewee import SelectQuery
from flask import request
from flask import abort
class PaginatedQuery(object):
def __init__(self, query_or_model, paginate_by, page_var='page', page=None, check_bounds=False):
self.paginate_by = paginate_by
self.page_var = page_var
self.page = pa... |
class PaginatedQuery(object):
def __init__(self, query_or_model, paginate_by, page_var='page', page=None, check_bounds=False):
pass
def get_page(self):
pass
def get_page_count(self):
pass
def get_object_list(self):
pass
def get_page_range(self, page, total, show... | 6 | 0 | 8 | 0 | 7 | 1 | 2 | 0.09 | 1 | 5 | 1 | 0 | 5 | 7 | 5 | 5 | 43 | 6 | 34 | 17 | 27 | 3 | 31 | 16 | 25 | 3 | 1 | 1 | 10 |
30,736 | coleifer/peewee | coleifer_peewee/playhouse/hybrid.py | playhouse.hybrid.hybrid_method | from peewee import ModelDescriptor
class hybrid_method(ModelDescriptor):
def __init__(self, func, expr=None):
self.func = func
self.expr = expr or func
def __get__(self, instance, instance_type):
if instance is None:
return self.expr.__get__(instance_type, instance_type.__... |
class hybrid_method(ModelDescriptor):
def __init__(self, func, expr=None):
pass
def __get__(self, instance, instance_type):
pass
def expression(self, expr):
pass | 4 | 0 | 3 | 0 | 3 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 3 | 2 | 3 | 3 | 13 | 2 | 11 | 6 | 7 | 0 | 11 | 6 | 7 | 2 | 2 | 1 | 4 |
30,737 | coleifer/peewee | coleifer_peewee/playhouse/hybrid.py | playhouse.hybrid.hybrid_property | from peewee import ModelDescriptor
class hybrid_property(ModelDescriptor):
def __init__(self, fget, fset=None, fdel=None, expr=None):
self.fget = fget
self.fset = fset
self.fdel = fdel
self.expr = expr or fget
def __get__(self, instance, instance_type):
if instance is ... |
class hybrid_property(ModelDescriptor):
def __init__(self, fget, fset=None, fdel=None, expr=None):
pass
def __get__(self, instance, instance_type):
pass
def __set__(self, instance, value):
pass
def __delete__(self, instance):
pass
def setter(self, fset):
... | 8 | 0 | 4 | 0 | 4 | 0 | 1 | 0 | 1 | 1 | 0 | 0 | 7 | 4 | 7 | 7 | 33 | 6 | 27 | 12 | 19 | 0 | 27 | 12 | 19 | 2 | 2 | 1 | 10 |
30,738 | coleifer/peewee | coleifer_peewee/playhouse/kv.py | playhouse.kv.KeyValue | from peewee import Expression
import operator
from playhouse.fields import PickleField
class KeyValue(object):
"""
Persistent dictionary.
:param Field key_field: field to use for key. Defaults to CharField.
:param Field value_field: field to use for value. Defaults to PickleField.
:param bool orde... |
class KeyValue(object):
'''
Persistent dictionary.
:param Field key_field: field to use for key. Defaults to CharField.
:param Field value_field: field to use for value. Defaults to PickleField.
:param bool ordered: data should be returned in key-sorted order.
:param Database database: database... | 24 | 1 | 6 | 0 | 6 | 0 | 2 | 0.07 | 1 | 11 | 6 | 0 | 21 | 10 | 21 | 21 | 161 | 26 | 126 | 48 | 101 | 9 | 104 | 47 | 80 | 5 | 1 | 3 | 36 |
30,739 | coleifer/peewee | coleifer_peewee/playhouse/kv.py | playhouse.kv.KeyValue.create_model.KeyValue | from playhouse.fields import PickleField
from peewee import Expression
import operator
class KeyValue(object):
"""
Persistent dictionary.
:param Field key_field: field to use for key. Defaults to CharField.
:param Field value_field: field to use for value. Defaults to PickleField.
:param bool orde... |
class KeyValue(object):
'''
Persistent dictionary.
:param Field key_field: field to use for key. Defaults to CharField.
:param Field value_field: field to use for value. Defaults to PickleField.
:param bool ordered: data should be returned in key-sorted order.
:param Database database: database... | 24 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 47 | 6 | 0 | 6 | 6 | 4 | 0 | 6 | 6 | 4 | 0 | 2 | 0 | 0 |
30,740 | coleifer/peewee | coleifer_peewee/playhouse/migrate.py | playhouse.migrate.CockroachDBMigrator | from peewee import Entity
class CockroachDBMigrator(PostgresqlMigrator):
explicit_create_foreign_key = True
def add_inline_fk_sql(self, ctx, field):
pass
@operation
def drop_index(self, table, index_name):
return self.make_context().literal('DROP INDEX ').sql(Entity(index_name)).liter... |
class CockroachDBMigrator(PostgresqlMigrator):
def add_inline_fk_sql(self, ctx, field):
pass
@operation
def drop_index(self, table, index_name):
pass | 4 | 0 | 4 | 0 | 4 | 0 | 1 | 0 | 1 | 1 | 1 | 0 | 2 | 0 | 2 | 29 | 13 | 2 | 11 | 5 | 7 | 0 | 6 | 4 | 3 | 1 | 3 | 0 | 2 |
30,741 | coleifer/peewee | coleifer_peewee/playhouse/migrate.py | playhouse.migrate.MySQLColumn | from peewee import Entity
from collections import namedtuple
from peewee import NodeList
class MySQLColumn(namedtuple('_Column', ('name', 'definition', 'null', 'pk', 'default', 'extra'))):
@property
def is_pk(self):
return self.pk == 'PRI'
@property
def is_unique(self):
return self.pk... |
class MySQLColumn(namedtuple('_Column', ('name', 'definition', 'null', 'pk', 'default', 'extra'))):
@property
def is_pk(self):
pass
@property
def is_unique(self):
pass
@property
def is_null(self):
pass
def sql(self, column_name=None, is_null=None):
pass | 8 | 0 | 6 | 0 | 6 | 0 | 3 | 0 | 1 | 3 | 3 | 0 | 4 | 0 | 4 | 9 | 33 | 3 | 30 | 10 | 21 | 0 | 23 | 6 | 18 | 7 | 1 | 1 | 10 |
30,742 | coleifer/peewee | coleifer_peewee/playhouse/migrate.py | playhouse.migrate.MySQLMigrator | from peewee import Entity
class MySQLMigrator(SchemaMigrator):
explicit_create_foreign_key = True
explicit_delete_foreign_key = True
def _alter_column(self, ctx, table, column):
return self._alter_table(ctx, table).literal(' MODIFY ').sql(Entity(column))
@operation
def rename_table(self, ... |
class MySQLMigrator(SchemaMigrator):
def _alter_column(self, ctx, table, column):
pass
@operation
def rename_table(self, old_name, new_name):
pass
def _get_column_definition(self, table, column_name):
pass
def get_foreign_key_constraint(self, table, column_name):
... | 19 | 0 | 11 | 0 | 10 | 0 | 2 | 0 | 1 | 5 | 2 | 0 | 11 | 0 | 11 | 35 | 138 | 14 | 124 | 38 | 105 | 0 | 55 | 31 | 43 | 3 | 2 | 2 | 18 |
30,743 | coleifer/peewee | coleifer_peewee/playhouse/migrate.py | playhouse.migrate.Operation | from peewee import Node
class Operation(object):
"""Encapsulate a single schema altering operation."""
def __init__(self, migrator, method, *args, **kwargs):
self.migrator = migrator
self.method = method
self.args = args
self.kwargs = kwargs
def execute(self, node):
... |
class Operation(object):
'''Encapsulate a single schema altering operation.'''
def __init__(self, migrator, method, *args, **kwargs):
pass
def execute(self, node):
pass
def _handle_result(self, result):
pass
def run(self):
pass | 5 | 1 | 5 | 0 | 5 | 0 | 2 | 0.05 | 1 | 4 | 2 | 0 | 4 | 4 | 4 | 4 | 25 | 3 | 21 | 12 | 16 | 1 | 19 | 12 | 14 | 5 | 1 | 2 | 8 |
30,744 | coleifer/peewee | coleifer_peewee/playhouse/migrate.py | playhouse.migrate.PostgresqlMigrator | class PostgresqlMigrator(SchemaMigrator):
def _primary_key_columns(self, tbl):
query = "\n SELECT pg_attribute.attname\n FROM pg_index, pg_class, pg_attribute\n WHERE\n pg_class.oid = '%s'::regclass AND\n indrelid = pg_class.oid AND\n ... | class PostgresqlMigrator(SchemaMigrator):
def _primary_key_columns(self, tbl):
pass
@operation
def set_search_path(self, schema_name):
pass
@operation
def rename_table(self, old_name, new_name):
pass | 6 | 0 | 13 | 1 | 12 | 0 | 2 | 0.03 | 1 | 2 | 0 | 1 | 3 | 0 | 3 | 27 | 44 | 5 | 38 | 15 | 32 | 1 | 19 | 13 | 15 | 3 | 2 | 2 | 5 |
30,745 | coleifer/peewee | coleifer_peewee/playhouse/migrate.py | playhouse.migrate.SchemaMigrator | from peewee import _truncate_constraint_name
from peewee import EnclosedNodeList
from peewee import NodeList
from peewee import OP
from peewee import Entity
from peewee import Expression
from peewee import callable_
from peewee import Node
class SchemaMigrator(object):
explicit_create_foreign_key = False
expli... |
class SchemaMigrator(object):
def __init__(self, database):
pass
def make_context(self):
pass
@classmethod
def from_database(cls, database):
pass
@operation
def apply_default(self, table, column_name, field):
pass
def _alter_table(self, ctx, table):
... | 44 | 0 | 10 | 1 | 8 | 1 | 2 | 0.05 | 1 | 19 | 16 | 3 | 23 | 1 | 24 | 24 | 274 | 38 | 224 | 67 | 178 | 12 | 117 | 46 | 92 | 6 | 1 | 2 | 47 |
30,746 | coleifer/peewee | coleifer_peewee/playhouse/migrate.py | playhouse.migrate.SqliteMigrator | from peewee import CommaNodeList
from peewee import NodeList
from peewee import EnclosedNodeList
from peewee import Entity
from peewee import callable_
from peewee import sqlite3
import re
class SqliteMigrator(SchemaMigrator):
"""
SQLite supports a subset of ALTER TABLE queries, view the docs for the
full ... |
class SqliteMigrator(SchemaMigrator):
'''
SQLite supports a subset of ALTER TABLE queries, view the docs for the
full details http://sqlite.org/lang_altertable.html
'''
def _get_column_names(self, table):
pass
def _get_create_table(self, table):
pass
@operation
def _up... | 35 | 1 | 12 | 1 | 9 | 1 | 2 | 0.18 | 1 | 10 | 3 | 0 | 14 | 0 | 14 | 38 | 248 | 38 | 178 | 75 | 145 | 32 | 132 | 63 | 111 | 15 | 2 | 3 | 44 |
30,747 | coleifer/peewee | coleifer_peewee/playhouse/mysql_ext.py | playhouse.mysql_ext.JSONField | import json
from peewee import TextField
from peewee import fn
from peewee import Node
class JSONField(TextField):
field_type = 'JSON'
def __init__(self, json_dumps=None, json_loads=None, **kwargs):
self._json_dumps = json_dumps or json.dumps
self._json_loads = json_loads or json.loads
... |
class JSONField(TextField):
def __init__(self, json_dumps=None, json_loads=None, **kwargs):
pass
def python_value(self, value):
pass
def db_value(self, value):
pass
def extract(self, path):
pass | 5 | 0 | 4 | 0 | 4 | 0 | 2 | 0 | 1 | 3 | 0 | 0 | 4 | 2 | 4 | 49 | 23 | 4 | 19 | 8 | 14 | 0 | 19 | 8 | 14 | 3 | 6 | 2 | 8 |
30,748 | coleifer/peewee | coleifer_peewee/playhouse/mysql_ext.py | playhouse.mysql_ext.MariaDBConnectorDatabase | from peewee import __deprecated__
from peewee import Insert
from peewee import MySQLDatabase
from peewee import ImproperlyConfigured
class MariaDBConnectorDatabase(MySQLDatabase):
def _connect(self):
if mariadb is None:
raise ImproperlyConfigured('mariadb connector not installed!')
sel... |
class MariaDBConnectorDatabase(MySQLDatabase):
def _connect(self):
pass
def cursor(self, commit=None, named_cursor=None):
pass
def _set_server_version(self, conn):
pass
def last_insert_id(self, cursor, query_type=None):
pass
def get_binary_type(self):
pa... | 6 | 0 | 7 | 0 | 7 | 0 | 3 | 0 | 1 | 4 | 2 | 0 | 5 | 3 | 5 | 87 | 40 | 4 | 36 | 12 | 30 | 0 | 33 | 11 | 27 | 4 | 4 | 2 | 13 |
30,749 | coleifer/peewee | coleifer_peewee/playhouse/mysql_ext.py | playhouse.mysql_ext.MySQLConnectorDatabase | from peewee import ImproperlyConfigured
from peewee import __deprecated__
from peewee import MySQLDatabase
class MySQLConnectorDatabase(MySQLDatabase):
def _connect(self):
if mysql_connector is None:
raise ImproperlyConfigured('MySQL connector not installed!')
return mysql_connector.co... |
class MySQLConnectorDatabase(MySQLDatabase):
def _connect(self):
pass
def cursor(self, commit=None, named_cursor=None):
pass
def get_binary_type(self):
pass | 4 | 0 | 5 | 0 | 5 | 0 | 2 | 0 | 1 | 1 | 1 | 0 | 3 | 1 | 3 | 85 | 19 | 2 | 17 | 5 | 13 | 0 | 15 | 4 | 11 | 4 | 4 | 2 | 7 |
30,750 | coleifer/peewee | coleifer_peewee/playhouse/pool.py | playhouse.pool.MaxConnectionsExceeded | class MaxConnectionsExceeded(ValueError):
pass | class MaxConnectionsExceeded(ValueError):
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,751 | coleifer/peewee | coleifer_peewee/playhouse/pool.py | playhouse.pool.PooledDatabase | import threading
import time
import heapq
class PooledDatabase(object):
def __init__(self, database, max_connections=20, stale_timeout=None, timeout=None, **kwargs):
self._max_connections = make_int(max_connections)
self._stale_timeout = make_int(stale_timeout)
self._wait_timeout = make_in... |
class PooledDatabase(object):
def __init__(self, database, max_connections=20, stale_timeout=None, timeout=None, **kwargs):
pass
def init(self, database, max_connections=None, stale_timeout=None, timeout=None, **connect_kwargs):
pass
def connect(self, reuse_if_open=False):
pass
... | 19 | 1 | 14 | 1 | 10 | 3 | 3 | 0.27 | 1 | 5 | 2 | 6 | 12 | 7 | 12 | 12 | 180 | 21 | 125 | 43 | 104 | 34 | 108 | 35 | 95 | 7 | 1 | 3 | 36 |
30,752 | coleifer/peewee | coleifer_peewee/playhouse/pool.py | playhouse.pool.PooledMySQLDatabase | from peewee import MySQLDatabase
class PooledMySQLDatabase(PooledDatabase, MySQLDatabase):
def _is_closed(self, conn):
if self.server_version[0] == 8:
args = ()
else:
args = (False,)
try:
conn.ping(*args)
except:
return True
e... |
class PooledMySQLDatabase(PooledDatabase, MySQLDatabase):
def _is_closed(self, conn):
pass | 2 | 0 | 11 | 0 | 11 | 0 | 3 | 0 | 2 | 0 | 0 | 0 | 1 | 0 | 1 | 95 | 12 | 0 | 12 | 3 | 10 | 0 | 11 | 3 | 9 | 3 | 4 | 1 | 3 |
30,753 | coleifer/peewee | coleifer_peewee/playhouse/pool.py | playhouse.pool.PooledPostgresqlDatabase | from peewee import PostgresqlDatabase
class PooledPostgresqlDatabase(_PooledPostgresqlDatabase, PostgresqlDatabase):
pass |
class PooledPostgresqlDatabase(_PooledPostgresqlDatabase, PostgresqlDatabase):
pass | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 | 0 | 0 | 0 | 0 | 0 | 0 | 97 | 2 | 0 | 2 | 1 | 1 | 0 | 2 | 1 | 1 | 0 | 4 | 0 | 0 |
30,754 | coleifer/peewee | coleifer_peewee/playhouse/pool.py | playhouse.pool.PooledSqliteDatabase | from peewee import SqliteDatabase
class PooledSqliteDatabase(_PooledSqliteDatabase, SqliteDatabase):
pass |
class PooledSqliteDatabase(_PooledSqliteDatabase, SqliteDatabase):
pass | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 | 0 | 0 | 0 | 0 | 0 | 0 | 125 | 2 | 0 | 2 | 1 | 1 | 0 | 2 | 1 | 1 | 0 | 4 | 0 | 0 |
30,755 | coleifer/peewee | coleifer_peewee/playhouse/pool.py | playhouse.pool._PooledPostgresqlDatabase | class _PooledPostgresqlDatabase(PooledDatabase):
def _is_closed(self, conn):
if conn.closed:
return True
txn_status = conn.get_transaction_status()
if txn_status == TRANSACTION_STATUS_UNKNOWN:
return True
elif txn_status != TRANSACTION_STATUS_IDLE:
... | class _PooledPostgresqlDatabase(PooledDatabase):
def _is_closed(self, conn):
pass
def _can_reuse(self, conn):
pass | 3 | 0 | 11 | 1 | 9 | 2 | 4 | 0.16 | 1 | 0 | 0 | 3 | 2 | 0 | 2 | 14 | 24 | 2 | 19 | 5 | 16 | 3 | 16 | 5 | 13 | 4 | 2 | 1 | 8 |
30,756 | coleifer/peewee | coleifer_peewee/playhouse/pool.py | playhouse.pool._PooledSqliteDatabase | class _PooledSqliteDatabase(PooledDatabase):
def _is_closed(self, conn):
try:
conn.total_changes
except:
return True
else:
return False | class _PooledSqliteDatabase(PooledDatabase):
def _is_closed(self, conn):
pass | 2 | 0 | 7 | 0 | 7 | 0 | 2 | 0 | 1 | 0 | 0 | 3 | 1 | 0 | 1 | 13 | 8 | 0 | 8 | 2 | 6 | 0 | 8 | 2 | 6 | 2 | 2 | 1 | 2 |
30,757 | coleifer/peewee | coleifer_peewee/playhouse/pool.py | playhouse.pool._sentinel | class _sentinel(object):
def __lt__(self, other):
return True | class _sentinel(object):
def __lt__(self, other):
pass | 2 | 0 | 2 | 0 | 2 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 1 | 0 | 1 | 1 | 3 | 0 | 3 | 2 | 1 | 0 | 3 | 2 | 1 | 1 | 1 | 0 | 1 |
30,758 | coleifer/peewee | coleifer_peewee/playhouse/postgres_ext.py | playhouse.postgres_ext.ArrayField | from peewee import NodeList
from peewee import Node
from peewee import Expression
class ArrayField(IndexedFieldMixin, Field):
passthrough = True
def __init__(self, field_class=IntegerField, field_kwargs=None, dimensions=1, convert_values=False, *args, **kwargs):
self.__field = field_class(**field_kwar... |
class ArrayField(IndexedFieldMixin, Field):
def __init__(self, field_class=IntegerField, field_kwargs=None, dimensions=1, convert_values=False, *args, **kwargs):
pass
def bind(self, model, name, set_attribute=True):
pass
def ddl_datatype(self, ctx):
pass
def db_value(self, v... | 13 | 0 | 4 | 0 | 4 | 0 | 2 | 0 | 2 | 8 | 6 | 0 | 11 | 4 | 11 | 54 | 68 | 11 | 57 | 29 | 43 | 0 | 51 | 28 | 38 | 4 | 4 | 2 | 18 |
30,759 | coleifer/peewee | coleifer_peewee/playhouse/postgres_ext.py | playhouse.postgres_ext.ArrayValue | from peewee import Node
class ArrayValue(Node):
def __init__(self, field, value):
self.field = field
self.value = value
def __sql__(self, ctx):
return ctx.sql(Value(self.value, unpack=False)).literal('::').sql(self.field.ddl_datatype(ctx)) |
class ArrayValue(Node):
def __init__(self, field, value):
pass
def __sql__(self, ctx):
pass | 3 | 0 | 4 | 0 | 4 | 0 | 1 | 0 | 1 | 1 | 1 | 0 | 2 | 2 | 2 | 8 | 10 | 1 | 9 | 5 | 6 | 0 | 6 | 5 | 3 | 1 | 2 | 0 | 2 |
30,760 | coleifer/peewee | coleifer_peewee/playhouse/postgres_ext.py | playhouse.postgres_ext.BinaryJSONField | from peewee import Expression
class BinaryJSONField(IndexedFieldMixin, JSONField):
field_type = 'JSONB'
_json_datatype = 'jsonb'
__hash__ = Field.__hash__
def contains(self, other):
if isinstance(other, JSONField):
return Expression(self, JSONB_CONTAINS, other)
return Expre... |
class BinaryJSONField(IndexedFieldMixin, JSONField):
def contains(self, other):
pass
def contained_by(self, other):
pass
def contains_any(self, *items):
pass
def contains_all(self, *items):
pass
def has_key(self, key):
pass
def remove(self, *items):... | 7 | 0 | 4 | 0 | 4 | 0 | 1 | 0 | 2 | 4 | 2 | 0 | 6 | 0 | 6 | 54 | 35 | 6 | 29 | 10 | 22 | 0 | 19 | 10 | 12 | 3 | 5 | 1 | 8 |
30,761 | coleifer/peewee | coleifer_peewee/playhouse/postgres_ext.py | playhouse.postgres_ext.DateTimeTZField | class DateTimeTZField(DateTimeField):
field_type = 'TIMESTAMPTZ' | class DateTimeTZField(DateTimeField):
pass | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 46 | 2 | 0 | 2 | 2 | 1 | 0 | 2 | 2 | 1 | 0 | 6 | 0 | 0 |
30,762 | coleifer/peewee | coleifer_peewee/playhouse/postgres_ext.py | playhouse.postgres_ext.FetchManyCursor | class FetchManyCursor(object):
__slots__ = ('cursor', 'array_size', 'exhausted', 'iterable')
def __init__(self, cursor, array_size=None):
self.cursor = cursor
self.array_size = array_size or cursor.itersize
self.exhausted = False
self.iterable = self.row_gen()
def __del__(s... | class FetchManyCursor(object):
def __init__(self, cursor, array_size=None):
pass
def __del__(self):
pass
@property
def description(self):
pass
def close(self):
pass
def row_gen(self):
pass
def fetchone(self):
pass | 8 | 0 | 5 | 0 | 5 | 0 | 2 | 0 | 1 | 2 | 0 | 0 | 6 | 4 | 6 | 6 | 41 | 6 | 35 | 15 | 27 | 0 | 33 | 14 | 26 | 4 | 1 | 3 | 13 |
30,763 | coleifer/peewee | coleifer_peewee/playhouse/postgres_ext.py | playhouse.postgres_ext.HStoreField | from peewee import Expression
class HStoreField(IndexedFieldMixin, Field):
field_type = 'HSTORE'
__hash__ = Field.__hash__
def __getitem__(self, key):
return Expression(self, HKEY, Value(key))
def keys(self):
return fn.akeys(self)
def values(self):
return fn.avals(self)
... |
class HStoreField(IndexedFieldMixin, Field):
def __getitem__(self, key):
pass
def keys(self):
pass
def values(self):
pass
def items(self):
pass
def slice(self, *args):
pass
def exists(self, key):
pass
def defined(self, key):
pas... | 12 | 0 | 3 | 0 | 3 | 0 | 1 | 0 | 2 | 5 | 2 | 0 | 11 | 0 | 11 | 54 | 43 | 11 | 32 | 15 | 20 | 0 | 30 | 15 | 18 | 3 | 4 | 1 | 13 |
30,764 | coleifer/peewee | coleifer_peewee/playhouse/postgres_ext.py | playhouse.postgres_ext.IndexedFieldMixin | class IndexedFieldMixin(object):
default_index_type = 'GIN'
def __init__(self, *args, **kwargs):
kwargs.setdefault('index', True)
super(IndexedFieldMixin, self).__init__(*args, **kwargs) | class IndexedFieldMixin(object):
def __init__(self, *args, **kwargs):
pass | 2 | 0 | 3 | 0 | 3 | 1 | 1 | 0.2 | 1 | 1 | 0 | 6 | 1 | 0 | 1 | 1 | 6 | 1 | 5 | 3 | 3 | 1 | 5 | 3 | 3 | 1 | 1 | 0 | 1 |
30,765 | coleifer/peewee | coleifer_peewee/playhouse/postgres_ext.py | playhouse.postgres_ext.IntervalField | class IntervalField(Field):
field_type = 'INTERVAL' | class IntervalField(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,766 | coleifer/peewee | coleifer_peewee/playhouse/postgres_ext.py | playhouse.postgres_ext.JSONField | import json
from peewee import Node
class JSONField(Field):
field_type = 'JSON'
_json_datatype = 'json'
def __init__(self, dumps=None, *args, **kwargs):
self.dumps = dumps or json.dumps
super(JSONField, self).__init__(*args, **kwargs)
def db_value(self, value):
if value is Non... |
class JSONField(Field):
def __init__(self, dumps=None, *args, **kwargs):
pass
def db_value(self, value):
pass
def __getitem__(self, value):
pass
def path(self, *keys):
pass
def concat(self, value):
pass | 6 | 0 | 3 | 0 | 3 | 0 | 2 | 0 | 1 | 4 | 3 | 1 | 5 | 1 | 5 | 47 | 25 | 5 | 20 | 9 | 14 | 0 | 20 | 9 | 14 | 3 | 4 | 1 | 8 |
30,767 | coleifer/peewee | coleifer_peewee/playhouse/postgres_ext.py | playhouse.postgres_ext.JsonLookup | class JsonLookup(_JsonLookupBase):
def __getitem__(self, value):
return JsonLookup(self.node, self.parts + [value], self._as_json)
def __sql__(self, ctx):
ctx.sql(self.node)
for part in self.parts[:-1]:
ctx.literal('->').sql(part)
if self.parts:
ctx.lite... | class JsonLookup(_JsonLookupBase):
def __getitem__(self, value):
pass
def __sql__(self, ctx):
pass | 3 | 0 | 6 | 1 | 6 | 0 | 3 | 0 | 1 | 0 | 0 | 0 | 2 | 0 | 2 | 41 | 14 | 2 | 12 | 4 | 9 | 0 | 10 | 4 | 7 | 4 | 5 | 1 | 5 |
30,768 | coleifer/peewee | coleifer_peewee/playhouse/postgres_ext.py | playhouse.postgres_ext.JsonPath | class JsonPath(_JsonLookupBase):
def __sql__(self, ctx):
return ctx.sql(self.node).literal('#>' if self._as_json else '#>>').sql(Value('{%s}' % ','.join(map(str, self.parts)))) | class JsonPath(_JsonLookupBase):
def __sql__(self, ctx):
pass | 2 | 0 | 5 | 0 | 5 | 1 | 2 | 0.17 | 1 | 3 | 1 | 0 | 1 | 0 | 1 | 40 | 6 | 0 | 6 | 2 | 4 | 1 | 3 | 2 | 1 | 2 | 5 | 0 | 2 |
30,769 | coleifer/peewee | coleifer_peewee/playhouse/postgres_ext.py | playhouse.postgres_ext.ObjectSlice | from peewee import Node
class ObjectSlice(_LookupNode):
@classmethod
def create(cls, node, value):
if isinstance(value, slice):
parts = [value.start or 0, value.stop or 0]
elif isinstance(value, int):
parts = [value]
elif isinstance(value, Node):
par... |
class ObjectSlice(_LookupNode):
@classmethod
def create(cls, node, value):
pass
def __sql__(self, ctx):
pass
def __getitem__(self, value):
pass | 5 | 0 | 7 | 0 | 6 | 0 | 2 | 0.05 | 1 | 3 | 0 | 0 | 2 | 0 | 3 | 34 | 24 | 2 | 21 | 6 | 16 | 1 | 16 | 5 | 12 | 4 | 4 | 1 | 7 |
30,770 | coleifer/peewee | coleifer_peewee/playhouse/postgres_ext.py | playhouse.postgres_ext.PostgresqlExtDatabase | import uuid
from peewee import __exception_wrapper__
from peewee import __deprecated__
class PostgresqlExtDatabase(PostgresqlDatabase):
def __init__(self, *args, **kwargs):
self._register_hstore = kwargs.pop('register_hstore', False)
self._server_side_cursors = kwargs.pop('server_side_cursors', Fa... |
class PostgresqlExtDatabase(PostgresqlDatabase):
def __init__(self, *args, **kwargs):
pass
def _connect(self):
pass
def cursor(self, commit=None, named_cursor=None):
pass
def execute(self, query, commit=None, named_cursor=False, array_size=None, **context_options):
p... | 6 | 0 | 8 | 0 | 8 | 0 | 3 | 0 | 1 | 4 | 2 | 1 | 5 | 2 | 5 | 88 | 47 | 4 | 43 | 15 | 36 | 0 | 39 | 14 | 33 | 5 | 4 | 2 | 13 |
30,771 | coleifer/peewee | coleifer_peewee/playhouse/postgres_ext.py | playhouse.postgres_ext.ServerSideQuery | from peewee import Node
class ServerSideQuery(Node):
def __init__(self, query, array_size=None):
self.query = query
self.array_size = array_size
self._cursor_wrapper = None
def __sql__(self, ctx):
return self.query.__sql__(ctx)
def __iter__(self):
if self._cursor_... |
class ServerSideQuery(Node):
def __init__(self, query, array_size=None):
pass
def __sql__(self, ctx):
pass
def __iter__(self):
pass
def _execute(self, database):
pass | 5 | 0 | 4 | 0 | 4 | 0 | 2 | 0 | 1 | 0 | 0 | 0 | 4 | 3 | 4 | 10 | 20 | 3 | 17 | 9 | 12 | 0 | 16 | 9 | 11 | 2 | 2 | 1 | 6 |
30,772 | coleifer/peewee | coleifer_peewee/playhouse/postgres_ext.py | playhouse.postgres_ext.TSVectorField | from peewee import Expression
class TSVectorField(IndexedFieldMixin, TextField):
field_type = 'TSVECTOR'
__hash__ = Field.__hash__
def match(self, query, language=None, plain=False):
params = (language, query) if language is not None else (query,)
func = fn.plainto_tsquery if plain else fn... |
class TSVectorField(IndexedFieldMixin, TextField):
def match(self, query, language=None, plain=False):
pass | 2 | 0 | 4 | 0 | 4 | 0 | 3 | 0 | 2 | 1 | 1 | 0 | 1 | 0 | 1 | 47 | 8 | 1 | 7 | 6 | 5 | 0 | 7 | 6 | 5 | 3 | 6 | 0 | 3 |
30,773 | coleifer/peewee | coleifer_peewee/playhouse/postgres_ext.py | playhouse.postgres_ext._JsonLookupBase | from peewee import Node
from peewee import Expression
class _JsonLookupBase(_LookupNode):
def __init__(self, node, parts, as_json=False):
super(_JsonLookupBase, self).__init__(node, parts)
self._as_json = as_json
def clone(self):
return type(self)(self.node, list(self.parts), self._as... |
class _JsonLookupBase(_LookupNode):
def __init__(self, node, parts, as_json=False):
pass
def clone(self):
pass
@Node.copy
def as_json(self, as_json=True):
pass
def concat(self, rhs):
pass
def contains(self, other):
pass
def contained_by(self, oth... | 12 | 0 | 4 | 0 | 4 | 0 | 1 | 0 | 1 | 6 | 2 | 3 | 8 | 1 | 8 | 39 | 37 | 7 | 30 | 12 | 20 | 0 | 23 | 11 | 14 | 2 | 4 | 1 | 10 |
30,774 | coleifer/peewee | coleifer_peewee/playhouse/postgres_ext.py | playhouse.postgres_ext._LookupNode | from peewee import ColumnBase
class _LookupNode(ColumnBase):
def __init__(self, node, parts):
self.node = node
self.parts = parts
super(_LookupNode, self).__init__()
def clone(self):
return type(self)(self.node, list(self.parts))
def __hash__(self):
return hash((s... |
class _LookupNode(ColumnBase):
def __init__(self, node, parts):
pass
def clone(self):
pass
def __hash__(self):
pass | 4 | 0 | 3 | 0 | 3 | 0 | 1 | 0 | 1 | 3 | 0 | 2 | 3 | 2 | 3 | 31 | 11 | 2 | 9 | 6 | 5 | 0 | 9 | 6 | 5 | 1 | 3 | 0 | 3 |
30,775 | coleifer/peewee | coleifer_peewee/playhouse/postgres_ext.py | playhouse.postgres_ext._empty_object | class _empty_object(object):
__slots__ = ()
def __nonzero__(self):
return False
__bool__ = __nonzero__ | class _empty_object(object):
def __nonzero__(self):
pass | 2 | 0 | 2 | 0 | 2 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 1 | 0 | 1 | 1 | 5 | 0 | 5 | 4 | 3 | 0 | 5 | 4 | 3 | 1 | 1 | 0 | 1 |
30,776 | coleifer/peewee | coleifer_peewee/playhouse/psycopg3_ext.py | playhouse.psycopg3_ext.BinaryJSONField | from playhouse.postgres_ext import IndexedFieldMixin
from peewee import Node
import json
from peewee import Expression
class BinaryJSONField(IndexedFieldMixin, Field):
field_type = 'JSONB'
_json_datatype = 'jsonb'
__hash__ = Field.__hash__
def __init__(self, dumps=None, *args, **kwargs):
self.... |
class BinaryJSONField(IndexedFieldMixin, Field):
def __init__(self, dumps=None, *args, **kwargs):
pass
def db_value(self, value):
pass
def __getitem__(self, value):
pass
def path(self, *keys):
pass
def concat(self, value):
pass
def contains(self, ot... | 12 | 0 | 4 | 0 | 4 | 0 | 1 | 0.11 | 2 | 8 | 5 | 0 | 11 | 1 | 11 | 54 | 62 | 11 | 46 | 16 | 34 | 5 | 36 | 16 | 24 | 3 | 4 | 1 | 16 |
30,777 | coleifer/peewee | coleifer_peewee/playhouse/psycopg3_ext.py | playhouse.psycopg3_ext.JsonLookup | class JsonLookup(_Psycopg3JsonLookupBase):
def __getitem__(self, value):
return JsonLookup(self.node, self.parts + [value], self._as_json)
def __sql__(self, ctx):
ctx.sql(self.node)
for part in self.parts[:-1]:
ctx.literal('->').sql(part)
if self.parts:
... | class JsonLookup(_Psycopg3JsonLookupBase):
def __getitem__(self, value):
pass
def __sql__(self, ctx):
pass | 3 | 0 | 6 | 1 | 6 | 0 | 3 | 0 | 1 | 0 | 0 | 0 | 2 | 0 | 2 | 43 | 14 | 2 | 12 | 4 | 9 | 0 | 10 | 4 | 7 | 4 | 6 | 1 | 5 |
30,778 | coleifer/peewee | coleifer_peewee/playhouse/psycopg3_ext.py | playhouse.psycopg3_ext.JsonPath | class JsonPath(_Psycopg3JsonLookupBase):
def __sql__(self, ctx):
return ctx.sql(self.node).literal('#>' if self._as_json else '#>>').sql(Value('{%s}' % ','.join(map(str, self.parts)))) | class JsonPath(_Psycopg3JsonLookupBase):
def __sql__(self, ctx):
pass | 2 | 0 | 5 | 0 | 5 | 1 | 2 | 0.17 | 1 | 3 | 1 | 0 | 1 | 0 | 1 | 42 | 6 | 0 | 6 | 2 | 4 | 1 | 3 | 2 | 1 | 2 | 6 | 0 | 2 |
30,779 | coleifer/peewee | coleifer_peewee/playhouse/psycopg3_ext.py | playhouse.psycopg3_ext.Psycopg3Database | from peewee import NodeList
class Psycopg3Database(PostgresqlDatabase):
def _connect(self):
if psycopg is None:
raise ImproperlyConfigured('psycopg3 is not installed!')
if self.database.startswith('postgresql://'):
conn = psycopg.connect(self.database, **self.connect_params... |
class Psycopg3Database(PostgresqlDatabase):
def _connect(self):
pass
def get_binary_type(self):
pass
def _set_server_version(self, conn):
pass
def is_connection_usable(self):
pass
def extract_date(self, date_part, date_field):
pass | 6 | 0 | 5 | 0 | 4 | 1 | 2 | 0.14 | 1 | 3 | 3 | 1 | 5 | 2 | 5 | 88 | 30 | 5 | 22 | 10 | 16 | 3 | 22 | 10 | 16 | 3 | 4 | 1 | 9 |
30,780 | coleifer/peewee | coleifer_peewee/playhouse/psycopg3_ext.py | playhouse.psycopg3_ext._Psycopg3JsonLookupBase | from peewee import Expression
from peewee import Node
from playhouse.postgres_ext import _JsonLookupBase
class _Psycopg3JsonLookupBase(_JsonLookupBase):
def concat(self, rhs):
if not isinstance(rhs, Node):
rhs = Jsonb(rhs)
return Expression(self.as_json(True), OP.CONCAT, rhs)
def ... |
class _Psycopg3JsonLookupBase(_JsonLookupBase):
def concat(self, rhs):
pass
def contains(self, other):
pass | 3 | 0 | 5 | 0 | 5 | 1 | 2 | 0.2 | 1 | 3 | 1 | 2 | 2 | 0 | 2 | 41 | 11 | 1 | 10 | 4 | 7 | 2 | 10 | 4 | 7 | 2 | 5 | 1 | 4 |
30,781 | coleifer/peewee | coleifer_peewee/playhouse/reflection.py | playhouse.reflection.CockroachDBMetadata | class CockroachDBMetadata(PostgresqlMetadata):
column_map = PostgresqlMetadata.column_map.copy()
column_map[20] = IntegerField
array_types = PostgresqlMetadata.array_types.copy()
array_types[1016] = IntegerField
extension_import = 'from playhouse.cockroachdb import *'
def __init__(self, databas... | class CockroachDBMetadata(PostgresqlMetadata):
def __init__(self, database):
pass | 2 | 0 | 16 | 3 | 12 | 1 | 5 | 0.17 | 1 | 3 | 3 | 0 | 1 | 1 | 1 | 15 | 25 | 4 | 18 | 9 | 16 | 3 | 17 | 9 | 15 | 5 | 3 | 3 | 5 |
30,782 | coleifer/peewee | coleifer_peewee/playhouse/reflection.py | playhouse.reflection.Column | from inspect import isclass
class Column(object):
"""
Store metadata about a database column.
"""
primary_key_types = (IntegerField, AutoField)
def __init__(self, name, field_class, raw_column_type, nullable, primary_key=False, column_name=None, index=False, unique=False, default=None, extra_param... |
class Column(object):
'''
Store metadata about a database column.
'''
def __init__(self, name, field_class, raw_column_type, nullable, primary_key=False, column_name=None, index=False, unique=False, default=None, extra_parameters=None):
pass
def __repr__(self):
pass
def get_f... | 9 | 1 | 12 | 1 | 11 | 1 | 3 | 0.1 | 1 | 4 | 4 | 0 | 8 | 14 | 8 | 8 | 110 | 16 | 86 | 34 | 74 | 9 | 68 | 31 | 59 | 12 | 1 | 2 | 23 |
30,783 | coleifer/peewee | coleifer_peewee/playhouse/reflection.py | playhouse.reflection.DatabaseMetadata | class DatabaseMetadata(_DatabaseMetadata):
def multi_column_indexes(self, table):
accum = []
for index in self.indexes[table]:
if len(index.columns) > 1:
field_names = [self.columns[table][column].name for column in index.columns if column in self.columns[table]]
... | class DatabaseMetadata(_DatabaseMetadata):
def multi_column_indexes(self, table):
pass
def column_indexes(self, table):
pass | 3 | 0 | 8 | 0 | 8 | 0 | 3 | 0 | 1 | 0 | 0 | 0 | 2 | 0 | 2 | 2 | 17 | 1 | 16 | 8 | 13 | 0 | 14 | 8 | 11 | 3 | 1 | 2 | 6 |
30,784 | coleifer/peewee | coleifer_peewee/playhouse/reflection.py | playhouse.reflection.Introspector | import warnings
import re
from peewee import make_snake_case
class Introspector(object):
pk_classes = [AutoField, IntegerField]
def __init__(self, metadata, schema=None):
self.metadata = metadata
self.schema = schema
def __repr__(self):
return '<Introspector: %s>' % self.metadata.... |
class Introspector(object):
def __init__(self, metadata, schema=None):
pass
def __repr__(self):
pass
@classmethod
def from_database(cls, database, schema=None):
pass
def get_database_class(self):
pass
def get_database_name(self):
pass
def get_dat... | 18 | 0 | 33 | 4 | 26 | 2 | 6 | 0.1 | 1 | 25 | 20 | 0 | 10 | 2 | 11 | 11 | 309 | 49 | 237 | 72 | 217 | 24 | 196 | 66 | 180 | 27 | 1 | 5 | 73 |
30,785 | coleifer/peewee | coleifer_peewee/playhouse/reflection.py | playhouse.reflection.Metadata | from peewee import text_type
from peewee import _StringField
class Metadata(object):
column_map = {}
extension_import = ''
def __init__(self, database):
self.database = database
self.requires_extension = False
def execute(self, sql, *params):
return self.database.execute_sql(s... |
class Metadata(object):
def __init__(self, database):
pass
def execute(self, sql, *params):
pass
def get_columns(self, table, schema=None):
pass
def get_column_types(self, table, schema=None):
pass
def _clean_default(self, field_class, default):
pass
... | 9 | 0 | 7 | 1 | 6 | 0 | 2 | 0.04 | 1 | 8 | 6 | 3 | 8 | 2 | 8 | 8 | 65 | 13 | 50 | 21 | 41 | 2 | 37 | 21 | 28 | 5 | 1 | 2 | 14 |
30,786 | coleifer/peewee | coleifer_peewee/playhouse/reflection.py | playhouse.reflection.MySQLMetadata | class MySQLMetadata(Metadata):
if FIELD_TYPE is None:
column_map = {}
else:
column_map = {FIELD_TYPE.BLOB: TextField, FIELD_TYPE.CHAR: CharField, FIELD_TYPE.DATE: DateField, FIELD_TYPE.DATETIME: DateTimeField, FIELD_TYPE.DECIMAL: DecimalField, FIELD_TYPE.DOUBLE: FloatField, FIELD_TYPE.FLOAT: Flo... | class MySQLMetadata(Metadata):
def __init__(self, database, **kwargs):
pass
def get_column_types(self, table, schema=None):
pass | 3 | 0 | 8 | 2 | 6 | 1 | 2 | 0.05 | 1 | 2 | 1 | 0 | 2 | 0 | 2 | 10 | 44 | 5 | 37 | 8 | 34 | 2 | 15 | 8 | 12 | 2 | 2 | 1 | 4 |
30,787 | coleifer/peewee | coleifer_peewee/playhouse/reflection.py | playhouse.reflection.PostgresqlMetadata | class PostgresqlMetadata(Metadata):
column_map = {16: BooleanField, 17: BlobField, 20: BigIntegerField, 21: SmallIntegerField, 23: IntegerField, 25: TextField, 700: FloatField, 701: DoubleField, 1042: CharField, 1043: CharField, 1082: DateField, 1114: DateTimeField, 1184: DateTimeField, 1083: TimeField, 1266: TimeF... | class PostgresqlMetadata(Metadata):
def __init__(self, database):
pass
def get_column_types(self, table, schema):
pass
def get_columns(self, table, schema=None):
pass
def get_foreign_keys(self, table, schema=None):
pass
def get_primary_keys(self, table, schema=No... | 7 | 0 | 10 | 1 | 8 | 1 | 3 | 0.06 | 1 | 8 | 6 | 1 | 6 | 1 | 6 | 14 | 99 | 12 | 84 | 20 | 77 | 5 | 42 | 20 | 35 | 8 | 2 | 3 | 17 |
30,788 | coleifer/peewee | coleifer_peewee/playhouse/reflection.py | playhouse.reflection.SqliteMetadata | import re
class SqliteMetadata(Metadata):
column_map = {'bigint': BigIntegerField, 'blob': BlobField, 'bool': BooleanField, 'boolean': BooleanField, 'char': CharField, 'date': DateField, 'datetime': DateTimeField, 'decimal': DecimalField, 'float': FloatField, 'integer': IntegerField, 'integer unsigned': IntegerFie... |
class SqliteMetadata(Metadata):
def _map_col(self, column_type):
pass
def get_column_types(self, table, schema=None):
pass | 3 | 0 | 11 | 1 | 10 | 0 | 3 | 0 | 1 | 3 | 3 | 0 | 2 | 0 | 2 | 10 | 56 | 5 | 51 | 13 | 48 | 0 | 22 | 13 | 19 | 4 | 2 | 2 | 6 |
30,789 | coleifer/peewee | coleifer_peewee/playhouse/reflection.py | playhouse.reflection.UnknownField | class UnknownField(object):
pass | class UnknownField(object):
pass | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 | 0 | 2 | 1 | 1 | 0 | 2 | 1 | 1 | 0 | 1 | 0 | 0 |
30,790 | coleifer/peewee | coleifer_peewee/playhouse/shortcuts.py | playhouse.shortcuts.ReconnectMixin | from peewee import __deprecated__
class ReconnectMixin(object):
"""
Mixin class that attempts to automatically reconnect to the database under
certain error conditions.
For example, MySQL servers will typically close connections that are idle
for 28800 seconds ("wait_timeout" setting). If your app... |
class ReconnectMixin(object):
'''
Mixin class that attempts to automatically reconnect to the database under
certain error conditions.
For example, MySQL servers will typically close connections that are idle
for 28800 seconds ("wait_timeout" setting). If your application makes use
of long-live... | 5 | 1 | 10 | 1 | 8 | 1 | 3 | 0.67 | 1 | 4 | 0 | 1 | 4 | 1 | 4 | 4 | 74 | 13 | 39 | 12 | 34 | 26 | 33 | 11 | 28 | 7 | 1 | 3 | 12 |
30,791 | coleifer/peewee | coleifer_peewee/playhouse/shortcuts.py | playhouse.shortcuts.ThreadSafeDatabaseMetadata | import threading
from peewee import Metadata
class ThreadSafeDatabaseMetadata(Metadata):
"""
Metadata class to allow swapping database at run-time in a multi-threaded
application. To use:
class Base(Model):
class Meta:
model_metadata_class = ThreadSafeDatabaseMetadata
"""
... |
class ThreadSafeDatabaseMetadata(Metadata):
'''
Metadata class to allow swapping database at run-time in a multi-threaded
application. To use:
class Base(Model):
class Meta:
model_metadata_class = ThreadSafeDatabaseMetadata
'''
def __init__(self, *args, **kwargs... | 4 | 1 | 4 | 0 | 3 | 0 | 1 | 0.67 | 1 | 2 | 0 | 0 | 3 | 2 | 3 | 26 | 22 | 2 | 12 | 7 | 8 | 8 | 12 | 7 | 8 | 2 | 2 | 1 | 4 |
30,792 | coleifer/peewee | coleifer_peewee/playhouse/signals.py | playhouse.signals.Model | from peewee import Model as _Model
class Model(_Model):
def __init__(self, *args, **kwargs):
super(Model, self).__init__(*args, **kwargs)
pre_init.send(self)
def save(self, *args, **kwargs):
pk_value = self._pk if self._meta.primary_key else True
created = kwargs.get('force_in... |
class Model(_Model):
def __init__(self, *args, **kwargs):
pass
def save(self, *args, **kwargs):
pass
def delete_instance(self, *args, **kwargs):
pass | 4 | 0 | 5 | 0 | 5 | 0 | 1 | 0 | 1 | 2 | 0 | 1 | 3 | 0 | 3 | 50 | 18 | 2 | 16 | 8 | 12 | 0 | 16 | 8 | 12 | 2 | 2 | 0 | 4 |
30,793 | coleifer/peewee | coleifer_peewee/playhouse/signals.py | playhouse.signals.Signal | class Signal(object):
def __init__(self):
self._flush()
def _flush(self):
self._receivers = set()
self._receiver_list = []
def connect(self, receiver, name=None, sender=None):
name = name or receiver.__name__
key = (name, sender)
if key not in self._receive... | class Signal(object):
def __init__(self):
pass
def _flush(self):
pass
def connect(self, receiver, name=None, sender=None):
pass
def disconnect(self, receiver=None, name=None, sender=None):
pass
def __call__(self, name=None, sender=None):
pass
def... | 8 | 0 | 6 | 0 | 6 | 0 | 2 | 0 | 1 | 3 | 0 | 0 | 6 | 2 | 6 | 6 | 46 | 7 | 39 | 15 | 31 | 0 | 35 | 15 | 27 | 4 | 1 | 2 | 13 |
30,794 | coleifer/peewee | coleifer_peewee/playhouse/sqlcipher_ext.py | playhouse.sqlcipher_ext.SqlCipherDatabase | class SqlCipherDatabase(_SqlCipherDatabase, SqliteDatabase):
pass | class SqlCipherDatabase(_SqlCipherDatabase, SqliteDatabase):
pass | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 | 0 | 0 | 0 | 0 | 0 | 0 | 115 | 2 | 0 | 2 | 1 | 1 | 0 | 2 | 1 | 1 | 0 | 4 | 0 | 0 |
30,795 | coleifer/peewee | coleifer_peewee/playhouse/sqlcipher_ext.py | playhouse.sqlcipher_ext.SqlCipherExtDatabase | from playhouse.sqlite_ext import SqliteExtDatabase
class SqlCipherExtDatabase(_SqlCipherDatabase, SqliteExtDatabase):
pass |
class SqlCipherExtDatabase(_SqlCipherDatabase, SqliteExtDatabase):
pass | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 | 0 | 0 | 0 | 0 | 0 | 0 | 118 | 2 | 0 | 2 | 1 | 1 | 0 | 2 | 1 | 1 | 0 | 5 | 0 | 0 |
30,796 | coleifer/peewee | coleifer_peewee/playhouse/sqlcipher_ext.py | playhouse.sqlcipher_ext._SqlCipherDatabase | class _SqlCipherDatabase(object):
server_version = __sqlcipher_version__
def _connect(self):
params = dict(self.connect_params)
passphrase = params.pop('passphrase', '').replace("'", "''")
conn = sqlcipher.connect(self.database, isolation_level=None, **params)
try:
i... | null | 4 | 0 | 9 | 1 | 8 | 0 | 2 | 0 | 1 | 2 | 1 | 2 | 3 | 1 | 3 | 3 | 32 | 6 | 26 | 8 | 22 | 0 | 24 | 8 | 20 | 3 | 1 | 2 | 7 |
30,797 | coleifer/peewee | coleifer_peewee/playhouse/sqlite_changelog.py | playhouse.sqlite_changelog.BaseChangeLog | from playhouse.sqlite_ext import JSONField
class BaseChangeLog(Model):
timestamp = DateTimeField(constraints=[SQL('DEFAULT CURRENT_TIMESTAMP')])
action = TextField()
table = TextField()
primary_key = IntegerField()
changes = JSONField() |
class BaseChangeLog(Model):
pass | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 47 | 6 | 0 | 6 | 6 | 5 | 0 | 6 | 6 | 5 | 0 | 2 | 0 | 0 |
30,798 | coleifer/peewee | coleifer_peewee/playhouse/sqlite_changelog.py | playhouse.sqlite_changelog.ChangeLog.model.ChangeLog | from playhouse.sqlite_ext import JSONField
class ChangeLog(object):
base_model = BaseChangeLog
template = 'CREATE TRIGGER IF NOT EXISTS %(table)s_changes_%(action)s\n AFTER %(action)s ON %(table)s\n BEGIN\n INSERT INTO %(change_table)s\n ("action", "table", "primary_key", "changes")\n ... |
class ChangeLog(object):
def __init__(self, db, table_name='changelog'):
pass
def _build_column_array(self, model, use_old, use_new, skip_fields=None):
pass
def trigger_sql(self, model, action, skip_fields=None):
pass
def drop_trigger_sql(self, model, action):
pass
... | 10 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 4 | 0 | 4 | 4 | 2 | 0 | 4 | 4 | 2 | 0 | 1 | 0 | 0 |
30,799 | coleifer/peewee | coleifer_peewee/playhouse/sqlite_ext.py | playhouse.sqlite_ext.AutoIncrementField | from peewee import NodeList
class AutoIncrementField(AutoField):
def ddl(self, ctx):
node_list = super(AutoIncrementField, self).ddl(ctx)
return NodeList((node_list, SQL('AUTOINCREMENT'))) |
class AutoIncrementField(AutoField):
def ddl(self, ctx):
pass | 2 | 0 | 3 | 0 | 3 | 0 | 1 | 0 | 1 | 3 | 2 | 0 | 1 | 0 | 1 | 45 | 4 | 0 | 4 | 3 | 2 | 0 | 4 | 3 | 2 | 1 | 6 | 0 | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.