L idZddlmZddlZddlZddlZddlZddlZddlZddl m Z dZ dZ dZ dd ZGd d eZGd d eZy)zE Helpers for logging. This module needs much love to become useful. )print_functionN)mkdirpcbtjjdrtd|dz S|S)zRemove .1s to the time under Windows: this is the time it take to stat files. This is needed to make results similar to timings under Unix, for tests winrg?)sysplatform startswithmaxts S/mnt/ssd/data/python-lab/Trading/venv/lib/python3.12/site-packages/joblib/logger.py _squeeze_timers+  ||u%1a#gc,t|}d||dz fzS)Nz%.1fs, %.1fminN@rr s r format_timer"saA q!d(m ++rc<t|}|dkDrd|dz zSd|zS)N<z%4.1fminrz %5.1fsrr s rshort_format_timer's,aA2vQX&&Arcdtjvr)ddl}|j}|j dddnd}t j |||}|rjdi||S) Nnumpyr@r) precision threshold edgeitems)depthindent)rmodulesrget_printoptionsset_printoptionspprintpformat)objr rnp print_optionsouts rr&r&/sf#++++-  a2C ..E& 9C,m, Jrc2eZdZdZddZdZdZdZd dZy) Loggerz Base class for logging messages.Nc4||_|r||_yd|_y)z Parameters ---------- depth: int, optional The depth of objects printed. name: str, optional The namespace to log to. If None, defaults to joblib. joblibN)r_name)selfrnames r__init__zLogger.__init__Cs !T x rcltj|jjd|d|yN[z]: )logging getLoggerr/warningr0msgs rwarnz Logger.warnOs$$**%--D#.FGrc:tjd|d|yr4)r6infor9s rr=z Logger.infoRs 4-.rcltj|jjd|d|yr4)r6r7r/debugr9s rr?z Logger.debugUs$$**%++$,DErc2t|||jS)z2Return the formatted representation of the object.)r r)r&r)r0r'r s rformatz Logger.formatYss6< E1 AE% E1EE"%E.*E1.E11E5c|s2tj|jz }|dt|}n,tj|jz }d|||dz fz}t |t j |j- t|jd5}t ||dddtj|_y#1swY#xYw#Y*xYw)zmPrint the time elapsed between the last call and the current call, with an optional message. z: z%s: %.2fs, %.1f minr)fileNa) rMrNrrOprintrstderrrSrZ)r0r:total time_lapsefull_msgfs r__call__zPrintTime.__call__st~~5J#& J(?@Ht6J,Zb/QQH hSZZ( << # $,,,,(+,,, s$ CC-CCCC)NN)F)rCrDrErFr2rhr!rrrHrHas= H%rrH)rrB)rF __future__rr6rPr%rWrrMdiskrrrrr&objectr,rHr!rrrmsQ& ,  "=V=B>%>%r