L iVddlmZddlmZddlmZddlmZddl m Z GddeZy) ) TracebackType)Optional)Self)FileLock) _WaitCounterc\eZdZdZdeffd Zdeeedeedee ddffd Z xZ S) ra~ This behaves like a normal file lock. However, it adds waitcounters for acquiring and releasing the filelock as well as for the critical region within it. pytorch.filelock.enter - While we're acquiring the filelock. pytorch.filelock.region - While we're holding the filelock and doing work. pytorch.filelock.exit - While we're releasing the filelock. returnctdj|_tdj5t|}ddd|jj S#1swY%xYw)Nzpytorch.filelock.regionzpytorch.filelock.enter)rguardregion_countersuper __enter__)selfresult __class__s [/mnt/ssd/data/python-lab/Trading/venv/lib/python3.12/site-packages/torch/utils/_filelock.pyrzFileLock.__enter__se*+DEKKM 2 3 9 9 ; )W&(F ) %%'  ) )s A,,A5exc_type exc_value tracebackNc|jjtdj5t||||dddy#1swYyxYw)Nzpytorch.filelock.exit)r __exit__rr r )rrrrrs rrzFileLock.__exit__sV $$& 1 2 8 8 : = G Xy) < =   = s AA) __name__ __module__ __qualname____doc__rrrtype BaseExceptionrr __classcell__)rs@rrr sX 4 4 ./ M* M*    rN) typesrtypingrtyping_extensionsrfilelockr base_FileLock torch.monitorrrrr's ".& } r