|L iddlmZddlmZddlmZddlmZddlZddl Z ddl m Z ddl Z ddl Z ddl mZddl mZdd l mZ dd lmZdd lmZe j*d k(Ze j.dk\Ze j.dk\Ze j.dk\Ze j.dk\ZGddej8ZerddlZnddlZerd d ddZ dd ddZ!nd d ddZ dd ddZ!d dZ" d! d"dZ# d#dZ$y)$) annotations) ConfigParser)metadata) EntryPointN)Path)Any)Iterator)SequenceT)inspect_getfullargspec)inspect_formatargspecposix))r )r )r ceZdZddZy) EncodedIOcyN)selfs Y/mnt/ssd/data/python-lab/Trading/venv/lib/python3.12/site-packages/alembic/util/compat.pyclosezEncodedIO.close&s N)returnNone)__name__ __module__ __qualname__rrrrrr%s rr)top_downc,tj|Sr)rwalk)pathr!s r path_walkr%2syyrFwalk_upc(|j||S)Nr&) relative_to)r$otherr's rpath_relative_tor+7sw77rc#lKtj||D]\}}}t|||fyw)N)topdown)osr#r)r$r!rootdirsfiless rr%r%>s:"$x!@ * D$t*dE) ) *s24c |j|S#t$rX|rTt|j|gz}|D]&} |j|ccYS#t$rY$wxYwt|d|wxYw)z Calculate the relative path of 'path' with respect to 'other', optionally allowing 'path' to be outside the subtree of 'other'. OK I used AI for this, sorry z is not in the same subtree as )r) ValueErrorlistparents)r$r*r'other_ancestorsancestors rr+r+Ds ##E* * "&u}}"5"? /!H!#//99%! !! !f;E7C s,)A4A A4 AA4AA4cJtjj|S)zprovide a facade for metadata.entry_points(). This is no longer a "compat" function as of Python 3.10, however the function is widely referenced in the test suite and elsewhere so is still in this module for compatibility reasons. group)r entry_pointsselectr9s rimportlib_metadata_getr=_s!  " ) ) ) 66rct|tr|St|dddk(r+t|j ddj ddSt|t rA|j d|fvrt|jS|j dz|jzSt|tjrt|j ddSt|j ddS) zvendored from python 3.7rNtypingztyping.~builtins.) isinstancestrgetattrreprreplacetyperr r?TypeVar) annotation base_modules rformatannotation_fwdrefrMjs *c"z<.(:J'' 26>>sBGG*d#  Z$= = //0 0$$s*Z-D-DDD J /J''R00   # #C ,,rc(|j|dS)Nlocale)encoding)read) file_config file_arguments rread_config_parserrT~s   MH  ==r)r$rr!boolrz+Iterator[tuple[Path, list[str], list[str]]])r$rr*rr'rUrr)r:rErzSequence[EntryPoint]r)rKrrLz Any | NonerrE)rRrrSzlist[str | os.PathLike[str]]rz list[str])% __future__r configparserr importlibrimportlib.metadatarior.pathlibrsysr?rr r sqlalchemy.utilr sqlalchemy.util.compatr nameis_posix version_infopy314py313py312py311 TextIOWrapperrtomllibtomlir%r+r=rMrTrrrris#%)   77g  G# G# G# G#       )-!% 4 5:888-18 8)-**!%* 4*5:-1 6704--",--(>>/>>r