U a@spddlmZddlmZddlmZddlmZddZdZeZdd Zd d Z d d Z Gddde Z dS))exc)util)collections_abc) immutabledictcstjfdd}|S)zDecorator, memoize a function in a connection.info stash. Only applicable to functions which take no arguments other than a connection. The memo will be stored in ``connection.info[key]``. csF|}z |jWStk r@||||j<}|YSXdSN)connectinfoKeyError)fnself connectionvalkeyWC:\Users\vtejo\AppData\Local\Temp\pip-unpacked-wheel-nyjtotrf\sqlalchemy\engine\util.py decorateds  z%connection_memoize..decorated)r decorator)rrrrrconnection_memoizesrrcCs|s|r||gSgSnt|dkr|d}t|ttfrj|r^t|ddrbt|ddsb|S|gSqt|drz|gS||ggSn.|t|ddrt|dds|S|gSdS)a Given arguments from the calling form \*multiparams, \**params, return a list of bind parameter structures, usually a list of dictionaries. In the case of 'raw' execution which accepts positional parameters, it may be a list of tuples or lists. __iter__stripkeysN)Z_warn_for_legacy_exec_formatlen isinstancelisttuplehasattrr Z multiparamsparamsZzerorrr_distill_params%s6      r!cCs|s|r|gSgSnt|dkr||d}t|ttfrb|rVt|ddrZt|ddsZ|S|gSqt|drr|gS|ggSn&t|ddrt|dds|S|gSdS)z_distill_params without any warnings. more appropriate for "cursor" params that can include tuple arguments, lists of tuples, etc. rrrrrN)rrrrrrrrr_distill_cursor_paramsXs0     r"cCsn|dkrttfSt|trF|rrrrrr)s  r)N) rrrrrr#r$r!r"r(objectr)rrrrs    3.