# Stubs for sqlalchemy.orm.session (Python 2)
#
# NOTE: This dynamically typed stub was automatically generated by stubgen.

from typing import Any

class _SessionClassMethods:
    @classmethod
    def close_all(cls): ...
    @classmethod
    def identity_key(cls, orm_util, *args, **kwargs): ...
    @classmethod
    def object_session(cls, instance): ...

class SessionTransaction:
    session = ... # type: Any
    nested = ... # type: Any
    def __init__(self, session, parent=..., nested=...) -> None: ...
    @property
    def is_active(self): ...
    def connection(self, bindkey, execution_options=..., **kwargs): ...
    def prepare(self): ...
    def commit(self): ...
    def rollback(self, _capture_exception=...): ...
    def close(self, invalidate=...): ...
    def __enter__(self): ...
    def __exit__(self, type, value, traceback): ...

class Session(_SessionClassMethods):
    public_methods = ... # type: Any
    identity_map = ... # type: Any
    bind = ... # type: Any
    transaction = ... # type: Any
    hash_key = ... # type: Any
    autoflush = ... # type: Any
    autocommit = ... # type: Any
    expire_on_commit = ... # type: Any
    twophase = ... # type: Any
    def __init__(self, bind=..., autoflush=..., expire_on_commit=..., _enable_transaction_accounting=..., autocommit=..., twophase=..., weak_identity_map=..., binds=..., extension=..., info=..., query_cls=...) -> None: ...
    connection_callable = ... # type: Any
    def info(self): ...
    def begin(self, subtransactions=..., nested=...): ...
    def begin_nested(self): ...
    def rollback(self): ...
    def commit(self): ...
    def prepare(self): ...
    def connection(self, mapper=..., clause=..., bind=..., close_with_result=..., execution_options=..., **kw): ...
    def execute(self, clause, params=..., mapper=..., bind=..., **kw): ...
    def scalar(self, clause, params=..., mapper=..., bind=..., **kw): ...
    def close(self): ...
    def invalidate(self): ...
    def expunge_all(self): ...
    def bind_mapper(self, mapper, bind): ...
    def bind_table(self, table, bind): ...
    def get_bind(self, mapper=..., clause=...): ...
    def query(self, *entities, **kwargs): ...
    @property
    def no_autoflush(self): ...
    def refresh(self, instance, attribute_names=..., lockmode=...): ...
    def expire_all(self): ...
    def expire(self, instance, attribute_names=...): ...
    def prune(self): ...
    def expunge(self, instance): ...
    def add(self, instance, _warn=...): ...
    def add_all(self, instances): ...
    def delete(self, instance): ...
    def merge(self, instance, load=...): ...
    def enable_relationship_loading(self, obj): ...
    def __contains__(self, instance): ...
    def __iter__(self): ...
    def flush(self, objects=...): ...
    def bulk_save_objects(self, objects, return_defaults=..., update_changed_only=...): ...
    def bulk_insert_mappings(self, mapper, mappings, return_defaults=...): ...
    def bulk_update_mappings(self, mapper, mappings): ...
    def is_modified(self, instance, include_collections=..., passive=...): ...
    @property
    def is_active(self): ...
    @property
    def dirty(self): ...
    @property
    def deleted(self): ...
    @property
    def new(self): ...

class sessionmaker(_SessionClassMethods):
    kw = ... # type: Any
    class_ = ... # type: Any
    def __init__(self, bind=..., class_=..., autoflush=..., autocommit=..., expire_on_commit=..., info=..., **kw) -> None: ...
    def __call__(self, **local_kw): ...
    def configure(self, **new_kw): ...

# Names in __all__ with no definition:
#   SessionExtension
