rem stringlengths 1 322k | add stringlengths 0 2.05M | context stringlengths 4 228k | meta stringlengths 156 215 |
|---|---|---|---|
from sqlalchemy.cresultproxy import rowproxy_reconstructor | from sqlalchemy.cresultproxy import safe_rowproxy_reconstructor def rowproxy_reconstructor(cls, state): return safe_rowproxy_reconstructor(cls, state) | def _commit_twophase_impl(self, xid, is_prepared): return proxy.commit_twophase(self, super(ProxyConnection, self)._commit_twophase_impl, xid, is_prepared) | ded4e1d76b634b94a161bc91a3b4eb9d8777332b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1074/ded4e1d76b634b94a161bc91a3b4eb9d8777332b/base.py |
(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='\\'), "mytable.myid NOT LIKE :myid_1 ESCAPE '\\'",... | ( 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='\\'), "mytable.myid NOT LIKE :myid_1 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', escape=... | 7dcfc49b349377b86f4d7d0e0c804f4d19282d15 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1074/7dcfc49b349377b86f4d7d0e0c804f4d19282d15/test_compiler.py |
for attr in '_columns', '_primary_key_foreign_keys', \ | for attr in '_columns', '_primary_key', '_foreign_keys', \ | def _reset_exported(self): """delete memoized collections when a FromClause is cloned.""" | f1648baa4bca7c4c3f2ab683ca34c2f271fc48f2 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1074/f1648baa4bca7c4c3f2ab683ca34c2f271fc48f2/expression.py |
(VARCHAR(10), "VARCHAR(10)"), | (VARCHAR(10), ("VARCHAR(10)","VARCHAR(10 CHAR)")), | 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... | 832d508816aae51af1f08e37a0e964ce41755104 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1074/832d508816aae51af1f08e37a0e964ce41755104/test_types.py |
def with_hint(self, selectable, text, dialect_name=None): | def with_hint(self, selectable, text, dialect_name='*'): | 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... | cb610d783e6ae6cab088437e333ee7b75c41867d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1074/cb610d783e6ae6cab088437e333ee7b75c41867d/query.py |
cx_oracle_ver = None | cx_oracle_ver = (0, 0, 0) | 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... | aabd00218ba7b6eb3e521b171c90aee4782b480f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1074/aabd00218ba7b6eb3e521b171c90aee4782b480f/cx_oracle.py |
MSSQLCompiler.render_literal_value(self, value, type_) | return super(MSSQLStrictCompiler, self).render_literal_value(value, type_) | 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... | f9fc9f85affff548a298e6f8a4db497dff6ea6f3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1074/f9fc9f85affff548a298e6f8a4db497dff6ea6f3/base.py |
active_history = self.parent_property.direction is not interfaces.MANYTOONE, | active_history = not self.use_get, | 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,... | c03b434104368b1c025f45987d7a3fa8048d5e37 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1074/c03b434104368b1c025f45987d7a3fa8048d5e37/strategies.py |
% (name, name)) | % (name, name), globals()) | 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) | 0ee04dfcb07b8ba1deaa0db51740bea31f10f54f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1074/0ee04dfcb07b8ba1deaa0db51740bea31f10f54f/test_parseconnect.py |
@profiling.function_call_count(64, {'2.4': 42, '2.7':67, | @profiling.function_call_count(72, {'2.4': 42, '2.7':67, | def setup(self): global pool pool = QueuePool(creator=self.Connection, pool_size=3, max_overflow=-1, use_threadlocal=True) | dd2b208d867c58403cbf2ff0f37b61942460204f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1074/dd2b208d867c58403cbf2ff0f37b61942460204f/test_pool.py |
engineer_id = Column('id', Integer, ForeignKey('people.id'), primary_key=True) | engineer_id = Column('id', Integer, ForeignKey('people.id'), primary_key=True) | def uc_name(self): return self.name.upper() | 47663a62287b4563a15dc08b4942a49616f9f1df /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1074/47663a62287b4563a15dc08b4942a49616f9f1df/declarative.py |
Like :func:`~sqlalchemy.orm.relationship`, all :class:`~sqlalchemy.orm.interfaces.MapperProperty` subclasses such as :func:`~sqlalchemy.orm.deferred`, :func:`~sqlalchemy.orm.column_property`, etc. ultimately involve references to columns, and therefore have the :func:`~sqlalchemy.util.classproperty` requirement so that... | Like :func:`~sqlalchemy.orm.relationship`, all :class:`~sqlalchemy.orm.interfaces.MapperProperty` subclasses such as :func:`~sqlalchemy.orm.deferred`, :func:`~sqlalchemy.orm.column_property`, etc. ultimately involve references to columns, and therefore have the :func:`~sqlalchemy.util.classproperty` requirement so that... | def target(cls): return relationship("Target", primaryjoin="Target.id==%s.target_id" % cls.__name__ ) | 47663a62287b4563a15dc08b4942a49616f9f1df /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1074/47663a62287b4563a15dc08b4942a49616f9f1df/declarative.py |
__tablename__ = None | primary_language = Column(String(50)) | def __tablename__(cls): if has_inherited_table(cls): return None return cls.__name__.lower() | 47663a62287b4563a15dc08b4942a49616f9f1df /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1074/47663a62287b4563a15dc08b4942a49616f9f1df/declarative.py |
primary_language = Column(String(50)) | def __tablename__(cls): if has_inherited_table(cls): return None return cls.__name__.lower() | 47663a62287b4563a15dc08b4942a49616f9f1df /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1074/47663a62287b4563a15dc08b4942a49616f9f1df/declarative.py | |
if (decl.has_inherited_table(cls) and TableNameMixin not in cls.__bases__): | if (has_inherited_table(cls) and Tablename not in cls.__bases__): | def __tablename__(cls): if (decl.has_inherited_table(cls) and TableNameMixin not in cls.__bases__): return None return cls.__name__.lower() | 47663a62287b4563a15dc08b4942a49616f9f1df /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1074/47663a62287b4563a15dc08b4942a49616f9f1df/declarative.py |
__tablename__ = None | primary_language = Column(String(50)) | def __tablename__(cls): if (decl.has_inherited_table(cls) and TableNameMixin not in cls.__bases__): return None return cls.__name__.lower() | 47663a62287b4563a15dc08b4942a49616f9f1df /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1074/47663a62287b4563a15dc08b4942a49616f9f1df/declarative.py |
primary_language = Column(String(50)) | def __tablename__(cls): if (decl.has_inherited_table(cls) and TableNameMixin not in cls.__bases__): return None return cls.__name__.lower() | 47663a62287b4563a15dc08b4942a49616f9f1df /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1074/47663a62287b4563a15dc08b4942a49616f9f1df/declarative.py | |
__tablename__ = None | id = Column(Integer, ForeignKey('person.id'), primary_key=True) preferred_recreation = Column(String(50)) | def __tablename__(cls): if (decl.has_inherited_table(cls) and TableNameMixin not in cls.__bases__): return None return cls.__name__.lower() | 47663a62287b4563a15dc08b4942a49616f9f1df /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1074/47663a62287b4563a15dc08b4942a49616f9f1df/declarative.py |
preferred_recreation = Column(String(50)) | def __tablename__(cls): if (decl.has_inherited_table(cls) and TableNameMixin not in cls.__bases__): return None return cls.__name__.lower() | 47663a62287b4563a15dc08b4942a49616f9f1df /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1074/47663a62287b4563a15dc08b4942a49616f9f1df/declarative.py | |
from sqlalchemy.orm import synonym as _orm_synonym, mapper, comparable_property, class_mapper | from sqlalchemy.orm import synonym as _orm_synonym, mapper,\ comparable_property, class_mapper | def __table_args__(self): args = dict() args.update(MySQLSettings.__table_args__) args.update(MyOtherMixin.__table_args__) return args | 47663a62287b4563a15dc08b4942a49616f9f1df /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1074/47663a62287b4563a15dc08b4942a49616f9f1df/declarative.py |
__all__ = 'declarative_base', 'synonym_for', 'comparable_using', 'instrument_declarative' | __all__ = 'declarative_base', 'synonym_for', \ 'comparable_using', 'instrument_declarative' | def __table_args__(self): args = dict() args.update(MySQLSettings.__table_args__) args.update(MyOtherMixin.__table_args__) return args | 47663a62287b4563a15dc08b4942a49616f9f1df /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1074/47663a62287b4563a15dc08b4942a49616f9f1df/declarative.py |
"""Given a class, return True if any of the classes it inherits from has a mapped table, otherwise return False. | """Given a class, return True if any of the classes it inherits from has a mapped table, otherwise 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 | 47663a62287b4563a15dc08b4942a49616f9f1df /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1074/47663a62287b4563a15dc08b4942a49616f9f1df/declarative.py |
"Tuple form of __table_args__ is " "(arg1, arg2, arg3, ..., {'kw1':val1, 'kw2':val2, ...})" ) | "Tuple form of __table_args__ is " "(arg1, arg2, arg3, ..., {'kw1':val1, " "'kw2':val2, ...})" ) | 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(... | 47663a62287b4563a15dc08b4942a49616f9f1df /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1074/47663a62287b4563a15dc08b4942a49616f9f1df/declarative.py |
*(tuple(cols) + tuple(args)), **table_kw) | *(tuple(cols) + tuple(args)), **table_kw) | 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(... | 47663a62287b4563a15dc08b4942a49616f9f1df /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1074/47663a62287b4563a15dc08b4942a49616f9f1df/declarative.py |
"Can't add additional column %r when specifying __table__" % key ) | "Can't add additional column %r when " "specifying __table__" % key ) | 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(... | 47663a62287b4563a15dc08b4942a49616f9f1df /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1074/47663a62287b4563a15dc08b4942a49616f9f1df/declarative.py |
mapper_args['inherits'] = cls._decl_class_registry.get(c.__name__, None) | mapper_args['inherits'] = cls._decl_class_registry.get( c.__name__, None) | 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(... | 47663a62287b4563a15dc08b4942a49616f9f1df /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1074/47663a62287b4563a15dc08b4942a49616f9f1df/declarative.py |
"specified and does not inherit from an existing table-mapped class." % cls | "specified and does not inherit from an existing " "table-mapped class." % cls | 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(... | 47663a62287b4563a15dc08b4942a49616f9f1df /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1074/47663a62287b4563a15dc08b4942a49616f9f1df/declarative.py |
inherited_mapper = class_mapper(mapper_args['inherits'], compile=False) | inherited_mapper = class_mapper(mapper_args['inherits'], compile=False) | 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(... | 47663a62287b4563a15dc08b4942a49616f9f1df /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1074/47663a62287b4563a15dc08b4942a49616f9f1df/declarative.py |
"Can't place __table_args__ on an inherited class with no table." | "Can't place __table_args__ on an inherited class " "with no table." | 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(... | 47663a62287b4563a15dc08b4942a49616f9f1df /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1074/47663a62287b4563a15dc08b4942a49616f9f1df/declarative.py |
"Can't place primary key columns on an inherited class with no table." | "Can't place primary key columns on an inherited " "class with no table." | 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(... | 47663a62287b4563a15dc08b4942a49616f9f1df /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1074/47663a62287b4563a15dc08b4942a49616f9f1df/declarative.py |
"Column '%s' on class %s conflicts with existing column '%s'" % (c, cls, inherited_table.c[c.name]) ) | "Column '%s' on class %s conflicts with " "existing column '%s'" % (c, cls, inherited_table.c[c.name]) ) | 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(... | 47663a62287b4563a15dc08b4942a49616f9f1df /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1074/47663a62287b4563a15dc08b4942a49616f9f1df/declarative.py |
inherited_mapper = class_mapper(mapper_args['inherits'], compile=False) | inherited_mapper = class_mapper(mapper_args['inherits'], compile=False) | 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(... | 47663a62287b4563a15dc08b4942a49616f9f1df /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1074/47663a62287b4563a15dc08b4942a49616f9f1df/declarative.py |
cls.__mapper__ = mapper_cls(cls, table, properties=our_stuff, **mapper_args) | cls.__mapper__ = mapper_cls(cls, table, properties=our_stuff, **mapper_args) | 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(... | 47663a62287b4563a15dc08b4942a49616f9f1df /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1074/47663a62287b4563a15dc08b4942a49616f9f1df/declarative.py |
cls.__mapper__.add_property(key, _deferred_relationship(cls, value)) | cls.__mapper__.add_property( key, _deferred_relationship(cls, value) ) | 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:... | 47663a62287b4563a15dc08b4942a49616f9f1df /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1074/47663a62287b4563a15dc08b4942a49616f9f1df/declarative.py |
"Class %r does not have a mapped column named %r" % (self.cls, key)) | "Class %r does not have a mapped column named %r" % (self.cls, key)) | 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... | 47663a62287b4563a15dc08b4942a49616f9f1df /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1074/47663a62287b4563a15dc08b4942a49616f9f1df/declarative.py |
"Property %r is not an instance of" " ColumnProperty (i.e. does not correspond" " directly to a Column)." % key) | "Property %r is not an instance of" " ColumnProperty (i.e. does not correspond" " directly to a Column)." % key) | 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... | 47663a62287b4563a15dc08b4942a49616f9f1df /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1074/47663a62287b4563a15dc08b4942a49616f9f1df/declarative.py |
"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 " "class after both dependent classes have been defined." % ( prop.parent, arg, n.args[0], cls)) | "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 class after " "both dependent classes have been defined." % (prop.parent, arg, n.args[0], cls) ) | 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... | 47663a62287b4563a15dc08b4942a49616f9f1df /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1074/47663a62287b4563a15dc08b4942a49616f9f1df/declarative.py |
A decorator version of :func:`~sqlalchemy.orm.synonym`. The function being decorated is the 'descriptor', otherwise passes its arguments through to synonym():: | A decorator version of :func:`~sqlalchemy.orm.synonym`. The function being decorated is the 'descriptor', otherwise passes its arguments through to synonym():: | 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... | 47663a62287b4563a15dc08b4942a49616f9f1df /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1074/47663a62287b4563a15dc08b4942a49616f9f1df/declarative.py |
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... | 47663a62287b4563a15dc08b4942a49616f9f1df /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1074/47663a62287b4563a15dc08b4942a49616f9f1df/declarative.py | ||
An optional callable, defaults to :func:`~sqlalchemy.orm.mapper`. Will be used to map subclasses to their Tables. | An optional callable, defaults to :func:`~sqlalchemy.orm.mapper`. Will be used to map subclasses to their Tables. | 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... | 47663a62287b4563a15dc08b4942a49616f9f1df /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1074/47663a62287b4563a15dc08b4942a49616f9f1df/declarative.py |
Defaults to :class:`object`. A type to use as the base for the generated declarative base class. May be a class or tuple of classes. | Defaults to :class:`object`. A type to use as the base for the generated declarative base class. May be a class or tuple of classes. | 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... | 47663a62287b4563a15dc08b4942a49616f9f1df /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1074/47663a62287b4563a15dc08b4942a49616f9f1df/declarative.py |
query = """ | query = sql.text(""" | 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... | 45177044a51a553fd29532c6ea3b1689ba8246bc /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1074/45177044a51a553fd29532c6ea3b1689ba8246bc/base.py |
WHERE name = ? | WHERE name = :name | 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... | 45177044a51a553fd29532c6ea3b1689ba8246bc /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1074/45177044a51a553fd29532c6ea3b1689ba8246bc/base.py |
""" | """) | 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... | 45177044a51a553fd29532c6ea3b1689ba8246bc /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1074/45177044a51a553fd29532c6ea3b1689ba8246bc/base.py |
default_schema_name = connection.scalar(query, [user_name]) | default_schema_name = connection.scalar(query, name=user_name) | 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... | 45177044a51a553fd29532c6ea3b1689ba8246bc /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1074/45177044a51a553fd29532c6ea3b1689ba8246bc/base.py |
@collection.adds('entity'): | @collection.adds('entity') | def append(self, append): ... | 3a12b3540eaaf91e83ebe08ad0df3a0f99ff9876 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1074/3a12b3540eaaf91e83ebe08ad0df3a0f99ff9876/collections.py |
self.listeners.append(obj) | if obj not in self.listeners: self.listeners.append(obj) | def append(self, obj, target): # this will be needed, but not # sure why we don't seem to need it yet | 1c832aa51ccf4b0970b242d92a0f458cd2fb2a45 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1074/1c832aa51ccf4b0970b242d92a0f458cd2fb2a45/event.py |
return None | return processors.to_str | def bind_processor(self, dialect): return None | 258acbeb72f012abcba1618e6930dda58307c5cc /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1074/258acbeb72f012abcba1618e6930dda58307c5cc/pypostgresql.py |
colfuncs[name.lower()] = (self._ambiguous_processor(origname), i, "ambiguous") | colfuncs[origname.lower()] = (self._ambiguous_processor(origname), i, "ambiguous") | def getcol(row): return processor(row[index]) | 463f73f80dcc3a35d9b4fe114445aa41bc2e933b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1074/463f73f80dcc3a35d9b4fe114445aa41bc2e933b/base.py |
Column('col2', PickleType(comparator=operator.eq)) | Column('col2', PickleType(comparator=operator.eq, mutable=True)) | def test_mutable_identity(self): metadata = MetaData(testing.db) | 17fdeb77adadc1833ecee388060c45444d91b7bd /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1074/17fdeb77adadc1833ecee388060c45444d91b7bd/test_memusage.py |
def _get_attr(self): return self._some_attr def _set_attr(self, attr): self._some_attr = attr attr = synonym('_attr', descriptor=property(_get_attr, _set_attr)) | @property def attr(self): return self._attr @attr.setter def attr(self, attr): self._attr = attr attr = synonym('_attr', descriptor=attr) | def _get_attr(self): return self._some_attr | bc8787a351004e5077c7c18869fb20f000d3b4db /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1074/bc8787a351004e5077c7c18869fb20f000d3b4db/declarative.py |
id = Column(Integer, primary_key=True) | def _set_attr(self, attr): self._some_attr = attr | bc8787a351004e5077c7c18869fb20f000d3b4db /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1074/bc8787a351004e5077c7c18869fb20f000d3b4db/declarative.py | |
return self._some_attr | return self._attr | def attr(self): return self._some_attr | bc8787a351004e5077c7c18869fb20f000d3b4db /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1074/bc8787a351004e5077c7c18869fb20f000d3b4db/declarative.py |
:func:`~sqlalchemy.orm.comparable_property` ORM function:: | :func:`~.comparable_property` ORM function:: | def attr(self): return self._some_attr | bc8787a351004e5077c7c18869fb20f000d3b4db /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1074/bc8787a351004e5077c7c18869fb20f000d3b4db/declarative.py |
global employees_table, metadata | def setup_class(cls): metadata = MetaData(testing.db) | 38d6c31a29b28577aabb5ae2e641cf95a3cdbc7a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1074/38d6c31a29b28577aabb5ae2e641cf95a3cdbc7a/test_rowcount.py | |
oracle8dialect._supports_char_length = False | oracle8dialect.server_version_info = (8, 0) | def test_char_length(self): self.assert_compile(VARCHAR(50),"VARCHAR(50 CHAR)") | 5095369ce8302111d56a1e3a15089606d1aee8e6 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1074/5095369ce8302111d56a1e3a15089606d1aee8e6/test_oracle.py |
return instance._should_log_debug and 'debug' or \ (instance._should_log_info and True or False) | 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) | 9fd094edbb4d7f160fcb36ae96f39514ac1d1f88 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1074/9fd094edbb4d7f160fcb36ae96f39514ac1d1f88/log.py |
assert dialect.table_names(cx, 'test_schema') == [] | assert dialect.get_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') == [] | 2438b38881a057015675d4b20ec894d4d6018e61 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1074/2438b38881a057015675d4b20ec894d4d6018e61/test_sqlite.py |
eq_(dialect.table_names(cx, 'test_schema'), | eq_(dialect.get_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') == [] | 2438b38881a057015675d4b20ec894d4d6018e61 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1074/2438b38881a057015675d4b20ec894d4d6018e61/test_sqlite.py |
assert dialect.table_names(cx, 'test_schema') == [] | assert dialect.get_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') == [] | 2438b38881a057015675d4b20ec894d4d6018e61 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1074/2438b38881a057015675d4b20ec894d4d6018e61/test_sqlite.py |
assert 'tempy' in cx.dialect.table_names(cx, None) | assert 'tempy' in cx.dialect.get_table_names(cx, None) | def test_temp_table_reflection(self): cx = testing.db.connect() try: cx.execute('CREATE TEMPORARY TABLE tempy (id INT)') | 2438b38881a057015675d4b20ec894d4d6018e61 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1074/2438b38881a057015675d4b20ec894d4d6018e61/test_sqlite.py |
t1.create() | metadata.create_all() | 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() | 1a352c69f9c66bdc7ef90ecaffcc0c65b5911073 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1074/1a352c69f9c66bdc7ef90ecaffcc0c65b5911073/test_unicode.py |
t1.drop() | metadata.drop_all() | 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() | 1a352c69f9c66bdc7ef90ecaffcc0c65b5911073 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1074/1a352c69f9c66bdc7ef90ecaffcc0c65b5911073/test_unicode.py |
print "\nSQL String:\n" + str(c) + repr(getattr(c, 'params', {})) | print "\nSQL String:\n" + str(c) + param_str | 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) | 74ab1c57a3b575f3f44f445cdf5909855c561274 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1074/74ab1c57a3b575f3f44f445cdf5909855c561274/testing.py |
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... | 993af53204a0e4378fbf65a0bbf9a617e34dede1 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1074/993af53204a0e4378fbf65a0bbf9a617e34dede1/caching_query.py | ||
assert cache_key is not None, "Cache key was None !" | 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... | 993af53204a0e4378fbf65a0bbf9a617e34dede1 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1074/993af53204a0e4378fbf65a0bbf9a617e34dede1/caching_query.py | |
value = query._params.get(bind.key, bind.value) if callable(value): value = value() | if bind.key in query._params: value = query._params[bind.key] elif bind.callable: value = bind.callable() else: value = bind.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) | 993af53204a0e4378fbf65a0bbf9a617e34dede1 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1074/993af53204a0e4378fbf65a0bbf9a617e34dede1/caching_query.py |
def test_unicode_warnings(self): """test the warnings raised when SQLA must coerce unicode binds, *and* is using the Unicode type. """ | 50bc970a33c05eab3b02bbba51f50f7d31810963 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1074/50bc970a33c05eab3b02bbba51f50f7d31810963/test_types.py | ||
type = DATE() | type = 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()) | 47f7b6f68e42d9157bbb88dc519f8a9875bef88f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1074/47f7b6f68e42d9157bbb88dc519f8a9875bef88f/test_functions.py |
filter(User.name.like.('%ed%')).\\ | filter(User.name.like('%ed%')).\\ | def with_entities(self, *entities): """Return a new :class:`.Query` replacing the SELECT list with the given entities. e.g.:: | ea81fa93a4e2598065951e80baab9b37523cc424 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1074/ea81fa93a4e2598065951e80baab9b37523cc424/query.py |
def test_unicode_warnings(self): """test the warnings raised when SQLA must coerce unicode binds, *and* is using the Unicode type. """ | 1f0e7a6120c3f97d73e6275aa71663ee5709dda5 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1074/1f0e7a6120c3f97d73e6275aa71663ee5709dda5/test_types.py | ||
def test_unicode_warnings(self): """test the warnings raised when SQLA must coerce unicode binds, *and* is using the Unicode type. """ | 1f0e7a6120c3f97d73e6275aa71663ee5709dda5 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1074/1f0e7a6120c3f97d73e6275aa71663ee5709dda5/test_types.py | ||
controls a Python logger; see `dbengine_logging` at the end of this chapter for information on how to configure logging directly. | controls a Python logger; see :ref:`dbengine_logging` for information on how to configure logging directly. | 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... | 3328792ebcc6af92c9c4e486e755a43300f6a279 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1074/3328792ebcc6af92c9c4e486e755a43300f6a279/__init__.py |
`dbengine_logging` for information on how to configure logging | :ref:`dbengine_logging` for information on how to configure logging | 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... | 3328792ebcc6af92c9c4e486e755a43300f6a279 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1074/3328792ebcc6af92c9c4e486e755a43300f6a279/__init__.py |
a = Address(email_address='foobar') | a = Address(id=12, email_address='foobar') | 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() | 4cbe117eb2feb7cff28c66d849d3a0613448fdce /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1074/4cbe117eb2feb7cff28c66d849d3a0613448fdce/test_expire.py |
m = re.compile(r"\[SQLCode\: (\d+)\]").search(str(exception.orig.args)) | m = re.compile(r"\[SQLCode\: (\d+)\]").search(str(exception.args)) | 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) | 855dbda8258ef62444286924431a5a8171b91e89 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1074/855dbda8258ef62444286924431a5a8171b91e89/zxjdbc.py |
if getattr(self, 'scale', None) is not None and dialect.supports_native_decimal: | if getattr(self, 'scale', None) is None: return processors.to_decimal_processor_factory(decimal.Decimal) elif dialect.supports_native_decimal: | 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... | 6dbcb67e54c4c9ec62987a9d318e088d3d58e47b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1074/6dbcb67e54c4c9ec62987a9d318e088d3d58e47b/base.py |
return processors.to_decimal_processor_factory(decimal.Decimal) | return processors.to_decimal_processor_factory(decimal.Decimal, self.scale) | 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... | 6dbcb67e54c4c9ec62987a9d318e088d3d58e47b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1074/6dbcb67e54c4c9ec62987a9d318e088d3d58e47b/base.py |
return None | 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... | 6dbcb67e54c4c9ec62987a9d318e088d3d58e47b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1074/6dbcb67e54c4c9ec62987a9d318e088d3d58e47b/base.py | |
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'): # ... | 9d868fb7d20b1eaca18281974ae962a002d95220 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/331/9d868fb7d20b1eaca18281974ae962a002d95220/dist.py | ||
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'): # ... | 9d868fb7d20b1eaca18281974ae962a002d95220 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/331/9d868fb7d20b1eaca18281974ae962a002d95220/dist.py | ||
count = num = int(os.popen('sysctl -n hw.ncpu').read()) | count = int(os.popen('sysctl -n hw.ncpu').read()) | 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'): # ... | 9d868fb7d20b1eaca18281974ae962a002d95220 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/331/9d868fb7d20b1eaca18281974ae962a002d95220/dist.py |
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'): # ... | 9d868fb7d20b1eaca18281974ae962a002d95220 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/331/9d868fb7d20b1eaca18281974ae962a002d95220/dist.py | ||
dists.append("src\\basic.dist") | dists.append("src/basic.dist") | 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 | 25c454a8bdca0d656ffbcdf3ec88b411dcab7247 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/331/25c454a8bdca0d656ffbcdf3ec88b411dcab7247/dist.py |
settings = {} | settings = { "static_path": os.path.join(os.path.dirname(__file__), "static"), } | 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'] ) | a9a0a5214eaba49a7f9939d48ca7d1d05b087843 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/14864/a9a0a5214eaba49a7f9939d48ca7d1d05b087843/emptysquare.py |
photo_index=int(photo_index) | photo_index=int(photo_index)-1 | 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... | c8ca1ce811a962c49b767393ef52cd758e3a6efe /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/14864/c8ca1ce811a962c49b767393ef52cd758e3a6efe/emptysquare.py |
libs = split_quoted( os.popen("'%s' --libs" % CURL_CONFIG).read()+\ os.popen("'%s' --static-libs" % CURL_CONFIG).read()) | optbuf = "" for option in ["--libs", "--static-libs"]: p = subprocess.Popen("'%s' %s" % (CURL_CONFIG, option), shell=True, stdout=subprocess.PIPE) (stdout, stderr) = p.communicate() if p.wait() == 0: optbuf += stdout if optbuf == "": raise Exception, ("Neither of curl-config --libs or --static-libs" + "produced out... | 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... | 0c5733bf5c3bbd3ee13e46ec4b9513be39cfe407 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10805/0c5733bf5c3bbd3ee13e46ec4b9513be39cfe407/setup.py |
sqlQuery = "select count(1) from address where time_created::date=now()::date" | sqlQuery = "select count(1) count from address where time_created::date=now()::date" | def countCreatedToday(self,request): | be24b40e1f020a5996c28518b1adf0fdbb015c17 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/4401/be24b40e1f020a5996c28518b1adf0fdbb015c17/addresses.py |
rows = result.fetchall() return rows[0][0] | for row in result: for column in row: return str(column) | def countCreatedToday(self,request): | be24b40e1f020a5996c28518b1adf0fdbb015c17 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/4401/be24b40e1f020a5996c28518b1adf0fdbb015c17/addresses.py |
rows = result.fetchall() return rows[0][0] | for row in result: for column in row: return str(column) | def countUpdatedToday(self,request): | be24b40e1f020a5996c28518b1adf0fdbb015c17 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/4401/be24b40e1f020a5996c28518b1adf0fdbb015c17/addresses.py |
displayText = displayText + column + ' ' | if column is not None: displayText = displayText + column + ' ' | 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'] | b1f344a03194f913c303aee5475114d12870296e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/4401/b1f344a03194f913c303aee5475114d12870296e/addresses.py |
self.mail("info@openaddresses.org","OpenAddresses.org new file uploaded !","The file " + permanent_file.name + " has been uploaded by " + email) | self.mail("cedric.moullet@openaddresses.org","OpenAddresses.org new file uploaded !","The file " + permanent_file.name + " has been uploaded by " + email) | 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... | affdc4df49448a2e6c732cf5b3de5e2c9912e2c9 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/4401/affdc4df49448a2e6c732cf5b3de5e2c9912e2c9/uploads.py |
msg['From'] = 'cedric.moullet@gmail.com' | msg['From'] = 'cedric.moullet@openaddresses.org' | def mail(self, to, subject, text): # http://kutuma.blogspot.com/2007/08/sending-emails-via-gmail-with-python.html msg = MIMEMultipart() | affdc4df49448a2e6c732cf5b3de5e2c9912e2c9 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/4401/affdc4df49448a2e6c732cf5b3de5e2c9912e2c9/uploads.py |
return os.getcwd() | return "Not implemented, for now" | def index(self, format='html'): """GET /uploads: All items in the collection""" # url('uploads') return os.getcwd() | b840397e72564d270e2a724ec5a44823ba42f79b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/4401/b840397e72564d270e2a724ec5a44823ba42f79b/uploads.py |
permanent_file = open(archive.filename.lstrip(os.sep),'w') | permanent_file = open(os.path.join(self.main_root + '/trunk/openaddresses/uploads',archive.filename.lstrip(os.sep)), 'w') | 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... | b840397e72564d270e2a724ec5a44823ba42f79b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/4401/b840397e72564d270e2a724ec5a44823ba42f79b/uploads.py |
return dumps({"success": True}) | return dumps({"success": True, "filename": permanent_file.name}) | 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... | b840397e72564d270e2a724ec5a44823ba42f79b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/4401/b840397e72564d270e2a724ec5a44823ba42f79b/uploads.py |
sqlQuery = sqlQuery + " WHERE tsvector_street_housenumber_city @@ to_tsquery('" + tsquery + "')" | sqlQuery = sqlQuery + " WHERE tsvector_street_housenumber_city @@ to_tsquery('english', '" + tsquery + "')" | 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'] | b5802d22e5d41c8ddbbd831b4bcf601707da23a8 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/4401/b5802d22e5d41c8ddbbd831b4bcf601707da23a8/addresses.py |
sqlQuery = sqlQuery + " WHERE tsvector_street_housenumber_city @@ to_tsquery('" + tsquery + "')" | sqlQuery = sqlQuery + " WHERE tsvector_street_housenumber_city @@ to_tsquery('english','" + tsquery + "')" | 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'] | b5802d22e5d41c8ddbbd831b4bcf601707da23a8 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/4401/b5802d22e5d41c8ddbbd831b4bcf601707da23a8/addresses.py |
sqlQuery = sqlQuery + " WHERE tsvector_street @@ to_tsquery('" + tsquery + "')" | sqlQuery = sqlQuery + " WHERE tsvector_street @@ to_tsquery('english','" + tsquery + "')" | 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'] | b5802d22e5d41c8ddbbd831b4bcf601707da23a8 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/4401/b5802d22e5d41c8ddbbd831b4bcf601707da23a8/addresses.py |
sqlQuery = sqlQuery + " WHERE to_tsvector(" + tsvector + ") @@ to_tsquery('" + tsquery + "')" | sqlQuery = sqlQuery + " WHERE to_tsvector(" + tsvector + ") @@ to_tsquery('english','" + tsquery + "')" | 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'] | b5802d22e5d41c8ddbbd831b4bcf601707da23a8 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/4401/b5802d22e5d41c8ddbbd831b4bcf601707da23a8/addresses.py |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.