Why Gemfury? Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Debian packages RPM packages NuGet packages

Repository URL to install this package:

Details    
contego / home / tvault / .virtenv / lib / python2.7 / site-packages / sqlalchemy / orm / collections.pyc
Size: Mime:
ó
‹EYc@sdZddlZddlZddlZddlmZddlmZmZ	ddlm
Z
ddlmZd	d
ddd
gZ
ejjƒZdefd„ƒYZdefd„ƒYZdefd„ƒYZd„Zdefd„ƒYZd„Zd„Zd	efd„ƒYZejdƒZdefd„ƒYZd„Zd„Zd„Zd „Z d!„Z!d"„Z"d#„Z#d$„Z$d%„Z%e&d&„Z'e&d'„Z(e&d(„Z)d)„Z*d*„Z+e,e-fZ.d+„Z/d,„Z0d-„Z1d.e2fd/„ƒYZ3d0e,fd1„ƒYZ4d2e5fd3„ƒYZ6ie3e26e4e,6e6e56Z7iid4d56d6d76d8d96e*ƒfe26id:d56d6d76d8d96e1ƒfe,6ej8r¹id;d96e+ƒfnid<d96e+ƒfe56Z9d=e5fd>„ƒYZ:e e:ƒe e3ƒe e4ƒdS(?sNSupport for collections of mapped entities.

The collections package supplies the machinery used to inform the ORM of
collection membership changes.  An instrumentation via decoration approach is
used, allowing arbitrary types (including built-ins) to be used as entity
collections without requiring inheritance from a base class.

Instrumentation decoration relays membership change events to the
:class:`.CollectionAttributeImpl` that is currently managing the collection.
The decorators observe function call arguments and return values, tracking
entities entering or leaving the collection.  Two decorator approaches are
provided.  One is a bundle of generic decorators that map function arguments
and return values to events::

  from sqlalchemy.orm.collections import collection
  class MyClass(object):
      # ...

      @collection.adds(1)
      def store(self, item):
          self.data.append(item)

      @collection.removes_return()
      def pop(self):
          return self.data.pop()


The second approach is a bundle of targeted decorators that wrap appropriate
append and remove notifiers around the mutation methods present in the
standard Python ``list``, ``set`` and ``dict`` interfaces.  These could be
specified in terms of generic decorator recipes, but are instead hand-tooled
for increased efficiency.  The targeted decorators occasionally implement
adapter-like behavior, such as mapping bulk-set methods (``extend``,
``update``, ``__setslice__``, etc.) into the series of atomic mutation events
that the ORM requires.

The targeted decorators are used internally for automatic instrumentation of
entity collection classes.  Every collection class goes through a
transformation process roughly like so:

1. If the class is a built-in, substitute a trivial sub-class
2. Is this class already instrumented?
3. Add in generic decorators
4. Sniff out the collection interface through duck-typing
5. Add targeted decoration to any undecorated interface method

This process modifies the class at runtime, decorating methods and adding some
bookkeeping properties.  This isn't possible (or desirable) for built-in
classes like ``list``, so trivial sub-classes are substituted to hold
decoration::

  class InstrumentedList(list):
      pass

Collection classes can be specified in ``relationship(collection_class=)`` as
types or a function that returns an instance.  Collection classes are
inspected and instrumented during the mapper compilation phase.  The
collection_class callable will be executed once to produce a specimen
instance, and the type of that specimen will be instrumented.  Functions that
return built-in types like ``lists`` will be adapted to produce instrumented
instances.

When extending a known type like ``list``, additional decorations are not
generally not needed.  Odds are, the extension method will delegate to a
method that's already instrumented.  For example::

  class QueueIsh(list):
     def push(self, item):
         self.append(item)
     def shift(self):
         return self.pop(0)

There's no need to decorate these methods.  ``append`` and ``pop`` are already
instrumented as part of the ``list`` interface.  Decorating them would fire
duplicate events, which should be avoided.

The targeted decoration tries not to rely on other methods in the underlying
collection class, but some are unavoidable.  Many depend on 'read' methods
being present to properly instrument a 'write', for example, ``__setitem__``
needs ``__getitem__``.  "Bulk" methods like ``update`` and ``extend`` may also
reimplemented in terms of atomic appends and removes, so the ``extend``
decoration will actually perform many ``append`` operations and not call the
underlying method at all.

Tight control over bulk operation and the firing of events is also possible by
implementing the instrumentation internally in your methods.  The basic
instrumentation package works under the general assumption that collection
mutation will not raise unusual exceptions.  If you want to closely
orchestrate append and remove events with exception management, internal
instrumentation may be the answer.  Within your method,
``collection_adapter(self)`` will retrieve an object that you can use for
explicit control over triggering append and remove events.

The owning object and :class:`.CollectionAttributeImpl` are also reachable
through the adapter, allowing for some very sophisticated behavior.

iÿÿÿÿNi(t
expression(tutiltexci(tbase(tinspect_getargspect
collectiontcollection_adaptertmapped_collectiontcolumn_mapped_collectiontattribute_mapped_collectiont_PlainColumnGettercBs2eZdZd„Zd„Zd„Zd„ZRS(sÖPlain column getter, stores collection of Column objects
    directly.

    Serializes to a :class:`._SerializableColumnGetterV2`
    which has more expensive __call__() performance
    and some rare caveats.

    cCs"||_t|ƒdk|_dS(Ni(tcolstlent	composite(tselfR((sO/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/orm/collections.pyt__init__…s	cCstj|jƒS(N(t_SerializableColumnGetterV2t_reduce_from_colsR(R((sO/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/orm/collections.pyt
__reduce__‰scCs|jS(N(R(Rtmapper((sO/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/orm/collections.pyt_colsŒscCsqtj|ƒ}tj|ƒ}g|j|ƒD]}|j||j|ƒ^q.}|jret|ƒS|dSdS(Ni(Rtinstance_statet
_state_mapperRt_get_state_attr_by_columntdictR
ttuple(Rtvaluetstatetmtcoltkey((sO/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/orm/collections.pyt__call__s1	
(t__name__t
__module__t__doc__RRRR(((sO/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/orm/collections.pyR
{s
			t_SerializableColumnGettercBs)eZdZd„Zd„Zd„ZRS(slColumn-based getter used in version 0.7.6 only.

    Remains here for pickle compatibility with 0.7.6.

    cCs"||_t|ƒdk|_dS(Ni(tcolkeysRR
(RR$((sO/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/orm/collections.pyR¥s	cCst|jffS(N(R#R$(R((sO/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/orm/collections.pyR©scCsutj|ƒ}tj|ƒ}g|jD](}|j||j|jj|ƒ^q(}|jrit	|ƒS|dSdS(Ni(
RRRR$RRtmapped_tabletcolumnsR
R(RRRRtkR((sO/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/orm/collections.pyR¬s5	
(R R!R"RRR(((sO/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/orm/collections.pyR#žs		RcBs8eZdZd„Zd„Zed„ƒZd„ZRS(s<Updated serializable getter which deals with
    multi-table mapped classes.

    Two extremely unusual cases are not supported.
    Mappings which have tables across multiple metadata
    objects, or which are mapped to non-Table selectables
    linked across inheriting mappers may fail to function
    here.

    cCs"||_t|ƒdk|_dS(Ni(R$RR
(RR$((sO/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/orm/collections.pyRÅs	cCs|j|jffS(N(t	__class__R$(R((sO/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/orm/collections.pyRÉscCs>d„}g|D]}|j||ƒf^q}t|ffS(NcSs't|jtjƒsdS|jjSdS(N(t
isinstancettableRtTableClausetNoneR(tc((sO/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/orm/collections.pyt
_table_keyÎs(RR(tclsRR.R-R$((sO/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/orm/collections.pyRÌs	(cCs’g}t|jddƒ}xp|jD]e\}}|dksU|dksU||kro|j|jj|ƒq%|j|j|j|ƒq%W|S(Ntmetadata(tgetattrtlocal_tableR,R$tappendR-ttables(RRRR0tckeyttkey((sO/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/orm/collections.pyRÖs(R R!R"RRtclassmethodRR(((sO/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/orm/collections.pyR¹s

		
csGgtj|ƒD]}tj|dƒ^q}t|ƒ‰‡fd†S(sßA dictionary-based collection type with column-based keying.

    Returns a :class:`.MappedCollection` factory with a keying function
    generated from mapping_spec, which may be a Column or a sequence
    of Columns.

    The key value must be immutable for the lifetime of the object.  You
    can not, for example, map on foreign key values if those key values will
    change during the session, i.e. from None to a database-assigned integer
    after a session flush.

    tmapping_speccs
tˆƒS(N(tMappedCollection((tkeyfunc(sO/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/orm/collections.pyt<lambda>ôs(Rtto_listRt_only_column_elementsR
(R8tqR((R:sO/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/orm/collections.pyRãs
+t_SerializableAttrGettercBs#eZd„Zd„Zd„ZRS(cCs||_tj|ƒ|_dS(N(tnametoperatort
attrgettertgetter(RR@((sO/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/orm/collections.pyRøs	cCs
|j|ƒS(N(RC(Rttarget((sO/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/orm/collections.pyRüscCst|jffS(N(R?R@(R((sO/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/orm/collections.pyRÿs(R R!RRR(((sO/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/orm/collections.pyR?÷s		cst|ƒ‰‡fd†S(sA dictionary-based collection type with attribute-based keying.

    Returns a :class:`.MappedCollection` factory with a keying based on the
    'attr_name' attribute of entities in the collection, where ``attr_name``
    is the string name of the attribute.

    The key value must be immutable for the lifetime of the object.  You
    can not, for example, map on foreign key values if those key values will
    change during the session, i.e. from None to a database-assigned integer
    after a session flush.

    cs
tˆƒS(N(R9((RC(sO/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/orm/collections.pyR;s(R?(t	attr_name((RCsO/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/orm/collections.pyR	s
cs
‡fd†S(sàA dictionary-based collection type with arbitrary keying.

    Returns a :class:`.MappedCollection` factory with a keying function
    generated from keyfunc, a callable that takes an entity and returns a
    key value.

    The key value must be immutable for the lifetime of the object.  You
    can not, for example, map on foreign key values if those key values will
    change during the session, i.e. from None to a database-assigned integer
    after a session flush.

    cs
tˆƒS(N(R9((R:(sO/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/orm/collections.pyR;!s((R:((R:sO/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/orm/collections.pyRs
cBsªeZdZed„ƒZed„ƒZed„ƒZed„ƒZed„ƒZeZ	ed„ƒZ
ed„ƒZed„ƒZed	„ƒZ
ed
„ƒZRS(s}Decorators for entity collection classes.

    The decorators fall into two groups: annotations and interception recipes.

    The annotating decorators (appender, remover, iterator, linker, converter,
    internally_instrumented) indicate the method's purpose and take no
    arguments.  They are not written with parens::

        @collection.appender
        def append(self, append): ...

    The recipe decorators all require parens, even those that take no
    arguments::

        @collection.adds('entity')
        def insert(self, position, entity): ...

        @collection.removes_return()
        def popitem(self): ...

    cCs
d|_|S(sTag the method as the collection appender.

        The appender method is called with one positional argument: the value
        to append. The method will be automatically decorated with 'adds(1)'
        if not already decorated::

            @collection.appender
            def add(self, append): ...

            # or, equivalently
            @collection.appender
            @collection.adds(1)
            def add(self, append): ...

            # for mapping type, an 'append' may kick out a previous value
            # that occupies that slot.  consider d['a'] = 'foo'- any previous
            # value in d['a'] is discarded.
            @collection.appender
            @collection.replaces(1)
            def add(self, entity):
                key = some_key_func(entity)
                previous = None
                if key in self:
                    previous = self[key]
                self[key] = entity
                return previous

        If the value to append is not allowed in the collection, you may
        raise an exception.  Something to remember is that the appender
        will be called for each object mapped by a database query.  If the
        database contains rows that violate your collection semantics, you
        will need to get creative to fix the problem, as access via the
        collection will not work.

        If the appender method is internally instrumented, you must also
        receive the keyword argument '_sa_initiator' and ensure its
        promulgation to collection events.

        tappender(t_sa_instrument_role(tfn((sO/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/orm/collections.pyRF=s)	cCs
d|_|S(sTag the method as the collection remover.

        The remover method is called with one positional argument: the value
        to remove. The method will be automatically decorated with
        :meth:`removes_return` if not already decorated::

            @collection.remover
            def zap(self, entity): ...

            # or, equivalently
            @collection.remover
            @collection.removes_return()
            def zap(self, ): ...

        If the value to remove is not present in the collection, you may
        raise an exception or return None to ignore the error.

        If the remove method is internally instrumented, you must also
        receive the keyword argument '_sa_initiator' and ensure its
        promulgation to collection events.

        tremover(RG(RH((sO/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/orm/collections.pyRIis	cCs
d|_|S(sÿTag the method as the collection remover.

        The iterator method is called with no arguments.  It is expected to
        return an iterator over all collection members::

            @collection.iterator
            def __iter__(self): ...

        titerator(RG(RH((sO/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/orm/collections.pyRJ„s	cCs
t|_|S(sÈTag the method as instrumented.

        This tag will prevent any decoration from being applied to the
        method. Use this if you are orchestrating your own calls to
        :func:`.collection_adapter` in one of the basic SQLAlchemy
        interface methods, or to prevent an automatic ABC method
        decoration from wrapping your implementation::

            # normally an 'extend' method on a list-like class would be
            # automatically intercepted and re-implemented in terms of
            # SQLAlchemy events and append().  your implementation will
            # never be called, unless:
            @collection.internally_instrumented
            def extend(self, items): ...

        (tTruet_sa_instrumented(RH((sO/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/orm/collections.pytinternally_instrumented’s	cCs
d|_|S(stTag the method as a "linked to attribute" event handler.

        This optional event handler will be called when the collection class
        is linked to or unlinked from the InstrumentedAttribute.  It is
        invoked immediately after the '_sa_adapter' property is set on
        the instance.  A single argument is passed: the collection adapter
        that has been linked, or None if unlinking.

        .. deprecated:: 1.0.0 - the :meth:`.collection.linker` handler
           is superseded by the :meth:`.AttributeEvents.init_collection`
           and :meth:`.AttributeEvents.dispose_collection` handlers.

        tlinker(RG(RH((sO/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/orm/collections.pyRN§s	cCs
d|_|S(s¡Tag the method as the collection converter.

        This optional method will be called when a collection is being
        replaced entirely, as in::

            myobj.acollection = [newvalue1, newvalue2]

        The converter method will receive the object being assigned and should
        return an iterable of values suitable for use by the ``appender``
        method.  A converter must not assign values or mutate the collection,
        its sole job is to adapt the value the user provides into an iterable
        of values for the ORM's use.

        The default converter implementation will use duck-typing to do the
        conversion.  A dict-like collection will be convert into an iterable
        of dictionary values, and other types will simply be iterated::

            @collection.converter
            def convert(self, other): ...

        If the duck-typing of the object does not match the type of this
        collection, a TypeError is raised.

        Supply an implementation of this method if you want to expand the
        range of possible types that can be assigned in bulk or perform
        validation on the values about to be assigned.

        t	converter(RG(RH((sO/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/orm/collections.pyRO¼s	cs‡fd†}|S(sÛMark the method as adding an entity to the collection.

        Adds "add to collection" handling to the method.  The decorator
        argument indicates which method argument holds the SQLAlchemy-relevant
        value.  Arguments can be specified positionally (i.e. integer) or by
        name::

            @collection.adds(1)
            def push(self, item): ...

            @collection.adds('entity')
            def do_stuff(self, thing, entity=None): ...

        csdˆf|_|S(Ntfire_append_event(t_sa_instrument_before(RH(targ(sO/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/orm/collections.pyt	decoratorís((RRRS((RRsO/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/orm/collections.pytaddsÝscs‡fd†}|S(sMark the method as replacing an entity in the collection.

        Adds "add to collection" and "remove from collection" handling to
        the method.  The decorator argument indicates which method argument
        holds the SQLAlchemy-relevant value to be added, and return value, if
        any will be considered the value to remove.

        Arguments can be specified positionally (i.e. integer) or by name::

            @collection.replaces(2)
            def __setitem__(self, index, item): ...

        csdˆf|_d|_|S(NRPtfire_remove_event(RQt_sa_instrument_after(RH(RR(sO/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/orm/collections.pyRSs	((RRRS((RRsO/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/orm/collections.pytreplacesòscs‡fd†}|S(sMark the method as removing an entity in the collection.

        Adds "remove from collection" handling to the method.  The decorator
        argument indicates which method argument holds the SQLAlchemy-relevant
        value to be removed. Arguments can be specified positionally (i.e.
        integer) or by name::

            @collection.removes(1)
            def zap(self, item): ...

        For methods where the value to remove is not known at call-time, use
        collection.removes_return.

        csdˆf|_|S(NRU(RQ(RH(RR(sO/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/orm/collections.pyRSs((RRRS((RRsO/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/orm/collections.pytremovesscCs
d„}|S(sµMark the method as removing an entity in the collection.

        Adds "remove from collection" handling to the method.  The return
        value of the method, if any, is considered the value to remove.  The
        method arguments are not inspected::

            @collection.removes_return()
            def pop(self): ...

        For methods where the value to remove is known at call-time, use
        collection.remove.

        cSs
d|_|S(NRU(RV(RH((sO/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/orm/collections.pyRS+s	((RS((sO/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/orm/collections.pytremoves_returns	(R R!R"tstaticmethodRFRIRJRMRNtlinkRORTRWRXRY(((sO/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/orm/collections.pyR$s,!t_sa_adaptertCollectionAdaptercBsþeZdZeZd„Zd„Zed„ƒZed„ƒZ	e
jd„ƒZd„Z
dd„Zd„Zd	„Zdd
„Zd„Zdd„Zd
„Zd„Zd„Zd„ZeZdd„Zdd„Zdd„Zd„Zd„ZRS(siBridges between the ORM and arbitrary Python collections.

    Proxies base-level collection operations (append, remove, iterate)
    to the underlying Python collection, and emits add/remove events for
    entities entering or leaving the collection.

    The ORM uses :class:`.CollectionAdapter` exclusively for interaction with
    entity collections.


    cCs4|j|_tj|ƒ|_||_||_dS(N(Rt_keytweakreftreft_datatowner_stateR\(RtattrRbtdata((sO/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/orm/collections.pyRCs	cCstjdƒdS(Ns%This collection has been invalidated.(Rtwarn(R((sO/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/orm/collections.pyt_warn_invalidatedIscCs
|jƒS(s$The entity collection being adapted.(Ra(R((sO/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/orm/collections.pyRdLscCs|jj|j|jƒkS(sÃreturn True if the owner state still refers to this collection.

        This will return False within a bulk replace operation,
        where this collection is the one being replaced.

        (RbRR^Ra(R((sO/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/orm/collections.pyt_referenced_by_ownerQscCs|jj|jjS(N(RbtmanagerR^timpl(R((sO/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/orm/collections.pyRc[scCs'|jƒj}|dk	r%||ƒStj|ƒ}tj|jƒƒ}|dksa||krÂ|dkrsdp||jj}|dkr |jƒjj}n	|j}td||fƒ‚nt|ddƒdk	rá|j	S|t
krtjr|jƒSt|d|jƒƒSn
t
|ƒSdS(sConverts collection-compatible objects to an iterable of values.

        Can be passed any type of object, and if the underlying collection
        determines that it can be adapted into a stream of values it can
        use, returns an iterable of values suitable for append()ing.

        This method may raise TypeError or any other suitable exception
        if adaptation fails.

        If a converter implementation is not supplied on the collection,
        a default duck-typing-based implementation is used.

        R,s/Incompatible collection type: %s is not %s-likeR\t
itervaluesN(Rat
_sa_converterR,Rtduck_type_collectionR(R t	TypeErrorR1R\Rtpy3ktvaluestiter(RtobjROtsetting_typetreceiving_typetgiventwanted((sO/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/orm/collections.pytadapt_like_to_iterable_s(
		
cCs|jƒj|d|ƒdS(s8Add an entity to the collection, firing mutation events.t
_sa_initiatorN(Rat_sa_appender(Rtitemt	initiator((sO/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/orm/collections.pytappend_with_event‹scCs|jƒj|dtƒdS(s=Add or restore an entity to the collection, firing no events.RwN(RaRxtFalse(RRy((sO/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/orm/collections.pytappend_without_eventscCs4|jƒj}x|D]}||dtƒqWdS(s=Add or restore an entity to the collection, firing no events.RwN(RaRxR|(RtitemsRFRy((sO/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/orm/collections.pytappend_multiple_without_event”s
cCs|jƒj|d|ƒdS(s=Remove an entity from the collection, firing mutation events.RwN(Rat_sa_remover(RRyRz((sO/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/orm/collections.pytremove_with_eventšscCs|jƒj|dtƒdS(s7Remove an entity from the collection, firing no events.RwN(RaR€R|(RRy((sO/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/orm/collections.pytremove_without_eventžscCs:|jƒj}x$t|ƒD]}||d|ƒqWdS(s>Empty the collection, firing a mutation event for each entity.RwN(RaR€tlist(RRzRIRy((sO/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/orm/collections.pytclear_with_event¢scCs:|jƒj}x$t|ƒD]}||dtƒqWdS(s'Empty the collection, firing no events.RwN(RaR€RƒR|(RRIRy((sO/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/orm/collections.pytclear_without_event©scCst|jƒjƒƒS(s(Iterate over entities in the collection.(RpRat_sa_iterator(R((sO/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/orm/collections.pyt__iter__°scCstt|jƒjƒƒƒS(s!Count entities in the collection.(RRƒRaR†(R((sO/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/orm/collections.pyt__len__µscCstS(N(RK(R((sO/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/orm/collections.pyt__bool__¹scCsL|tk	rD|jr"|jƒn|jj|j|jj||ƒS|SdS(s Notify that a entity has entered the collection.

        Initiator is a token owned by the InstrumentedAttribute that
        initiated the membership mutation, and should be left as None
        unless you are passing along an initiator value from a chained
        operation.

        N(R|tinvalidatedRfRcRPRbR(RRyRz((sO/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/orm/collections.pyRP¾s		
		
cCsK|tk	rG|jr"|jƒn|jj|j|jj||ƒndS(sNotify that a entity has been removed from the collection.

        Initiator is the InstrumentedAttribute that initiated the membership
        mutation, and should be left as None unless you are passing along
        an initiator value from a chained operation.

        N(R|RŠRfRcRURbR(RRyRz((sO/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/orm/collections.pyRUÑs	
		cCs<|jr|jƒn|jj|j|jjd|ƒdS(s«Notify that an entity is about to be removed from the collection.

        Only called if the entity cannot be removed after calling
        fire_remove_event().

        RzN(RŠRfRctfire_pre_remove_eventRbR(RRz((sO/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/orm/collections.pyR‹ás	
	cCs"i|jd6|jd6|jd6S(NRRbRd(R^RbRd(R((sO/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/orm/collections.pyt__getstate__ïs

cCs4|d|_|d|_tj|dƒ|_dS(NRRbRd(R^RbR_R`Ra(Rtd((sO/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/orm/collections.pyt__setstate__ôs

N(R R!R"R|RŠRRftpropertyRdRgRtmemoized_propertyRcRvR,R{R}RRR‚R„R…R‡RˆR‰t__nonzero__RPRUR‹RŒRŽ(((sO/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/orm/collections.pyR]5s0		
	,								c	Csòt|tƒst|ƒ}ntj}||p3dƒ}|j|pHdƒ}||pZdƒj|ƒ}|j|ƒ}xL|p„dD]>}||kr§|j|ƒq…||kr…|j|ƒq…q…W|rîx|D]}|j|ƒqÔWndS(sFLoad a new collection, firing events based on prior like membership.

    Appends instances in ``values`` onto the ``new_adapter``. Events will be
    fired for any instance not present in the ``existing_adapter``.  Any
    instances in ``existing_adapter`` not present in ``values`` will have
    remove events fired upon them.

    :param values: An iterable of collection member instances

    :param existing_adapter: A :class:`.CollectionAdapter` of
     instances to be replaced

    :param new_adapter: An empty :class:`.CollectionAdapter`
     to load with ``values``


    N(((((	R)RƒRtIdentitySettintersectiont
differenceR{R}R(	Rotexisting_adaptertnew_adaptertidsettexisting_idsett	constantst	additionstremovalstmember((sO/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/orm/collections.pytbulk_replaceús	
cCsŸ|tkrt|}nt|ƒƒ}|tkrOt||ƒ}|ƒ}ntjƒr›z/t|ddƒt|ƒkr‰t|ƒnWdtj	ƒXn|S(soPrepare a callable for future use as a collection class factory.

    Given a collection class factory (either a type or no-arg callable),
    return another factory that will produce compatible instances when
    called.

    This function is responsible for converting collection_class=list
    into the run-time behavior of collection_class=InstrumentedList.

    RLN(
t__canned_instrumentationttypet__converting_factoryt__instrumentation_mutextacquireR1R,tidt_instrument_classtrelease(tfactoryR/((sO/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/orm/collections.pytprepare_instrumentation s
cs<t|‰‡‡fd†}dˆj|_ˆj|_|S(ssReturn a wrapper that converts a "canned" collection like
    set, dict, list into the Instrumented* version.

    csˆƒ}ˆ|ƒS(N((R(tinstrumented_clstoriginal_factory(sO/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/orm/collections.pytwrapperKs	s	%sWrapper(RžR R"(tspecimen_clsR©Rª((R¨R©sO/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/orm/collections.pyR Cs

cCsg|jdkr!tjdƒ‚nt|ƒ\}}t|||ƒt|||ƒt|||ƒdS(s6Modify methods in a class and install instrumentation.t__builtin__sGCan not instrument a built-in type. Use a subclass, even a trivial one.N(R!tsa_exct
ArgumentErrort_locate_roles_and_methodst_setup_canned_rolest_assert_required_rolest_set_collection_attributes(R/trolestmethods((sO/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/orm/collections.pyR¤VscCsSi}i}x:|jD]/}x&t|ƒjƒD]\}}tj|ƒsPq/nt|dƒr|j}|dkszt‚|j||ƒnd
\}}t|dƒrØ|j
\}	}
|	dksÉt‚|	|
f}nt|d
ƒr|j}	|	dkst‚|	}n|r%||f||<q/|r/dd|f||<q/q/WqW||fS(sgsearch for _sa_instrument_role-decorated methods in
    method resolution order, assign to roles.

    RGRFRIRJRNRORQRPRURV(sappendersremoversiteratorslinkers	converterN(NN(sfire_append_eventsfire_remove_event(sfire_append_eventsfire_remove_event(t__mro__tvarsR~RtcallablethasattrRGtAssertionErrort
setdefaultR,RQRV(R/R³R´tsuperclsR@tmethodtroletbeforetaftertoptargument((sO/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/orm/collections.pyR¯js2			cCsÉtj|ƒ}|tkrÅt|\}}x*|jƒD]\}}|j||ƒq8Wxj|jƒD]Y\}}	t||dƒ}
|
re||kret|
dƒret|||	|
ƒƒqeqeWndS(sÇsee if this class has "canned" roles based on a known
    collection type (dict, set, list).  Apply those roles
    as needed to the "roles" dictionary, and also
    prepare "decorator" methods

    RLN(	RRlt__interfacesR~RºR1R,R¸tsetattr(R/R³R´tcollection_typetcanned_rolest
decoratorsR½R@R¼RSRH((sO/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/orm/collections.pyR°‘sc	Cs+d|ks t||dƒr9tjd|jƒ‚n>|d|krwtt||dƒdƒrwd||d<nd|ks—t||dƒr°tjd|jƒ‚n>|d|krîtt||dƒdƒrîd
||d<nd	|kst||d	ƒr'tjd
|jƒ‚ndS(sTensure all roles are present, and apply implicit instrumentation if
    needed

    RFs>Type %s must elect an appender method to be a collection classRLRPiRIs<Type %s must elect a remover method to be a collection classRURJs>Type %s must elect an iterator method to be a collection classN(sfire_append_eventiN(sfire_remove_eventiN(R¸R­R®R R1R,(R/R³R´((sO/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/orm/collections.pyR±¦s$   c	Cs¿xK|jƒD]=\}\}}}t||tt||ƒ|||ƒƒq
Wx7|jƒD])\}}t|d|t||ƒƒq[Wd|_t|dƒs¬d|_nt|ƒ|_	dS(skapply ad-hoc instrumentation from decorators, class-level defaults
    and implicit role declarations

    s_sa_%sRkN(
R~RÃt_instrument_membership_mutatorR1R,R\R¸RkR£RL(R/R³R´tmethod_nameR¾RÁR¿R½((sO/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/orm/collections.pyR²Ás"	!	csðˆrttjtˆƒdƒƒ}tˆtƒr_ˆ‰t|ƒˆkrV|ˆpYd‰n*ˆ|kr}|jˆƒ‰nd‰ˆ‰~n‡‡‡‡‡‡fd†}t	|_
tˆdƒrԈj|_nˆj
|_
ˆj|_|S(sIRoute method args and/or return value through the collection
    adapter.ics?ˆrˆdkrAˆ|kr4tjdˆƒ‚n|ˆ}qt|ƒˆkr`|ˆ}qˆ|kry|ˆ}qtjdˆƒ‚n|jddƒ}|tkr¶d}n
|dj}ˆrè|rèt|ˆƒ||ƒnˆsö|rˆ||ŽSˆ||Ž}|dk	r7t|ˆƒ||ƒn|SdS(NsMissing argument %sRwi(R,R­R®RtpopR|R\R1(targstkwRRztexecutortres(R¿RÁR¾R¼t	named_argtpos_arg(sO/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/orm/collections.pyRªæs0


	

RGN(RƒRtflatten_iteratorRR)tintRR,tindexRKRLR¸RGR R"(R¼R¾RÁR¿tfn_argsRª((R¿RÁR¾R¼RÎRÏsO/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/orm/collections.pyRÇÕs"%!	cCs7|tk	r3|j}|r3|j||ƒ}q3n|S(s:Run set events, may eventually be inlined into decorators.(R|R\RP(RRyRwRÌ((sO/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/orm/collections.pyt__sets
	cCs5|tk	r1|j}|r1|j||ƒq1ndS(s:Run del events, may eventually be inlined into decorators.N(R|R\RU(RRyRwRÌ((sO/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/orm/collections.pyt__dels	cCs#|j}|r|j|ƒndS(s5Special method to run 'commit existing value' methodsN(R\R‹(RRwRÌ((sO/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/orm/collections.pyt__before_delete!s	csæd„‰‡fd†}‡fd†}‡fd†}‡fd†}‡fd†}tjr~‡fd†}‡fd†}n‡fd	†}‡fd
†}‡fd†}	tjsƇfd†}
ntƒjƒ}|jd
ƒ|S(s:Tailored instrumentation wrappers for any list-like class.cSs%t|_tt|jƒj|_dS(N(RKRLR1RƒR R"(RH((sO/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/orm/collections.pyt_tidy+s	cs d‡fd†}ˆ|ƒ|S(Ncs#t|||ƒ}ˆ||ƒdS(N(RÔ(RRyRw(RH(sO/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/orm/collections.pyR30s(R,(RHR3(R×(RHsO/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/orm/collections.pyR3/s
cs d‡fd†}ˆ|ƒ|S(Ncs.t||ƒˆ||ƒt|||ƒdS(N(RÖRÕ(RRRw(RH(sO/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/orm/collections.pytremove7s

(R,(RHRØ(R×(RHsO/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/orm/collections.pyRØ6s
cs‡fd†}ˆ|ƒ|S(Ncs#t||ƒ}ˆ|||ƒdS(N(RÔ(RRÒR(RH(sO/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/orm/collections.pytinsert@s((RHRÙ(R×(RHsO/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/orm/collections.pyRÙ?s
cs‡fd†}ˆ|ƒ|S(Nc
sÜt|tƒsW||}|dk	r5t||ƒnt||ƒ}ˆ|||ƒn|jpcd}|jprd}|dkr”|t|ƒ7}n|jdk	r¯|j}nt|ƒ}|dkrÚ|t|ƒ7}n|dkrSx6t	|||ƒD]"}t|ƒ|krù||=qùqùWx¶t
|ƒD] \}}|j|||ƒq,Wn…tt	|||ƒƒ}	t|ƒt|	ƒkr¨t
dt|ƒt|	ƒfƒ‚nx-t|	|ƒD]\}}|j||ƒq¸WdS(NiisBattempt to assign sequence of size %s to extended slice of size %s(R)tsliceR,RÕRÔtsteptstartRtstoptranget	enumerateRÙRƒt
ValueErrortzipt__setitem__(
RRÒRtexistingRÛRÜRÝtiRytrng(RH(sO/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/orm/collections.pyRâGs:
	((RHRâ(R×(RHsO/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/orm/collections.pyRâFs$
cs‡fd†}ˆ|ƒ|S(Ncsit|tƒs6||}t||ƒˆ||ƒn/x||D]}t||ƒqAWˆ||ƒdS(N(R)RÚRÕ(RRÒRy(RH(sO/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/orm/collections.pyt__delitem__os

((RHRæ(R×(RHsO/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/orm/collections.pyRæns
cs‡fd†}ˆ|ƒ|S(Ncs^x"|||!D]}t||ƒqWg|D]}t||ƒ^q,}ˆ||||ƒdS(N(RÕRÔ(RRÜtendRoR(RH(sO/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/orm/collections.pyt__setslice__€s"((RHRè(R×(RHsO/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/orm/collections.pyRès
cs‡fd†}ˆ|ƒ|S(Ncs9x"|||!D]}t||ƒqWˆ|||ƒdS(N(RÕ(RRÜRçR(RH(sO/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/orm/collections.pyt__delslice__‰s((RHRé(R×(RHsO/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/orm/collections.pyRéˆs
csd„}ˆ|ƒ|S(NcSs"x|D]}|j|ƒqWdS(N(R3(RtiterableR((sO/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/orm/collections.pytextend‘s
((RHRë(R×(sO/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/orm/collections.pyRës	
csd„}ˆ|ƒ|S(NcSs"x|D]}|j|ƒqW|S(N(R3(RRêR((sO/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/orm/collections.pyt__iadd__˜s
((RHRì(R×(sO/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/orm/collections.pyRì—s	
cs d‡fd†}ˆ|ƒ|S(Niÿÿÿÿcs*t|ƒˆ||ƒ}t||ƒ|S(N(RÖRÕ(RRÒRy(RH(sO/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/orm/collections.pyRÉ¢s

((RHRÉ(R×(RHsO/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/orm/collections.pyRÉ¡s
cs d‡fd†}ˆ|ƒ|S(Niÿÿÿÿcs,x|D]}t||ƒqWˆ|ƒdS(N(RÕ(RRÒRy(RH(sO/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/orm/collections.pytclear¬s
((RHRí(R×(RHsO/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/orm/collections.pyRí«s
R×(Rtpy2ktlocalstcopyRÉ(R3RØRÙRâRæRèRéRëRìRÉRítl((R×sO/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/orm/collections.pyt_list_decorators(s"		(		
		

cs´d„‰tjdƒ‰‡fd†}‡fd†}‡fd†}‡‡fd†}‡fd†}‡fd†}‡‡fd	†}tƒjƒ}|jd
ƒ|jdƒ|S(sBTailored instrumentation wrappers for any dict-like mapping class.cSs%t|_tt|jƒj|_dS(N(RKRLR1RR R"(RH((sO/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/orm/collections.pyR×Às	tUnspecifiedcs d‡fd†}ˆ|ƒ|S(NcsI||kr#t||||ƒnt|||ƒ}ˆ|||ƒdS(N(RÕRÔ(RRRRw(RH(sO/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/orm/collections.pyRâÇs(R,(RHRâ(R×(RHsO/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/orm/collections.pyRâÆs
cs d‡fd†}ˆ|ƒ|S(Ncs4||kr#t||||ƒnˆ||ƒdS(N(RÕ(RRRw(RH(sO/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/orm/collections.pyRæÐs(R,(RHRæ(R×(RHsO/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/orm/collections.pyRæÏs
cs‡fd†}ˆ|ƒ|S(Ncs0x|D]}t|||ƒqWˆ|ƒdS(N(RÕ(RR(RH(sO/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/orm/collections.pyRíØs
((RHRí(R×(RHsO/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/orm/collections.pyRí×s
cs#ˆ‡‡fd†}ˆ|ƒ|S(NcsM||kr t|||ƒn|ˆkr9ˆ||ƒSˆ|||ƒSdS(N(RÕ(RRtdefault(RóRH(sO/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/orm/collections.pyRÉàs

((RHRÉ(RóR×(RHsO/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/orm/collections.pyRÉßs
cs‡fd†}ˆ|ƒ|S(Ncs+t|ƒˆ|ƒ}t||dƒ|S(Ni(RÖRÕ(RRy(RH(sO/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/orm/collections.pytpopitemës
((RHRõ(R×(RHsO/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/orm/collections.pyRõês
csdd„}ˆ|ƒ|S(NcSs1||kr |j||ƒ|S|j|ƒSdS(N(Rât__getitem__(RRRô((sO/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/orm/collections.pyRºôs(R,(RHRº(R×(sO/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/orm/collections.pyRºós
cs ˆ‡fd†}ˆ|ƒ|S(Ncsï|ˆk	r©t|dƒrfxˆt|ƒD]7}||ksN||||k	r(||||<q(q(Wq©x@|D]5\}}||ks•|||k	rm|||<qmqmWnx?|D]7}||ksÖ||||k	r°||||<q°q°WdS(Ntkeys(R¸Rƒ(Rt__otherRËRR(Ró(sO/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/orm/collections.pytupdateþs
 ((RHRù(RóR×(sO/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/orm/collections.pyRùýs
R×(RtsymbolRïRðRÉ(RâRæRíRÉRõRºRùRñ((RóR×sO/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/orm/collections.pyt_dict_decorators½s			


cCst|t|jfƒS(sKAllow only set, frozenset and self.__class__-derived
    objects in binops.(R)t_set_binop_basesR((RRq((sO/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/orm/collections.pyt_set_binops_check_strictscCs,t|t|jfƒp+tj|ƒtkS(s5Allow anything set-like to participate in set binops.(R)RüR(RRltset(RRq((sO/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/orm/collections.pyt_set_binops_check_loosescsd„‰tjdƒ}‡fd†}‡fd†}‡fd†}‡fd†}‡fd†}‡fd†}‡fd	†}‡fd
†}‡fd†}	‡fd†}
‡fd
†}‡fd†}‡fd†}
tƒjƒ}|jdƒ|jdƒ|S(s9Tailored instrumentation wrappers for any set-like class.cSs%t|_tt|jƒj|_dS(N(RKRLR1RþR R"(RH((sO/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/orm/collections.pyR×&s	Rócs d‡fd†}ˆ|ƒ|S(Ncs2||kr!t|||ƒ}nˆ||ƒdS(N(RÔ(RRRw(RH(sO/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/orm/collections.pytadd-s(R,(RHR(R×(RHsO/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/orm/collections.pyR,s
cs d‡fd†}ˆ|ƒ|S(Ncs0||krt|||ƒnˆ||ƒdS(N(RÕ(RRRw(RH(sO/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/orm/collections.pytdiscard6s(R,(RHR(R×(RHsO/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/orm/collections.pyR5s
cs d‡fd†}ˆ|ƒ|S(Ncs0||krt|||ƒnˆ||ƒdS(N(RÕ(RRRw(RH(sO/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/orm/collections.pyRØ@s(R,(RHRØ(R×(RHsO/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/orm/collections.pyRØ?s
cs‡fd†}ˆ|ƒ|S(Ncs't|ƒˆ|ƒ}t||ƒ|S(N(RÖRÕ(RRy(RH(sO/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/orm/collections.pyRÉJs

((RHRÉ(R×(RHsO/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/orm/collections.pyRÉIs
csd„}ˆ|ƒ|S(NcSs(x!t|ƒD]}|j|ƒq
WdS(N(RƒRØ(RRy((sO/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/orm/collections.pyRíSs((RHRí(R×(sO/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/orm/collections.pyRíRs	
csd„}ˆ|ƒ|S(NcSs"x|D]}|j|ƒqWdS(N(R(RRRy((sO/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/orm/collections.pyRùZs
((RHRù(R×(sO/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/orm/collections.pyRùYs	
csd„}ˆ|ƒ|S(NcSs5t||ƒstSx|D]}|j|ƒqW|S(N(RýtNotImplementedR(RRRy((sO/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/orm/collections.pyt__ior__as

((RHR(R×(sO/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/orm/collections.pyR`s	
csd„}ˆ|ƒ|S(NcSs"x|D]}|j|ƒqWdS(N(R(RRRy((sO/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/orm/collections.pytdifference_updateks
((RHR(R×(sO/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/orm/collections.pyRjs	
csd„}ˆ|ƒ|S(NcSs5t||ƒstSx|D]}|j|ƒqW|S(N(RýRR(RRRy((sO/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/orm/collections.pyt__isub__rs

((RHR(R×(sO/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/orm/collections.pyRqs	
csd„}ˆ|ƒ|S(NcSsq|j|ƒt|ƒ}}||||}}x|D]}|j|ƒq8Wx|D]}|j|ƒqVWdS(N(R“RþRØR(RtothertwantthaveRØRRy((sO/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/orm/collections.pytintersection_update|s

((RHR	(R×(sO/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/orm/collections.pyR	{s	
csd„}ˆ|ƒ|S(NcSs„t||ƒstS|j|ƒt|ƒ}}||||}}x|D]}|j|ƒqKWx|D]}|j|ƒqiW|S(N(RýRR“RþRØR(RRRRRØRRy((sO/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/orm/collections.pyt__iand__ˆs

((RHR
(R×(sO/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/orm/collections.pyR
‡s	
csd„}ˆ|ƒ|S(NcSsq|j|ƒt|ƒ}}||||}}x|D]}|j|ƒq8Wx|D]}|j|ƒqVWdS(N(tsymmetric_differenceRþRØR(RRRRRØRRy((sO/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/orm/collections.pytsymmetric_difference_update—s

((RHR(R×(sO/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/orm/collections.pyR–s	
csd„}ˆ|ƒ|S(NcSs„t||ƒstS|j|ƒt|ƒ}}||||}}x|D]}|j|ƒqKWx|D]}|j|ƒqiW|S(N(RýRRRþRØR(RRRRRØRRy((sO/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/orm/collections.pyt__ixor__£s

((RHR
(R×(sO/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/orm/collections.pyR
¢s	
R×(RRúRïRðRÉ(RóRRRØRÉRíRùRRRR	R
RR
Rñ((R×sO/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/orm/collections.pyt_set_decorators#s&		

	



tInstrumentedListcBseZdZRS(s-An instrumented version of the built-in list.(R R!R"(((sO/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/orm/collections.pyR·stInstrumentedSetcBseZdZRS(s,An instrumented version of the built-in set.(R R!R"(((sO/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/orm/collections.pyR»stInstrumentedDictcBseZdZRS(s-An instrumented version of the built-in dict.(R R!R"(((sO/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/orm/collections.pyR¿sR3RFRØRIR‡RJRRoRjR9cBseeZdZd„Zejejdd„ƒƒZej	ejdd„ƒƒZ
ejd„ƒZRS(s)A basic dictionary-based collection class.

    Extends dict with the minimal bag semantics that collection
    classes require. ``set`` and ``remove`` are implemented in terms
    of a keying function: any callable that takes an object and
    returns an object for use as a dictionary key.

    cCs
||_dS(shCreate a new collection with keying provided by keyfunc.

        keyfunc may be any callable that takes an object and returns an object
        for use as a dictionary key.

        The keyfunc will be called every time the ORM needs to add a member by
        value-only (such as when loading instances from the database) or
        remove a member.  The usual cautions about dictionary keying apply-
        ``keyfunc(object)`` should return the same output for the life of the
        collection.  Keying based on mutable properties can result in
        unreachable instances "lost" in the collection.

        N(R:(RR:((sO/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/orm/collections.pyRäscCs&|j|ƒ}|j|||ƒdS(s9Add an item by value, consulting the keyfunc for the key.N(R:Râ(RRRwR((sO/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/orm/collections.pyRþôscCsV|j|ƒ}|||krBtjd||||fƒ‚n|j||ƒdS(s<Remove an item by value, consulting the keyfunc for the key.s¼Can not remove '%s': collection holds '%s' for key '%s'. Possible cause: is the MappedCollection key function based on mutable properties or properties that only obtain values after flush?N(R:R­tInvalidRequestErrorRæ(RRRwR((sO/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/orm/collections.pyRØüsccs`xYtj|ƒD]H\}}|j|ƒ}||krStd|||fƒ‚n|VqWdS(sÊValidate and convert a dict-like object into values for set()ing.

        This is called behind the scenes when a MappedCollection is replaced
        entirely by another collection, as in::

          myobj.mappedcollection = {'a':obj1, 'b': obj2} # ...

        Raises a TypeError if the key in any (key, value) pair in the dictlike
        object does not match the key that this collection's keyfunc would
        have assigned for that value.

        snFound incompatible key %r for value %r; this collection's keying function requires a key of %r for this value.N(Rtdictlike_iteritemsR:Rm(Rtdictliketincoming_keyRtnew_key((sO/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/orm/collections.pyt_convert
sN(
R R!R"RRRFRMR,RþRIRØROR(((sO/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/orm/collections.pyR9Ús	(;R"tinspectRAR_tsqlRtRRR­Rtsqlalchemy.util.compatRt__all__t	threadingtLockR¡tobjectR
R#RRR?R	RRRBRR]RR§R R¤R¯R°R±R²RÇR,RÔRÕRÖRòRûRþt	frozensetRüRýRÿRRƒRRRRRžRnRÂR9(((sO/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/orm/collections.pyt<module>hsv	#*			ÿÅ	&	#			'				:
	•	W			”

P