#NEWLINE# def init_collection( obj , key ) : #NEWLINE# #INDENT# "Initialize a collection attribute and return the collection adapter.\n\n    This function is used to provide direct access to collection internals\n    for a previously unloaded attribute.  e.g.::\n\n        collection_adapter = init_collection(someobject, 'elements')\n        for elem in values:\n            collection_adapter.append_without_event(elem)\n\n    For an easier way to do the above, see\n    :func:`~sqlalchemy.orm.attributes.set_committed_value`.\n\n    obj is an instrumented object instance.  An InstanceState\n    is accepted directly for backwards compatibility but\n    this usage is deprecated.\n\n    " #NEWLINE# state = instance_state ( obj ) #NEWLINE# dict_ = state . dict #NEWLINE# return init_state_collection ( state , dict_ , key )