body stringlengths 26 98.2k | body_hash int64 -9,222,864,604,528,158,000 9,221,803,474B | docstring stringlengths 1 16.8k | path stringlengths 5 230 | name stringlengths 1 96 | repository_name stringlengths 7 89 | lang stringclasses 1
value | body_without_docstring stringlengths 20 98.2k |
|---|---|---|---|---|---|---|---|
def label(self, name):
'Return the full SELECT statement represented by this\n :class:`.Query`, converted\n to a scalar subquery with a label of the given name.\n\n Analogous to :meth:`sqlalchemy.sql.expression.SelectBase.label`.\n\n .. versionadded:: 0.6.5\n\n '
return self.e... | -3,590,657,937,570,311,000 | Return the full SELECT statement represented by this
:class:`.Query`, converted
to a scalar subquery with a label of the given name.
Analogous to :meth:`sqlalchemy.sql.expression.SelectBase.label`.
.. versionadded:: 0.6.5 | lib/sqlalchemy/orm/query.py | label | slafs/sqlalchemy | python | def label(self, name):
'Return the full SELECT statement represented by this\n :class:`.Query`, converted\n to a scalar subquery with a label of the given name.\n\n Analogous to :meth:`sqlalchemy.sql.expression.SelectBase.label`.\n\n .. versionadded:: 0.6.5\n\n '
return self.e... |
def as_scalar(self):
'Return the full SELECT statement represented by this\n :class:`.Query`, converted to a scalar subquery.\n\n Analogous to :meth:`sqlalchemy.sql.expression.SelectBase.as_scalar`.\n\n .. versionadded:: 0.6.5\n\n '
return self.enable_eagerloads(False).statement.as_s... | 1,437,486,943,326,028,500 | Return the full SELECT statement represented by this
:class:`.Query`, converted to a scalar subquery.
Analogous to :meth:`sqlalchemy.sql.expression.SelectBase.as_scalar`.
.. versionadded:: 0.6.5 | lib/sqlalchemy/orm/query.py | as_scalar | slafs/sqlalchemy | python | def as_scalar(self):
'Return the full SELECT statement represented by this\n :class:`.Query`, converted to a scalar subquery.\n\n Analogous to :meth:`sqlalchemy.sql.expression.SelectBase.as_scalar`.\n\n .. versionadded:: 0.6.5\n\n '
return self.enable_eagerloads(False).statement.as_s... |
@property
def selectable(self):
'Return the :class:`.Select` object emitted by this :class:`.Query`.\n\n Used for :func:`.inspect` compatibility, this is equivalent to::\n\n query.enable_eagerloads(False).with_labels().statement\n\n '
return self.__clause_element__() | -8,503,839,907,772,944,000 | Return the :class:`.Select` object emitted by this :class:`.Query`.
Used for :func:`.inspect` compatibility, this is equivalent to::
query.enable_eagerloads(False).with_labels().statement | lib/sqlalchemy/orm/query.py | selectable | slafs/sqlalchemy | python | @property
def selectable(self):
'Return the :class:`.Select` object emitted by this :class:`.Query`.\n\n Used for :func:`.inspect` compatibility, this is equivalent to::\n\n query.enable_eagerloads(False).with_labels().statement\n\n '
return self.__clause_element__() |
@_generative()
def enable_eagerloads(self, value):
"Control whether or not eager joins and subqueries are\n rendered.\n\n When set to False, the returned Query will not render\n eager joins regardless of :func:`~sqlalchemy.orm.joinedload`,\n :func:`~sqlalchemy.orm.subqueryload` options\n... | -317,527,578,000,730,430 | Control whether or not eager joins and subqueries are
rendered.
When set to False, the returned Query will not render
eager joins regardless of :func:`~sqlalchemy.orm.joinedload`,
:func:`~sqlalchemy.orm.subqueryload` options
or mapper-level ``lazy='joined'``/``lazy='subquery'``
configurations.
This is used primarily ... | lib/sqlalchemy/orm/query.py | enable_eagerloads | slafs/sqlalchemy | python | @_generative()
def enable_eagerloads(self, value):
"Control whether or not eager joins and subqueries are\n rendered.\n\n When set to False, the returned Query will not render\n eager joins regardless of :func:`~sqlalchemy.orm.joinedload`,\n :func:`~sqlalchemy.orm.subqueryload` options\n... |
@_generative()
def with_labels(self):
"Apply column labels to the return value of Query.statement.\n\n Indicates that this Query's `statement` accessor should return\n a SELECT statement that applies labels to all columns in the\n form <tablename>_<columnname>; this is commonly used to\n ... | -6,678,946,715,591,037,000 | Apply column labels to the return value of Query.statement.
Indicates that this Query's `statement` accessor should return
a SELECT statement that applies labels to all columns in the
form <tablename>_<columnname>; this is commonly used to
disambiguate columns from multiple tables which have the same
name.
When the `... | lib/sqlalchemy/orm/query.py | with_labels | slafs/sqlalchemy | python | @_generative()
def with_labels(self):
"Apply column labels to the return value of Query.statement.\n\n Indicates that this Query's `statement` accessor should return\n a SELECT statement that applies labels to all columns in the\n form <tablename>_<columnname>; this is commonly used to\n ... |
@_generative()
def enable_assertions(self, value):
'Control whether assertions are generated.\n\n When set to False, the returned Query will\n not assert its state before certain operations,\n including that LIMIT/OFFSET has not been applied\n when filter() is called, no criterion exists... | -6,685,429,428,474,270,000 | Control whether assertions are generated.
When set to False, the returned Query will
not assert its state before certain operations,
including that LIMIT/OFFSET has not been applied
when filter() is called, no criterion exists
when get() is called, and no "from_statement()"
exists when filter()/order_by()/group_by() e... | lib/sqlalchemy/orm/query.py | enable_assertions | slafs/sqlalchemy | python | @_generative()
def enable_assertions(self, value):
'Control whether assertions are generated.\n\n When set to False, the returned Query will\n not assert its state before certain operations,\n including that LIMIT/OFFSET has not been applied\n when filter() is called, no criterion exists... |
@property
def whereclause(self):
'A readonly attribute which returns the current WHERE criterion for\n this Query.\n\n This returned value is a SQL expression construct, or ``None`` if no\n criterion has been established.\n\n '
return self._criterion | -7,438,584,989,382,183,000 | A readonly attribute which returns the current WHERE criterion for
this Query.
This returned value is a SQL expression construct, or ``None`` if no
criterion has been established. | lib/sqlalchemy/orm/query.py | whereclause | slafs/sqlalchemy | python | @property
def whereclause(self):
'A readonly attribute which returns the current WHERE criterion for\n this Query.\n\n This returned value is a SQL expression construct, or ``None`` if no\n criterion has been established.\n\n '
return self._criterion |
@_generative()
def _with_current_path(self, path):
'indicate that this query applies to objects loaded\n within a certain path.\n\n Used by deferred loaders (see strategies.py) which transfer\n query options from an originating query to a newly generated\n query intended for the deferred... | -7,653,136,271,238,835,000 | indicate that this query applies to objects loaded
within a certain path.
Used by deferred loaders (see strategies.py) which transfer
query options from an originating query to a newly generated
query intended for the deferred load. | lib/sqlalchemy/orm/query.py | _with_current_path | slafs/sqlalchemy | python | @_generative()
def _with_current_path(self, path):
'indicate that this query applies to objects loaded\n within a certain path.\n\n Used by deferred loaders (see strategies.py) which transfer\n query options from an originating query to a newly generated\n query intended for the deferred... |
@_generative(_no_clauseelement_condition)
def with_polymorphic(self, cls_or_mappers, selectable=None, polymorphic_on=None):
'Load columns for inheriting classes.\n\n :meth:`.Query.with_polymorphic` applies transformations\n to the "main" mapped class represented by this :class:`.Query`.\n The "... | 3,415,142,683,067,965,000 | Load columns for inheriting classes.
:meth:`.Query.with_polymorphic` applies transformations
to the "main" mapped class represented by this :class:`.Query`.
The "main" mapped class here means the :class:`.Query`
object's first argument is a full class, i.e.
``session.query(SomeClass)``. These transformations allow add... | lib/sqlalchemy/orm/query.py | with_polymorphic | slafs/sqlalchemy | python | @_generative(_no_clauseelement_condition)
def with_polymorphic(self, cls_or_mappers, selectable=None, polymorphic_on=None):
'Load columns for inheriting classes.\n\n :meth:`.Query.with_polymorphic` applies transformations\n to the "main" mapped class represented by this :class:`.Query`.\n The "... |
@_generative()
def yield_per(self, count):
"Yield only ``count`` rows at a time.\n\n The purpose of this method is when fetching very large result sets\n (> 10K rows), to batch results in sub-collections and yield them\n out partially, so that the Python interpreter doesn't need to declare\n ... | 8,542,419,139,688,637,000 | Yield only ``count`` rows at a time.
The purpose of this method is when fetching very large result sets
(> 10K rows), to batch results in sub-collections and yield them
out partially, so that the Python interpreter doesn't need to declare
very large areas of memory which is both time consuming and leads
to excessive m... | lib/sqlalchemy/orm/query.py | yield_per | slafs/sqlalchemy | python | @_generative()
def yield_per(self, count):
"Yield only ``count`` rows at a time.\n\n The purpose of this method is when fetching very large result sets\n (> 10K rows), to batch results in sub-collections and yield them\n out partially, so that the Python interpreter doesn't need to declare\n ... |
def get(self, ident):
"Return an instance based on the given primary key identifier,\n or ``None`` if not found.\n\n E.g.::\n\n my_user = session.query(User).get(5)\n\n some_object = session.query(VersionedFoo).get((5, 10))\n\n :meth:`~.Query.get` is special in that it pro... | -3,563,799,869,527,115,300 | Return an instance based on the given primary key identifier,
or ``None`` if not found.
E.g.::
my_user = session.query(User).get(5)
some_object = session.query(VersionedFoo).get((5, 10))
:meth:`~.Query.get` is special in that it provides direct
access to the identity map of the owning :class:`.Session`.
If ... | lib/sqlalchemy/orm/query.py | get | slafs/sqlalchemy | python | def get(self, ident):
"Return an instance based on the given primary key identifier,\n or ``None`` if not found.\n\n E.g.::\n\n my_user = session.query(User).get(5)\n\n some_object = session.query(VersionedFoo).get((5, 10))\n\n :meth:`~.Query.get` is special in that it pro... |
@_generative()
def correlate(self, *args):
'Return a :class:`.Query` construct which will correlate the given\n FROM clauses to that of an enclosing :class:`.Query` or\n :func:`~.expression.select`.\n\n The method here accepts mapped classes, :func:`.aliased` constructs,\n and :func:`.ma... | 8,299,163,503,500,809,000 | Return a :class:`.Query` construct which will correlate the given
FROM clauses to that of an enclosing :class:`.Query` or
:func:`~.expression.select`.
The method here accepts mapped classes, :func:`.aliased` constructs,
and :func:`.mapper` constructs as arguments, which are resolved into
expression constructs, in addi... | lib/sqlalchemy/orm/query.py | correlate | slafs/sqlalchemy | python | @_generative()
def correlate(self, *args):
'Return a :class:`.Query` construct which will correlate the given\n FROM clauses to that of an enclosing :class:`.Query` or\n :func:`~.expression.select`.\n\n The method here accepts mapped classes, :func:`.aliased` constructs,\n and :func:`.ma... |
@_generative()
def autoflush(self, setting):
"Return a Query with a specific 'autoflush' setting.\n\n Note that a Session with autoflush=False will\n not autoflush, even if this flag is set to True at the\n Query level. Therefore this flag is usually used only\n to disable autoflush for... | -6,814,322,319,448,208,000 | Return a Query with a specific 'autoflush' setting.
Note that a Session with autoflush=False will
not autoflush, even if this flag is set to True at the
Query level. Therefore this flag is usually used only
to disable autoflush for a specific Query. | lib/sqlalchemy/orm/query.py | autoflush | slafs/sqlalchemy | python | @_generative()
def autoflush(self, setting):
"Return a Query with a specific 'autoflush' setting.\n\n Note that a Session with autoflush=False will\n not autoflush, even if this flag is set to True at the\n Query level. Therefore this flag is usually used only\n to disable autoflush for... |
@_generative()
def populate_existing(self):
"Return a :class:`.Query` that will expire and refresh all instances\n as they are loaded, or reused from the current :class:`.Session`.\n\n :meth:`.populate_existing` does not improve behavior when\n the ORM is used normally - the :class:`.Session` o... | -4,353,034,707,983,916,000 | Return a :class:`.Query` that will expire and refresh all instances
as they are loaded, or reused from the current :class:`.Session`.
:meth:`.populate_existing` does not improve behavior when
the ORM is used normally - the :class:`.Session` object's usual
behavior of maintaining a transaction and expiring all attribut... | lib/sqlalchemy/orm/query.py | populate_existing | slafs/sqlalchemy | python | @_generative()
def populate_existing(self):
"Return a :class:`.Query` that will expire and refresh all instances\n as they are loaded, or reused from the current :class:`.Session`.\n\n :meth:`.populate_existing` does not improve behavior when\n the ORM is used normally - the :class:`.Session` o... |
@_generative()
def _with_invoke_all_eagers(self, value):
"Set the 'invoke all eagers' flag which causes joined- and\n subquery loaders to traverse into already-loaded related objects\n and collections.\n\n Default is that of :attr:`.Query._invoke_all_eagers`.\n\n "
self._invoke_all_e... | 2,516,530,542,997,360,000 | Set the 'invoke all eagers' flag which causes joined- and
subquery loaders to traverse into already-loaded related objects
and collections.
Default is that of :attr:`.Query._invoke_all_eagers`. | lib/sqlalchemy/orm/query.py | _with_invoke_all_eagers | slafs/sqlalchemy | python | @_generative()
def _with_invoke_all_eagers(self, value):
"Set the 'invoke all eagers' flag which causes joined- and\n subquery loaders to traverse into already-loaded related objects\n and collections.\n\n Default is that of :attr:`.Query._invoke_all_eagers`.\n\n "
self._invoke_all_e... |
def with_parent(self, instance, property=None):
"Add filtering criterion that relates the given instance\n to a child object or collection, using its attribute state\n as well as an established :func:`.relationship()`\n configuration.\n\n The method uses the :func:`.with_parent` function... | 3,725,749,902,457,954,300 | Add filtering criterion that relates the given instance
to a child object or collection, using its attribute state
as well as an established :func:`.relationship()`
configuration.
The method uses the :func:`.with_parent` function to generate
the clause, the result of which is passed to :meth:`.Query.filter`.
Paramete... | lib/sqlalchemy/orm/query.py | with_parent | slafs/sqlalchemy | python | def with_parent(self, instance, property=None):
"Add filtering criterion that relates the given instance\n to a child object or collection, using its attribute state\n as well as an established :func:`.relationship()`\n configuration.\n\n The method uses the :func:`.with_parent` function... |
@_generative()
def add_entity(self, entity, alias=None):
'add a mapped entity to the list of result columns\n to be returned.'
if (alias is not None):
entity = aliased(entity, alias)
self._entities = list(self._entities)
m = _MapperEntity(self, entity)
self._set_entity_selectables([m]... | 4,260,054,064,693,129,000 | add a mapped entity to the list of result columns
to be returned. | lib/sqlalchemy/orm/query.py | add_entity | slafs/sqlalchemy | python | @_generative()
def add_entity(self, entity, alias=None):
'add a mapped entity to the list of result columns\n to be returned.'
if (alias is not None):
entity = aliased(entity, alias)
self._entities = list(self._entities)
m = _MapperEntity(self, entity)
self._set_entity_selectables([m]... |
@_generative()
def with_session(self, session):
'Return a :class:`.Query` that will use the given :class:`.Session`.\n\n '
self.session = session | -7,848,927,941,019,966,000 | Return a :class:`.Query` that will use the given :class:`.Session`. | lib/sqlalchemy/orm/query.py | with_session | slafs/sqlalchemy | python | @_generative()
def with_session(self, session):
'\n\n '
self.session = session |
def from_self(self, *entities):
"return a Query that selects from this Query's\n SELECT statement.\n\n \\*entities - optional list of entities which will replace\n those being selected.\n\n "
fromclause = self.with_labels().enable_eagerloads(False).statement.correlate(None)
q = s... | -4,215,021,601,722,620,400 | return a Query that selects from this Query's
SELECT statement.
\*entities - optional list of entities which will replace
those being selected. | lib/sqlalchemy/orm/query.py | from_self | slafs/sqlalchemy | python | def from_self(self, *entities):
"return a Query that selects from this Query's\n SELECT statement.\n\n \\*entities - optional list of entities which will replace\n those being selected.\n\n "
fromclause = self.with_labels().enable_eagerloads(False).statement.correlate(None)
q = s... |
def values(self, *columns):
'Return an iterator yielding result tuples corresponding\n to the given list of columns'
if (not columns):
return iter(())
q = self._clone()
q._set_entities(columns, entity_wrapper=_ColumnEntity)
if (not q._yield_per):
q._yield_per = 10
return i... | -2,566,075,710,266,303,000 | Return an iterator yielding result tuples corresponding
to the given list of columns | lib/sqlalchemy/orm/query.py | values | slafs/sqlalchemy | python | def values(self, *columns):
'Return an iterator yielding result tuples corresponding\n to the given list of columns'
if (not columns):
return iter(())
q = self._clone()
q._set_entities(columns, entity_wrapper=_ColumnEntity)
if (not q._yield_per):
q._yield_per = 10
return i... |
def value(self, column):
'Return a scalar result corresponding to the given\n column expression.'
try:
return next(self.values(column))[0]
except StopIteration:
return None | -8,450,482,974,219,938,000 | Return a scalar result corresponding to the given
column expression. | lib/sqlalchemy/orm/query.py | value | slafs/sqlalchemy | python | def value(self, column):
'Return a scalar result corresponding to the given\n column expression.'
try:
return next(self.values(column))[0]
except StopIteration:
return None |
@_generative()
def with_entities(self, *entities):
"Return a new :class:`.Query` replacing the SELECT list with the\n given entities.\n\n e.g.::\n\n # Users, filtered on some arbitrary criterion\n # and then ordered by related email address\n q = session.query(User).\\... | -2,123,473,005,620,002,000 | Return a new :class:`.Query` replacing the SELECT list with the
given entities.
e.g.::
# Users, filtered on some arbitrary criterion
# and then ordered by related email address
q = session.query(User).\
join(User.address).\
filter(User.name.like('%ed%')).\
o... | lib/sqlalchemy/orm/query.py | with_entities | slafs/sqlalchemy | python | @_generative()
def with_entities(self, *entities):
"Return a new :class:`.Query` replacing the SELECT list with the\n given entities.\n\n e.g.::\n\n # Users, filtered on some arbitrary criterion\n # and then ordered by related email address\n q = session.query(User).\\... |
@_generative()
def add_columns(self, *column):
'Add one or more column expressions to the list\n of result columns to be returned.'
self._entities = list(self._entities)
l = len(self._entities)
for c in column:
_ColumnEntity(self, c)
self._set_entity_selectables(self._entities[l:]) | -3,059,124,657,342,454,000 | Add one or more column expressions to the list
of result columns to be returned. | lib/sqlalchemy/orm/query.py | add_columns | slafs/sqlalchemy | python | @_generative()
def add_columns(self, *column):
'Add one or more column expressions to the list\n of result columns to be returned.'
self._entities = list(self._entities)
l = len(self._entities)
for c in column:
_ColumnEntity(self, c)
self._set_entity_selectables(self._entities[l:]) |
@util.pending_deprecation('0.7', ':meth:`.add_column` is superseded by :meth:`.add_columns`', False)
def add_column(self, column):
'Add a column expression to the list of result columns to be\n returned.\n\n Pending deprecation: :meth:`.add_column` will be superseded by\n :meth:`.add_columns`.\... | -1,024,067,364,979,711,500 | Add a column expression to the list of result columns to be
returned.
Pending deprecation: :meth:`.add_column` will be superseded by
:meth:`.add_columns`. | lib/sqlalchemy/orm/query.py | add_column | slafs/sqlalchemy | python | @util.pending_deprecation('0.7', ':meth:`.add_column` is superseded by :meth:`.add_columns`', False)
def add_column(self, column):
'Add a column expression to the list of result columns to be\n returned.\n\n Pending deprecation: :meth:`.add_column` will be superseded by\n :meth:`.add_columns`.\... |
def options(self, *args):
'Return a new Query object, applying the given list of\n mapper options.\n\n Most supplied options regard changing how column- and\n relationship-mapped attributes are loaded. See the sections\n :ref:`deferred` and :doc:`/orm/loading` for reference\n docu... | -1,856,513,415,575,226,600 | Return a new Query object, applying the given list of
mapper options.
Most supplied options regard changing how column- and
relationship-mapped attributes are loaded. See the sections
:ref:`deferred` and :doc:`/orm/loading` for reference
documentation. | lib/sqlalchemy/orm/query.py | options | slafs/sqlalchemy | python | def options(self, *args):
'Return a new Query object, applying the given list of\n mapper options.\n\n Most supplied options regard changing how column- and\n relationship-mapped attributes are loaded. See the sections\n :ref:`deferred` and :doc:`/orm/loading` for reference\n docu... |
def with_transformation(self, fn):
'Return a new :class:`.Query` object transformed by\n the given function.\n\n E.g.::\n\n def filter_something(criterion):\n def transform(q):\n return q.filter(criterion)\n return transform\n\n q ... | -736,751,184,440,080,300 | Return a new :class:`.Query` object transformed by
the given function.
E.g.::
def filter_something(criterion):
def transform(q):
return q.filter(criterion)
return transform
q = q.with_transformation(filter_something(x==5))
This allows ad-hoc recipes to be created for :class:`.Que... | lib/sqlalchemy/orm/query.py | with_transformation | slafs/sqlalchemy | python | def with_transformation(self, fn):
'Return a new :class:`.Query` object transformed by\n the given function.\n\n E.g.::\n\n def filter_something(criterion):\n def transform(q):\n return q.filter(criterion)\n return transform\n\n q ... |
@_generative()
def with_hint(self, selectable, text, dialect_name='*'):
'Add an indexing or other executional context\n hint for the given entity or selectable to\n this :class:`.Query`.\n\n Functionality is passed straight through to\n :meth:`~sqlalchemy.sql.expression.Select.with_hint`... | -168,000,100,214,669,760 | Add an indexing or other executional context
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 ORM entity / mapped class
/e... | lib/sqlalchemy/orm/query.py | with_hint | slafs/sqlalchemy | python | @_generative()
def with_hint(self, selectable, text, dialect_name='*'):
'Add an indexing or other executional context\n hint for the given entity or selectable to\n this :class:`.Query`.\n\n Functionality is passed straight through to\n :meth:`~sqlalchemy.sql.expression.Select.with_hint`... |
def with_statement_hint(self, text, dialect_name='*'):
'add a statement hint to this :class:`.Select`.\n\n This method is similar to :meth:`.Select.with_hint` except that\n it does not require an individual table, and instead applies to the\n statement as a whole.\n\n This feature calls ... | 5,776,794,080,481,404,000 | add a statement hint to this :class:`.Select`.
This method is similar to :meth:`.Select.with_hint` except that
it does not require an individual table, and instead applies to the
statement as a whole.
This feature calls down into :meth:`.Select.with_statement_hint`.
.. versionadded:: 1.0.0
.. seealso::
:meth:`... | lib/sqlalchemy/orm/query.py | with_statement_hint | slafs/sqlalchemy | python | def with_statement_hint(self, text, dialect_name='*'):
'add a statement hint to this :class:`.Select`.\n\n This method is similar to :meth:`.Select.with_hint` except that\n it does not require an individual table, and instead applies to the\n statement as a whole.\n\n This feature calls ... |
@_generative()
def execution_options(self, **kwargs):
' Set non-SQL options which take effect during execution.\n\n The options are the same as those accepted by\n :meth:`.Connection.execution_options`.\n\n Note that the ``stream_results`` execution option is enabled\n automatically if t... | 133,150,205,277,101,300 | Set non-SQL options which take effect during execution.
The options are the same as those accepted by
:meth:`.Connection.execution_options`.
Note that the ``stream_results`` execution option is enabled
automatically if the :meth:`~sqlalchemy.orm.query.Query.yield_per()`
method is used. | lib/sqlalchemy/orm/query.py | execution_options | slafs/sqlalchemy | python | @_generative()
def execution_options(self, **kwargs):
' Set non-SQL options which take effect during execution.\n\n The options are the same as those accepted by\n :meth:`.Connection.execution_options`.\n\n Note that the ``stream_results`` execution option is enabled\n automatically if t... |
@_generative()
def with_lockmode(self, mode):
'Return a new :class:`.Query` object with the specified "locking mode",\n which essentially refers to the ``FOR UPDATE`` clause.\n\n .. deprecated:: 0.9.0 superseded by :meth:`.Query.with_for_update`.\n\n :param mode: a string representing the desir... | -3,654,983,027,576,608,000 | Return a new :class:`.Query` object with the specified "locking mode",
which essentially refers to the ``FOR UPDATE`` clause.
.. deprecated:: 0.9.0 superseded by :meth:`.Query.with_for_update`.
:param mode: a string representing the desired locking mode.
Valid values are:
* ``None`` - translates to no lockmode
*... | lib/sqlalchemy/orm/query.py | with_lockmode | slafs/sqlalchemy | python | @_generative()
def with_lockmode(self, mode):
'Return a new :class:`.Query` object with the specified "locking mode",\n which essentially refers to the ``FOR UPDATE`` clause.\n\n .. deprecated:: 0.9.0 superseded by :meth:`.Query.with_for_update`.\n\n :param mode: a string representing the desir... |
@_generative()
def with_for_update(self, read=False, nowait=False, of=None):
'return a new :class:`.Query` with the specified options for the\n ``FOR UPDATE`` clause.\n\n The behavior of this method is identical to that of\n :meth:`.SelectBase.with_for_update`. When called with no arguments,\n... | -5,221,234,547,136,602,000 | return a new :class:`.Query` with the specified options for the
``FOR UPDATE`` clause.
The behavior of this method is identical to that of
:meth:`.SelectBase.with_for_update`. When called with no arguments,
the resulting ``SELECT`` statement will have a ``FOR UPDATE`` clause
appended. When additional arguments are s... | lib/sqlalchemy/orm/query.py | with_for_update | slafs/sqlalchemy | python | @_generative()
def with_for_update(self, read=False, nowait=False, of=None):
'return a new :class:`.Query` with the specified options for the\n ``FOR UPDATE`` clause.\n\n The behavior of this method is identical to that of\n :meth:`.SelectBase.with_for_update`. When called with no arguments,\n... |
@_generative()
def params(self, *args, **kwargs):
'add values for bind parameters which may have been\n specified in filter().\n\n parameters may be specified using \\**kwargs, or optionally a single\n dictionary as the first positional argument. The reason for both is\n that \\**kwargs ... | 1,281,354,998,151,989,500 | add values for bind parameters which may have been
specified in filter().
parameters may be specified using \**kwargs, or optionally a single
dictionary as the first positional argument. The reason for both is
that \**kwargs is convenient, however some parameter dictionaries
contain unicode keys in which case \**kwarg... | lib/sqlalchemy/orm/query.py | params | slafs/sqlalchemy | python | @_generative()
def params(self, *args, **kwargs):
'add values for bind parameters which may have been\n specified in filter().\n\n parameters may be specified using \\**kwargs, or optionally a single\n dictionary as the first positional argument. The reason for both is\n that \\**kwargs ... |
@_generative(_no_statement_condition, _no_limit_offset)
def filter(self, *criterion):
"apply the given filtering criterion to a copy\n of this :class:`.Query`, using SQL expressions.\n\n e.g.::\n\n session.query(MyClass).filter(MyClass.name == 'some name')\n\n Multiple criteria are j... | 4,063,492,974,036,546,000 | apply the given filtering criterion to a copy
of this :class:`.Query`, using SQL expressions.
e.g.::
session.query(MyClass).filter(MyClass.name == 'some name')
Multiple criteria are joined together by AND::
session.query(MyClass).\
filter(MyClass.name == 'some name', MyClass.id > 5)
The criterion i... | lib/sqlalchemy/orm/query.py | filter | slafs/sqlalchemy | python | @_generative(_no_statement_condition, _no_limit_offset)
def filter(self, *criterion):
"apply the given filtering criterion to a copy\n of this :class:`.Query`, using SQL expressions.\n\n e.g.::\n\n session.query(MyClass).filter(MyClass.name == 'some name')\n\n Multiple criteria are j... |
def filter_by(self, **kwargs):
"apply the given filtering criterion to a copy\n of this :class:`.Query`, using keyword expressions.\n\n e.g.::\n\n session.query(MyClass).filter_by(name = 'some name')\n\n Multiple criteria are joined together by AND::\n\n session.query(MyCl... | -3,225,263,455,888,484,400 | apply the given filtering criterion to a copy
of this :class:`.Query`, using keyword expressions.
e.g.::
session.query(MyClass).filter_by(name = 'some name')
Multiple criteria are joined together by AND::
session.query(MyClass).\
filter_by(name = 'some name', id = 5)
The keyword expressions are ext... | lib/sqlalchemy/orm/query.py | filter_by | slafs/sqlalchemy | python | def filter_by(self, **kwargs):
"apply the given filtering criterion to a copy\n of this :class:`.Query`, using keyword expressions.\n\n e.g.::\n\n session.query(MyClass).filter_by(name = 'some name')\n\n Multiple criteria are joined together by AND::\n\n session.query(MyCl... |
@_generative(_no_statement_condition, _no_limit_offset)
def order_by(self, *criterion):
'apply one or more ORDER BY criterion to the query and return\n the newly resulting ``Query``\n\n All existing ORDER BY settings can be suppressed by\n passing ``None`` - this will suppress any ORDER BY conf... | -7,147,566,917,387,758,000 | apply one or more ORDER BY criterion to the query and return
the newly resulting ``Query``
All existing ORDER BY settings can be suppressed by
passing ``None`` - this will suppress any ORDER BY configured
on mappers as well.
Alternatively, an existing ORDER BY setting on the Query
object can be entirely cancelled by ... | lib/sqlalchemy/orm/query.py | order_by | slafs/sqlalchemy | python | @_generative(_no_statement_condition, _no_limit_offset)
def order_by(self, *criterion):
'apply one or more ORDER BY criterion to the query and return\n the newly resulting ``Query``\n\n All existing ORDER BY settings can be suppressed by\n passing ``None`` - this will suppress any ORDER BY conf... |
@_generative(_no_statement_condition, _no_limit_offset)
def group_by(self, *criterion):
'apply one or more GROUP BY criterion to the query and return\n the newly resulting :class:`.Query`'
criterion = list(chain(*[_orm_columns(c) for c in criterion]))
criterion = self._adapt_col_list(criterion)
i... | -4,990,816,376,501,235,000 | apply one or more GROUP BY criterion to the query and return
the newly resulting :class:`.Query` | lib/sqlalchemy/orm/query.py | group_by | slafs/sqlalchemy | python | @_generative(_no_statement_condition, _no_limit_offset)
def group_by(self, *criterion):
'apply one or more GROUP BY criterion to the query and return\n the newly resulting :class:`.Query`'
criterion = list(chain(*[_orm_columns(c) for c in criterion]))
criterion = self._adapt_col_list(criterion)
i... |
@_generative(_no_statement_condition, _no_limit_offset)
def having(self, criterion):
'apply a HAVING criterion to the query and return the\n newly resulting :class:`.Query`.\n\n :meth:`~.Query.having` is used in conjunction with\n :meth:`~.Query.group_by`.\n\n HAVING criterion makes it p... | 8,944,880,713,640,449,000 | apply a HAVING criterion to the query and return the
newly resulting :class:`.Query`.
:meth:`~.Query.having` is used in conjunction with
:meth:`~.Query.group_by`.
HAVING criterion makes it possible to use filters on aggregate
functions like COUNT, SUM, AVG, MAX, and MIN, eg.::
q = session.query(User.id).\
... | lib/sqlalchemy/orm/query.py | having | slafs/sqlalchemy | python | @_generative(_no_statement_condition, _no_limit_offset)
def having(self, criterion):
'apply a HAVING criterion to the query and return the\n newly resulting :class:`.Query`.\n\n :meth:`~.Query.having` is used in conjunction with\n :meth:`~.Query.group_by`.\n\n HAVING criterion makes it p... |
def union(self, *q):
"Produce a UNION of this Query against one or more queries.\n\n e.g.::\n\n q1 = sess.query(SomeClass).filter(SomeClass.foo=='bar')\n q2 = sess.query(SomeClass).filter(SomeClass.bar=='foo')\n\n q3 = q1.union(q2)\n\n The method accepts multiple Query... | -5,395,724,443,501,062,000 | Produce a UNION of this Query against one or more queries.
e.g.::
q1 = sess.query(SomeClass).filter(SomeClass.foo=='bar')
q2 = sess.query(SomeClass).filter(SomeClass.bar=='foo')
q3 = q1.union(q2)
The method accepts multiple Query objects so as to control
the level of nesting. A series of ``union()`` ca... | lib/sqlalchemy/orm/query.py | union | slafs/sqlalchemy | python | def union(self, *q):
"Produce a UNION of this Query against one or more queries.\n\n e.g.::\n\n q1 = sess.query(SomeClass).filter(SomeClass.foo=='bar')\n q2 = sess.query(SomeClass).filter(SomeClass.bar=='foo')\n\n q3 = q1.union(q2)\n\n The method accepts multiple Query... |
def union_all(self, *q):
'Produce a UNION ALL of this Query against one or more queries.\n\n Works the same way as :meth:`~sqlalchemy.orm.query.Query.union`. See\n that method for usage examples.\n\n '
return self._from_selectable(expression.union_all(*([self] + list(q)))) | -7,173,164,358,490,195,000 | Produce a UNION ALL of this Query against one or more queries.
Works the same way as :meth:`~sqlalchemy.orm.query.Query.union`. See
that method for usage examples. | lib/sqlalchemy/orm/query.py | union_all | slafs/sqlalchemy | python | def union_all(self, *q):
'Produce a UNION ALL of this Query against one or more queries.\n\n Works the same way as :meth:`~sqlalchemy.orm.query.Query.union`. See\n that method for usage examples.\n\n '
return self._from_selectable(expression.union_all(*([self] + list(q)))) |
def intersect(self, *q):
'Produce an INTERSECT of this Query against one or more queries.\n\n Works the same way as :meth:`~sqlalchemy.orm.query.Query.union`. See\n that method for usage examples.\n\n '
return self._from_selectable(expression.intersect(*([self] + list(q)))) | -458,251,160,218,900,860 | Produce an INTERSECT of this Query against one or more queries.
Works the same way as :meth:`~sqlalchemy.orm.query.Query.union`. See
that method for usage examples. | lib/sqlalchemy/orm/query.py | intersect | slafs/sqlalchemy | python | def intersect(self, *q):
'Produce an INTERSECT of this Query against one or more queries.\n\n Works the same way as :meth:`~sqlalchemy.orm.query.Query.union`. See\n that method for usage examples.\n\n '
return self._from_selectable(expression.intersect(*([self] + list(q)))) |
def intersect_all(self, *q):
'Produce an INTERSECT ALL of this Query against one or more queries.\n\n Works the same way as :meth:`~sqlalchemy.orm.query.Query.union`. See\n that method for usage examples.\n\n '
return self._from_selectable(expression.intersect_all(*([self] + list(q)))) | 1,162,686,790,410,963,200 | Produce an INTERSECT ALL of this Query against one or more queries.
Works the same way as :meth:`~sqlalchemy.orm.query.Query.union`. See
that method for usage examples. | lib/sqlalchemy/orm/query.py | intersect_all | slafs/sqlalchemy | python | def intersect_all(self, *q):
'Produce an INTERSECT ALL of this Query against one or more queries.\n\n Works the same way as :meth:`~sqlalchemy.orm.query.Query.union`. See\n that method for usage examples.\n\n '
return self._from_selectable(expression.intersect_all(*([self] + list(q)))) |
def except_(self, *q):
'Produce an EXCEPT of this Query against one or more queries.\n\n Works the same way as :meth:`~sqlalchemy.orm.query.Query.union`. See\n that method for usage examples.\n\n '
return self._from_selectable(expression.except_(*([self] + list(q)))) | 1,257,272,805,102,739,700 | Produce an EXCEPT of this Query against one or more queries.
Works the same way as :meth:`~sqlalchemy.orm.query.Query.union`. See
that method for usage examples. | lib/sqlalchemy/orm/query.py | except_ | slafs/sqlalchemy | python | def except_(self, *q):
'Produce an EXCEPT of this Query against one or more queries.\n\n Works the same way as :meth:`~sqlalchemy.orm.query.Query.union`. See\n that method for usage examples.\n\n '
return self._from_selectable(expression.except_(*([self] + list(q)))) |
def except_all(self, *q):
'Produce an EXCEPT ALL of this Query against one or more queries.\n\n Works the same way as :meth:`~sqlalchemy.orm.query.Query.union`. See\n that method for usage examples.\n\n '
return self._from_selectable(expression.except_all(*([self] + list(q)))) | -7,427,639,660,594,553,000 | Produce an EXCEPT ALL of this Query against one or more queries.
Works the same way as :meth:`~sqlalchemy.orm.query.Query.union`. See
that method for usage examples. | lib/sqlalchemy/orm/query.py | except_all | slafs/sqlalchemy | python | def except_all(self, *q):
'Produce an EXCEPT ALL of this Query against one or more queries.\n\n Works the same way as :meth:`~sqlalchemy.orm.query.Query.union`. See\n that method for usage examples.\n\n '
return self._from_selectable(expression.except_all(*([self] + list(q)))) |
def join(self, *props, **kwargs):
'Create a SQL JOIN against this :class:`.Query` object\'s criterion\n and apply generatively, returning the newly resulting :class:`.Query`.\n\n **Simple Relationship Joins**\n\n Consider a mapping between two classes ``User`` and ``Address``,\n with a r... | -5,546,919,944,220,456,000 | Create a SQL JOIN against this :class:`.Query` object's criterion
and apply generatively, returning the newly resulting :class:`.Query`.
**Simple Relationship Joins**
Consider a mapping between two classes ``User`` and ``Address``,
with a relationship ``User.addresses`` representing a collection
of ``Address`` object... | lib/sqlalchemy/orm/query.py | join | slafs/sqlalchemy | python | def join(self, *props, **kwargs):
'Create a SQL JOIN against this :class:`.Query` object\'s criterion\n and apply generatively, returning the newly resulting :class:`.Query`.\n\n **Simple Relationship Joins**\n\n Consider a mapping between two classes ``User`` and ``Address``,\n with a r... |
def outerjoin(self, *props, **kwargs):
"Create a left outer join against this ``Query`` object's criterion\n and apply generatively, returning the newly resulting ``Query``.\n\n Usage is the same as the ``join()`` method.\n\n "
(aliased, from_joinpoint) = (kwargs.pop('aliased', False), kwar... | -7,954,997,624,322,960,000 | Create a left outer join against this ``Query`` object's criterion
and apply generatively, returning the newly resulting ``Query``.
Usage is the same as the ``join()`` method. | lib/sqlalchemy/orm/query.py | outerjoin | slafs/sqlalchemy | python | def outerjoin(self, *props, **kwargs):
"Create a left outer join against this ``Query`` object's criterion\n and apply generatively, returning the newly resulting ``Query``.\n\n Usage is the same as the ``join()`` method.\n\n "
(aliased, from_joinpoint) = (kwargs.pop('aliased', False), kwar... |
@_generative(_no_statement_condition, _no_limit_offset)
def _join(self, keys, outerjoin, create_aliases, from_joinpoint):
'consumes arguments from join() or outerjoin(), places them into a\n consistent format with which to form the actual JOIN constructs.\n\n '
if (not from_joinpoint):
sel... | 6,434,774,937,667,570,000 | consumes arguments from join() or outerjoin(), places them into a
consistent format with which to form the actual JOIN constructs. | lib/sqlalchemy/orm/query.py | _join | slafs/sqlalchemy | python | @_generative(_no_statement_condition, _no_limit_offset)
def _join(self, keys, outerjoin, create_aliases, from_joinpoint):
'consumes arguments from join() or outerjoin(), places them into a\n consistent format with which to form the actual JOIN constructs.\n\n '
if (not from_joinpoint):
sel... |
def _join_left_to_right(self, left, right, onclause, outerjoin, create_aliases, prop):
"append a JOIN to the query's from clause."
self._polymorphic_adapters = self._polymorphic_adapters.copy()
if (left is None):
if self._from_obj:
left = self._from_obj[0]
elif self._entities:
... | 4,310,489,427,954,364,400 | append a JOIN to the query's from clause. | lib/sqlalchemy/orm/query.py | _join_left_to_right | slafs/sqlalchemy | python | def _join_left_to_right(self, left, right, onclause, outerjoin, create_aliases, prop):
self._polymorphic_adapters = self._polymorphic_adapters.copy()
if (left is None):
if self._from_obj:
left = self._from_obj[0]
elif self._entities:
left = self._entities[0].entity_z... |
@_generative(_no_statement_condition)
def reset_joinpoint(self):
'Return a new :class:`.Query`, where the "join point" has\n been reset back to the base FROM entities of the query.\n\n This method is usually used in conjunction with the\n ``aliased=True`` feature of the :meth:`~.Query.join`\n ... | -4,546,611,727,478,187,500 | Return a new :class:`.Query`, where the "join point" has
been reset back to the base FROM entities of the query.
This method is usually used in conjunction with the
``aliased=True`` feature of the :meth:`~.Query.join`
method. See the example in :meth:`~.Query.join` for how
this is used. | lib/sqlalchemy/orm/query.py | reset_joinpoint | slafs/sqlalchemy | python | @_generative(_no_statement_condition)
def reset_joinpoint(self):
'Return a new :class:`.Query`, where the "join point" has\n been reset back to the base FROM entities of the query.\n\n This method is usually used in conjunction with the\n ``aliased=True`` feature of the :meth:`~.Query.join`\n ... |
@_generative(_no_clauseelement_condition)
def select_from(self, *from_obj):
'Set the FROM clause of this :class:`.Query` explicitly.\n\n :meth:`.Query.select_from` is often used in conjunction with\n :meth:`.Query.join` in order to control which entity is selected\n from on the "left" side of t... | 6,294,455,819,122,400,000 | Set the FROM clause of this :class:`.Query` explicitly.
:meth:`.Query.select_from` is often used in conjunction with
:meth:`.Query.join` in order to control which entity is selected
from on the "left" side of the join.
The entity or selectable object here effectively replaces the
"left edge" of any calls to :meth:`~.... | lib/sqlalchemy/orm/query.py | select_from | slafs/sqlalchemy | python | @_generative(_no_clauseelement_condition)
def select_from(self, *from_obj):
'Set the FROM clause of this :class:`.Query` explicitly.\n\n :meth:`.Query.select_from` is often used in conjunction with\n :meth:`.Query.join` in order to control which entity is selected\n from on the "left" side of t... |
@_generative(_no_clauseelement_condition)
def select_entity_from(self, from_obj):
'Set the FROM clause of this :class:`.Query` to a\n core selectable, applying it as a replacement FROM clause\n for corresponding mapped entities.\n\n This method is similar to the :meth:`.Query.select_from`\n ... | 8,139,648,133,792,127,000 | Set the FROM clause of this :class:`.Query` to a
core selectable, applying it as a replacement FROM clause
for corresponding mapped entities.
This method is similar to the :meth:`.Query.select_from`
method, in that it sets the FROM clause of the query. However,
where :meth:`.Query.select_from` only affects what is pl... | lib/sqlalchemy/orm/query.py | select_entity_from | slafs/sqlalchemy | python | @_generative(_no_clauseelement_condition)
def select_entity_from(self, from_obj):
'Set the FROM clause of this :class:`.Query` to a\n core selectable, applying it as a replacement FROM clause\n for corresponding mapped entities.\n\n This method is similar to the :meth:`.Query.select_from`\n ... |
@_generative(_no_statement_condition)
def slice(self, start, stop):
'apply LIMIT/OFFSET to the ``Query`` based on a "\n "range and return the newly resulting ``Query``.'
if ((start is not None) and (stop is not None)):
self._offset = ((self._offset or 0) + start)
self._limit = (stop - sta... | 4,062,953,535,849,662 | apply LIMIT/OFFSET to the ``Query`` based on a "
"range and return the newly resulting ``Query``. | lib/sqlalchemy/orm/query.py | slice | slafs/sqlalchemy | python | @_generative(_no_statement_condition)
def slice(self, start, stop):
'apply LIMIT/OFFSET to the ``Query`` based on a "\n "range and return the newly resulting ``Query``.'
if ((start is not None) and (stop is not None)):
self._offset = ((self._offset or 0) + start)
self._limit = (stop - sta... |
@_generative(_no_statement_condition)
def limit(self, limit):
'Apply a ``LIMIT`` to the query and return the newly resulting\n\n ``Query``.\n\n '
self._limit = limit | 5,282,936,834,975,429,000 | Apply a ``LIMIT`` to the query and return the newly resulting
``Query``. | lib/sqlalchemy/orm/query.py | limit | slafs/sqlalchemy | python | @_generative(_no_statement_condition)
def limit(self, limit):
'Apply a ``LIMIT`` to the query and return the newly resulting\n\n ``Query``.\n\n '
self._limit = limit |
@_generative(_no_statement_condition)
def offset(self, offset):
'Apply an ``OFFSET`` to the query and return the newly resulting\n ``Query``.\n\n '
self._offset = offset | -2,520,904,459,605,291,000 | Apply an ``OFFSET`` to the query and return the newly resulting
``Query``. | lib/sqlalchemy/orm/query.py | offset | slafs/sqlalchemy | python | @_generative(_no_statement_condition)
def offset(self, offset):
'Apply an ``OFFSET`` to the query and return the newly resulting\n ``Query``.\n\n '
self._offset = offset |
@_generative(_no_statement_condition)
def distinct(self, *criterion):
'Apply a ``DISTINCT`` to the query and return the newly resulting\n ``Query``.\n\n :param \\*expr: optional column expressions. When present,\n the Postgresql dialect will render a ``DISTINCT ON (<expressions>>)``\n ... | -8,107,857,850,585,034,000 | Apply a ``DISTINCT`` to the query and return the newly resulting
``Query``.
:param \*expr: optional column expressions. When present,
the Postgresql dialect will render a ``DISTINCT ON (<expressions>>)``
construct. | lib/sqlalchemy/orm/query.py | distinct | slafs/sqlalchemy | python | @_generative(_no_statement_condition)
def distinct(self, *criterion):
'Apply a ``DISTINCT`` to the query and return the newly resulting\n ``Query``.\n\n :param \\*expr: optional column expressions. When present,\n the Postgresql dialect will render a ``DISTINCT ON (<expressions>>)``\n ... |
@_generative()
def prefix_with(self, *prefixes):
"Apply the prefixes to the query and return the newly resulting\n ``Query``.\n\n :param \\*prefixes: optional prefixes, typically strings,\n not using any commas. In particular is useful for MySQL keywords.\n\n e.g.::\n\n que... | 5,733,379,320,651,781,000 | Apply the prefixes to the query and return the newly resulting
``Query``.
:param \*prefixes: optional prefixes, typically strings,
not using any commas. In particular is useful for MySQL keywords.
e.g.::
query = sess.query(User.name).\
prefix_with('HIGH_PRIORITY').\
prefix_with('SQL_SMALL_RESU... | lib/sqlalchemy/orm/query.py | prefix_with | slafs/sqlalchemy | python | @_generative()
def prefix_with(self, *prefixes):
"Apply the prefixes to the query and return the newly resulting\n ``Query``.\n\n :param \\*prefixes: optional prefixes, typically strings,\n not using any commas. In particular is useful for MySQL keywords.\n\n e.g.::\n\n que... |
def all(self):
'Return the results represented by this ``Query`` as a list.\n\n This results in an execution of the underlying query.\n\n '
return list(self) | 4,352,606,581,994,707,000 | Return the results represented by this ``Query`` as a list.
This results in an execution of the underlying query. | lib/sqlalchemy/orm/query.py | all | slafs/sqlalchemy | python | def all(self):
'Return the results represented by this ``Query`` as a list.\n\n This results in an execution of the underlying query.\n\n '
return list(self) |
@_generative(_no_clauseelement_condition)
def from_statement(self, statement):
'Execute the given SELECT statement and return results.\n\n This method bypasses all internal statement compilation, and the\n statement is executed without modification.\n\n The statement is typically either a :func... | 7,552,317,356,849,819,000 | Execute the given SELECT statement and return results.
This method bypasses all internal statement compilation, and the
statement is executed without modification.
The statement is typically either a :func:`~.expression.text`
or :func:`~.expression.select` construct, and should return the set
of columns
appropriate t... | lib/sqlalchemy/orm/query.py | from_statement | slafs/sqlalchemy | python | @_generative(_no_clauseelement_condition)
def from_statement(self, statement):
'Execute the given SELECT statement and return results.\n\n This method bypasses all internal statement compilation, and the\n statement is executed without modification.\n\n The statement is typically either a :func... |
def first(self):
"Return the first result of this ``Query`` or\n None if the result doesn't contain any row.\n\n first() applies a limit of one within the generated SQL, so that\n only one primary entity row is generated on the server side\n (note this may consist of multiple result rows... | -1,583,235,085,555,168,300 | Return the first result of this ``Query`` or
None if the result doesn't contain any row.
first() applies a limit of one within the generated SQL, so that
only one primary entity row is generated on the server side
(note this may consist of multiple result rows if join-loaded
collections are present).
Calling ``first(... | lib/sqlalchemy/orm/query.py | first | slafs/sqlalchemy | python | def first(self):
"Return the first result of this ``Query`` or\n None if the result doesn't contain any row.\n\n first() applies a limit of one within the generated SQL, so that\n only one primary entity row is generated on the server side\n (note this may consist of multiple result rows... |
def one(self):
'Return exactly one result or raise an exception.\n\n Raises ``sqlalchemy.orm.exc.NoResultFound`` if the query selects\n no rows. Raises ``sqlalchemy.orm.exc.MultipleResultsFound``\n if multiple object identities are returned, or if multiple\n rows are returned for a quer... | 2,604,968,758,797,791,000 | Return exactly one result or raise an exception.
Raises ``sqlalchemy.orm.exc.NoResultFound`` if the query selects
no rows. Raises ``sqlalchemy.orm.exc.MultipleResultsFound``
if multiple object identities are returned, or if multiple
rows are returned for a query that does not return object
identities.
Note that an e... | lib/sqlalchemy/orm/query.py | one | slafs/sqlalchemy | python | def one(self):
'Return exactly one result or raise an exception.\n\n Raises ``sqlalchemy.orm.exc.NoResultFound`` if the query selects\n no rows. Raises ``sqlalchemy.orm.exc.MultipleResultsFound``\n if multiple object identities are returned, or if multiple\n rows are returned for a quer... |
def scalar(self):
'Return the first element of the first result or None\n if no rows present. If multiple rows are returned,\n raises MultipleResultsFound.\n\n >>> session.query(Item).scalar()\n <Item>\n >>> session.query(Item.id).scalar()\n 1\n >>> sessio... | -7,254,197,736,888,337,000 | Return the first element of the first result or None
if no rows present. If multiple rows are returned,
raises MultipleResultsFound.
>>> session.query(Item).scalar()
<Item>
>>> session.query(Item.id).scalar()
1
>>> session.query(Item.id).filter(Item.id < 0).scalar()
None
>>> session.query(Item.id, Item.... | lib/sqlalchemy/orm/query.py | scalar | slafs/sqlalchemy | python | def scalar(self):
'Return the first element of the first result or None\n if no rows present. If multiple rows are returned,\n raises MultipleResultsFound.\n\n >>> session.query(Item).scalar()\n <Item>\n >>> session.query(Item.id).scalar()\n 1\n >>> sessio... |
@property
def column_descriptions(self):
"Return metadata about the columns which would be\n returned by this :class:`.Query`.\n\n Format is a list of dictionaries::\n\n user_alias = aliased(User, name='user2')\n q = sess.query(User, User.id, user_alias)\n\n # this exp... | 4,443,220,158,900,704,000 | Return metadata about the columns which would be
returned by this :class:`.Query`.
Format is a list of dictionaries::
user_alias = aliased(User, name='user2')
q = sess.query(User, User.id, user_alias)
# this expression:
q.column_descriptions
# would return:
[
{
'name':'Us... | lib/sqlalchemy/orm/query.py | column_descriptions | slafs/sqlalchemy | python | @property
def column_descriptions(self):
"Return metadata about the columns which would be\n returned by this :class:`.Query`.\n\n Format is a list of dictionaries::\n\n user_alias = aliased(User, name='user2')\n q = sess.query(User, User.id, user_alias)\n\n # this exp... |
def instances(self, cursor, __context=None):
'Given a ResultProxy cursor as returned by connection.execute(),\n return an ORM result as an iterator.\n\n e.g.::\n\n result = engine.execute("select * from users")\n for u in session.query(User).instances(result):\n pr... | 214,403,814,212,797,630 | Given a ResultProxy cursor as returned by connection.execute(),
return an ORM result as an iterator.
e.g.::
result = engine.execute("select * from users")
for u in session.query(User).instances(result):
print u | lib/sqlalchemy/orm/query.py | instances | slafs/sqlalchemy | python | def instances(self, cursor, __context=None):
'Given a ResultProxy cursor as returned by connection.execute(),\n return an ORM result as an iterator.\n\n e.g.::\n\n result = engine.execute("select * from users")\n for u in session.query(User).instances(result):\n pr... |
def merge_result(self, iterator, load=True):
"Merge a result into this :class:`.Query` object's Session.\n\n Given an iterator returned by a :class:`.Query` of the same structure\n as this one, return an identical iterator of results, with all mapped\n instances merged into the session using :m... | -3,701,953,095,847,633,000 | Merge a result into this :class:`.Query` object's Session.
Given an iterator returned by a :class:`.Query` of the same structure
as this one, return an identical iterator of results, with all mapped
instances merged into the session using :meth:`.Session.merge`. This
is an optimized method which will merge all mapped ... | lib/sqlalchemy/orm/query.py | merge_result | slafs/sqlalchemy | python | def merge_result(self, iterator, load=True):
"Merge a result into this :class:`.Query` object's Session.\n\n Given an iterator returned by a :class:`.Query` of the same structure\n as this one, return an identical iterator of results, with all mapped\n instances merged into the session using :m... |
def exists(self):
"A convenience method that turns a query into an EXISTS subquery\n of the form EXISTS (SELECT 1 FROM ... WHERE ...).\n\n e.g.::\n\n q = session.query(User).filter(User.name == 'fred')\n session.query(q.exists())\n\n Producing SQL similar to::\n\n ... | 2,540,586,680,894,167,000 | A convenience method that turns a query into an EXISTS subquery
of the form EXISTS (SELECT 1 FROM ... WHERE ...).
e.g.::
q = session.query(User).filter(User.name == 'fred')
session.query(q.exists())
Producing SQL similar to::
SELECT EXISTS (
SELECT 1 FROM users WHERE users.name = :name_1
) A... | lib/sqlalchemy/orm/query.py | exists | slafs/sqlalchemy | python | def exists(self):
"A convenience method that turns a query into an EXISTS subquery\n of the form EXISTS (SELECT 1 FROM ... WHERE ...).\n\n e.g.::\n\n q = session.query(User).filter(User.name == 'fred')\n session.query(q.exists())\n\n Producing SQL similar to::\n\n ... |
def count(self):
'Return a count of rows this Query would return.\n\n This generates the SQL for this Query as follows::\n\n SELECT count(1) AS count_1 FROM (\n SELECT <rest of query follows...>\n ) AS anon_1\n\n .. versionchanged:: 0.7\n The above schem... | 1,003,972,134,544,188,200 | Return a count of rows this Query would return.
This generates the SQL for this Query as follows::
SELECT count(1) AS count_1 FROM (
SELECT <rest of query follows...>
) AS anon_1
.. versionchanged:: 0.7
The above scheme is newly refined as of 0.7b3.
For fine grained control over specific columns... | lib/sqlalchemy/orm/query.py | count | slafs/sqlalchemy | python | def count(self):
'Return a count of rows this Query would return.\n\n This generates the SQL for this Query as follows::\n\n SELECT count(1) AS count_1 FROM (\n SELECT <rest of query follows...>\n ) AS anon_1\n\n .. versionchanged:: 0.7\n The above schem... |
def delete(self, synchronize_session='evaluate'):
'Perform a bulk delete query.\n\n Deletes rows matched by this query from the database.\n\n :param synchronize_session: chooses the strategy for the removal of\n matched objects from the session. Valid values are:\n\n ``False`` - ... | 8,814,820,009,756,160,000 | Perform a bulk delete query.
Deletes rows matched by this query from the database.
:param synchronize_session: chooses the strategy for the removal of
matched objects from the session. Valid values are:
``False`` - don't synchronize the session. This option is the most
efficient and is reliable once the ... | lib/sqlalchemy/orm/query.py | delete | slafs/sqlalchemy | python | def delete(self, synchronize_session='evaluate'):
'Perform a bulk delete query.\n\n Deletes rows matched by this query from the database.\n\n :param synchronize_session: chooses the strategy for the removal of\n matched objects from the session. Valid values are:\n\n ``False`` - ... |
def update(self, values, synchronize_session='evaluate'):
'Perform a bulk update query.\n\n Updates rows matched by this query in the database.\n\n E.g.::\n\n sess.query(User).filter(User.age == 25). update({User.age: User.age - 10}, synchronize_session=\'fetch\')\n\n\n ... | -7,350,619,407,197,641,000 | Perform a bulk update query.
Updates rows matched by this query in the database.
E.g.::
sess.query(User).filter(User.age == 25). update({User.age: User.age - 10}, synchronize_session='fetch')
sess.query(User).filter(User.age == 25). update({"age": User.age - 10}, synchronize_s... | lib/sqlalchemy/orm/query.py | update | slafs/sqlalchemy | python | def update(self, values, synchronize_session='evaluate'):
'Perform a bulk update query.\n\n Updates rows matched by this query in the database.\n\n E.g.::\n\n sess.query(User).filter(User.age == 25). update({User.age: User.age - 10}, synchronize_session=\'fetch\')\n\n\n ... |
def _adjust_for_single_inheritance(self, context):
'Apply single-table-inheritance filtering.\n\n For all distinct single-table-inheritance mappers represented in\n the columns clause of this query, add criterion to the WHERE\n clause of the given QueryContext such that only the appropriate\n ... | -7,571,517,035,935,323,000 | Apply single-table-inheritance filtering.
For all distinct single-table-inheritance mappers represented in
the columns clause of this query, add criterion to the WHERE
clause of the given QueryContext such that only the appropriate
subtypes are selected from the total results. | lib/sqlalchemy/orm/query.py | _adjust_for_single_inheritance | slafs/sqlalchemy | python | def _adjust_for_single_inheritance(self, context):
'Apply single-table-inheritance filtering.\n\n For all distinct single-table-inheritance mappers represented in\n the columns clause of this query, add criterion to the WHERE\n clause of the given QueryContext such that only the appropriate\n ... |
def set_with_polymorphic(self, query, cls_or_mappers, selectable, polymorphic_on):
"Receive an update from a call to query.with_polymorphic().\n\n Note the newer style of using a free standing with_polymporphic()\n construct doesn't make use of this method.\n\n\n "
if self.is_aliased_class:... | -3,790,119,450,206,022,700 | Receive an update from a call to query.with_polymorphic().
Note the newer style of using a free standing with_polymporphic()
construct doesn't make use of this method. | lib/sqlalchemy/orm/query.py | set_with_polymorphic | slafs/sqlalchemy | python | def set_with_polymorphic(self, query, cls_or_mappers, selectable, polymorphic_on):
"Receive an update from a call to query.with_polymorphic().\n\n Note the newer style of using a free standing with_polymporphic()\n construct doesn't make use of this method.\n\n\n "
if self.is_aliased_class:... |
def __init__(self, name, *exprs, **kw):
'Construct a new :class:`.Bundle`.\n\n e.g.::\n\n bn = Bundle("mybundle", MyClass.x, MyClass.y)\n\n for row in session.query(bn).filter(\n bn.c.x == 5).filter(bn.c.y == 4):\n print(row.mybundle.x, row.mybundle.y)\... | 4,016,396,337,611,967,000 | Construct a new :class:`.Bundle`.
e.g.::
bn = Bundle("mybundle", MyClass.x, MyClass.y)
for row in session.query(bn).filter(
bn.c.x == 5).filter(bn.c.y == 4):
print(row.mybundle.x, row.mybundle.y)
:param name: name of the bundle.
:param \*exprs: columns or SQL expressions comprising the b... | lib/sqlalchemy/orm/query.py | __init__ | slafs/sqlalchemy | python | def __init__(self, name, *exprs, **kw):
'Construct a new :class:`.Bundle`.\n\n e.g.::\n\n bn = Bundle("mybundle", MyClass.x, MyClass.y)\n\n for row in session.query(bn).filter(\n bn.c.x == 5).filter(bn.c.y == 4):\n print(row.mybundle.x, row.mybundle.y)\... |
def label(self, name):
'Provide a copy of this :class:`.Bundle` passing a new label.'
cloned = self._clone()
cloned.name = name
return cloned | -4,030,217,709,794,036,000 | Provide a copy of this :class:`.Bundle` passing a new label. | lib/sqlalchemy/orm/query.py | label | slafs/sqlalchemy | python | def label(self, name):
cloned = self._clone()
cloned.name = name
return cloned |
def create_row_processor(self, query, procs, labels):
'Produce the "row processing" function for this :class:`.Bundle`.\n\n May be overridden by subclasses.\n\n .. seealso::\n\n :ref:`bundles` - includes an example of subclassing.\n\n '
keyed_tuple = util.lightweight_named_tuple(... | 5,742,511,179,740,265,000 | Produce the "row processing" function for this :class:`.Bundle`.
May be overridden by subclasses.
.. seealso::
:ref:`bundles` - includes an example of subclassing. | lib/sqlalchemy/orm/query.py | create_row_processor | slafs/sqlalchemy | python | def create_row_processor(self, query, procs, labels):
'Produce the "row processing" function for this :class:`.Bundle`.\n\n May be overridden by subclasses.\n\n .. seealso::\n\n :ref:`bundles` - includes an example of subclassing.\n\n '
keyed_tuple = util.lightweight_named_tuple(... |
def __init__(self, alias):
'Return a :class:`.MapperOption` that will indicate to the :class:`.Query`\n that the main table has been aliased.\n\n This is a seldom-used option to suit the\n very rare case that :func:`.contains_eager`\n is being used in conjunction with a user-defined SELE... | -3,389,426,055,958,328,300 | Return a :class:`.MapperOption` that will indicate to the :class:`.Query`
that the main table has been aliased.
This is a seldom-used option to suit the
very rare case that :func:`.contains_eager`
is being used in conjunction with a user-defined SELECT
statement that aliases the parent table. E.g.::
# define an ... | lib/sqlalchemy/orm/query.py | __init__ | slafs/sqlalchemy | python | def __init__(self, alias):
'Return a :class:`.MapperOption` that will indicate to the :class:`.Query`\n that the main table has been aliased.\n\n This is a seldom-used option to suit the\n very rare case that :func:`.contains_eager`\n is being used in conjunction with a user-defined SELE... |
def piter(self, storage=None, dynamic=False):
'Iterate over time series components in parallel.\n\n This allows you to iterate over a time series while dispatching\n individual components of that time series to different processors or\n processor groups. If the parallelism strategy was set to ... | -6,974,026,987,528,458,000 | Iterate over time series components in parallel.
This allows you to iterate over a time series while dispatching
individual components of that time series to different processors or
processor groups. If the parallelism strategy was set to be
multi-processor (by "parallel = N" where N is an integer when the
DatasetSer... | yt/data_objects/time_series.py | piter | edilberto100/yt | python | def piter(self, storage=None, dynamic=False):
'Iterate over time series components in parallel.\n\n This allows you to iterate over a time series while dispatching\n individual components of that time series to different processors or\n processor groups. If the parallelism strategy was set to ... |
@classmethod
def from_filenames(cls, filenames, parallel=True, setup_function=None, **kwargs):
'Create a time series from either a filename pattern or a list of\n filenames.\n\n This method provides an easy way to create a\n :class:`~yt.data_objects.time_series.DatasetSeries`, given a set of\n ... | -6,576,160,609,459,206,000 | Create a time series from either a filename pattern or a list of
filenames.
This method provides an easy way to create a
:class:`~yt.data_objects.time_series.DatasetSeries`, given a set of
filenames or a pattern that matches them. Additionally, it can set the
parallelism strategy.
Parameters
----------
filenames : l... | yt/data_objects/time_series.py | from_filenames | edilberto100/yt | python | @classmethod
def from_filenames(cls, filenames, parallel=True, setup_function=None, **kwargs):
'Create a time series from either a filename pattern or a list of\n filenames.\n\n This method provides an easy way to create a\n :class:`~yt.data_objects.time_series.DatasetSeries`, given a set of\n ... |
def particle_trajectories(self, indices, fields=None, suppress_logging=False, ptype=None):
'Create a collection of particle trajectories in time over a series of\n datasets.\n\n Parameters\n ----------\n indices : array_like\n An integer array of particle indices whose traject... | 4,003,370,931,211,506,000 | Create a collection of particle trajectories in time over a series of
datasets.
Parameters
----------
indices : array_like
An integer array of particle indices whose trajectories we
want to track. If they are not sorted they will be sorted.
fields : list of strings, optional
A set of fields that is retriev... | yt/data_objects/time_series.py | particle_trajectories | edilberto100/yt | python | def particle_trajectories(self, indices, fields=None, suppress_logging=False, ptype=None):
'Create a collection of particle trajectories in time over a series of\n datasets.\n\n Parameters\n ----------\n indices : array_like\n An integer array of particle indices whose traject... |
def __init__(self, parameter_filename, find_outputs=False):
'\n Base class for generating simulation time series types.\n Principally consists of a *parameter_filename*.\n '
if (not os.path.exists(parameter_filename)):
raise IOError(parameter_filename)
self.parameter_filename = ... | -1,257,832,470,454,142,500 | Base class for generating simulation time series types.
Principally consists of a *parameter_filename*. | yt/data_objects/time_series.py | __init__ | edilberto100/yt | python | def __init__(self, parameter_filename, find_outputs=False):
'\n Base class for generating simulation time series types.\n Principally consists of a *parameter_filename*.\n '
if (not os.path.exists(parameter_filename)):
raise IOError(parameter_filename)
self.parameter_filename = ... |
@parallel_root_only
def print_key_parameters(self):
'\n Print out some key parameters for the simulation.\n '
if (self.simulation_type == 'grid'):
for a in ['domain_dimensions', 'domain_left_edge', 'domain_right_edge']:
self._print_attr(a)
for a in ['initial_time', 'final_t... | -3,723,327,881,550,641,000 | Print out some key parameters for the simulation. | yt/data_objects/time_series.py | print_key_parameters | edilberto100/yt | python | @parallel_root_only
def print_key_parameters(self):
'\n \n '
if (self.simulation_type == 'grid'):
for a in ['domain_dimensions', 'domain_left_edge', 'domain_right_edge']:
self._print_attr(a)
for a in ['initial_time', 'final_time', 'cosmological_simulation']:
self._p... |
def _print_attr(self, a):
'\n Print the attribute or warn about it missing.\n '
if (not hasattr(self, a)):
mylog.error('Missing %s in dataset definition!', a)
return
v = getattr(self, a)
mylog.info('Parameters: %-25s = %s', a, v) | 7,750,444,500,331,655,000 | Print the attribute or warn about it missing. | yt/data_objects/time_series.py | _print_attr | edilberto100/yt | python | def _print_attr(self, a):
'\n \n '
if (not hasattr(self, a)):
mylog.error('Missing %s in dataset definition!', a)
return
v = getattr(self, a)
mylog.info('Parameters: %-25s = %s', a, v) |
def _get_outputs_by_key(self, key, values, tolerance=None, outputs=None):
"\n Get datasets at or near to given values.\n\n Parameters\n ----------\n key: str\n The key by which to retrieve outputs, usually 'time' or\n 'redshift'.\n values: array_like\n ... | 1,400,193,438,704,522,500 | Get datasets at or near to given values.
Parameters
----------
key: str
The key by which to retrieve outputs, usually 'time' or
'redshift'.
values: array_like
A list of values, given as floats.
tolerance : float
If not None, do not return a dataset unless the value is
within the tolerance value. I... | yt/data_objects/time_series.py | _get_outputs_by_key | edilberto100/yt | python | def _get_outputs_by_key(self, key, values, tolerance=None, outputs=None):
"\n Get datasets at or near to given values.\n\n Parameters\n ----------\n key: str\n The key by which to retrieve outputs, usually 'time' or\n 'redshift'.\n values: array_like\n ... |
def doJob(self, http_res, backend, dbms, parent=None):
'This method do a Job.'
self.payloads['revisable'] = ('True' if (self.doReturn is False) else 'False')
self.settings = self.generate_payloads(http_res, parent=parent)
return self.settings | 2,761,890,933,076,850,700 | This method do a Job. | core/attack/mod_unfilter.py | doJob | qazbnm456/VWGen | python | def doJob(self, http_res, backend, dbms, parent=None):
self.payloads['revisable'] = ('True' if (self.doReturn is False) else 'False')
self.settings = self.generate_payloads(http_res, parent=parent)
return self.settings |
def to_haystack(unit):
'\n Some parsing tweaks to fit pint units / handling of edge cases.\n '
global HAYSTACK_CONVERSION
global PINT_CONVERSION
if ((unit == u'per_minute') or (unit == u'/min') or (unit == u'per_second') or (unit == u'/s') or (unit == u'per_hour') or (unit == u'/h') or (unit == No... | -2,415,941,517,977,249,000 | Some parsing tweaks to fit pint units / handling of edge cases. | hszinc/pintutil.py | to_haystack | clarsen/hszinc | python | def to_haystack(unit):
'\n \n '
global HAYSTACK_CONVERSION
global PINT_CONVERSION
if ((unit == u'per_minute') or (unit == u'/min') or (unit == u'per_second') or (unit == u'/s') or (unit == u'per_hour') or (unit == u'/h') or (unit == None)):
return u
for (pint_value, haystack_value) in ... |
def to_pint(unit):
'\n Some parsing tweaks to fit pint units / handling of edge cases.\n '
global HAYSTACK_CONVERSION
if ((unit == u'per_minute') or (unit == u'/min') or (unit == u'per_second') or (unit == u'/s') or (unit == u'per_hour') or (unit == u'/h') or (unit == None)):
return ''
for... | 3,679,479,176,463,237,000 | Some parsing tweaks to fit pint units / handling of edge cases. | hszinc/pintutil.py | to_pint | clarsen/hszinc | python | def to_pint(unit):
'\n \n '
global HAYSTACK_CONVERSION
if ((unit == u'per_minute') or (unit == u'/min') or (unit == u'per_second') or (unit == u'/s') or (unit == u'per_hour') or (unit == u'/h') or (unit == None)):
return
for (haystack_value, pint_value) in HAYSTACK_CONVERSION:
uni... |
def define_haystack_units():
'\n Missing units found in project-haystack\n Added to the registry\n '
ureg = UnitRegistry(on_redefinition='ignore')
ureg.define(u'% = [] = percent')
ureg.define(u'pixel = [] = px = dot = picture_element = pel')
ureg.define(u'decibel = [] = dB')
ureg.define... | 7,882,874,107,201,615,000 | Missing units found in project-haystack
Added to the registry | hszinc/pintutil.py | define_haystack_units | clarsen/hszinc | python | def define_haystack_units():
'\n Missing units found in project-haystack\n Added to the registry\n '
ureg = UnitRegistry(on_redefinition='ignore')
ureg.define(u'% = [] = percent')
ureg.define(u'pixel = [] = px = dot = picture_element = pel')
ureg.define(u'decibel = [] = dB')
ureg.define... |
def setupperenergy(self, value):
' Method to set the upper state energy.\n\n Parameters\n ----------\n value : float\n The value to set the upper state energy to.\n\n Returns\n -------\n None\n '
if isinstance(value, float):... | -210,451,890,552,821,570 | Method to set the upper state energy.
Parameters
----------
value : float
The value to set the upper state energy to.
Returns
-------
None | admit/util/Line.py | setupperenergy | astroumd/admit | python | def setupperenergy(self, value):
' Method to set the upper state energy.\n\n Parameters\n ----------\n value : float\n The value to set the upper state energy to.\n\n Returns\n -------\n None\n '
if isinstance(value, float):... |
def setlowerenergy(self, value):
' Method to set the lower state energy.\n\n Parameters\n ----------\n value : float\n The value to set the lower state energy to.\n\n Returns\n -------\n None\n '
if isinstance(value, float):... | -5,033,974,829,888,944,000 | Method to set the lower state energy.
Parameters
----------
value : float
The value to set the lower state energy to.
Returns
-------
None | admit/util/Line.py | setlowerenergy | astroumd/admit | python | def setlowerenergy(self, value):
' Method to set the lower state energy.\n\n Parameters\n ----------\n value : float\n The value to set the lower state energy to.\n\n Returns\n -------\n None\n '
if isinstance(value, float):... |
def getlowerenergy(self):
' Method to get the lower state energy.\n\n Parameters\n ----------\n None\n\n Returns\n -------\n Float of the lower state energy.\n\n '
return self.energies[0] | 4,097,149,889,143,395,000 | Method to get the lower state energy.
Parameters
----------
None
Returns
-------
Float of the lower state energy. | admit/util/Line.py | getlowerenergy | astroumd/admit | python | def getlowerenergy(self):
' Method to get the lower state energy.\n\n Parameters\n ----------\n None\n\n Returns\n -------\n Float of the lower state energy.\n\n '
return self.energies[0] |
def getupperenergy(self):
' Method to get the upper state energy.\n\n Parameters\n ----------\n None\n\n Returns\n -------\n Float of the upper state energy.\n\n '
return self.energies[1] | -2,025,381,944,315,756,000 | Method to get the upper state energy.
Parameters
----------
None
Returns
-------
Float of the upper state energy. | admit/util/Line.py | getupperenergy | astroumd/admit | python | def getupperenergy(self):
' Method to get the upper state energy.\n\n Parameters\n ----------\n None\n\n Returns\n -------\n Float of the upper state energy.\n\n '
return self.energies[1] |
def setkey(self, name='', value=''):
'\n set keys, two styles are possible:\n\n 1. name = {key:val} e.g. **setkey({"a":1})**\n\n 2. name = "key", value = val e.g. **setkey("a", 1)**\n\n This method checks the type of the keyword value, as it must\n ... | 8,722,881,559,404,423,000 | set keys, two styles are possible:
1. name = {key:val} e.g. **setkey({"a":1})**
2. name = "key", value = val e.g. **setkey("a", 1)**
This method checks the type of the keyword value, as it must
remain the same. Also new keywords cannot be added.
Parameters
----------
name : dictionary or string
... | admit/util/Line.py | setkey | astroumd/admit | python | def setkey(self, name=, value=):
'\n set keys, two styles are possible:\n\n 1. name = {key:val} e.g. **setkey({"a":1})**\n\n 2. name = "key", value = val e.g. **setkey("a", 1)**\n\n This method checks the type of the keyword value, as it must\n r... |
def isequal(self, line):
' Experimental method to compare 2 line classes\n\n Parameters\n ----------\n line : Line\n The class to compare this one to.\n\n Returns\n -------\n Boolean whether or not the two classes contain the same data... | -6,666,949,688,399,691,000 | Experimental method to compare 2 line classes
Parameters
----------
line : Line
The class to compare this one to.
Returns
-------
Boolean whether or not the two classes contain the same data. | admit/util/Line.py | isequal | astroumd/admit | python | def isequal(self, line):
' Experimental method to compare 2 line classes\n\n Parameters\n ----------\n line : Line\n The class to compare this one to.\n\n Returns\n -------\n Boolean whether or not the two classes contain the same data... |
def _hash_bucket(df: pd.DataFrame, subset: Optional[Sequence[str]], num_buckets: int):
'\n Categorize each row of `df` based on the data in the columns `subset`\n into `num_buckets` values. This is based on `pandas.util.hash_pandas_object`\n '
if (not subset):
subset = df.columns
hash_arr =... | -6,590,359,751,248,936,000 | Categorize each row of `df` based on the data in the columns `subset`
into `num_buckets` values. This is based on `pandas.util.hash_pandas_object` | kartothek/io/dask/_shuffle.py | _hash_bucket | MartinHaffner/kartothek | python | def _hash_bucket(df: pd.DataFrame, subset: Optional[Sequence[str]], num_buckets: int):
'\n Categorize each row of `df` based on the data in the columns `subset`\n into `num_buckets` values. This is based on `pandas.util.hash_pandas_object`\n '
if (not subset):
subset = df.columns
hash_arr =... |
def shuffle_store_dask_partitions(ddf: dd.DataFrame, table: str, secondary_indices: List[str], metadata_version: int, partition_on: List[str], store_factory: StoreFactory, df_serializer: Optional[DataFrameSerializer], dataset_uuid: str, num_buckets: int, sort_partitions_by: List[str], bucket_by: Sequence[str]) -> da.Ar... | 7,840,959,128,910,960,000 | Perform a dataset update with dask reshuffling to control partitioning.
The shuffle operation will perform the following steps
1. Pack payload data
Payload data is serialized and compressed into a single byte value using
``distributed.protocol.serialize_bytes``, see also ``pack_payload``.
2. Apply bucketing
... | kartothek/io/dask/_shuffle.py | shuffle_store_dask_partitions | MartinHaffner/kartothek | python | def shuffle_store_dask_partitions(ddf: dd.DataFrame, table: str, secondary_indices: List[str], metadata_version: int, partition_on: List[str], store_factory: StoreFactory, df_serializer: Optional[DataFrameSerializer], dataset_uuid: str, num_buckets: int, sort_partitions_by: List[str], bucket_by: Sequence[str]) -> da.Ar... |
def _unpack_store_partition(df: pd.DataFrame, secondary_indices: List[str], sort_partitions_by: List[str], table: str, dataset_uuid: str, partition_on: List[str], store_factory: StoreFactory, df_serializer: DataFrameSerializer, metadata_version: int, unpacked_meta: pd.DataFrame) -> MetaPartition:
'Unpack payload da... | -6,418,627,830,148,800,000 | Unpack payload data and store partition | kartothek/io/dask/_shuffle.py | _unpack_store_partition | MartinHaffner/kartothek | python | def _unpack_store_partition(df: pd.DataFrame, secondary_indices: List[str], sort_partitions_by: List[str], table: str, dataset_uuid: str, partition_on: List[str], store_factory: StoreFactory, df_serializer: DataFrameSerializer, metadata_version: int, unpacked_meta: pd.DataFrame) -> MetaPartition:
df = unpack_p... |
@app.get('/todoer/v1/tasks', status_code=200)
async def root(request: Request, database=Depends(get_database), pagination: Tuple[(int, int)]=Depends(pagination)) -> dict:
'\n GET tasks as html page\n '
tasks = (await database.get_all(*pagination))
return TEMPLATES.TemplateResponse('index.html', {'requ... | 6,508,956,269,686,269,000 | GET tasks as html page | todoer_api/app/main.py | root | owlsong/todoer | python | @app.get('/todoer/v1/tasks', status_code=200)
async def root(request: Request, database=Depends(get_database), pagination: Tuple[(int, int)]=Depends(pagination)) -> dict:
'\n \n '
tasks = (await database.get_all(*pagination))
return TEMPLATES.TemplateResponse('index.html', {'request': request, 'tasks'... |
def data_generator(path, batch_size=8, input_shape=96, scale=2):
'data generator for fit_generator'
fns = os.listdir(path)
n = len(fns)
i = 0
while True:
(lrs, hrs) = ([], [])
for b in range(batch_size):
if (i == 0):
np.random.shuffle(fns)
fn =... | -6,014,064,260,644,129,000 | data generator for fit_generator | src/train.py | data_generator | zhaipro/keras-wdsr | python | def data_generator(path, batch_size=8, input_shape=96, scale=2):
fns = os.listdir(path)
n = len(fns)
i = 0
while True:
(lrs, hrs) = ([], [])
for b in range(batch_size):
if (i == 0):
np.random.shuffle(fns)
fn = fns[i]
fn = os.path.j... |
@property
def peers(self) -> Mapping[(bytes, Peer)]:
'Returns a read-only copy of peers.'
with self.lock:
return self._peers.copy() | -9,164,602,136,683,299,000 | Returns a read-only copy of peers. | electrum/lnworker.py | peers | jeroz1/electrum-ravencoin-utd | python | @property
def peers(self) -> Mapping[(bytes, Peer)]:
with self.lock:
return self._peers.copy() |
def get_node_alias(self, node_id: bytes) -> Optional[str]:
'Returns the alias of the node, or None if unknown.'
node_alias = None
if self.channel_db:
node_info = self.channel_db.get_node_info_for_node_id(node_id)
if node_info:
node_alias = node_info.alias
else:
for (k... | 115,511,388,044,440,000 | Returns the alias of the node, or None if unknown. | electrum/lnworker.py | get_node_alias | jeroz1/electrum-ravencoin-utd | python | def get_node_alias(self, node_id: bytes) -> Optional[str]:
node_alias = None
if self.channel_db:
node_info = self.channel_db.get_node_info_for_node_id(node_id)
if node_info:
node_alias = node_info.alias
else:
for (k, v) in hardcoded_trampoline_nodes().items():
... |
def get_sync_progress_estimate(self) -> Tuple[(Optional[int], Optional[int], Optional[int])]:
'Estimates the gossip synchronization process and returns the number\n of synchronized channels, the total channels in the network and a\n rescaled percentage of the synchronization process.'
if (self.num... | 3,173,733,034,705,334,300 | Estimates the gossip synchronization process and returns the number
of synchronized channels, the total channels in the network and a
rescaled percentage of the synchronization process. | electrum/lnworker.py | get_sync_progress_estimate | jeroz1/electrum-ravencoin-utd | python | def get_sync_progress_estimate(self) -> Tuple[(Optional[int], Optional[int], Optional[int])]:
'Estimates the gossip synchronization process and returns the number\n of synchronized channels, the total channels in the network and a\n rescaled percentage of the synchronization process.'
if (self.num... |
@property
def channels(self) -> Mapping[(bytes, Channel)]:
'Returns a read-only copy of channels.'
with self.lock:
return self._channels.copy() | -6,742,783,748,671,863,000 | Returns a read-only copy of channels. | electrum/lnworker.py | channels | jeroz1/electrum-ravencoin-utd | python | @property
def channels(self) -> Mapping[(bytes, Channel)]:
with self.lock:
return self._channels.copy() |
@property
def channel_backups(self) -> Mapping[(bytes, ChannelBackup)]:
'Returns a read-only copy of channels.'
with self.lock:
return self._channel_backups.copy() | -5,893,535,997,725,226,000 | Returns a read-only copy of channels. | electrum/lnworker.py | channel_backups | jeroz1/electrum-ravencoin-utd | python | @property
def channel_backups(self) -> Mapping[(bytes, ChannelBackup)]:
with self.lock:
return self._channel_backups.copy() |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.