bugged
stringlengths
4
228k
fixed
stringlengths
0
96.3M
__index_level_0__
int64
0
481k
def _commit_twophase_impl(self, xid, is_prepared): return proxy.commit_twophase(self, super(ProxyConnection, self)._commit_twophase_impl, xid, is_prepared)
def _commit_twophase_impl(self, xid, is_prepared): return proxy.commit_twophase(self, super(ProxyConnection, self)._commit_twophase_impl, xid, is_prepared)
464,500
def test_like(self): for expr, check, dialect in [ (table1.c.myid.like('somstr'), "mytable.myid LIKE :myid_1", None), (~table1.c.myid.like('somstr'), "mytable.myid NOT LIKE :myid_1", None), (table1.c.myid.like('somstr', escape='\\'), "mytable.myid LIKE :myid_1 ESCAPE '\\'", None), (~table1.c.myid.like('somstr', escape=...
def test_like(self): for expr, check, dialect in [ ( table1.c.myid.like('somstr'), "mytable.myid LIKE :myid_1", None), ( ~table1.c.myid.like('somstr'), "mytable.myid NOT LIKE :myid_1", None), ( table1.c.myid.like('somstr', escape='\\'), "mytable.myid LIKE :myid_1 ESCAPE '\\'", None), ( ~table1.c.myid.like('somstr', esc...
464,501
def _reset_exported(self): """delete memoized collections when a FromClause is cloned."""
def _reset_exported(self): """delete memoized collections when a FromClause is cloned."""
464,502
def test_uppercase_rendering(self): """Test that uppercase types from types.py always render as their type. As of SQLA 0.6, using an uppercase type means you want specifically that type. If the database in use doesn't support that DDL, it (the DB backend) should raise an error - it means you should be using a lowerca...
def test_uppercase_rendering(self): """Test that uppercase types from types.py always render as their type. As of SQLA 0.6, using an uppercase type means you want specifically that type. If the database in use doesn't support that DDL, it (the DB backend) should raise an error - it means you should be using a lowerca...
464,503
def with_hint(self, selectable, text, dialect_name=None): """Add an indexing hint for the given entity or selectable to this :class:`Query`. Functionality is passed straight through to :meth:`~sqlalchemy.sql.expression.Select.with_hint`, with the addition that ``selectable`` can be a :class:`Table`, :class:`Alias`, or...
def with_hint(self, selectable, text, dialect_name='*'): """Add an indexing hint for the given entity or selectable to this :class:`Query`. Functionality is passed straight through to :meth:`~sqlalchemy.sql.expression.Select.with_hint`, with the addition that ``selectable`` can be a :class:`Table`, :class:`Alias`, or ...
464,504
def __init__(self, auto_setinputsizes=True, auto_convert_lobs=True, threaded=True, allow_twophase=True, arraysize=50, **kwargs): OracleDialect.__init__(self, **kwargs) self.threaded = threaded self.arraysize = arraysize self.allow_twophase = allow_twophase self.supports_timestamp = self.dbapi is None or hasattr(self.db...
def __init__(self, auto_setinputsizes=True, auto_convert_lobs=True, threaded=True, allow_twophase=True, arraysize=50, **kwargs): OracleDialect.__init__(self, **kwargs) self.threaded = threaded self.arraysize = arraysize self.allow_twophase = allow_twophase self.supports_timestamp = self.dbapi is None or hasattr(self.db...
464,505
def render_literal_value(self, value, type_): """ For date and datetime values, convert to a string format acceptable to MSSQL. That seems to be the so-called ODBC canonical date format which looks like this: yyyy-mm-dd hh:mi:ss.mmm(24h) For other data types, call the base class implementation. """ # datetime and dat...
def render_literal_value(self, value, type_): """ For date and datetime values, convert to a string format acceptable to MSSQL. That seems to be the so-called ODBC canonical date format which looks like this: yyyy-mm-dd hh:mi:ss.mmm(24h) For other data types, call the base class implementation. """ # datetime and dat...
464,506
def init_class_attribute(self, mapper): self.is_class_level = True # MANYTOONE currently only needs the "old" value for delete-orphan # cascades. the required _SingleParentValidator will enable active_history # in that case. otherwise we don't need the "old" value during backref operations. _register_attribute(self,...
def init_class_attribute(self, mapper): self.is_class_level = True # MANYTOONE currently only needs the "old" value for delete-orphan # cascades. the required _SingleParentValidator will enable active_history # in that case. otherwise we don't need the "old" value during backref operations. _register_attribute(self,...
464,507
def test_import_base_dialects(self): for name in ('mysql', 'firebird', 'postgresql', 'sqlite', 'oracle', 'mssql'): exec("from sqlalchemy.dialects import %s\n" "dialect = %s.dialect()" % (name, name)) eq_(dialect.name, name)
def test_import_base_dialects(self): for name in ('mysql', 'firebird', 'postgresql', 'sqlite', 'oracle', 'mssql'): exec("from sqlalchemy.dialects import %s\n" "dialect = %s.dialect()" % (name, name), globals()) eq_(dialect.name, name)
464,508
def setup(self): global pool pool = QueuePool(creator=self.Connection, pool_size=3, max_overflow=-1, use_threadlocal=True)
def setup(self): global pool pool = QueuePool(creator=self.Connection, pool_size=3, max_overflow=-1, use_threadlocal=True)
464,509
def uc_name(self): return self.name.upper()
def uc_name(self): return self.name.upper()
464,510
def target(cls): return relationship("Target", primaryjoin="Target.id==%s.target_id" % cls.__name__ )
def target(cls): return relationship("Target", primaryjoin="Target.id==%s.target_id" % cls.__name__ )
464,511
def __tablename__(cls): if has_inherited_table(cls): return None return cls.__name__.lower()
def __tablename__(cls): if has_inherited_table(cls): return None return cls.__name__.lower()
464,512
def __tablename__(cls): if has_inherited_table(cls): return None return cls.__name__.lower()
def __tablename__(cls): if has_inherited_table(cls): return None return cls.__name__.lower()
464,513
def __tablename__(cls): if (decl.has_inherited_table(cls) and TableNameMixin not in cls.__bases__): return None return cls.__name__.lower()
def __tablename__(cls): if (has_inherited_table(cls) and Tablename not in cls.__bases__): return None return cls.__name__.lower()
464,514
def __tablename__(cls): if (decl.has_inherited_table(cls) and TableNameMixin not in cls.__bases__): return None return cls.__name__.lower()
def __tablename__(cls): if (decl.has_inherited_table(cls) and TableNameMixin not in cls.__bases__): return None return cls.__name__.lower()
464,515
def __tablename__(cls): if (decl.has_inherited_table(cls) and TableNameMixin not in cls.__bases__): return None return cls.__name__.lower()
def __tablename__(cls): if (decl.has_inherited_table(cls) and TableNameMixin not in cls.__bases__): return None return cls.__name__.lower()
464,516
def __tablename__(cls): if (decl.has_inherited_table(cls) and TableNameMixin not in cls.__bases__): return None return cls.__name__.lower()
def __tablename__(cls): if (decl.has_inherited_table(cls) and TableNameMixin not in cls.__bases__): return None return cls.__name__.lower()
464,517
def __tablename__(cls): if (decl.has_inherited_table(cls) and TableNameMixin not in cls.__bases__): return None return cls.__name__.lower()
def __tablename__(cls): if (decl.has_inherited_table(cls) and TableNameMixin not in cls.__bases__): return None return cls.__name__.lower()
464,518
def __table_args__(self): args = dict() args.update(MySQLSettings.__table_args__) args.update(MyOtherMixin.__table_args__) return args
def __table_args__(self): args = dict() args.update(MySQLSettings.__table_args__) args.update(MyOtherMixin.__table_args__) return args
464,519
def __table_args__(self): args = dict() args.update(MySQLSettings.__table_args__) args.update(MyOtherMixin.__table_args__) return args
def __table_args__(self): args = dict() args.update(MySQLSettings.__table_args__) args.update(MyOtherMixin.__table_args__) return args
464,520
def has_inherited_table(cls): """Given a class, return True if any of the classes it inherits from has a mapped table, otherwise return False. """ for class_ in cls.__mro__: if getattr(class_,'__table__',None) is not None: return True return False
def has_inherited_table(cls): """Given a class, return True if any of the classes it inherits from has a mapped table, otherwise return False. """ for class_ in cls.__mro__: if getattr(class_,'__table__',None) is not None: return True return False
464,521
def _as_declarative(cls, classname, dict_): # dict_ will be a dictproxy, which we can't write to, and we need to! dict_ = dict(dict_) column_copies = {} potential_columns = {} mapper_args = {} table_args = inherited_table_args = None tablename = None parent_columns = () for base in cls.__mro__: if _is_mapped_class(...
def _as_declarative(cls, classname, dict_): # dict_ will be a dictproxy, which we can't write to, and we need to! dict_ = dict(dict_) column_copies = {} potential_columns = {} mapper_args = {} table_args = inherited_table_args = None tablename = None parent_columns = () for base in cls.__mro__: if _is_mapped_class(...
464,522
def _as_declarative(cls, classname, dict_): # dict_ will be a dictproxy, which we can't write to, and we need to! dict_ = dict(dict_) column_copies = {} potential_columns = {} mapper_args = {} table_args = inherited_table_args = None tablename = None parent_columns = () for base in cls.__mro__: if _is_mapped_class(...
def _as_declarative(cls, classname, dict_): # dict_ will be a dictproxy, which we can't write to, and we need to! dict_ = dict(dict_) column_copies = {} potential_columns = {} mapper_args = {} table_args = inherited_table_args = None tablename = None parent_columns = () for base in cls.__mro__: if _is_mapped_class(...
464,523
def _as_declarative(cls, classname, dict_): # dict_ will be a dictproxy, which we can't write to, and we need to! dict_ = dict(dict_) column_copies = {} potential_columns = {} mapper_args = {} table_args = inherited_table_args = None tablename = None parent_columns = () for base in cls.__mro__: if _is_mapped_class(...
def _as_declarative(cls, classname, dict_): # dict_ will be a dictproxy, which we can't write to, and we need to! dict_ = dict(dict_) column_copies = {} potential_columns = {} mapper_args = {} table_args = inherited_table_args = None tablename = None parent_columns = () for base in cls.__mro__: if _is_mapped_class(...
464,524
def _as_declarative(cls, classname, dict_): # dict_ will be a dictproxy, which we can't write to, and we need to! dict_ = dict(dict_) column_copies = {} potential_columns = {} mapper_args = {} table_args = inherited_table_args = None tablename = None parent_columns = () for base in cls.__mro__: if _is_mapped_class(...
def _as_declarative(cls, classname, dict_): # dict_ will be a dictproxy, which we can't write to, and we need to! dict_ = dict(dict_) column_copies = {} potential_columns = {} mapper_args = {} table_args = inherited_table_args = None tablename = None parent_columns = () for base in cls.__mro__: if _is_mapped_class(...
464,525
def _as_declarative(cls, classname, dict_): # dict_ will be a dictproxy, which we can't write to, and we need to! dict_ = dict(dict_) column_copies = {} potential_columns = {} mapper_args = {} table_args = inherited_table_args = None tablename = None parent_columns = () for base in cls.__mro__: if _is_mapped_class(...
def _as_declarative(cls, classname, dict_): # dict_ will be a dictproxy, which we can't write to, and we need to! dict_ = dict(dict_) column_copies = {} potential_columns = {} mapper_args = {} table_args = inherited_table_args = None tablename = None parent_columns = () for base in cls.__mro__: if _is_mapped_class(...
464,526
def _as_declarative(cls, classname, dict_): # dict_ will be a dictproxy, which we can't write to, and we need to! dict_ = dict(dict_) column_copies = {} potential_columns = {} mapper_args = {} table_args = inherited_table_args = None tablename = None parent_columns = () for base in cls.__mro__: if _is_mapped_class(...
def _as_declarative(cls, classname, dict_): # dict_ will be a dictproxy, which we can't write to, and we need to! dict_ = dict(dict_) column_copies = {} potential_columns = {} mapper_args = {} table_args = inherited_table_args = None tablename = None parent_columns = () for base in cls.__mro__: if _is_mapped_class(...
464,527
def _as_declarative(cls, classname, dict_): # dict_ will be a dictproxy, which we can't write to, and we need to! dict_ = dict(dict_) column_copies = {} potential_columns = {} mapper_args = {} table_args = inherited_table_args = None tablename = None parent_columns = () for base in cls.__mro__: if _is_mapped_class(...
def _as_declarative(cls, classname, dict_): # dict_ will be a dictproxy, which we can't write to, and we need to! dict_ = dict(dict_) column_copies = {} potential_columns = {} mapper_args = {} table_args = inherited_table_args = None tablename = None parent_columns = () for base in cls.__mro__: if _is_mapped_class(...
464,528
def _as_declarative(cls, classname, dict_): # dict_ will be a dictproxy, which we can't write to, and we need to! dict_ = dict(dict_) column_copies = {} potential_columns = {} mapper_args = {} table_args = inherited_table_args = None tablename = None parent_columns = () for base in cls.__mro__: if _is_mapped_class(...
def _as_declarative(cls, classname, dict_): # dict_ will be a dictproxy, which we can't write to, and we need to! dict_ = dict(dict_) column_copies = {} potential_columns = {} mapper_args = {} table_args = inherited_table_args = None tablename = None parent_columns = () for base in cls.__mro__: if _is_mapped_class(...
464,529
def _as_declarative(cls, classname, dict_): # dict_ will be a dictproxy, which we can't write to, and we need to! dict_ = dict(dict_) column_copies = {} potential_columns = {} mapper_args = {} table_args = inherited_table_args = None tablename = None parent_columns = () for base in cls.__mro__: if _is_mapped_class(...
def _as_declarative(cls, classname, dict_): # dict_ will be a dictproxy, which we can't write to, and we need to! dict_ = dict(dict_) column_copies = {} potential_columns = {} mapper_args = {} table_args = inherited_table_args = None tablename = None parent_columns = () for base in cls.__mro__: if _is_mapped_class(...
464,530
def _as_declarative(cls, classname, dict_): # dict_ will be a dictproxy, which we can't write to, and we need to! dict_ = dict(dict_) column_copies = {} potential_columns = {} mapper_args = {} table_args = inherited_table_args = None tablename = None parent_columns = () for base in cls.__mro__: if _is_mapped_class(...
def _as_declarative(cls, classname, dict_): # dict_ will be a dictproxy, which we can't write to, and we need to! dict_ = dict(dict_) column_copies = {} potential_columns = {} mapper_args = {} table_args = inherited_table_args = None tablename = None parent_columns = () for base in cls.__mro__: if _is_mapped_class(...
464,531
def _as_declarative(cls, classname, dict_): # dict_ will be a dictproxy, which we can't write to, and we need to! dict_ = dict(dict_) column_copies = {} potential_columns = {} mapper_args = {} table_args = inherited_table_args = None tablename = None parent_columns = () for base in cls.__mro__: if _is_mapped_class(...
def _as_declarative(cls, classname, dict_): # dict_ will be a dictproxy, which we can't write to, and we need to! dict_ = dict(dict_) column_copies = {} potential_columns = {} mapper_args = {} table_args = inherited_table_args = None tablename = None parent_columns = () for base in cls.__mro__: if _is_mapped_class(...
464,532
def __setattr__(cls, key, value): if '__mapper__' in cls.__dict__: if isinstance(value, Column): _undefer_column_name(key, value) cls.__table__.append_column(value) cls.__mapper__.add_property(key, value) elif isinstance(value, ColumnProperty): for col in value.columns: if isinstance(col, Column) and col.table is None:...
def __setattr__(cls, key, value): if '__mapper__' in cls.__dict__: if isinstance(value, Column): _undefer_column_name(key, value) cls.__table__.append_column(value) cls.__mapper__.add_property(key, value) elif isinstance(value, ColumnProperty): for col in value.columns: if isinstance(col, Column) and col.table is None:...
464,533
def __getattr__(self, key): mapper = class_mapper(self.cls, compile=False) if mapper: prop = mapper.get_property(key, raiseerr=False) if prop is None: raise exceptions.InvalidRequestError( "Class %r does not have a mapped column named %r" % (self.cls, key)) elif not isinstance(prop, ColumnProperty): raise exceptions.I...
def __getattr__(self, key): mapper = class_mapper(self.cls, compile=False) if mapper: prop = mapper.get_property(key, raiseerr=False) if prop is None: raise exceptions.InvalidRequestError( "Class %r does not have a mapped column named %r" % (self.cls, key)) elif not isinstance(prop, ColumnProperty): raise exceptions.I...
464,534
def __getattr__(self, key): mapper = class_mapper(self.cls, compile=False) if mapper: prop = mapper.get_property(key, raiseerr=False) if prop is None: raise exceptions.InvalidRequestError( "Class %r does not have a mapped column named %r" % (self.cls, key)) elif not isinstance(prop, ColumnProperty): raise exceptions.I...
def __getattr__(self, key): mapper = class_mapper(self.cls, compile=False) if mapper: prop = mapper.get_property(key, raiseerr=False) if prop is None: raise exceptions.InvalidRequestError( "Class %r does not have a mapped column named %r" % (self.cls, key)) elif not isinstance(prop, ColumnProperty): raise exceptions.I...
464,535
def return_cls(): try: x = eval(arg, globals(), d) if isinstance(x, _GetColumns): return x.cls else: return x except NameError, n: raise exceptions.InvalidRequestError( "When compiling mapper %s, expression %r failed to locate a name (%r). " "If this is a class name, consider adding this relationship() to the %r " "cl...
def return_cls(): try: x = eval(arg, globals(), d) if isinstance(x, _GetColumns): return x.cls else: return x except NameError, n: raise exceptions.InvalidRequestError( "When compiling mapper %s, expression %r failed to locate a name (%r). " "If this is a class name, consider adding this relationship() to the %r " "cl...
464,536
def synonym_for(name, map_column=False): """Decorator, make a Python @property a query synonym for a column. A decorator version of :func:`~sqlalchemy.orm.synonym`. The function being decorated is the 'descriptor', otherwise passes its arguments through to synonym():: @synonym_for('col') @property def prop(self): re...
def synonym_for(name, map_column=False): """Decorator, make a Python @property a query synonym for a column. A decorator version of :func:`~sqlalchemy.orm.synonym`. The function being decorated is the 'descriptor', otherwise passes its arguments through to synonym():: @synonym_for('col') @property def prop(self): ret...
464,537
def declarative_base(bind=None, metadata=None, mapper=None, cls=object, name='Base', constructor=_declarative_constructor, metaclass=DeclarativeMeta): """Construct a base class for declarative class definitions. The new base class will be given a metaclass that produces appropriate :class:`~sqlalchemy.schema.Table` ob...
defdeclarative_base(bind=None,metadata=None,mapper=None,cls=object,name='Base',constructor=_declarative_constructor,metaclass=DeclarativeMeta):"""Constructabaseclassfordeclarativeclassdefinitions.Thenewbaseclasswillbegivenametaclassthatproducesappropriate:class:`~sqlalchemy.schema.Table`objectsandmakestheappropriate:fu...
464,538
def declarative_base(bind=None, metadata=None, mapper=None, cls=object, name='Base', constructor=_declarative_constructor, metaclass=DeclarativeMeta): """Construct a base class for declarative class definitions. The new base class will be given a metaclass that produces appropriate :class:`~sqlalchemy.schema.Table` ob...
def declarative_base(bind=None, metadata=None, mapper=None, cls=object, name='Base', constructor=_declarative_constructor, metaclass=DeclarativeMeta): """Construct a base class for declarative class definitions. The new base class will be given a metaclass that produces appropriate :class:`~sqlalchemy.schema.Table` ob...
464,539
def declarative_base(bind=None, metadata=None, mapper=None, cls=object, name='Base', constructor=_declarative_constructor, metaclass=DeclarativeMeta): """Construct a base class for declarative class definitions. The new base class will be given a metaclass that produces appropriate :class:`~sqlalchemy.schema.Table` ob...
def declarative_base(bind=None, metadata=None, mapper=None, cls=object, name='Base', constructor=_declarative_constructor, metaclass=DeclarativeMeta): """Construct a base class for declarative class definitions. The new base class will be given a metaclass that produces appropriate :class:`~sqlalchemy.schema.Table` ob...
464,540
def _get_default_schema_name(self, connection): user_name = connection.scalar("SELECT user_name() as user_name;") if user_name is not None: # now, get the default schema query = """ SELECT default_schema_name FROM sys.database_principals WHERE name = ? AND type = 'S' """ try: default_schema_name = connection.scalar(que...
def _get_default_schema_name(self, connection): user_name = connection.scalar("SELECT user_name() as user_name;") if user_name is not None: # now, get the default schema query = sql.text(""" SELECT default_schema_name FROM sys.database_principals WHERE name = ? AND type = 'S' """ try: default_schema_name = connection.s...
464,541
def _get_default_schema_name(self, connection): user_name = connection.scalar("SELECT user_name() as user_name;") if user_name is not None: # now, get the default schema query = """ SELECT default_schema_name FROM sys.database_principals WHERE name = ? AND type = 'S' """ try: default_schema_name = connection.scalar(que...
def _get_default_schema_name(self, connection): user_name = connection.scalar("SELECT user_name() as user_name;") if user_name is not None: # now, get the default schema query = """ SELECT default_schema_name FROM sys.database_principals WHERE name = :name AND type = 'S' """ try: default_schema_name = connection.scalar...
464,542
def _get_default_schema_name(self, connection): user_name = connection.scalar("SELECT user_name() as user_name;") if user_name is not None: # now, get the default schema query = """ SELECT default_schema_name FROM sys.database_principals WHERE name = ? AND type = 'S' """ try: default_schema_name = connection.scalar(que...
def _get_default_schema_name(self, connection): user_name = connection.scalar("SELECT user_name() as user_name;") if user_name is not None: # now, get the default schema query = """) SELECT default_schema_name FROM sys.database_principals WHERE name = ? AND type = 'S' """) try: default_schema_name = connection.scalar(q...
464,543
def _get_default_schema_name(self, connection): user_name = connection.scalar("SELECT user_name() as user_name;") if user_name is not None: # now, get the default schema query = """ SELECT default_schema_name FROM sys.database_principals WHERE name = ? AND type = 'S' """ try: default_schema_name = connection.scalar(que...
def _get_default_schema_name(self, connection): user_name = connection.scalar("SELECT user_name() as user_name;") if user_name is not None: # now, get the default schema query = """ SELECT default_schema_name FROM sys.database_principals WHERE name = ? AND type = 'S' """ try: default_schema_name = connection.scalar(que...
464,544
def append(self, append): ...
def append(self, append): ...
464,545
def append(self, obj, target): # this will be needed, but not # sure why we don't seem to need it yet
def append(self, obj, target): # this will be needed, but not # sure why we don't seem to need it yet
464,546
def bind_processor(self, dialect): return None
def bind_processor(self, dialect): return None
464,547
def getcol(row): return processor(row[index])
def getcol(row): return processor(row[index])
464,548
def test_mutable_identity(self): metadata = MetaData(testing.db)
def test_mutable_identity(self): metadata = MetaData(testing.db)
464,549
def _get_attr(self): return self._some_attr
def _get_attr(self): return self._some_attr
464,550
def _set_attr(self, attr): self._some_attr = attr
def id = Column(Integer, primary_key=True) _set_attr(self, id = Column(Integer, primary_key=True) attr): id = Column(Integer, primary_key=True) self._some_attr id = Column(Integer, primary_key=True) = id = Column(Integer, primary_key=True) attr
464,551
def attr(self): return self._some_attr
def attr(self): return self._some_attr
464,552
def attr(self): return self._some_attr
def attr(self): return self._some_attr
464,553
def setup_class(cls): metadata = MetaData(testing.db)
def setup_class(cls): metadata = MetaData(testing.db)
464,554
def test_char_length(self): self.assert_compile(VARCHAR(50),"VARCHAR(50 CHAR)")
def test_char_length(self): self.assert_compile(VARCHAR(50),"VARCHAR(50 CHAR)")
464,555
def __get__(self, instance, owner): if instance is None: return self else: return instance._should_log_debug and 'debug' or \ (instance._should_log_info and True or False)
def __get__(self, instance, owner): if instance is None: return self else: return instance._should_log_debug and 'debug' or \ (instance._should_log_info and True or False)
464,556
def test_attached_as_schema(self): cx = testing.db.connect() try: cx.execute('ATTACH DATABASE ":memory:" AS test_schema') dialect = cx.dialect assert dialect.table_names(cx, 'test_schema') == []
def test_attached_as_schema(self): cx = testing.db.connect() try: cx.execute('ATTACH DATABASE ":memory:" AS test_schema') dialect = cx.dialect assert dialect.table_names(cx, 'test_schema') == []
464,557
def test_attached_as_schema(self): cx = testing.db.connect() try: cx.execute('ATTACH DATABASE ":memory:" AS test_schema') dialect = cx.dialect assert dialect.table_names(cx, 'test_schema') == []
def test_attached_as_schema(self): cx = testing.db.connect() try: cx.execute('ATTACH DATABASE ":memory:" AS test_schema') dialect = cx.dialect assert dialect.table_names(cx, 'test_schema') == []
464,558
def test_attached_as_schema(self): cx = testing.db.connect() try: cx.execute('ATTACH DATABASE ":memory:" AS test_schema') dialect = cx.dialect assert dialect.table_names(cx, 'test_schema') == []
def test_attached_as_schema(self): cx = testing.db.connect() try: cx.execute('ATTACH DATABASE ":memory:" AS test_schema') dialect = cx.dialect assert dialect.table_names(cx, 'test_schema') == []
464,559
def test_temp_table_reflection(self): cx = testing.db.connect() try: cx.execute('CREATE TEMPORARY TABLE tempy (id INT)')
def test_temp_table_reflection(self): cx = testing.db.connect() try: cx.execute('CREATE TEMPORARY TABLE tempy (id INT)')
464,560
def test_default_exec(self): metadata = MetaData(testing.db) t1 = Table('t1', metadata, Column(u'special_col', Integer, Sequence('special_col'), primary_key=True), Column('data', String(50)) # to appease SQLite without DEFAULT VALUES ) t1.create()
def test_default_exec(self): metadata = MetaData(testing.db) t1 = Table('t1', metadata, Column(u'special_col', Integer, Sequence('special_col'), primary_key=True), Column('data', String(50)) # to appease SQLite without DEFAULT VALUES ) t1.create()
464,561
def test_default_exec(self): metadata = MetaData(testing.db) t1 = Table('t1', metadata, Column(u'special_col', Integer, Sequence('special_col'), primary_key=True), Column('data', String(50)) # to appease SQLite without DEFAULT VALUES ) t1.create()
def test_default_exec(self): metadata = MetaData(testing.db) t1 = Table('t1', metadata, Column(u'special_col', Integer, Sequence('special_col'), primary_key=True), Column('data', String(50)) # to appease SQLite without DEFAULT VALUES ) t1.create()
464,562
def assert_compile(self, clause, result, params=None, checkparams=None, dialect=None, use_default_dialect=False): if use_default_dialect: dialect = default.DefaultDialect() if dialect is None: dialect = getattr(self, '__dialect__', None)
def assert_compile(self, clause, result, params=None, checkparams=None, dialect=None, use_default_dialect=False): if use_default_dialect: dialect = default.DefaultDialect() if dialect is None: dialect = getattr(self, '__dialect__', None)
464,563
def _get_cache_parameters(query): """For a query with cache_region and cache_namespace configured, return the correspoinding Cache instance and cache key, based on this query's current criterion and parameter values. """ if not hasattr(query, '_cache_parameters'): raise ValueError("This Query does not have caching par...
def _get_cache_parameters(query): """For a query with cache_region and cache_namespace configured, return the correspoinding Cache instance and cache key, based on this query's current criterion and parameter values. """ if not hasattr(query, '_cache_parameters'): raise ValueError("This Query does not have caching par...
464,564
def _get_cache_parameters(query): """For a query with cache_region and cache_namespace configured, return the correspoinding Cache instance and cache key, based on this query's current criterion and parameter values. """ if not hasattr(query, '_cache_parameters'): raise ValueError("This Query does not have caching par...
def assert cache_key is not None, "Cache key was None !" _get_cache_parameters(query): assert cache_key is not None, "Cache key was None !" """For assert cache_key is not None, "Cache key was None !" a assert cache_key is not None, "Cache key was None !" query assert cache_key is not None, "Cache key was None !" w...
464,565
def visit_bindparam(bind): value = query._params.get(bind.key, bind.value) # lazyloader may dig a callable in here, intended # to late-evaluate params after autoflush is called. # convert to a scalar value. if callable(value): value = value() v.append(value)
def visit_bindparam(bind): value = query._params.get(bind.key, bind.value) # lazyloader may dig a callable in here, intended # to late-evaluate params after autoflush is called. # convert to a scalar value. if callable(value): value = value() v.append(value)
464,566
def test_unicode_warnings(self): """test the warnings raised when SQLA must coerce unicode binds, *and* is using the Unicode type. """
deftest_unicode_warnings(self):"""testthewarningsraisedwhenSQLAmustcoerceunicodebinds,*and*isusingtheUnicodetype."""
464,567
def test_conn_execute(self): from sqlalchemy.sql.expression import FunctionElement from sqlalchemy.ext.compiler import compiles class myfunc(FunctionElement): type = DATE() @compiles(myfunc) def compile(elem, compiler, **kw): return compiler.process(func.current_date())
def test_conn_execute(self): from sqlalchemy.sql.expression import FunctionElement from sqlalchemy.ext.compiler import compiles class myfunc(FunctionElement): type = Date() @compiles(myfunc) def compile(elem, compiler, **kw): return compiler.process(func.current_date())
464,568
def with_entities(self, *entities): """Return a new :class:`.Query` replacing the SELECT list with the given entities. e.g.::
def with_entities(self, *entities): """Return a new :class:`.Query` replacing the SELECT list with the given entities. e.g.::
464,569
def test_unicode_warnings(self): """test the warnings raised when SQLA must coerce unicode binds, *and* is using the Unicode type. """
deftest_unicode_warnings(self):"""testthewarningsraisedwhenSQLAmustcoerceunicodebinds,*and*isusingtheUnicodetype."""
464,570
def test_unicode_warnings(self): """test the warnings raised when SQLA must coerce unicode binds, *and* is using the Unicode type. """
deftest_unicode_warnings(self):"""testthewarningsraisedwhenSQLAmustcoerceunicodebinds,*and*isusingtheUnicodetype."""
464,571
def create_engine(*args, **kwargs): """Create a new Engine instance. The standard method of specifying the engine is via URL as the first positional argument, to indicate the appropriate database dialect and connection arguments, with additional keyword arguments sent as options to the dialect and resulting Engine. T...
def create_engine(*args, **kwargs): """Create a new Engine instance. The standard method of specifying the engine is via URL as the first positional argument, to indicate the appropriate database dialect and connection arguments, with additional keyword arguments sent as options to the dialect and resulting Engine. T...
464,572
def create_engine(*args, **kwargs): """Create a new Engine instance. The standard method of specifying the engine is via URL as the first positional argument, to indicate the appropriate database dialect and connection arguments, with additional keyword arguments sent as options to the dialect and resulting Engine. T...
def create_engine(*args, **kwargs): """Create a new Engine instance. The standard method of specifying the engine is via URL as the first positional argument, to indicate the appropriate database dialect and connection arguments, with additional keyword arguments sent as options to the dialect and resulting Engine. T...
464,573
def _test_cascade_to_pending(self, cascade, expire_or_refresh): mapper(User, users, properties={ 'addresses':relationship(Address, cascade=cascade) }) mapper(Address, addresses) s = create_session()
def _test_cascade_to_pending(self, cascade, expire_or_refresh): mapper(User, users, properties={ 'addresses':relationship(Address, cascade=cascade) }) mapper(Address, addresses) s = create_session()
464,574
def _extract_error_code(self, exception): # e.g.: DBAPIError: (Error) Table 'test.u2' doesn't exist # [SQLCode: 1146], [SQLState: 42S02] 'DESCRIBE `u2`' () m = re.compile(r"\[SQLCode\: (\d+)\]").search(str(exception.orig.args)) c = m.group(1) if c: return int(c)
def _extract_error_code(self, exception): # e.g.: DBAPIError: (Error) Table 'test.u2' doesn't exist # [SQLCode: 1146], [SQLState: 42S02] 'DESCRIBE `u2`' () m = re.compile(r"\[SQLCode\: (\d+)\]").search(str(exception.args)) c = m.group(1) if c: return int(c)
464,575
def result_processor(self, dialect, coltype): if self.asdecimal: if getattr(self, 'scale', None) is not None and dialect.supports_native_decimal: return None else: return processors.to_decimal_processor_factory(decimal.Decimal) else: #XXX: if the DBAPI returns a float (this is likely, given the # processor when asdecim...
def result_processor(self, dialect, coltype): if self.asdecimal: if getattr(self, 'scale', None) is None: return processors.to_decimal_processor_factory(decimal.Decimal) elif dialect.supports_native_decimal: return None else: return processors.to_decimal_processor_factory(decimal.Decimal) else: #XXX: if the DBAPI r...
464,576
def result_processor(self, dialect, coltype): if self.asdecimal: if getattr(self, 'scale', None) is not None and dialect.supports_native_decimal: return None else: return processors.to_decimal_processor_factory(decimal.Decimal) else: #XXX: if the DBAPI returns a float (this is likely, given the # processor when asdecim...
def result_processor(self, dialect, coltype): if self.asdecimal: if getattr(self, 'scale', None) is not None and dialect.supports_native_decimal: return None else: return processors.to_decimal_processor_factory(decimal.Decimal, self.scale) else: #XXX: if the DBAPI returns a float (this is likely, given the # processor...
464,577
def result_processor(self, dialect, coltype): if self.asdecimal: if getattr(self, 'scale', None) is not None and dialect.supports_native_decimal: return None else: return processors.to_decimal_processor_factory(decimal.Decimal) else: #XXX: if the DBAPI returns a float (this is likely, given the # processor when asdecim...
def result_processor(self, dialect, coltype): if self.asdecimal: if getattr(self, 'scale', None) is not None and dialect.supports_native_decimal: else: return processors.to_decimal_processor_factory(decimal.Decimal) else: #XXX: if the DBAPI returns a float (this is likely, given the # processor when asdecimal is True),...
464,578
def cores(): ''' Returns the number of CPUs in the system ''' # ------------------------------------- # # From: http://pyprocessing.berlios.de/ # # ------------------------------------- # try: count = 0 if system("linux"): ##Another way count = os.sysconf('SC_NPROCESSORS_ONLN') #for line in open('/proc/cpuinfo'): # ...
defcores():'''ReturnsthenumberofCPUsinthesystem'''#-------------------------------------##From:http://pyprocessing.berlios.de/##-------------------------------------#try:count=0ifsystem("linux"):##Anotherwaycount=os.sysconf('SC_NPROCESSORS_ONLN')#forlineinopen('/proc/cpuinfo'):#ifline.startswith("coreid"):#count+=1elif...
464,579
def cores(): ''' Returns the number of CPUs in the system ''' # ------------------------------------- # # From: http://pyprocessing.berlios.de/ # # ------------------------------------- # try: count = 0 if system("linux"): ##Another way count = os.sysconf('SC_NPROCESSORS_ONLN') #for line in open('/proc/cpuinfo'): # ...
def cores(): ''' Returns the number of CPUs in the system ''' # ------------------------------------- # # From: http://pyprocessing.berlios.de/ # # ------------------------------------- # try: count = 0 if system("linux"): ##Another way count = os.sysconf('SC_NPROCESSORS_ONLN') #for line in open('/proc/cpuinfo'): # if ...
464,580
def cores(): ''' Returns the number of CPUs in the system ''' # ------------------------------------- # # From: http://pyprocessing.berlios.de/ # # ------------------------------------- # try: count = 0 if system("linux"): ##Another way count = os.sysconf('SC_NPROCESSORS_ONLN') #for line in open('/proc/cpuinfo'): # ...
def cores(): ''' Returns the number of CPUs in the system ''' # ------------------------------------- # # From: http://pyprocessing.berlios.de/ # # ------------------------------------- # try: count = 0 if system("linux"): ##Another way count = os.sysconf('SC_NPROCESSORS_ONLN') #for line in open('/proc/cpuinfo'): # ...
464,581
def cores(): ''' Returns the number of CPUs in the system ''' # ------------------------------------- # # From: http://pyprocessing.berlios.de/ # # ------------------------------------- # try: count = 0 if system("linux"): ##Another way count = os.sysconf('SC_NPROCESSORS_ONLN') #for line in open('/proc/cpuinfo'): # ...
defcores():'''ReturnsthenumberofCPUsinthesystem'''#-------------------------------------##From:http://pyprocessing.berlios.de/##-------------------------------------#try:count=0ifsystem("linux"):##Anotherwaycount=os.sysconf('SC_NPROCESSORS_ONLN')#forlineinopen('/proc/cpuinfo'):#ifline.startswith("coreid"):#count+=1elif...
464,582
def get_dists(*args): """ Find all dists refered in args """ ds = parse(*args)['dist'] dists = get_dists_helper(ds,[]) dists.append("src\\basic.dist") #print dists return dists
def get_dists(*args): """ Find all dists refered in args """ ds = parse(*args)['dist'] dists = get_dists_helper(ds,[]) dists.append("src/basic.dist") #print dists return dists
464,583
def get(self): self.render( "templates/contact.html", sets=emptysquare_collection()['set'], current_slug='contact', current_set_index=-1, next_set_slug=emptysquare_collection()['set'][0]['slug'] )
def get(self): self.render( "templates/contact.html", sets=emptysquare_collection()['set'], current_slug='contact', current_set_index=-1, next_set_slug=emptysquare_collection()['set'][0]['slug'] )
464,584
def get(self, slug, photo_index): if 'facebookexternalhit' in self.request.headers['User-Agent']: # A visitor to my site has clicked "Like", so FB is scraping the # hashless URL sets = emptysquare_collection()['set'] current_set_index = index_for_set_slug(slug) return self.render( "templates/photo_for_facebook.html", s...
def get(self, slug, photo_index): if 'facebookexternalhit' in self.request.headers['User-Agent']: # A visitor to my site has clicked "Like", so FB is scraping the # hashless URL sets = emptysquare_collection()['set'] current_set_index = index_for_set_slug(slug) return self.render( "templates/photo_for_facebook.html", s...
464,585
def add_libdirs(envvar, sep, fatal=0): v = os.environ.get(envvar) if not v: return for dir in string.split(v, sep): dir = string.strip(dir) if not dir: continue dir = os.path.normpath(dir) if os.path.isdir(dir): if not dir in library_dirs: library_dirs.append(dir) elif fatal: print "FATAL: bad directory %s in environme...
def add_libdirs(envvar, sep, fatal=0): v = os.environ.get(envvar) if not v: return for dir in string.split(v, sep): dir = string.strip(dir) if not dir: continue dir = os.path.normpath(dir) if os.path.isdir(dir): if not dir in library_dirs: library_dirs.append(dir) elif fatal: print "FATAL: bad directory %s in environme...
464,586
def countCreatedToday(self,request):
def countCreatedToday(self,request):
464,587
def countCreatedToday(self,request):
def countCreatedToday(self,request):
464,588
def countUpdatedToday(self,request):
def countUpdatedToday(self,request):
464,589
def fullTextSearch(self,request): # addresses/fullTextSearch?fields=street,city,housenumber&query=ch%20du%2028&tolerance=0.005&easting=6.62379551&northing=46.51687241&limit=20&distinct=true # Read request parameters fields = request.params['fields']
def fullTextSearch(self,request): # addresses/fullTextSearch?fields=street,city,housenumber&query=ch%20du%2028&tolerance=0.005&easting=6.62379551&northing=46.51687241&limit=20&distinct=true # Read request parameters fields = request.params['fields']
464,590
def create(self): """POST /uploads: Create a new item""" archive = request.POST['uploaded_file'] email = request.POST['email'] permanent_file = open(os.path.join(self.main_root + '/trunk/openaddresses/uploads',archive.filename.lstrip(os.sep)), 'w') shutil.copyfileobj(archive.file, permanent_file) archive.file.close() p...
def create(self): """POST /uploads: Create a new item""" archive = request.POST['uploaded_file'] email = request.POST['email'] permanent_file = open(os.path.join(self.main_root + '/trunk/openaddresses/uploads',archive.filename.lstrip(os.sep)), 'w') shutil.copyfileobj(archive.file, permanent_file) archive.file.close() p...
464,591
def mail(self, to, subject, text): # http://kutuma.blogspot.com/2007/08/sending-emails-via-gmail-with-python.html msg = MIMEMultipart()
def mail(self, to, subject, text): # http://kutuma.blogspot.com/2007/08/sending-emails-via-gmail-with-python.html msg = MIMEMultipart()
464,592
def index(self, format='html'): """GET /uploads: All items in the collection""" # url('uploads') return os.getcwd()
def index(self, format='html'): """GET /uploads: All items in the collection""" # url('uploads') return os.getcwd()
464,593
def create(self): """POST /uploads: Create a new item""" archive = request.POST['uploaded_file'] email = request.POST['email'] permanent_file = open(archive.filename.lstrip(os.sep),'w') shutil.copyfileobj(archive.file, permanent_file) archive.file.close() permanent_file.close() self.mail(email,"OpenAddresses.org upload...
def create(self): """POST /uploads: Create a new item""" archive = request.POST['uploaded_file'] email = request.POST['email'] permanent_file = open(os.path.join(self.main_root + '/trunk/openaddresses/uploads',archive.filename.lstrip(os.sep)), 'w') shutil.copyfileobj(archive.file, permanent_file) archive.file.close() p...
464,594
def create(self): """POST /uploads: Create a new item""" archive = request.POST['uploaded_file'] email = request.POST['email'] permanent_file = open(archive.filename.lstrip(os.sep),'w') shutil.copyfileobj(archive.file, permanent_file) archive.file.close() permanent_file.close() self.mail(email,"OpenAddresses.org upload...
def create(self): """POST /uploads: Create a new item""" archive = request.POST['uploaded_file'] email = request.POST['email'] permanent_file = open(archive.filename.lstrip(os.sep),'w') shutil.copyfileobj(archive.file, permanent_file) archive.file.close() permanent_file.close() self.mail(email,"OpenAddresses.org upload...
464,595
def fullTextSearch(self,request): # addresses/fullTextSearch?fields=street,city,housenumber&query=ch%20du%2028&tolerance=0.005&easting=6.62379551&northing=46.51687241&limit=20&distinct=true # Read request parameters fields = request.params['fields']
def fullTextSearch(self,request): # addresses/fullTextSearch?fields=street,city,housenumber&query=ch%20du%2028&tolerance=0.005&easting=6.62379551&northing=46.51687241&limit=20&distinct=true # Read request parameters fields = request.params['fields']
464,596
def fullTextSearch(self,request): # addresses/fullTextSearch?fields=street,city,housenumber&query=ch%20du%2028&tolerance=0.005&easting=6.62379551&northing=46.51687241&limit=20&distinct=true # Read request parameters fields = request.params['fields']
def fullTextSearch(self,request): # addresses/fullTextSearch?fields=street,city,housenumber&query=ch%20du%2028&tolerance=0.005&easting=6.62379551&northing=46.51687241&limit=20&distinct=true # Read request parameters fields = request.params['fields']
464,597
def fullTextSearch(self,request): # addresses/fullTextSearch?fields=street,city,housenumber&query=ch%20du%2028&tolerance=0.005&easting=6.62379551&northing=46.51687241&limit=20&distinct=true # Read request parameters fields = request.params['fields']
def fullTextSearch(self,request): # addresses/fullTextSearch?fields=street,city,housenumber&query=ch%20du%2028&tolerance=0.005&easting=6.62379551&northing=46.51687241&limit=20&distinct=true # Read request parameters fields = request.params['fields']
464,598
def fullTextSearch(self,request): # addresses/fullTextSearch?fields=street,city,housenumber&query=ch%20du%2028&tolerance=0.005&easting=6.62379551&northing=46.51687241&limit=20&distinct=true # Read request parameters fields = request.params['fields']
def fullTextSearch(self,request): # addresses/fullTextSearch?fields=street,city,housenumber&query=ch%20du%2028&tolerance=0.005&easting=6.62379551&northing=46.51687241&limit=20&distinct=true # Read request parameters fields = request.params['fields']
464,599