Nuitka-winsvc 2.7.7__cp313-cp313-win_amd64.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of Nuitka-winsvc might be problematic. Click here for more details.
- nuitka/Builtins.py +259 -0
- nuitka/BytecodeCaching.py +184 -0
- nuitka/Bytecodes.py +109 -0
- nuitka/CacheCleanup.py +54 -0
- nuitka/Constants.py +425 -0
- nuitka/Errors.py +93 -0
- nuitka/HardImportRegistry.py +408 -0
- nuitka/MainControl.py +1201 -0
- nuitka/ModuleRegistry.py +364 -0
- nuitka/OptionParsing.py +2473 -0
- nuitka/Options.py +2948 -0
- nuitka/OutputDirectories.py +201 -0
- nuitka/PostProcessing.py +551 -0
- nuitka/Progress.py +252 -0
- nuitka/PythonFlavors.py +426 -0
- nuitka/PythonOperators.py +146 -0
- nuitka/PythonVersions.py +513 -0
- nuitka/Serialization.py +291 -0
- nuitka/SourceCodeReferences.py +176 -0
- nuitka/Tracing.py +579 -0
- nuitka/TreeXML.py +141 -0
- nuitka/Variables.py +515 -0
- nuitka/Version.py +88 -0
- nuitka/__init__.py +19 -0
- nuitka/__main__.py +224 -0
- nuitka/__past__.py +217 -0
- nuitka/build/Backend.scons +1111 -0
- nuitka/build/CCompilerVersion.scons +281 -0
- nuitka/build/DataComposerInterface.py +116 -0
- nuitka/build/Offsets.scons +626 -0
- nuitka/build/Onefile.scons +564 -0
- nuitka/build/SconsCaching.py +451 -0
- nuitka/build/SconsCompilerSettings.py +1133 -0
- nuitka/build/SconsHacks.py +215 -0
- nuitka/build/SconsInterface.py +664 -0
- nuitka/build/SconsProgress.py +100 -0
- nuitka/build/SconsSpawn.py +436 -0
- nuitka/build/SconsUtils.py +939 -0
- nuitka/build/__init__.py +19 -0
- nuitka/build/include/nuitka/allocator.h +450 -0
- nuitka/build/include/nuitka/builtins.h +97 -0
- nuitka/build/include/nuitka/calling.h +123 -0
- nuitka/build/include/nuitka/checkers.h +39 -0
- nuitka/build/include/nuitka/checksum_tools.h +28 -0
- nuitka/build/include/nuitka/compiled_asyncgen.h +281 -0
- nuitka/build/include/nuitka/compiled_cell.h +64 -0
- nuitka/build/include/nuitka/compiled_coroutine.h +271 -0
- nuitka/build/include/nuitka/compiled_frame.h +502 -0
- nuitka/build/include/nuitka/compiled_function.h +170 -0
- nuitka/build/include/nuitka/compiled_generator.h +287 -0
- nuitka/build/include/nuitka/compiled_method.h +54 -0
- nuitka/build/include/nuitka/constants.h +251 -0
- nuitka/build/include/nuitka/constants_blob.h +34 -0
- nuitka/build/include/nuitka/debug_settings.h +60 -0
- nuitka/build/include/nuitka/environment_variables.h +30 -0
- nuitka/build/include/nuitka/environment_variables_system.h +51 -0
- nuitka/build/include/nuitka/exception_groups.h +167 -0
- nuitka/build/include/nuitka/exceptions.h +1458 -0
- nuitka/build/include/nuitka/filesystem_paths.h +117 -0
- nuitka/build/include/nuitka/freelists.h +92 -0
- nuitka/build/include/nuitka/hedley.h +1774 -0
- nuitka/build/include/nuitka/helper/attributes.h +90 -0
- nuitka/build/include/nuitka/helper/boolean.h +86 -0
- nuitka/build/include/nuitka/helper/bytearrays.h +34 -0
- nuitka/build/include/nuitka/helper/bytes.h +28 -0
- nuitka/build/include/nuitka/helper/calling_generated.h +132 -0
- nuitka/build/include/nuitka/helper/comparisons_dual_eq.h +47 -0
- nuitka/build/include/nuitka/helper/comparisons_dual_ge.h +39 -0
- nuitka/build/include/nuitka/helper/comparisons_dual_gt.h +39 -0
- nuitka/build/include/nuitka/helper/comparisons_dual_le.h +47 -0
- nuitka/build/include/nuitka/helper/comparisons_dual_lt.h +47 -0
- nuitka/build/include/nuitka/helper/comparisons_dual_ne.h +39 -0
- nuitka/build/include/nuitka/helper/comparisons_eq.h +247 -0
- nuitka/build/include/nuitka/helper/comparisons_ge.h +197 -0
- nuitka/build/include/nuitka/helper/comparisons_gt.h +197 -0
- nuitka/build/include/nuitka/helper/comparisons_le.h +247 -0
- nuitka/build/include/nuitka/helper/comparisons_lt.h +247 -0
- nuitka/build/include/nuitka/helper/comparisons_ne.h +197 -0
- nuitka/build/include/nuitka/helper/complex.h +46 -0
- nuitka/build/include/nuitka/helper/dictionaries.h +481 -0
- nuitka/build/include/nuitka/helper/floats.h +32 -0
- nuitka/build/include/nuitka/helper/import_hard.h +121 -0
- nuitka/build/include/nuitka/helper/indexes.h +47 -0
- nuitka/build/include/nuitka/helper/ints.h +165 -0
- nuitka/build/include/nuitka/helper/iterators.h +376 -0
- nuitka/build/include/nuitka/helper/lists.h +94 -0
- nuitka/build/include/nuitka/helper/lists_generated.h +36 -0
- nuitka/build/include/nuitka/helper/mappings.h +39 -0
- nuitka/build/include/nuitka/helper/operations.h +114 -0
- nuitka/build/include/nuitka/helper/operations_binary_add.h +240 -0
- nuitka/build/include/nuitka/helper/operations_binary_bitand.h +108 -0
- nuitka/build/include/nuitka/helper/operations_binary_bitor.h +108 -0
- nuitka/build/include/nuitka/helper/operations_binary_bitxor.h +108 -0
- nuitka/build/include/nuitka/helper/operations_binary_divmod.h +103 -0
- nuitka/build/include/nuitka/helper/operations_binary_dual_add.h +34 -0
- nuitka/build/include/nuitka/helper/operations_binary_floordiv.h +103 -0
- nuitka/build/include/nuitka/helper/operations_binary_lshift.h +99 -0
- nuitka/build/include/nuitka/helper/operations_binary_matmult.h +60 -0
- nuitka/build/include/nuitka/helper/operations_binary_mod.h +304 -0
- nuitka/build/include/nuitka/helper/operations_binary_mult.h +247 -0
- nuitka/build/include/nuitka/helper/operations_binary_olddiv.h +125 -0
- nuitka/build/include/nuitka/helper/operations_binary_pow.h +90 -0
- nuitka/build/include/nuitka/helper/operations_binary_rshift.h +99 -0
- nuitka/build/include/nuitka/helper/operations_binary_sub.h +117 -0
- nuitka/build/include/nuitka/helper/operations_binary_truediv.h +103 -0
- nuitka/build/include/nuitka/helper/operations_builtin_types.h +247 -0
- nuitka/build/include/nuitka/helper/operations_inplace_add.h +173 -0
- nuitka/build/include/nuitka/helper/operations_inplace_bitand.h +76 -0
- nuitka/build/include/nuitka/helper/operations_inplace_bitor.h +76 -0
- nuitka/build/include/nuitka/helper/operations_inplace_bitxor.h +76 -0
- nuitka/build/include/nuitka/helper/operations_inplace_floordiv.h +95 -0
- nuitka/build/include/nuitka/helper/operations_inplace_lshift.h +62 -0
- nuitka/build/include/nuitka/helper/operations_inplace_matmult.h +60 -0
- nuitka/build/include/nuitka/helper/operations_inplace_mod.h +218 -0
- nuitka/build/include/nuitka/helper/operations_inplace_mult.h +184 -0
- nuitka/build/include/nuitka/helper/operations_inplace_olddiv.h +115 -0
- nuitka/build/include/nuitka/helper/operations_inplace_pow.h +87 -0
- nuitka/build/include/nuitka/helper/operations_inplace_rshift.h +62 -0
- nuitka/build/include/nuitka/helper/operations_inplace_sub.h +102 -0
- nuitka/build/include/nuitka/helper/operations_inplace_truediv.h +95 -0
- nuitka/build/include/nuitka/helper/raising.h +114 -0
- nuitka/build/include/nuitka/helper/rangeobjects.h +66 -0
- nuitka/build/include/nuitka/helper/richcomparisons.h +35 -0
- nuitka/build/include/nuitka/helper/sequences.h +33 -0
- nuitka/build/include/nuitka/helper/sets.h +25 -0
- nuitka/build/include/nuitka/helper/slices.h +314 -0
- nuitka/build/include/nuitka/helper/strings.h +30 -0
- nuitka/build/include/nuitka/helper/subscripts.h +390 -0
- nuitka/build/include/nuitka/helper/tuples.h +187 -0
- nuitka/build/include/nuitka/helpers.h +417 -0
- nuitka/build/include/nuitka/importing.h +149 -0
- nuitka/build/include/nuitka/incbin.h +402 -0
- nuitka/build/include/nuitka/jit_sources.h +25 -0
- nuitka/build/include/nuitka/prelude.h +626 -0
- nuitka/build/include/nuitka/printing.h +84 -0
- nuitka/build/include/nuitka/python_pgo.h +57 -0
- nuitka/build/include/nuitka/safe_string_ops.h +57 -0
- nuitka/build/include/nuitka/threading.h +142 -0
- nuitka/build/include/nuitka/tracing.h +82 -0
- nuitka/build/include/nuitka/type_aliases.h +30 -0
- nuitka/build/include/nuitka/unfreezing.h +91 -0
- nuitka/build/inline_copy/appdirs/LICENSE.txt +23 -0
- nuitka/build/inline_copy/appdirs/appdirs.py +611 -0
- nuitka/build/inline_copy/atomicwrites/LICENSE +19 -0
- nuitka/build/inline_copy/atomicwrites/atomicwrites.py +226 -0
- nuitka/build/inline_copy/bin/scons.py +58 -0
- nuitka/build/inline_copy/clcache/clcache/LICENSE +30 -0
- nuitka/build/inline_copy/clcache/clcache/__init__.py +4 -0
- nuitka/build/inline_copy/clcache/clcache/caching.py +2008 -0
- nuitka/build/inline_copy/colorama/LICENSE.txt +27 -0
- nuitka/build/inline_copy/colorama/colorama/__init__.py +6 -0
- nuitka/build/inline_copy/colorama/colorama/ansi.py +102 -0
- nuitka/build/inline_copy/colorama/colorama/ansitowin32.py +258 -0
- nuitka/build/inline_copy/colorama/colorama/initialise.py +80 -0
- nuitka/build/inline_copy/colorama/colorama/win32.py +152 -0
- nuitka/build/inline_copy/colorama/colorama/winterm.py +169 -0
- nuitka/build/inline_copy/glob2/LICENSE +27 -0
- nuitka/build/inline_copy/glob2/glob2/__init__.py +5 -0
- nuitka/build/inline_copy/glob2/glob2/compat.py +167 -0
- nuitka/build/inline_copy/glob2/glob2/fnmatch.py +141 -0
- nuitka/build/inline_copy/glob2/glob2/impl.py +216 -0
- nuitka/build/inline_copy/jinja2/LICENSE.rst +28 -0
- nuitka/build/inline_copy/jinja2/README.rst +2 -0
- nuitka/build/inline_copy/jinja2/jinja2/__init__.py +72 -0
- nuitka/build/inline_copy/jinja2/jinja2/_compat.py +105 -0
- nuitka/build/inline_copy/jinja2/jinja2/_identifier.py +2 -0
- nuitka/build/inline_copy/jinja2/jinja2/bccache.py +361 -0
- nuitka/build/inline_copy/jinja2/jinja2/compiler.py +1721 -0
- nuitka/build/inline_copy/jinja2/jinja2/constants.py +32 -0
- nuitka/build/inline_copy/jinja2/jinja2/debug.py +378 -0
- nuitka/build/inline_copy/jinja2/jinja2/defaults.py +56 -0
- nuitka/build/inline_copy/jinja2/jinja2/environment.py +1276 -0
- nuitka/build/inline_copy/jinja2/jinja2/exceptions.py +146 -0
- nuitka/build/inline_copy/jinja2/jinja2/ext.py +627 -0
- nuitka/build/inline_copy/jinja2/jinja2/filters.py +1190 -0
- nuitka/build/inline_copy/jinja2/jinja2/idtracking.py +286 -0
- nuitka/build/inline_copy/jinja2/jinja2/lexer.py +739 -0
- nuitka/build/inline_copy/jinja2/jinja2/loaders.py +483 -0
- nuitka/build/inline_copy/jinja2/jinja2/meta.py +106 -0
- nuitka/build/inline_copy/jinja2/jinja2/nativetypes.py +220 -0
- nuitka/build/inline_copy/jinja2/jinja2/nodes.py +999 -0
- nuitka/build/inline_copy/jinja2/jinja2/optimizer.py +49 -0
- nuitka/build/inline_copy/jinja2/jinja2/parser.py +903 -0
- nuitka/build/inline_copy/jinja2/jinja2/runtime.py +808 -0
- nuitka/build/inline_copy/jinja2/jinja2/sandbox.py +488 -0
- nuitka/build/inline_copy/jinja2/jinja2/tests.py +174 -0
- nuitka/build/inline_copy/jinja2/jinja2/utils.py +642 -0
- nuitka/build/inline_copy/jinja2/jinja2/visitor.py +87 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Action.py +1475 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Builder.py +905 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/CacheDir.py +314 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Conftest.py +805 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Debug.py +251 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Defaults.py +646 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Environment.py +2561 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/EnvironmentValues.py +119 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Errors.py +222 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Executor.py +660 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Job.py +439 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Memoize.py +242 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Node/Alias.py +176 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Node/FS.py +3861 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Node/Python.py +195 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Node/__init__.py +1784 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/PathList.py +224 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Platform/__init__.py +341 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Platform/aix.py +81 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Platform/cygwin.py +61 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Platform/darwin.py +70 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Platform/hpux.py +45 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Platform/irix.py +41 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Platform/mingw.py +33 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Platform/os2.py +55 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Platform/posix.py +124 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Platform/sunos.py +47 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Platform/virtualenv.py +115 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Platform/win32.py +429 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/SConf.py +1119 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/SConsign.py +453 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Scanner/C.py +226 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Scanner/Dir.py +131 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Scanner/Prog.py +114 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Scanner/RC.py +57 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Scanner/__init__.py +436 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Script/Interactive.py +372 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Script/Main.py +1469 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Script/SConsOptions.py +1071 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Script/SConscript.py +686 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Script/__init__.py +425 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Subst.py +979 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Taskmaster.py +1062 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/386asm.py +61 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/GettextCommon.py +429 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/MSCommon/__init__.py +52 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/MSCommon/arch.py +66 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/MSCommon/common.py +371 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/MSCommon/netframework.py +83 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/MSCommon/sdk.py +411 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/MSCommon/vc.py +994 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/MSCommon/vs.py +608 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/PharLapCommon.py +116 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/__init__.py +882 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/aixc++.py +43 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/aixcc.py +74 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/aixcxx.py +77 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/aixlink.py +78 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/applelink.py +209 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/ar.py +63 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/as.py +49 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/asm.py +78 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/bcc32.py +81 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/c++.py +44 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/cc.py +105 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/clang.py +91 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/clangCommon/__init__.py +18 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/clangxx.py +99 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/cxx.py +95 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/cyglink.py +212 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/default.py +50 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/filesystem.py +98 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/g++.py +45 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/gas.py +56 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/gcc.py +110 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/gettext_tool.py +69 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/gnulink.py +70 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/gxx.py +78 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/hpc++.py +45 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/hpcc.py +53 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/hpcxx.py +88 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/hplink.py +72 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/icc.py +59 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/icl.py +52 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/ilink.py +55 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/ilink32.py +60 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/install.py +510 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/intelc.py +617 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/link.py +72 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/linkCommon/LoadableModule.py +131 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/linkCommon/SharedLibrary.py +218 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/linkCommon/__init__.py +171 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/linkloc.py +112 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/m4.py +63 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/masm.py +77 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/mingw.py +232 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/msgfmt.py +132 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/msginit.py +137 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/msgmerge.py +125 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/mslib.py +73 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/mslink.py +339 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/mssdk.py +50 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/msvc.py +325 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/msvs.py +2116 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/mwcc.py +207 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/mwld.py +108 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/nasm.py +72 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/rmic.py +139 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/rpcgen.py +70 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/sgiar.py +68 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/sgic++.py +43 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/sgicc.py +53 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/sgicxx.py +61 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/sgilink.py +59 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/sunar.py +64 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/sunc++.py +45 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/suncc.py +58 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/suncxx.py +153 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/sunlink.py +79 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/tar.py +73 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/textfile.py +198 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/tlib.py +53 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/wix.py +104 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/xgettext.py +337 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/zip.py +120 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Util.py +2134 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Utilities/ConfigureCache.py +171 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Utilities/__init__.py +0 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Utilities/sconsign.py +494 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Variables/BoolVariable.py +96 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Variables/EnumVariable.py +110 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Variables/ListVariable.py +152 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Variables/PackageVariable.py +107 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Variables/PathVariable.py +158 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Variables/__init__.py +334 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Warnings.py +238 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/__init__.py +9 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/compat/__init__.py +104 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/compat/_scons_dbm.py +42 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/compat/win32.py +101 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/cpp.py +640 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/dblite.py +295 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/exitfuncs.py +59 -0
- nuitka/build/inline_copy/markupsafe/LICENSE.rst +28 -0
- nuitka/build/inline_copy/markupsafe/markupsafe/__init__.py +327 -0
- nuitka/build/inline_copy/markupsafe/markupsafe/_compat.py +33 -0
- nuitka/build/inline_copy/markupsafe/markupsafe/_constants.py +264 -0
- nuitka/build/inline_copy/markupsafe/markupsafe/_native.py +69 -0
- nuitka/build/inline_copy/pefile/LICENSE.txt +21 -0
- nuitka/build/inline_copy/pefile/ordlookup/__init__.py +41 -0
- nuitka/build/inline_copy/pefile/ordlookup/oleaut32.py +400 -0
- nuitka/build/inline_copy/pefile/ordlookup/ws2_32.py +120 -0
- nuitka/build/inline_copy/pefile/pefile.py +8034 -0
- nuitka/build/inline_copy/pkg_resources/pkg_resources/__init__.py +3272 -0
- nuitka/build/inline_copy/pkg_resources/pkg_resources/py31compat.py +21 -0
- nuitka/build/inline_copy/python_hacl/LICENSE.txt +201 -0
- nuitka/build/inline_copy/python_hacl/hacl_312/Hacl_Hash_MD5.c +1430 -0
- nuitka/build/inline_copy/python_hacl/hacl_312/Hacl_Hash_MD5.h +66 -0
- nuitka/build/inline_copy/python_hacl/hacl_312/Hacl_Hash_SHA1.c +463 -0
- nuitka/build/inline_copy/python_hacl/hacl_312/Hacl_Hash_SHA1.h +66 -0
- nuitka/build/inline_copy/python_hacl/hacl_312/Hacl_Hash_SHA2.c +1273 -0
- nuitka/build/inline_copy/python_hacl/hacl_312/Hacl_Hash_SHA2.h +204 -0
- nuitka/build/inline_copy/python_hacl/hacl_312/Hacl_Hash_SHA3.c +734 -0
- nuitka/build/inline_copy/python_hacl/hacl_312/Hacl_Hash_SHA3.h +131 -0
- nuitka/build/inline_copy/python_hacl/hacl_312/Hacl_Streaming_Types.h +83 -0
- nuitka/build/inline_copy/python_hacl/hacl_312/include/krml/FStar_UInt128_Verified.h +346 -0
- nuitka/build/inline_copy/python_hacl/hacl_312/include/krml/FStar_UInt_8_16_32_64.h +107 -0
- nuitka/build/inline_copy/python_hacl/hacl_312/include/krml/fstar_uint128_struct_endianness.h +68 -0
- nuitka/build/inline_copy/python_hacl/hacl_312/include/krml/internal/target.h +293 -0
- nuitka/build/inline_copy/python_hacl/hacl_312/include/krml/lowstar_endianness.h +231 -0
- nuitka/build/inline_copy/python_hacl/hacl_312/include/krml/types.h +14 -0
- nuitka/build/inline_copy/python_hacl/hacl_312/internal/Hacl_Hash_MD5.h +56 -0
- nuitka/build/inline_copy/python_hacl/hacl_312/internal/Hacl_Hash_SHA1.h +56 -0
- nuitka/build/inline_copy/python_hacl/hacl_312/internal/Hacl_Hash_SHA2.h +164 -0
- nuitka/build/inline_copy/python_hacl/hacl_312/internal/Hacl_Hash_SHA3.h +65 -0
- nuitka/build/inline_copy/python_hacl/hacl_312/python_hacl_namespaces.h +89 -0
- nuitka/build/inline_copy/stubgen/astunparse.py +938 -0
- nuitka/build/inline_copy/stubgen/six.py +998 -0
- nuitka/build/inline_copy/stubgen/stubgen.py +484 -0
- nuitka/build/inline_copy/tqdm/tqdm/__init__.py +40 -0
- nuitka/build/inline_copy/tqdm/tqdm/_main.py +9 -0
- nuitka/build/inline_copy/tqdm/tqdm/_monitor.py +97 -0
- nuitka/build/inline_copy/tqdm/tqdm/_tqdm.py +9 -0
- nuitka/build/inline_copy/tqdm/tqdm/_tqdm_notebook.py +9 -0
- nuitka/build/inline_copy/tqdm/tqdm/_tqdm_pandas.py +24 -0
- nuitka/build/inline_copy/tqdm/tqdm/_utils.py +12 -0
- nuitka/build/inline_copy/tqdm/tqdm/auto.py +44 -0
- nuitka/build/inline_copy/tqdm/tqdm/autonotebook.py +28 -0
- nuitka/build/inline_copy/tqdm/tqdm/dask.py +46 -0
- nuitka/build/inline_copy/tqdm/tqdm/notebook.py +316 -0
- nuitka/build/inline_copy/tqdm/tqdm/std.py +1524 -0
- nuitka/build/inline_copy/tqdm/tqdm/tk.py +207 -0
- nuitka/build/inline_copy/tqdm/tqdm/utils.py +351 -0
- nuitka/build/inline_copy/tqdm/tqdm/version.py +2 -0
- nuitka/build/inline_copy/yaml/LICENSE +20 -0
- nuitka/build/inline_copy/yaml/yaml/__init__.py +427 -0
- nuitka/build/inline_copy/yaml/yaml/composer.py +139 -0
- nuitka/build/inline_copy/yaml/yaml/constructor.py +748 -0
- nuitka/build/inline_copy/yaml/yaml/cyaml.py +101 -0
- nuitka/build/inline_copy/yaml/yaml/dumper.py +62 -0
- nuitka/build/inline_copy/yaml/yaml/emitter.py +1137 -0
- nuitka/build/inline_copy/yaml/yaml/error.py +75 -0
- nuitka/build/inline_copy/yaml/yaml/events.py +86 -0
- nuitka/build/inline_copy/yaml/yaml/loader.py +63 -0
- nuitka/build/inline_copy/yaml/yaml/nodes.py +49 -0
- nuitka/build/inline_copy/yaml/yaml/parser.py +589 -0
- nuitka/build/inline_copy/yaml/yaml/reader.py +185 -0
- nuitka/build/inline_copy/yaml/yaml/representer.py +389 -0
- nuitka/build/inline_copy/yaml/yaml/resolver.py +227 -0
- nuitka/build/inline_copy/yaml/yaml/scanner.py +1435 -0
- nuitka/build/inline_copy/yaml/yaml/serializer.py +111 -0
- nuitka/build/inline_copy/yaml/yaml/tokens.py +104 -0
- nuitka/build/inline_copy/zlib/LICENSE +22 -0
- nuitka/build/inline_copy/zlib/crc32.c +1049 -0
- nuitka/build/inline_copy/zlib/crc32.h +9446 -0
- nuitka/build/inline_copy/zlib/zconf.h +551 -0
- nuitka/build/inline_copy/zlib/zlib.h +1938 -0
- nuitka/build/inline_copy/zlib/zutil.h +275 -0
- nuitka/build/inline_copy/zstd/LICENSE.txt +30 -0
- nuitka/build/inline_copy/zstd/common/bitstream.h +463 -0
- nuitka/build/inline_copy/zstd/common/compiler.h +288 -0
- nuitka/build/inline_copy/zstd/common/cpu.h +213 -0
- nuitka/build/inline_copy/zstd/common/debug.h +107 -0
- nuitka/build/inline_copy/zstd/common/entropy_common.c +360 -0
- nuitka/build/inline_copy/zstd/common/error_private.c +56 -0
- nuitka/build/inline_copy/zstd/common/error_private.h +80 -0
- nuitka/build/inline_copy/zstd/common/fse.h +715 -0
- nuitka/build/inline_copy/zstd/common/fse_decompress.c +393 -0
- nuitka/build/inline_copy/zstd/common/huf.h +361 -0
- nuitka/build/inline_copy/zstd/common/mem.h +426 -0
- nuitka/build/inline_copy/zstd/common/xxhash.c +826 -0
- nuitka/build/inline_copy/zstd/common/xxhash.h +285 -0
- nuitka/build/inline_copy/zstd/common/zstd_common.c +83 -0
- nuitka/build/inline_copy/zstd/common/zstd_deps.h +111 -0
- nuitka/build/inline_copy/zstd/common/zstd_errors.h +95 -0
- nuitka/build/inline_copy/zstd/common/zstd_internal.h +478 -0
- nuitka/build/inline_copy/zstd/decompress/huf_decompress.c +1350 -0
- nuitka/build/inline_copy/zstd/decompress/zstd_ddict.c +244 -0
- nuitka/build/inline_copy/zstd/decompress/zstd_ddict.h +44 -0
- nuitka/build/inline_copy/zstd/decompress/zstd_decompress.c +1930 -0
- nuitka/build/inline_copy/zstd/decompress/zstd_decompress_block.c +1540 -0
- nuitka/build/inline_copy/zstd/decompress/zstd_decompress_block.h +62 -0
- nuitka/build/inline_copy/zstd/decompress/zstd_decompress_internal.h +190 -0
- nuitka/build/inline_copy/zstd/zstd.h +2391 -0
- nuitka/build/static_src/CompiledAsyncgenType.c +2211 -0
- nuitka/build/static_src/CompiledCellType.c +300 -0
- nuitka/build/static_src/CompiledCodeHelpers.c +2160 -0
- nuitka/build/static_src/CompiledCoroutineType.c +1946 -0
- nuitka/build/static_src/CompiledFrameType.c +1337 -0
- nuitka/build/static_src/CompiledFunctionType.c +3320 -0
- nuitka/build/static_src/CompiledGeneratorType.c +1997 -0
- nuitka/build/static_src/CompiledGeneratorTypeUncompiledIntegration.c +2117 -0
- nuitka/build/static_src/CompiledMethodType.c +614 -0
- nuitka/build/static_src/GenerateHeadersMain.c +30 -0
- nuitka/build/static_src/HelpersAllocator.c +939 -0
- nuitka/build/static_src/HelpersAttributes.c +1241 -0
- nuitka/build/static_src/HelpersBuiltin.c +901 -0
- nuitka/build/static_src/HelpersBuiltinTypeMethods.c +3594 -0
- nuitka/build/static_src/HelpersBytes.c +107 -0
- nuitka/build/static_src/HelpersCalling.c +397 -0
- nuitka/build/static_src/HelpersCallingGenerated.c +14361 -0
- nuitka/build/static_src/HelpersChecksumTools.c +59 -0
- nuitka/build/static_src/HelpersClasses.c +91 -0
- nuitka/build/static_src/HelpersComparisonDualEq.c +183 -0
- nuitka/build/static_src/HelpersComparisonDualGe.c +121 -0
- nuitka/build/static_src/HelpersComparisonDualGt.c +121 -0
- nuitka/build/static_src/HelpersComparisonDualLe.c +183 -0
- nuitka/build/static_src/HelpersComparisonDualLt.c +183 -0
- nuitka/build/static_src/HelpersComparisonDualNe.c +121 -0
- nuitka/build/static_src/HelpersComparisonEq.c +12070 -0
- nuitka/build/static_src/HelpersComparisonEqUtils.c +169 -0
- nuitka/build/static_src/HelpersComparisonGe.c +11871 -0
- nuitka/build/static_src/HelpersComparisonGt.c +11855 -0
- nuitka/build/static_src/HelpersComparisonLe.c +11957 -0
- nuitka/build/static_src/HelpersComparisonLt.c +11941 -0
- nuitka/build/static_src/HelpersComparisonNe.c +11979 -0
- nuitka/build/static_src/HelpersConsole.c +124 -0
- nuitka/build/static_src/HelpersConstantsBlob.c +1487 -0
- nuitka/build/static_src/HelpersDeepcopy.c +636 -0
- nuitka/build/static_src/HelpersDictionaries.c +1739 -0
- nuitka/build/static_src/HelpersDictionariesGenerated.c +738 -0
- nuitka/build/static_src/HelpersDumpBacktraces.c +63 -0
- nuitka/build/static_src/HelpersEnvironmentVariables.c +65 -0
- nuitka/build/static_src/HelpersEnvironmentVariablesSystem.c +97 -0
- nuitka/build/static_src/HelpersExceptions.c +298 -0
- nuitka/build/static_src/HelpersFiles.c +353 -0
- nuitka/build/static_src/HelpersFilesystemPaths.c +1322 -0
- nuitka/build/static_src/HelpersFloats.c +92 -0
- nuitka/build/static_src/HelpersHeapStorage.c +68 -0
- nuitka/build/static_src/HelpersImport.c +506 -0
- nuitka/build/static_src/HelpersImportHard.c +526 -0
- nuitka/build/static_src/HelpersJitSources.c +48 -0
- nuitka/build/static_src/HelpersLists.c +899 -0
- nuitka/build/static_src/HelpersListsGenerated.c +564 -0
- nuitka/build/static_src/HelpersMappings.c +46 -0
- nuitka/build/static_src/HelpersMatching.c +192 -0
- nuitka/build/static_src/HelpersOperationBinaryAdd.c +6477 -0
- nuitka/build/static_src/HelpersOperationBinaryAddUtils.c +703 -0
- nuitka/build/static_src/HelpersOperationBinaryBitand.c +2738 -0
- nuitka/build/static_src/HelpersOperationBinaryBitor.c +2738 -0
- nuitka/build/static_src/HelpersOperationBinaryBitxor.c +2738 -0
- nuitka/build/static_src/HelpersOperationBinaryDivmod.c +2406 -0
- nuitka/build/static_src/HelpersOperationBinaryDivmodUtils.c +33 -0
- nuitka/build/static_src/HelpersOperationBinaryDualAdd.c +172 -0
- nuitka/build/static_src/HelpersOperationBinaryFloordiv.c +2422 -0
- nuitka/build/static_src/HelpersOperationBinaryInplaceAdd.c +220 -0
- nuitka/build/static_src/HelpersOperationBinaryLshift.c +2846 -0
- nuitka/build/static_src/HelpersOperationBinaryMatmult.c +453 -0
- nuitka/build/static_src/HelpersOperationBinaryMod.c +6549 -0
- nuitka/build/static_src/HelpersOperationBinaryMult.c +6438 -0
- nuitka/build/static_src/HelpersOperationBinaryMultUtils.c +125 -0
- nuitka/build/static_src/HelpersOperationBinaryOlddiv.c +2355 -0
- nuitka/build/static_src/HelpersOperationBinaryPow.c +2743 -0
- nuitka/build/static_src/HelpersOperationBinaryPowUtils.c +26 -0
- nuitka/build/static_src/HelpersOperationBinaryRshift.c +2706 -0
- nuitka/build/static_src/HelpersOperationBinarySub.c +2649 -0
- nuitka/build/static_src/HelpersOperationBinaryTruediv.c +2415 -0
- nuitka/build/static_src/HelpersOperationInplaceAdd.c +5211 -0
- nuitka/build/static_src/HelpersOperationInplaceAddUtils.c +144 -0
- nuitka/build/static_src/HelpersOperationInplaceBitand.c +1826 -0
- nuitka/build/static_src/HelpersOperationInplaceBitor.c +1826 -0
- nuitka/build/static_src/HelpersOperationInplaceBitxor.c +1826 -0
- nuitka/build/static_src/HelpersOperationInplaceFloordiv.c +2605 -0
- nuitka/build/static_src/HelpersOperationInplaceLshift.c +1594 -0
- nuitka/build/static_src/HelpersOperationInplaceMatmult.c +603 -0
- nuitka/build/static_src/HelpersOperationInplaceMod.c +4762 -0
- nuitka/build/static_src/HelpersOperationInplaceMult.c +4689 -0
- nuitka/build/static_src/HelpersOperationInplaceOlddiv.c +2553 -0
- nuitka/build/static_src/HelpersOperationInplacePow.c +2807 -0
- nuitka/build/static_src/HelpersOperationInplaceRshift.c +1534 -0
- nuitka/build/static_src/HelpersOperationInplaceSub.c +2894 -0
- nuitka/build/static_src/HelpersOperationInplaceTruediv.c +2612 -0
- nuitka/build/static_src/HelpersProfiling.c +104 -0
- nuitka/build/static_src/HelpersPythonPgo.c +113 -0
- nuitka/build/static_src/HelpersRaising.c +447 -0
- nuitka/build/static_src/HelpersSafeStrings.c +185 -0
- nuitka/build/static_src/HelpersSequences.c +134 -0
- nuitka/build/static_src/HelpersSlices.c +73 -0
- nuitka/build/static_src/HelpersStrings.c +998 -0
- nuitka/build/static_src/HelpersTuples.c +148 -0
- nuitka/build/static_src/HelpersTypes.c +329 -0
- nuitka/build/static_src/InspectPatcher.c +439 -0
- nuitka/build/static_src/MainProgram.c +2060 -0
- nuitka/build/static_src/MetaPathBasedLoader.c +2290 -0
- nuitka/build/static_src/MetaPathBasedLoaderImportlibMetadataDistribution.c +125 -0
- nuitka/build/static_src/MetaPathBasedLoaderResourceReader.c +158 -0
- nuitka/build/static_src/MetaPathBasedLoaderResourceReaderFiles.c +785 -0
- nuitka/build/static_src/OnefileBootstrap.c +1580 -0
- nuitka/build/static_src/OnefileSplashScreen.cpp +275 -0
- nuitka/code_generation/AsyncgenCodes.py +186 -0
- nuitka/code_generation/AttributeCodes.py +357 -0
- nuitka/code_generation/BinaryOperationHelperDefinitions.py +720 -0
- nuitka/code_generation/BranchCodes.py +67 -0
- nuitka/code_generation/BuiltinCodes.py +529 -0
- nuitka/code_generation/CallCodes.py +1186 -0
- nuitka/code_generation/ClassCodes.py +156 -0
- nuitka/code_generation/CodeGeneration.py +1078 -0
- nuitka/code_generation/CodeHelperSelection.py +81 -0
- nuitka/code_generation/CodeHelpers.py +455 -0
- nuitka/code_generation/CodeObjectCodes.py +165 -0
- nuitka/code_generation/ComparisonCodes.py +569 -0
- nuitka/code_generation/ComparisonHelperDefinitions.py +146 -0
- nuitka/code_generation/ConditionalCodes.py +236 -0
- nuitka/code_generation/ConstantCodes.py +243 -0
- nuitka/code_generation/Contexts.py +1248 -0
- nuitka/code_generation/CoroutineCodes.py +253 -0
- nuitka/code_generation/CtypesCodes.py +46 -0
- nuitka/code_generation/DictCodes.py +918 -0
- nuitka/code_generation/Emission.py +75 -0
- nuitka/code_generation/ErrorCodes.py +281 -0
- nuitka/code_generation/EvalCodes.py +444 -0
- nuitka/code_generation/ExceptionCodes.py +337 -0
- nuitka/code_generation/ExpressionCTypeSelectionHelpers.py +227 -0
- nuitka/code_generation/ExpressionCodes.py +61 -0
- nuitka/code_generation/FrameCodes.py +518 -0
- nuitka/code_generation/FunctionCodes.py +858 -0
- nuitka/code_generation/GeneratorCodes.py +218 -0
- nuitka/code_generation/GlobalConstants.py +249 -0
- nuitka/code_generation/GlobalsLocalsCodes.py +211 -0
- nuitka/code_generation/IdCodes.py +53 -0
- nuitka/code_generation/ImportCodes.py +468 -0
- nuitka/code_generation/Indentation.py +45 -0
- nuitka/code_generation/IndexCodes.py +50 -0
- nuitka/code_generation/InjectCCodes.py +28 -0
- nuitka/code_generation/IntegerCodes.py +110 -0
- nuitka/code_generation/IteratorCodes.py +378 -0
- nuitka/code_generation/JitCodes.py +44 -0
- nuitka/code_generation/LabelCodes.py +68 -0
- nuitka/code_generation/LineNumberCodes.py +91 -0
- nuitka/code_generation/ListCodes.py +502 -0
- nuitka/code_generation/LoaderCodes.py +193 -0
- nuitka/code_generation/LocalsDictCodes.py +359 -0
- nuitka/code_generation/LoopCodes.py +88 -0
- nuitka/code_generation/MatchCodes.py +67 -0
- nuitka/code_generation/ModuleCodes.py +247 -0
- nuitka/code_generation/Namify.py +260 -0
- nuitka/code_generation/NetworkxCodes.py +51 -0
- nuitka/code_generation/OperationCodes.py +398 -0
- nuitka/code_generation/PackageResourceCodes.py +986 -0
- nuitka/code_generation/PrintCodes.py +93 -0
- nuitka/code_generation/PythonAPICodes.py +215 -0
- nuitka/code_generation/RaisingCodes.py +481 -0
- nuitka/code_generation/Reports.py +115 -0
- nuitka/code_generation/ReturnCodes.py +143 -0
- nuitka/code_generation/SetCodes.py +196 -0
- nuitka/code_generation/SliceCodes.py +465 -0
- nuitka/code_generation/StringCodes.py +303 -0
- nuitka/code_generation/SubscriptCodes.py +263 -0
- nuitka/code_generation/TensorflowCodes.py +54 -0
- nuitka/code_generation/TryCodes.py +326 -0
- nuitka/code_generation/TupleCodes.py +115 -0
- nuitka/code_generation/TypeAliasCodes.py +120 -0
- nuitka/code_generation/VariableCodes.py +519 -0
- nuitka/code_generation/VariableDeclarations.py +279 -0
- nuitka/code_generation/YieldCodes.py +253 -0
- nuitka/code_generation/__init__.py +19 -0
- nuitka/code_generation/c_types/CTypeBases.py +177 -0
- nuitka/code_generation/c_types/CTypeBooleans.py +104 -0
- nuitka/code_generation/c_types/CTypeCFloats.py +57 -0
- nuitka/code_generation/c_types/CTypeCLongs.py +45 -0
- nuitka/code_generation/c_types/CTypeModuleDictVariables.py +109 -0
- nuitka/code_generation/c_types/CTypeNuitkaBooleans.py +150 -0
- nuitka/code_generation/c_types/CTypeNuitkaInts.py +200 -0
- nuitka/code_generation/c_types/CTypeNuitkaVoids.py +107 -0
- nuitka/code_generation/c_types/CTypePyObjectPointers.py +572 -0
- nuitka/code_generation/c_types/CTypeVoids.py +92 -0
- nuitka/code_generation/c_types/__init__.py +19 -0
- nuitka/code_generation/templates/CodeTemplatesAsyncgens.py +106 -0
- nuitka/code_generation/templates/CodeTemplatesConstants.py +296 -0
- nuitka/code_generation/templates/CodeTemplatesCoroutines.py +109 -0
- nuitka/code_generation/templates/CodeTemplatesExceptions.py +84 -0
- nuitka/code_generation/templates/CodeTemplatesFrames.py +235 -0
- nuitka/code_generation/templates/CodeTemplatesFunction.py +117 -0
- nuitka/code_generation/templates/CodeTemplatesGeneratorFunction.py +130 -0
- nuitka/code_generation/templates/CodeTemplatesIterators.py +40 -0
- nuitka/code_generation/templates/CodeTemplatesLoader.py +180 -0
- nuitka/code_generation/templates/CodeTemplatesModules.py +710 -0
- nuitka/code_generation/templates/CodeTemplatesVariables.py +388 -0
- nuitka/code_generation/templates/TemplateDebugWrapper.py +80 -0
- nuitka/code_generation/templates/__init__.py +19 -0
- nuitka/code_generation/templates_c/CodeTemplateCallsMethodPositional.c.j2 +321 -0
- nuitka/code_generation/templates_c/CodeTemplateCallsMixed.c.j2 +143 -0
- nuitka/code_generation/templates_c/CodeTemplateCallsPositional.c.j2 +677 -0
- nuitka/code_generation/templates_c/CodeTemplateCallsPositionalMethodDescr.c.j2 +165 -0
- nuitka/code_generation/templates_c/CodeTemplateMakeListHinted.c.j2 +38 -0
- nuitka/code_generation/templates_c/CodeTemplateMakeListSmall.c.j2 +41 -0
- nuitka/code_generation/templates_c/HelperBuiltinMethodOperation.c.j2 +53 -0
- nuitka/code_generation/templates_c/HelperDictionaryCopy.c.j2 +364 -0
- nuitka/code_generation/templates_c/HelperImportHard.c.j2 +37 -0
- nuitka/code_generation/templates_c/HelperLongTools.c.j2 +53 -0
- nuitka/code_generation/templates_c/HelperObjectTools.c.j2 +20 -0
- nuitka/code_generation/templates_c/HelperOperationBinary.c.j2 +148 -0
- nuitka/code_generation/templates_c/HelperOperationBinaryDual.c.j2 +115 -0
- nuitka/code_generation/templates_c/HelperOperationComparison.c.j2 +352 -0
- nuitka/code_generation/templates_c/HelperOperationComparisonBytes.c.j2 +115 -0
- nuitka/code_generation/templates_c/HelperOperationComparisonDual.c.j2 +86 -0
- nuitka/code_generation/templates_c/HelperOperationComparisonFloat.c.j2 +31 -0
- nuitka/code_generation/templates_c/HelperOperationComparisonInt.c.j2 +32 -0
- nuitka/code_generation/templates_c/HelperOperationComparisonList.c.j2 +112 -0
- nuitka/code_generation/templates_c/HelperOperationComparisonLong.c.j2 +157 -0
- nuitka/code_generation/templates_c/HelperOperationComparisonStr.c.j2 +115 -0
- nuitka/code_generation/templates_c/HelperOperationComparisonTuple.c.j2 +99 -0
- nuitka/code_generation/templates_c/HelperOperationComparisonUnicode.c.j2 +115 -0
- nuitka/code_generation/templates_c/HelperOperationInplace.c.j2 +281 -0
- nuitka/code_generation/templates_c/HelperSlotsBinary.c.j2 +420 -0
- nuitka/code_generation/templates_c/HelperSlotsBytes.c.j2 +51 -0
- nuitka/code_generation/templates_c/HelperSlotsCommon.c.j2 +71 -0
- nuitka/code_generation/templates_c/HelperSlotsFloat.c.j2 +327 -0
- nuitka/code_generation/templates_c/HelperSlotsInt.c.j2 +411 -0
- nuitka/code_generation/templates_c/HelperSlotsList.c.j2 +59 -0
- nuitka/code_generation/templates_c/HelperSlotsLong.c.j2 +229 -0
- nuitka/code_generation/templates_c/HelperSlotsSet.c.j2 +47 -0
- nuitka/code_generation/templates_c/HelperSlotsStr.c.j2 +55 -0
- nuitka/code_generation/templates_c/HelperSlotsTuple.c.j2 +58 -0
- nuitka/code_generation/templates_c/HelperSlotsUnicode.c.j2 +62 -0
- nuitka/containers/Namedtuples.py +51 -0
- nuitka/containers/OrderedDicts.py +191 -0
- nuitka/containers/OrderedSets.py +123 -0
- nuitka/containers/OrderedSetsFallback.py +139 -0
- nuitka/containers/__init__.py +19 -0
- nuitka/distutils/Build.py +76 -0
- nuitka/distutils/DistutilCommands.py +438 -0
- nuitka/distutils/__init__.py +19 -0
- nuitka/finalizations/Finalization.py +35 -0
- nuitka/finalizations/FinalizeMarkups.py +136 -0
- nuitka/finalizations/__init__.py +19 -0
- nuitka/freezer/DependsExe.py +257 -0
- nuitka/freezer/DllDependenciesCommon.py +97 -0
- nuitka/freezer/DllDependenciesMacOS.py +444 -0
- nuitka/freezer/DllDependenciesPosix.py +242 -0
- nuitka/freezer/DllDependenciesWin32.py +315 -0
- nuitka/freezer/ImportDetection.py +359 -0
- nuitka/freezer/IncludedDataFiles.py +689 -0
- nuitka/freezer/IncludedEntryPoints.py +376 -0
- nuitka/freezer/Onefile.py +296 -0
- nuitka/freezer/Standalone.py +520 -0
- nuitka/freezer/__init__.py +19 -0
- nuitka/importing/IgnoreListing.py +449 -0
- nuitka/importing/ImportCache.py +95 -0
- nuitka/importing/ImportResolving.py +186 -0
- nuitka/importing/Importing.py +1200 -0
- nuitka/importing/PreloadedPackages.py +164 -0
- nuitka/importing/Recursion.py +611 -0
- nuitka/importing/StandardLibrary.py +429 -0
- nuitka/importing/__init__.py +19 -0
- nuitka/nodes/AsyncgenNodes.py +107 -0
- nuitka/nodes/AttributeLookupNodes.py +124 -0
- nuitka/nodes/AttributeNodes.py +386 -0
- nuitka/nodes/AttributeNodesGenerated.py +10734 -0
- nuitka/nodes/BuiltinAllNodes.py +115 -0
- nuitka/nodes/BuiltinAnyNodes.py +124 -0
- nuitka/nodes/BuiltinComplexNodes.py +83 -0
- nuitka/nodes/BuiltinDecodingNodes.py +52 -0
- nuitka/nodes/BuiltinDecoratorNodes.py +85 -0
- nuitka/nodes/BuiltinDictNodes.py +140 -0
- nuitka/nodes/BuiltinFormatNodes.py +159 -0
- nuitka/nodes/BuiltinHashNodes.py +63 -0
- nuitka/nodes/BuiltinInputNodes.py +39 -0
- nuitka/nodes/BuiltinIntegerNodes.py +170 -0
- nuitka/nodes/BuiltinIteratorNodes.py +391 -0
- nuitka/nodes/BuiltinLenNodes.py +61 -0
- nuitka/nodes/BuiltinNextNodes.py +111 -0
- nuitka/nodes/BuiltinOpenNodes.py +148 -0
- nuitka/nodes/BuiltinOperationNodeBasesGenerated.py +7367 -0
- nuitka/nodes/BuiltinRangeNodes.py +690 -0
- nuitka/nodes/BuiltinRefNodes.py +314 -0
- nuitka/nodes/BuiltinSumNodes.py +104 -0
- nuitka/nodes/BuiltinTypeNodes.py +454 -0
- nuitka/nodes/BuiltinVarsNodes.py +44 -0
- nuitka/nodes/BytesNodes.py +829 -0
- nuitka/nodes/CallNodes.py +217 -0
- nuitka/nodes/Checkers.py +55 -0
- nuitka/nodes/ChildrenHavingMixins.py +21576 -0
- nuitka/nodes/ClassNodes.py +286 -0
- nuitka/nodes/CodeObjectSpecs.py +230 -0
- nuitka/nodes/ComparisonNodes.py +687 -0
- nuitka/nodes/ConditionalNodes.py +884 -0
- nuitka/nodes/ConstantRefNodes.py +1717 -0
- nuitka/nodes/ContainerMakingNodes.py +408 -0
- nuitka/nodes/ContainerOperationNodes.py +87 -0
- nuitka/nodes/CoroutineNodes.py +144 -0
- nuitka/nodes/CtypesNodes.py +51 -0
- nuitka/nodes/DictionaryNodes.py +1513 -0
- nuitka/nodes/ExceptionNodes.py +393 -0
- nuitka/nodes/ExecEvalNodes.py +229 -0
- nuitka/nodes/ExpressionBases.py +1301 -0
- nuitka/nodes/ExpressionBasesGenerated.py +2103 -0
- nuitka/nodes/ExpressionShapeMixins.py +886 -0
- nuitka/nodes/FrameNodes.py +413 -0
- nuitka/nodes/FunctionAttributeNodes.py +102 -0
- nuitka/nodes/FunctionNodes.py +1303 -0
- nuitka/nodes/FutureSpecs.py +224 -0
- nuitka/nodes/GeneratorNodes.py +201 -0
- nuitka/nodes/GlobalsLocalsNodes.py +209 -0
- nuitka/nodes/HardImportNodesGenerated.py +3599 -0
- nuitka/nodes/ImportHardNodes.py +185 -0
- nuitka/nodes/ImportNodes.py +1366 -0
- nuitka/nodes/IndicatorMixins.py +79 -0
- nuitka/nodes/InjectCNodes.py +51 -0
- nuitka/nodes/IterationHandles.py +407 -0
- nuitka/nodes/KeyValuePairNodes.py +378 -0
- nuitka/nodes/ListOperationNodes.py +525 -0
- nuitka/nodes/LocalsDictNodes.py +717 -0
- nuitka/nodes/LocalsScopes.py +505 -0
- nuitka/nodes/LoopNodes.py +445 -0
- nuitka/nodes/MatchNodes.py +60 -0
- nuitka/nodes/ModuleAttributeNodes.py +180 -0
- nuitka/nodes/ModuleNodes.py +1137 -0
- nuitka/nodes/NetworkxNodes.py +45 -0
- nuitka/nodes/NodeBases.py +890 -0
- nuitka/nodes/NodeMakingHelpers.py +481 -0
- nuitka/nodes/NodeMetaClasses.py +172 -0
- nuitka/nodes/OperatorNodes.py +944 -0
- nuitka/nodes/OperatorNodesUnary.py +403 -0
- nuitka/nodes/OsSysNodes.py +215 -0
- nuitka/nodes/OutlineNodes.py +372 -0
- nuitka/nodes/PackageMetadataNodes.py +982 -0
- nuitka/nodes/PackageResourceNodes.py +424 -0
- nuitka/nodes/PrintNodes.py +105 -0
- nuitka/nodes/ReturnNodes.py +255 -0
- nuitka/nodes/SideEffectNodes.py +139 -0
- nuitka/nodes/SliceNodes.py +386 -0
- nuitka/nodes/StatementBasesGenerated.py +3419 -0
- nuitka/nodes/StatementNodes.py +316 -0
- nuitka/nodes/StrNodes.py +919 -0
- nuitka/nodes/StringConcatenationNodes.py +103 -0
- nuitka/nodes/SubscriptNodes.py +245 -0
- nuitka/nodes/TensorflowNodes.py +38 -0
- nuitka/nodes/TryNodes.py +519 -0
- nuitka/nodes/TypeMatchNodes.py +65 -0
- nuitka/nodes/TypeNodes.py +390 -0
- nuitka/nodes/VariableAssignNodes.py +1177 -0
- nuitka/nodes/VariableDelNodes.py +320 -0
- nuitka/nodes/VariableNameNodes.py +153 -0
- nuitka/nodes/VariableRefNodes.py +895 -0
- nuitka/nodes/VariableReleaseNodes.py +153 -0
- nuitka/nodes/YieldNodes.py +121 -0
- nuitka/nodes/__init__.py +19 -0
- nuitka/nodes/shapes/BuiltinTypeShapes.py +4290 -0
- nuitka/nodes/shapes/ControlFlowDescriptions.py +199 -0
- nuitka/nodes/shapes/IteratorShapes.py +71 -0
- nuitka/nodes/shapes/ShapeMixins.py +255 -0
- nuitka/nodes/shapes/StandardShapes.py +1384 -0
- nuitka/nodes/shapes/__init__.py +19 -0
- nuitka/optimizations/BytecodeDemotion.py +105 -0
- nuitka/optimizations/FunctionInlining.py +110 -0
- nuitka/optimizations/Graphs.py +70 -0
- nuitka/optimizations/Optimization.py +363 -0
- nuitka/optimizations/OptimizeBuiltinCalls.py +1582 -0
- nuitka/optimizations/Tags.py +76 -0
- nuitka/optimizations/TraceCollections.py +1257 -0
- nuitka/optimizations/ValueTraces.py +980 -0
- nuitka/optimizations/__init__.py +19 -0
- nuitka/pgo/PGO.py +160 -0
- nuitka/pgo/__init__.py +19 -0
- nuitka/plugins/PluginBase.py +1924 -0
- nuitka/plugins/Plugins.py +2007 -0
- nuitka/plugins/YamlPluginBase.py +121 -0
- nuitka/plugins/__init__.py +19 -0
- nuitka/plugins/standard/AntiBloatPlugin.py +1024 -0
- nuitka/plugins/standard/ConsiderPyLintAnnotationsPlugin.py +95 -0
- nuitka/plugins/standard/DataFilesPlugin.py +311 -0
- nuitka/plugins/standard/DelvewheelPlugin.py +150 -0
- nuitka/plugins/standard/DillPlugin/DillPlugin.c +37 -0
- nuitka/plugins/standard/DillPlugin/cloudpickle-postLoad.py +67 -0
- nuitka/plugins/standard/DillPlugin/dill-postLoad.py +223 -0
- nuitka/plugins/standard/DillPlugin.py +137 -0
- nuitka/plugins/standard/DllFilesPlugin.py +527 -0
- nuitka/plugins/standard/EnumPlugin.py +64 -0
- nuitka/plugins/standard/EventletPlugin.py +57 -0
- nuitka/plugins/standard/GeventPlugin.py +64 -0
- nuitka/plugins/standard/GiPlugin.py +118 -0
- nuitka/plugins/standard/GlfwPlugin.py +138 -0
- nuitka/plugins/standard/ImplicitImports.py +845 -0
- nuitka/plugins/standard/KivyPlugin.py +141 -0
- nuitka/plugins/standard/MatplotlibPlugin.py +256 -0
- nuitka/plugins/standard/MultiprocessingPlugin.py +199 -0
- nuitka/plugins/standard/NumpyPlugin.py +35 -0
- nuitka/plugins/standard/OptionsNannyPlugin.py +158 -0
- nuitka/plugins/standard/PbrPlugin.py +62 -0
- nuitka/plugins/standard/PkgResourcesPlugin.py +162 -0
- nuitka/plugins/standard/PlaywrightPlugin.py +179 -0
- nuitka/plugins/standard/PmwPlugin.py +248 -0
- nuitka/plugins/standard/PySidePyQtPlugin.py +1666 -0
- nuitka/plugins/standard/PywebViewPlugin.py +81 -0
- nuitka/plugins/standard/SpacyPlugin.py +137 -0
- nuitka/plugins/standard/TensorflowPlugin.py +35 -0
- nuitka/plugins/standard/TkinterPlugin.py +416 -0
- nuitka/plugins/standard/TorchPlugin.py +35 -0
- nuitka/plugins/standard/TransformersPlugin.py +121 -0
- nuitka/plugins/standard/TrioPlugin.py +33 -0
- nuitka/plugins/standard/UpxPlugin.py +174 -0
- nuitka/plugins/standard/__init__.py +19 -0
- nuitka/plugins/standard/standard.nuitka-package.config.yml +9313 -0
- nuitka/plugins/standard/stdlib2.nuitka-package.config.yml +78 -0
- nuitka/plugins/standard/stdlib3.nuitka-package.config.yml +468 -0
- nuitka/reports/CompilationReportReader.py +83 -0
- nuitka/reports/LicenseReport.rst.j2 +41 -0
- nuitka/reports/Reports.py +961 -0
- nuitka/reports/__init__.py +19 -0
- nuitka/specs/BuiltinBytesOperationSpecs.py +180 -0
- nuitka/specs/BuiltinDictOperationSpecs.py +82 -0
- nuitka/specs/BuiltinListOperationSpecs.py +80 -0
- nuitka/specs/BuiltinParameterSpecs.py +831 -0
- nuitka/specs/BuiltinStrOperationSpecs.py +181 -0
- nuitka/specs/BuiltinTypeOperationSpecs.py +34 -0
- nuitka/specs/BuiltinUnicodeOperationSpecs.py +123 -0
- nuitka/specs/HardImportSpecs.py +236 -0
- nuitka/specs/ParameterSpecs.py +630 -0
- nuitka/specs/__init__.py +19 -0
- nuitka/tools/Basics.py +55 -0
- nuitka/tools/__init__.py +19 -0
- nuitka/tools/commercial/__init__.py +21 -0
- nuitka/tools/data_composer/DataComposer.py +593 -0
- nuitka/tools/data_composer/__init__.py +19 -0
- nuitka/tools/data_composer/__main__.py +41 -0
- nuitka/tools/environments/CreateEnvironment.py +69 -0
- nuitka/tools/environments/Virtualenv.py +158 -0
- nuitka/tools/environments/__init__.py +19 -0
- nuitka/tools/general/__init__.py +19 -0
- nuitka/tools/general/dll_report/__init__.py +19 -0
- nuitka/tools/general/dll_report/__main__.py +83 -0
- nuitka/tools/general/find_module/FindModuleCode.py +127 -0
- nuitka/tools/general/find_module/__init__.py +19 -0
- nuitka/tools/general/generate_header/GenerateHeader.py +73 -0
- nuitka/tools/general/generate_header/__init__.py +19 -0
- nuitka/tools/onefile_compressor/OnefileCompressor.py +390 -0
- nuitka/tools/onefile_compressor/__init__.py +19 -0
- nuitka/tools/onefile_compressor/__main__.py +41 -0
- nuitka/tools/podman/Podman.py +55 -0
- nuitka/tools/podman/__init__.py +19 -0
- nuitka/tools/podman/__main__.py +425 -0
- nuitka/tools/profiler/__init__.py +19 -0
- nuitka/tools/profiler/__main__.py +93 -0
- nuitka/tools/scanning/DisplayDistributions.py +39 -0
- nuitka/tools/scanning/DisplayPackageDLLs.py +151 -0
- nuitka/tools/scanning/DisplayPackageData.py +73 -0
- nuitka/tools/scanning/__init__.py +19 -0
- nuitka/tools/specialize/CTypeDescriptions.py +1928 -0
- nuitka/tools/specialize/Common.py +380 -0
- nuitka/tools/specialize/SpecializeC.py +1483 -0
- nuitka/tools/specialize/SpecializePython.py +1151 -0
- nuitka/tools/specialize/__init__.py +19 -0
- nuitka/tools/testing/Common.py +2007 -0
- nuitka/tools/testing/Constructs.py +53 -0
- nuitka/tools/testing/DocTests.py +156 -0
- nuitka/tools/testing/OutputComparison.py +313 -0
- nuitka/tools/testing/Pythons.py +34 -0
- nuitka/tools/testing/RuntimeTracing.py +260 -0
- nuitka/tools/testing/SearchModes.py +208 -0
- nuitka/tools/testing/Valgrind.py +103 -0
- nuitka/tools/testing/__init__.py +19 -0
- nuitka/tools/testing/check_reference_counts/__init__.py +19 -0
- nuitka/tools/testing/check_reference_counts/__main__.py +107 -0
- nuitka/tools/testing/compare_with_cpython/__init__.py +19 -0
- nuitka/tools/testing/compare_with_cpython/__main__.py +942 -0
- nuitka/tools/testing/find_sxs_modules/__init__.py +19 -0
- nuitka/tools/testing/find_sxs_modules/__main__.py +73 -0
- nuitka/tools/testing/measure_construct_performance/__init__.py +19 -0
- nuitka/tools/testing/measure_construct_performance/__main__.py +288 -0
- nuitka/tools/testing/run_nuitka_tests/__init__.py +19 -0
- nuitka/tools/testing/run_nuitka_tests/__main__.py +1091 -0
- nuitka/tools/watch/AutoStage.py +145 -0
- nuitka/tools/watch/Common.py +55 -0
- nuitka/tools/watch/Conda.py +125 -0
- nuitka/tools/watch/GitHub.py +113 -0
- nuitka/tools/watch/Pacman.py +73 -0
- nuitka/tools/watch/Pipenv.py +145 -0
- nuitka/tools/watch/__init__.py +19 -0
- nuitka/tools/watch/__main__.py +615 -0
- nuitka/tree/Building.py +1459 -0
- nuitka/tree/ComplexCallHelperFunctions.py +2150 -0
- nuitka/tree/Extractions.py +48 -0
- nuitka/tree/FutureSpecState.py +71 -0
- nuitka/tree/InternalModule.py +96 -0
- nuitka/tree/Operations.py +45 -0
- nuitka/tree/ReformulationAssertStatements.py +97 -0
- nuitka/tree/ReformulationAssignmentStatements.py +1260 -0
- nuitka/tree/ReformulationBooleanExpressions.py +97 -0
- nuitka/tree/ReformulationCallExpressions.py +314 -0
- nuitka/tree/ReformulationClasses.py +407 -0
- nuitka/tree/ReformulationClasses3.py +1149 -0
- nuitka/tree/ReformulationComparisonExpressions.py +174 -0
- nuitka/tree/ReformulationContractionExpressions.py +676 -0
- nuitka/tree/ReformulationDictionaryCreation.py +304 -0
- nuitka/tree/ReformulationExecStatements.py +386 -0
- nuitka/tree/ReformulationForLoopStatements.py +215 -0
- nuitka/tree/ReformulationFunctionStatements.py +931 -0
- nuitka/tree/ReformulationImportStatements.py +333 -0
- nuitka/tree/ReformulationLambdaExpressions.py +185 -0
- nuitka/tree/ReformulationMatchStatements.py +797 -0
- nuitka/tree/ReformulationMultidist.py +80 -0
- nuitka/tree/ReformulationNamespacePackages.py +239 -0
- nuitka/tree/ReformulationPrintStatements.py +127 -0
- nuitka/tree/ReformulationSequenceCreation.py +438 -0
- nuitka/tree/ReformulationSubscriptExpressions.py +123 -0
- nuitka/tree/ReformulationTryExceptStatements.py +418 -0
- nuitka/tree/ReformulationTryFinallyStatements.py +239 -0
- nuitka/tree/ReformulationWhileLoopStatements.py +160 -0
- nuitka/tree/ReformulationWithStatements.py +382 -0
- nuitka/tree/ReformulationYieldExpressions.py +133 -0
- nuitka/tree/SourceHandling.py +476 -0
- nuitka/tree/SyntaxErrors.py +143 -0
- nuitka/tree/TreeHelpers.py +720 -0
- nuitka/tree/VariableClosure.py +483 -0
- nuitka/tree/__init__.py +19 -0
- nuitka/utils/AppDirs.py +104 -0
- nuitka/utils/CStrings.py +208 -0
- nuitka/utils/CommandLineOptions.py +207 -0
- nuitka/utils/Distributions.py +728 -0
- nuitka/utils/Download.py +217 -0
- nuitka/utils/Execution.py +517 -0
- nuitka/utils/FileOperations.py +1587 -0
- nuitka/utils/Hashing.py +137 -0
- nuitka/utils/Images.py +79 -0
- nuitka/utils/Importing.py +335 -0
- nuitka/utils/InlineCopies.py +52 -0
- nuitka/utils/InstalledPythons.py +254 -0
- nuitka/utils/InstanceCounters.py +86 -0
- nuitka/utils/Jinja2.py +158 -0
- nuitka/utils/Json.py +40 -0
- nuitka/utils/MacOSApp.py +134 -0
- nuitka/utils/MemoryUsage.py +165 -0
- nuitka/utils/ModuleNames.py +317 -0
- nuitka/utils/PackageResources.py +44 -0
- nuitka/utils/ReExecute.py +152 -0
- nuitka/utils/Rest.py +60 -0
- nuitka/utils/SharedLibraries.py +1014 -0
- nuitka/utils/Shebang.py +113 -0
- nuitka/utils/Signing.py +144 -0
- nuitka/utils/SlotMetaClasses.py +57 -0
- nuitka/utils/StaticLibraries.py +260 -0
- nuitka/utils/ThreadedExecutor.py +87 -0
- nuitka/utils/Timing.py +102 -0
- nuitka/utils/Utils.py +483 -0
- nuitka/utils/WindowsFileUsage.py +337 -0
- nuitka/utils/WindowsResources.py +652 -0
- nuitka/utils/Yaml.py +247 -0
- nuitka/utils/__init__.py +19 -0
- nuitka_winsvc-2.7.7.data/scripts/nuitka-run.cmd +24 -0
- nuitka_winsvc-2.7.7.data/scripts/nuitka.cmd +30 -0
- nuitka_winsvc-2.7.7.dist-info/METADATA +115 -0
- nuitka_winsvc-2.7.7.dist-info/RECORD +995 -0
- nuitka_winsvc-2.7.7.dist-info/WHEEL +5 -0
- nuitka_winsvc-2.7.7.dist-info/entry_points.txt +7 -0
- nuitka_winsvc-2.7.7.dist-info/licenses/LICENSE.txt +202 -0
- nuitka_winsvc-2.7.7.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,1524 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Customisable progressbar decorator for iterators.
|
|
3
|
+
Includes a default `range` iterator printing to `stderr`.
|
|
4
|
+
|
|
5
|
+
Usage:
|
|
6
|
+
>>> from tqdm import trange, tqdm
|
|
7
|
+
>>> for i in trange(10):
|
|
8
|
+
... ...
|
|
9
|
+
"""
|
|
10
|
+
from __future__ import absolute_import, division
|
|
11
|
+
|
|
12
|
+
import sys
|
|
13
|
+
from collections import OrderedDict, defaultdict
|
|
14
|
+
from contextlib import contextmanager
|
|
15
|
+
from datetime import datetime, timedelta
|
|
16
|
+
from numbers import Number
|
|
17
|
+
from time import time
|
|
18
|
+
from warnings import warn
|
|
19
|
+
from weakref import WeakSet
|
|
20
|
+
|
|
21
|
+
from ._monitor import TMonitor
|
|
22
|
+
from .utils import (
|
|
23
|
+
CallbackIOWrapper, Comparable, DisableOnWriteError, FormatReplace,
|
|
24
|
+
SimpleTextIOWrapper, _basestring, _is_ascii, _range, _screen_shape_wrapper,
|
|
25
|
+
_supports_unicode, _term_move_up, _unich, _unicode, disp_len, disp_trim)
|
|
26
|
+
|
|
27
|
+
__author__ = "https://github.com/tqdm/tqdm#contributions"
|
|
28
|
+
__all__ = ['tqdm', 'trange',
|
|
29
|
+
'TqdmTypeError', 'TqdmKeyError', 'TqdmWarning',
|
|
30
|
+
'TqdmExperimentalWarning', 'TqdmDeprecationWarning',
|
|
31
|
+
'TqdmMonitorWarning']
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
class TqdmTypeError(TypeError):
|
|
35
|
+
pass
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
class TqdmKeyError(KeyError):
|
|
39
|
+
pass
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
class TqdmWarning(Warning):
|
|
43
|
+
"""base class for all tqdm warnings.
|
|
44
|
+
|
|
45
|
+
Used for non-external-code-breaking errors, such as garbled printing.
|
|
46
|
+
"""
|
|
47
|
+
def __init__(self, msg, fp_write=None, *a, **k):
|
|
48
|
+
if fp_write is not None:
|
|
49
|
+
fp_write("\n" + self.__class__.__name__ + ": " + str(msg).rstrip() + '\n')
|
|
50
|
+
else:
|
|
51
|
+
super(TqdmWarning, self).__init__(msg, *a, **k)
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
class TqdmExperimentalWarning(TqdmWarning, FutureWarning):
|
|
55
|
+
"""beta feature, unstable API and behaviour"""
|
|
56
|
+
pass
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
class TqdmDeprecationWarning(TqdmWarning, DeprecationWarning):
|
|
60
|
+
# not suppressed if raised
|
|
61
|
+
pass
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
class TqdmMonitorWarning(TqdmWarning, RuntimeWarning):
|
|
65
|
+
"""tqdm monitor errors which do not affect external functionality"""
|
|
66
|
+
pass
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
def TRLock(*args, **kwargs):
|
|
70
|
+
"""threading RLock"""
|
|
71
|
+
try:
|
|
72
|
+
from threading import RLock
|
|
73
|
+
return RLock(*args, **kwargs)
|
|
74
|
+
except (ImportError, OSError): # pragma: no cover
|
|
75
|
+
pass
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
class TqdmDefaultWriteLock(object):
|
|
79
|
+
"""
|
|
80
|
+
Provide a default write lock for thread and multiprocessing safety.
|
|
81
|
+
Works only on platforms supporting `fork` (so Windows is excluded).
|
|
82
|
+
You must initialise a `tqdm` or `TqdmDefaultWriteLock` instance
|
|
83
|
+
before forking in order for the write lock to work.
|
|
84
|
+
On Windows, you need to supply the lock from the parent to the children as
|
|
85
|
+
an argument to joblib or the parallelism lib you use.
|
|
86
|
+
"""
|
|
87
|
+
# global thread lock so no setup required for multithreading.
|
|
88
|
+
# NB: Do not create multiprocessing lock as it sets the multiprocessing
|
|
89
|
+
# context, disallowing `spawn()`/`forkserver()`
|
|
90
|
+
th_lock = TRLock()
|
|
91
|
+
|
|
92
|
+
def __init__(self):
|
|
93
|
+
# Create global parallelism locks to avoid racing issues with parallel
|
|
94
|
+
# bars works only if fork available (Linux/MacOSX, but not Windows)
|
|
95
|
+
cls = type(self)
|
|
96
|
+
root_lock = cls.th_lock
|
|
97
|
+
if root_lock is not None:
|
|
98
|
+
root_lock.acquire()
|
|
99
|
+
cls.create_mp_lock()
|
|
100
|
+
self.locks = [lk for lk in [cls.mp_lock, cls.th_lock] if lk is not None]
|
|
101
|
+
if root_lock is not None:
|
|
102
|
+
root_lock.release()
|
|
103
|
+
|
|
104
|
+
def acquire(self, *a, **k):
|
|
105
|
+
for lock in self.locks:
|
|
106
|
+
lock.acquire(*a, **k)
|
|
107
|
+
|
|
108
|
+
def release(self):
|
|
109
|
+
for lock in self.locks[::-1]: # Release in inverse order of acquisition
|
|
110
|
+
lock.release()
|
|
111
|
+
|
|
112
|
+
def __enter__(self):
|
|
113
|
+
self.acquire()
|
|
114
|
+
|
|
115
|
+
def __exit__(self, *exc):
|
|
116
|
+
self.release()
|
|
117
|
+
|
|
118
|
+
@classmethod
|
|
119
|
+
def create_mp_lock(cls):
|
|
120
|
+
if not hasattr(cls, 'mp_lock'):
|
|
121
|
+
try:
|
|
122
|
+
from multiprocessing import RLock
|
|
123
|
+
cls.mp_lock = RLock()
|
|
124
|
+
except (ImportError, OSError): # pragma: no cover
|
|
125
|
+
cls.mp_lock = None
|
|
126
|
+
|
|
127
|
+
@classmethod
|
|
128
|
+
def create_th_lock(cls):
|
|
129
|
+
assert hasattr(cls, 'th_lock')
|
|
130
|
+
warn("create_th_lock not needed anymore", TqdmDeprecationWarning, stacklevel=2)
|
|
131
|
+
|
|
132
|
+
|
|
133
|
+
class Bar(object):
|
|
134
|
+
"""
|
|
135
|
+
`str.format`-able bar with format specifiers: `[width][type]`
|
|
136
|
+
|
|
137
|
+
- `width`
|
|
138
|
+
+ unspecified (default): use `self.default_len`
|
|
139
|
+
+ `int >= 0`: overrides `self.default_len`
|
|
140
|
+
+ `int < 0`: subtract from `self.default_len`
|
|
141
|
+
- `type`
|
|
142
|
+
+ `a`: ascii (`charset=self.ASCII` override)
|
|
143
|
+
+ `u`: unicode (`charset=self.UTF` override)
|
|
144
|
+
+ `b`: blank (`charset=" "` override)
|
|
145
|
+
"""
|
|
146
|
+
ASCII = " 123456789#"
|
|
147
|
+
UTF = u" " + u''.join(map(_unich, range(0x258F, 0x2587, -1)))
|
|
148
|
+
BLANK = " "
|
|
149
|
+
COLOUR_RESET = '\x1b[0m'
|
|
150
|
+
COLOUR_RGB = '\x1b[38;2;%d;%d;%dm'
|
|
151
|
+
COLOURS = {'BLACK': '\x1b[30m', 'RED': '\x1b[31m', 'GREEN': '\x1b[32m',
|
|
152
|
+
'YELLOW': '\x1b[33m', 'BLUE': '\x1b[34m', 'MAGENTA': '\x1b[35m',
|
|
153
|
+
'CYAN': '\x1b[36m', 'WHITE': '\x1b[37m'}
|
|
154
|
+
|
|
155
|
+
def __init__(self, frac, default_len=10, charset=UTF, colour=None):
|
|
156
|
+
if not 0 <= frac <= 1:
|
|
157
|
+
warn("clamping frac to range [0, 1]", TqdmWarning, stacklevel=2)
|
|
158
|
+
frac = max(0, min(1, frac))
|
|
159
|
+
assert default_len > 0
|
|
160
|
+
self.frac = frac
|
|
161
|
+
self.default_len = default_len
|
|
162
|
+
self.charset = charset
|
|
163
|
+
self.colour = colour
|
|
164
|
+
|
|
165
|
+
@property
|
|
166
|
+
def colour(self):
|
|
167
|
+
return self._colour
|
|
168
|
+
|
|
169
|
+
@colour.setter
|
|
170
|
+
def colour(self, value):
|
|
171
|
+
if not value:
|
|
172
|
+
self._colour = None
|
|
173
|
+
return
|
|
174
|
+
try:
|
|
175
|
+
if value.upper() in self.COLOURS:
|
|
176
|
+
self._colour = self.COLOURS[value.upper()]
|
|
177
|
+
elif value[0] == '#' and len(value) == 7:
|
|
178
|
+
self._colour = self.COLOUR_RGB % tuple(
|
|
179
|
+
int(i, 16) for i in (value[1:3], value[3:5], value[5:7]))
|
|
180
|
+
else:
|
|
181
|
+
raise KeyError
|
|
182
|
+
except (KeyError, AttributeError):
|
|
183
|
+
warn("Unknown colour (%s); valid choices: [hex (#00ff00), %s]" % (
|
|
184
|
+
value, ", ".join(self.COLOURS)),
|
|
185
|
+
TqdmWarning, stacklevel=2)
|
|
186
|
+
self._colour = None
|
|
187
|
+
|
|
188
|
+
def __format__(self, format_spec):
|
|
189
|
+
if format_spec:
|
|
190
|
+
_type = format_spec[-1].lower()
|
|
191
|
+
try:
|
|
192
|
+
charset = {'a': self.ASCII, 'u': self.UTF, 'b': self.BLANK}[_type]
|
|
193
|
+
except KeyError:
|
|
194
|
+
charset = self.charset
|
|
195
|
+
else:
|
|
196
|
+
format_spec = format_spec[:-1]
|
|
197
|
+
if format_spec:
|
|
198
|
+
N_BARS = int(format_spec)
|
|
199
|
+
if N_BARS < 0:
|
|
200
|
+
N_BARS += self.default_len
|
|
201
|
+
else:
|
|
202
|
+
N_BARS = self.default_len
|
|
203
|
+
else:
|
|
204
|
+
charset = self.charset
|
|
205
|
+
N_BARS = self.default_len
|
|
206
|
+
|
|
207
|
+
nsyms = len(charset) - 1
|
|
208
|
+
bar_length, frac_bar_length = divmod(int(self.frac * N_BARS * nsyms), nsyms)
|
|
209
|
+
|
|
210
|
+
res = charset[-1] * bar_length
|
|
211
|
+
if bar_length < N_BARS: # whitespace padding
|
|
212
|
+
res = res + charset[frac_bar_length] + \
|
|
213
|
+
charset[0] * (N_BARS - bar_length - 1)
|
|
214
|
+
return self.colour + res + self.COLOUR_RESET if self.colour else res
|
|
215
|
+
|
|
216
|
+
|
|
217
|
+
class EMA(object):
|
|
218
|
+
"""
|
|
219
|
+
Exponential moving average: smoothing to give progressively lower
|
|
220
|
+
weights to older values.
|
|
221
|
+
|
|
222
|
+
Parameters
|
|
223
|
+
----------
|
|
224
|
+
smoothing : float, optional
|
|
225
|
+
Smoothing factor in range [0, 1], [default: 0.3].
|
|
226
|
+
Increase to give more weight to recent values.
|
|
227
|
+
Ranges from 0 (yields old value) to 1 (yields new value).
|
|
228
|
+
"""
|
|
229
|
+
def __init__(self, smoothing=0.3):
|
|
230
|
+
self.alpha = smoothing
|
|
231
|
+
self.last = 0
|
|
232
|
+
self.calls = 0
|
|
233
|
+
|
|
234
|
+
def __call__(self, x=None):
|
|
235
|
+
"""
|
|
236
|
+
Parameters
|
|
237
|
+
----------
|
|
238
|
+
x : float
|
|
239
|
+
New value to include in EMA.
|
|
240
|
+
"""
|
|
241
|
+
beta = 1 - self.alpha
|
|
242
|
+
if x is not None:
|
|
243
|
+
self.last = self.alpha * x + beta * self.last
|
|
244
|
+
self.calls += 1
|
|
245
|
+
return self.last / (1 - beta ** self.calls) if self.calls else self.last
|
|
246
|
+
|
|
247
|
+
|
|
248
|
+
class tqdm(Comparable):
|
|
249
|
+
"""
|
|
250
|
+
Decorate an iterable object, returning an iterator which acts exactly
|
|
251
|
+
like the original iterable, but prints a dynamically updating
|
|
252
|
+
progressbar every time a value is requested.
|
|
253
|
+
"""
|
|
254
|
+
|
|
255
|
+
monitor_interval = 10 # set to 0 to disable the thread
|
|
256
|
+
monitor = None
|
|
257
|
+
_instances = WeakSet()
|
|
258
|
+
|
|
259
|
+
@staticmethod
|
|
260
|
+
def format_sizeof(num, suffix='', divisor=1000):
|
|
261
|
+
"""
|
|
262
|
+
Formats a number (greater than unity) with SI Order of Magnitude
|
|
263
|
+
prefixes.
|
|
264
|
+
|
|
265
|
+
Parameters
|
|
266
|
+
----------
|
|
267
|
+
num : float
|
|
268
|
+
Number ( >= 1) to format.
|
|
269
|
+
suffix : str, optional
|
|
270
|
+
Post-postfix [default: ''].
|
|
271
|
+
divisor : float, optional
|
|
272
|
+
Divisor between prefixes [default: 1000].
|
|
273
|
+
|
|
274
|
+
Returns
|
|
275
|
+
-------
|
|
276
|
+
out : str
|
|
277
|
+
Number with Order of Magnitude SI unit postfix.
|
|
278
|
+
"""
|
|
279
|
+
for unit in ['', 'k', 'M', 'G', 'T', 'P', 'E', 'Z']:
|
|
280
|
+
if abs(num) < 999.5:
|
|
281
|
+
if abs(num) < 99.95:
|
|
282
|
+
if abs(num) < 9.995:
|
|
283
|
+
return '{0:1.2f}'.format(num) + unit + suffix
|
|
284
|
+
return '{0:2.1f}'.format(num) + unit + suffix
|
|
285
|
+
return '{0:3.0f}'.format(num) + unit + suffix
|
|
286
|
+
num /= divisor
|
|
287
|
+
return '{0:3.1f}Y'.format(num) + suffix
|
|
288
|
+
|
|
289
|
+
@staticmethod
|
|
290
|
+
def format_interval(t):
|
|
291
|
+
"""
|
|
292
|
+
Formats a number of seconds as a clock time, [H:]MM:SS
|
|
293
|
+
|
|
294
|
+
Parameters
|
|
295
|
+
----------
|
|
296
|
+
t : int
|
|
297
|
+
Number of seconds.
|
|
298
|
+
|
|
299
|
+
Returns
|
|
300
|
+
-------
|
|
301
|
+
out : str
|
|
302
|
+
[H:]MM:SS
|
|
303
|
+
"""
|
|
304
|
+
mins, s = divmod(int(t), 60)
|
|
305
|
+
h, m = divmod(mins, 60)
|
|
306
|
+
if h:
|
|
307
|
+
return '{0:d}:{1:02d}:{2:02d}'.format(h, m, s)
|
|
308
|
+
else:
|
|
309
|
+
return '{0:02d}:{1:02d}'.format(m, s)
|
|
310
|
+
|
|
311
|
+
@staticmethod
|
|
312
|
+
def format_num(n):
|
|
313
|
+
"""
|
|
314
|
+
Intelligent scientific notation (.3g).
|
|
315
|
+
|
|
316
|
+
Parameters
|
|
317
|
+
----------
|
|
318
|
+
n : int or float or Numeric
|
|
319
|
+
A Number.
|
|
320
|
+
|
|
321
|
+
Returns
|
|
322
|
+
-------
|
|
323
|
+
out : str
|
|
324
|
+
Formatted number.
|
|
325
|
+
"""
|
|
326
|
+
f = '{0:.3g}'.format(n).replace('+0', '+').replace('-0', '-')
|
|
327
|
+
n = str(n)
|
|
328
|
+
return f if len(f) < len(n) else n
|
|
329
|
+
|
|
330
|
+
@staticmethod
|
|
331
|
+
def status_printer(file):
|
|
332
|
+
"""
|
|
333
|
+
Manage the printing and in-place updating of a line of characters.
|
|
334
|
+
Note that if the string is longer than a line, then in-place
|
|
335
|
+
updating may not work (it will print a new line at each refresh).
|
|
336
|
+
"""
|
|
337
|
+
fp = file
|
|
338
|
+
fp_flush = getattr(fp, 'flush', lambda: None) # pragma: no cover
|
|
339
|
+
|
|
340
|
+
def fp_write(s):
|
|
341
|
+
fp.write(_unicode(s))
|
|
342
|
+
fp_flush()
|
|
343
|
+
|
|
344
|
+
last_len = [0]
|
|
345
|
+
|
|
346
|
+
def print_status(s):
|
|
347
|
+
len_s = disp_len(s)
|
|
348
|
+
fp_write('\r' + s + (' ' * max(last_len[0] - len_s, 0)))
|
|
349
|
+
last_len[0] = len_s
|
|
350
|
+
|
|
351
|
+
return print_status
|
|
352
|
+
|
|
353
|
+
@staticmethod
|
|
354
|
+
def format_meter(n, total, elapsed, ncols=None, prefix='', ascii=False, unit='it',
|
|
355
|
+
unit_scale=False, rate=None, bar_format=None, postfix=None,
|
|
356
|
+
unit_divisor=1000, initial=0, colour=None, **extra_kwargs):
|
|
357
|
+
"""
|
|
358
|
+
Return a string-based progress bar given some parameters
|
|
359
|
+
|
|
360
|
+
Parameters
|
|
361
|
+
----------
|
|
362
|
+
n : int or float
|
|
363
|
+
Number of finished iterations.
|
|
364
|
+
total : int or float
|
|
365
|
+
The expected total number of iterations. If meaningless (None),
|
|
366
|
+
only basic progress statistics are displayed (no ETA).
|
|
367
|
+
elapsed : float
|
|
368
|
+
Number of seconds passed since start.
|
|
369
|
+
ncols : int, optional
|
|
370
|
+
The width of the entire output message. If specified,
|
|
371
|
+
dynamically resizes `{bar}` to stay within this bound
|
|
372
|
+
[default: None]. If `0`, will not print any bar (only stats).
|
|
373
|
+
The fallback is `{bar:10}`.
|
|
374
|
+
prefix : str, optional
|
|
375
|
+
Prefix message (included in total width) [default: ''].
|
|
376
|
+
Use as {desc} in bar_format string.
|
|
377
|
+
ascii : bool, optional or str, optional
|
|
378
|
+
If not set, use unicode (smooth blocks) to fill the meter
|
|
379
|
+
[default: False]. The fallback is to use ASCII characters
|
|
380
|
+
" 123456789#".
|
|
381
|
+
unit : str, optional
|
|
382
|
+
The iteration unit [default: 'it'].
|
|
383
|
+
unit_scale : bool or int or float, optional
|
|
384
|
+
If 1 or True, the number of iterations will be printed with an
|
|
385
|
+
appropriate SI metric prefix (k = 10^3, M = 10^6, etc.)
|
|
386
|
+
[default: False]. If any other non-zero number, will scale
|
|
387
|
+
`total` and `n`.
|
|
388
|
+
rate : float, optional
|
|
389
|
+
Manual override for iteration rate.
|
|
390
|
+
If [default: None], uses n/elapsed.
|
|
391
|
+
bar_format : str, optional
|
|
392
|
+
Specify a custom bar string formatting. May impact performance.
|
|
393
|
+
[default: '{l_bar}{bar}{r_bar}'], where
|
|
394
|
+
l_bar='{desc}: {percentage:3.0f}%|' and
|
|
395
|
+
r_bar='| {n_fmt}/{total_fmt} [{elapsed}<{remaining}, '
|
|
396
|
+
'{rate_fmt}{postfix}]'
|
|
397
|
+
Possible vars: l_bar, bar, r_bar, n, n_fmt, total, total_fmt,
|
|
398
|
+
percentage, elapsed, elapsed_s, ncols, nrows, desc, unit,
|
|
399
|
+
rate, rate_fmt, rate_noinv, rate_noinv_fmt,
|
|
400
|
+
rate_inv, rate_inv_fmt, postfix, unit_divisor,
|
|
401
|
+
remaining, remaining_s, eta.
|
|
402
|
+
Note that a trailing ": " is automatically removed after {desc}
|
|
403
|
+
if the latter is empty.
|
|
404
|
+
postfix : *, optional
|
|
405
|
+
Similar to `prefix`, but placed at the end
|
|
406
|
+
(e.g. for additional stats).
|
|
407
|
+
Note: postfix is usually a string (not a dict) for this method,
|
|
408
|
+
and will if possible be set to postfix = ', ' + postfix.
|
|
409
|
+
However other types are supported (#382).
|
|
410
|
+
unit_divisor : float, optional
|
|
411
|
+
[default: 1000], ignored unless `unit_scale` is True.
|
|
412
|
+
initial : int or float, optional
|
|
413
|
+
The initial counter value [default: 0].
|
|
414
|
+
colour : str, optional
|
|
415
|
+
Bar colour (e.g. 'green', '#00ff00').
|
|
416
|
+
|
|
417
|
+
Returns
|
|
418
|
+
-------
|
|
419
|
+
out : Formatted meter and stats, ready to display.
|
|
420
|
+
"""
|
|
421
|
+
|
|
422
|
+
# sanity check: total
|
|
423
|
+
if total and n >= (total + 0.5): # allow float imprecision (#849)
|
|
424
|
+
total = None
|
|
425
|
+
|
|
426
|
+
# apply custom scale if necessary
|
|
427
|
+
if unit_scale and unit_scale not in (True, 1):
|
|
428
|
+
if total:
|
|
429
|
+
total *= unit_scale
|
|
430
|
+
n *= unit_scale
|
|
431
|
+
if rate:
|
|
432
|
+
rate *= unit_scale # by default rate = self.avg_dn / self.avg_dt
|
|
433
|
+
unit_scale = False
|
|
434
|
+
|
|
435
|
+
elapsed_str = tqdm.format_interval(elapsed)
|
|
436
|
+
|
|
437
|
+
# if unspecified, attempt to use rate = average speed
|
|
438
|
+
# (we allow manual override since predicting time is an arcane art)
|
|
439
|
+
if rate is None and elapsed:
|
|
440
|
+
rate = (n - initial) / elapsed
|
|
441
|
+
inv_rate = 1 / rate if rate else None
|
|
442
|
+
format_sizeof = tqdm.format_sizeof
|
|
443
|
+
rate_noinv_fmt = ((format_sizeof(rate) if unit_scale else
|
|
444
|
+
'{0:5.2f}'.format(rate)) if rate else '?') + unit + '/s'
|
|
445
|
+
rate_inv_fmt = (
|
|
446
|
+
(format_sizeof(inv_rate) if unit_scale else '{0:5.2f}'.format(inv_rate))
|
|
447
|
+
if inv_rate else '?') + 's/' + unit
|
|
448
|
+
rate_fmt = rate_inv_fmt if inv_rate and inv_rate > 1 else rate_noinv_fmt
|
|
449
|
+
|
|
450
|
+
if unit_scale:
|
|
451
|
+
n_fmt = format_sizeof(n, divisor=unit_divisor)
|
|
452
|
+
total_fmt = format_sizeof(total, divisor=unit_divisor) \
|
|
453
|
+
if total is not None else '?'
|
|
454
|
+
else:
|
|
455
|
+
n_fmt = str(n)
|
|
456
|
+
total_fmt = str(total) if total is not None else '?'
|
|
457
|
+
|
|
458
|
+
try:
|
|
459
|
+
postfix = ', ' + postfix if postfix else ''
|
|
460
|
+
except TypeError:
|
|
461
|
+
pass
|
|
462
|
+
|
|
463
|
+
remaining = (total - n) / rate if rate and total else 0
|
|
464
|
+
remaining_str = tqdm.format_interval(remaining) if rate else '?'
|
|
465
|
+
try:
|
|
466
|
+
eta_dt = datetime.now() + timedelta(seconds=remaining) \
|
|
467
|
+
if rate and total else datetime.utcfromtimestamp(0)
|
|
468
|
+
except OverflowError:
|
|
469
|
+
eta_dt = datetime.max
|
|
470
|
+
|
|
471
|
+
# format the stats displayed to the left and right sides of the bar
|
|
472
|
+
if prefix:
|
|
473
|
+
# old prefix setup work around
|
|
474
|
+
bool_prefix_colon_already = (prefix[-2:] == ": ")
|
|
475
|
+
l_bar = prefix if bool_prefix_colon_already else prefix + ": "
|
|
476
|
+
else:
|
|
477
|
+
l_bar = ''
|
|
478
|
+
|
|
479
|
+
r_bar = '| {0}/{1} [{2}<{3}, {4}{5}]'.format(
|
|
480
|
+
n_fmt, total_fmt, elapsed_str, remaining_str, rate_fmt, postfix)
|
|
481
|
+
|
|
482
|
+
# Custom bar formatting
|
|
483
|
+
# Populate a dict with all available progress indicators
|
|
484
|
+
format_dict = dict(
|
|
485
|
+
# slight extension of self.format_dict
|
|
486
|
+
n=n, n_fmt=n_fmt, total=total, total_fmt=total_fmt,
|
|
487
|
+
elapsed=elapsed_str, elapsed_s=elapsed,
|
|
488
|
+
ncols=ncols, desc=prefix or '', unit=unit,
|
|
489
|
+
rate=inv_rate if inv_rate and inv_rate > 1 else rate,
|
|
490
|
+
rate_fmt=rate_fmt, rate_noinv=rate,
|
|
491
|
+
rate_noinv_fmt=rate_noinv_fmt, rate_inv=inv_rate,
|
|
492
|
+
rate_inv_fmt=rate_inv_fmt,
|
|
493
|
+
postfix=postfix, unit_divisor=unit_divisor,
|
|
494
|
+
colour=colour,
|
|
495
|
+
# plus more useful definitions
|
|
496
|
+
remaining=remaining_str, remaining_s=remaining,
|
|
497
|
+
l_bar=l_bar, r_bar=r_bar, eta=eta_dt,
|
|
498
|
+
**extra_kwargs)
|
|
499
|
+
|
|
500
|
+
# total is known: we can predict some stats
|
|
501
|
+
if total:
|
|
502
|
+
# fractional and percentage progress
|
|
503
|
+
frac = n / total
|
|
504
|
+
percentage = frac * 100
|
|
505
|
+
|
|
506
|
+
l_bar += '{0:3.0f}%|'.format(percentage)
|
|
507
|
+
|
|
508
|
+
if ncols == 0:
|
|
509
|
+
return l_bar[:-1] + r_bar[1:]
|
|
510
|
+
|
|
511
|
+
format_dict.update(l_bar=l_bar)
|
|
512
|
+
if bar_format:
|
|
513
|
+
format_dict.update(percentage=percentage)
|
|
514
|
+
|
|
515
|
+
# auto-remove colon for empty `desc`
|
|
516
|
+
if not prefix:
|
|
517
|
+
bar_format = bar_format.replace("{desc}: ", '')
|
|
518
|
+
else:
|
|
519
|
+
bar_format = "{l_bar}{bar}{r_bar}"
|
|
520
|
+
|
|
521
|
+
full_bar = FormatReplace()
|
|
522
|
+
try:
|
|
523
|
+
nobar = bar_format.format(bar=full_bar, **format_dict)
|
|
524
|
+
except UnicodeEncodeError:
|
|
525
|
+
bar_format = _unicode(bar_format)
|
|
526
|
+
nobar = bar_format.format(bar=full_bar, **format_dict)
|
|
527
|
+
if not full_bar.format_called:
|
|
528
|
+
# no {bar}, we can just format and return
|
|
529
|
+
return nobar
|
|
530
|
+
|
|
531
|
+
# Formatting progress bar space available for bar's display
|
|
532
|
+
full_bar = Bar(frac,
|
|
533
|
+
max(1, ncols - disp_len(nobar)) if ncols else 10,
|
|
534
|
+
charset=Bar.ASCII if ascii is True else ascii or Bar.UTF,
|
|
535
|
+
colour=colour)
|
|
536
|
+
if not _is_ascii(full_bar.charset) and _is_ascii(bar_format):
|
|
537
|
+
bar_format = _unicode(bar_format)
|
|
538
|
+
res = bar_format.format(bar=full_bar, **format_dict)
|
|
539
|
+
return disp_trim(res, ncols) if ncols else res
|
|
540
|
+
|
|
541
|
+
elif bar_format:
|
|
542
|
+
# user-specified bar_format but no total
|
|
543
|
+
l_bar += '|'
|
|
544
|
+
format_dict.update(l_bar=l_bar, percentage=0)
|
|
545
|
+
full_bar = FormatReplace()
|
|
546
|
+
nobar = bar_format.format(bar=full_bar, **format_dict)
|
|
547
|
+
if not full_bar.format_called:
|
|
548
|
+
return nobar
|
|
549
|
+
full_bar = Bar(0,
|
|
550
|
+
max(1, ncols - disp_len(nobar)) if ncols else 10,
|
|
551
|
+
charset=Bar.BLANK, colour=colour)
|
|
552
|
+
res = bar_format.format(bar=full_bar, **format_dict)
|
|
553
|
+
return disp_trim(res, ncols) if ncols else res
|
|
554
|
+
else:
|
|
555
|
+
# no total: no progressbar, ETA, just progress stats
|
|
556
|
+
return ((prefix + ": ") if prefix else '') + \
|
|
557
|
+
'{0}{1} [{2}, {3}{4}]'.format(
|
|
558
|
+
n_fmt, unit, elapsed_str, rate_fmt, postfix)
|
|
559
|
+
|
|
560
|
+
def __new__(cls, *_, **__):
|
|
561
|
+
instance = object.__new__(cls)
|
|
562
|
+
with cls.get_lock(): # also constructs lock if non-existent
|
|
563
|
+
cls._instances.add(instance)
|
|
564
|
+
# create monitoring thread
|
|
565
|
+
if cls.monitor_interval and (cls.monitor is None
|
|
566
|
+
or not cls.monitor.report()):
|
|
567
|
+
try:
|
|
568
|
+
cls.monitor = TMonitor(cls, cls.monitor_interval)
|
|
569
|
+
except Exception as e: # pragma: nocover
|
|
570
|
+
warn("tqdm:disabling monitor support"
|
|
571
|
+
" (monitor_interval = 0) due to:\n" + str(e),
|
|
572
|
+
TqdmMonitorWarning, stacklevel=2)
|
|
573
|
+
cls.monitor_interval = 0
|
|
574
|
+
return instance
|
|
575
|
+
|
|
576
|
+
@classmethod
|
|
577
|
+
def _get_free_pos(cls, instance=None):
|
|
578
|
+
"""Skips specified instance."""
|
|
579
|
+
positions = {abs(inst.pos) for inst in cls._instances
|
|
580
|
+
if inst is not instance and hasattr(inst, "pos")}
|
|
581
|
+
return min(set(range(len(positions) + 1)).difference(positions))
|
|
582
|
+
|
|
583
|
+
@classmethod
|
|
584
|
+
def _decr_instances(cls, instance):
|
|
585
|
+
"""
|
|
586
|
+
Remove from list and reposition another unfixed bar
|
|
587
|
+
to fill the new gap.
|
|
588
|
+
|
|
589
|
+
This means that by default (where all nested bars are unfixed),
|
|
590
|
+
order is not maintained but screen flicker/blank space is minimised.
|
|
591
|
+
(tqdm<=4.44.1 moved ALL subsequent unfixed bars up.)
|
|
592
|
+
"""
|
|
593
|
+
with cls._lock:
|
|
594
|
+
try:
|
|
595
|
+
cls._instances.remove(instance)
|
|
596
|
+
except KeyError:
|
|
597
|
+
# if not instance.gui: # pragma: no cover
|
|
598
|
+
# raise
|
|
599
|
+
pass # py2: maybe magically removed already
|
|
600
|
+
# else:
|
|
601
|
+
if not instance.gui:
|
|
602
|
+
last = (instance.nrows or 20) - 1
|
|
603
|
+
# find unfixed (`pos >= 0`) overflow (`pos >= nrows - 1`)
|
|
604
|
+
instances = list(filter(
|
|
605
|
+
lambda i: hasattr(i, "pos") and last <= i.pos,
|
|
606
|
+
cls._instances))
|
|
607
|
+
# set first found to current `pos`
|
|
608
|
+
if instances:
|
|
609
|
+
inst = min(instances, key=lambda i: i.pos)
|
|
610
|
+
inst.clear(nolock=True)
|
|
611
|
+
inst.pos = abs(instance.pos)
|
|
612
|
+
|
|
613
|
+
@classmethod
|
|
614
|
+
def write(cls, s, file=None, end="\n", nolock=False):
|
|
615
|
+
"""Print a message via tqdm (without overlap with bars)."""
|
|
616
|
+
fp = file if file is not None else sys.stdout
|
|
617
|
+
with cls.external_write_mode(file=file, nolock=nolock):
|
|
618
|
+
# Write the message
|
|
619
|
+
fp.write(s)
|
|
620
|
+
fp.write(end)
|
|
621
|
+
|
|
622
|
+
@classmethod
|
|
623
|
+
@contextmanager
|
|
624
|
+
def external_write_mode(cls, file=None, nolock=False):
|
|
625
|
+
"""
|
|
626
|
+
Disable tqdm within context and refresh tqdm when exits.
|
|
627
|
+
Useful when writing to standard output stream
|
|
628
|
+
"""
|
|
629
|
+
fp = file if file is not None else sys.stdout
|
|
630
|
+
|
|
631
|
+
try:
|
|
632
|
+
if not nolock:
|
|
633
|
+
cls.get_lock().acquire()
|
|
634
|
+
# Clear all bars
|
|
635
|
+
inst_cleared = []
|
|
636
|
+
for inst in tuple(getattr(cls, '_instances', [])):
|
|
637
|
+
# Clear instance if in the target output file
|
|
638
|
+
# or if write output + tqdm output are both either
|
|
639
|
+
# sys.stdout or sys.stderr (because both are mixed in terminal)
|
|
640
|
+
if hasattr(inst, "start_t") and (inst.fp == fp or all(
|
|
641
|
+
f in (sys.stdout, sys.stderr) for f in (fp, inst.fp))):
|
|
642
|
+
inst.clear(nolock=True)
|
|
643
|
+
inst_cleared.append(inst)
|
|
644
|
+
yield
|
|
645
|
+
# Force refresh display of bars we cleared
|
|
646
|
+
for inst in inst_cleared:
|
|
647
|
+
inst.refresh(nolock=True)
|
|
648
|
+
finally:
|
|
649
|
+
if not nolock:
|
|
650
|
+
cls._lock.release()
|
|
651
|
+
|
|
652
|
+
@classmethod
|
|
653
|
+
def set_lock(cls, lock):
|
|
654
|
+
"""Set the global lock."""
|
|
655
|
+
cls._lock = lock
|
|
656
|
+
|
|
657
|
+
@classmethod
|
|
658
|
+
def get_lock(cls):
|
|
659
|
+
"""Get the global lock. Construct it if it does not exist."""
|
|
660
|
+
if not hasattr(cls, '_lock'):
|
|
661
|
+
cls._lock = TqdmDefaultWriteLock()
|
|
662
|
+
return cls._lock
|
|
663
|
+
|
|
664
|
+
@classmethod
|
|
665
|
+
def pandas(cls, **tqdm_kwargs):
|
|
666
|
+
"""
|
|
667
|
+
Registers the current `tqdm` class with
|
|
668
|
+
pandas.core.
|
|
669
|
+
( frame.DataFrame
|
|
670
|
+
| series.Series
|
|
671
|
+
| groupby.(generic.)DataFrameGroupBy
|
|
672
|
+
| groupby.(generic.)SeriesGroupBy
|
|
673
|
+
).progress_apply
|
|
674
|
+
|
|
675
|
+
A new instance will be create every time `progress_apply` is called,
|
|
676
|
+
and each instance will automatically `close()` upon completion.
|
|
677
|
+
|
|
678
|
+
Parameters
|
|
679
|
+
----------
|
|
680
|
+
tqdm_kwargs : arguments for the tqdm instance
|
|
681
|
+
|
|
682
|
+
Examples
|
|
683
|
+
--------
|
|
684
|
+
>>> import pandas as pd
|
|
685
|
+
>>> import numpy as np
|
|
686
|
+
>>> from tqdm import tqdm
|
|
687
|
+
>>> from tqdm.gui import tqdm as tqdm_gui
|
|
688
|
+
>>>
|
|
689
|
+
>>> df = pd.DataFrame(np.random.randint(0, 100, (100000, 6)))
|
|
690
|
+
>>> tqdm.pandas(ncols=50) # can use tqdm_gui, optional kwargs, etc
|
|
691
|
+
>>> # Now you can use `progress_apply` instead of `apply`
|
|
692
|
+
>>> df.groupby(0).progress_apply(lambda x: x**2)
|
|
693
|
+
|
|
694
|
+
References
|
|
695
|
+
----------
|
|
696
|
+
<https://stackoverflow.com/questions/18603270/\
|
|
697
|
+
progress-indicator-during-pandas-operations-python>
|
|
698
|
+
"""
|
|
699
|
+
from warnings import catch_warnings, simplefilter
|
|
700
|
+
|
|
701
|
+
from pandas.core.frame import DataFrame
|
|
702
|
+
from pandas.core.series import Series
|
|
703
|
+
try:
|
|
704
|
+
with catch_warnings():
|
|
705
|
+
simplefilter("ignore", category=FutureWarning)
|
|
706
|
+
from pandas import Panel
|
|
707
|
+
except ImportError: # pandas>=1.2.0
|
|
708
|
+
Panel = None
|
|
709
|
+
Rolling, Expanding = None, None
|
|
710
|
+
try: # pandas>=1.0.0
|
|
711
|
+
from pandas.core.window.rolling import _Rolling_and_Expanding
|
|
712
|
+
except ImportError:
|
|
713
|
+
try: # pandas>=0.18.0
|
|
714
|
+
from pandas.core.window import _Rolling_and_Expanding
|
|
715
|
+
except ImportError: # pandas>=1.2.0
|
|
716
|
+
try: # pandas>=1.2.0
|
|
717
|
+
from pandas.core.window.expanding import Expanding
|
|
718
|
+
from pandas.core.window.rolling import Rolling
|
|
719
|
+
_Rolling_and_Expanding = Rolling, Expanding
|
|
720
|
+
except ImportError: # pragma: no cover
|
|
721
|
+
_Rolling_and_Expanding = None
|
|
722
|
+
try: # pandas>=0.25.0
|
|
723
|
+
from pandas.core.groupby.generic import SeriesGroupBy # , NDFrameGroupBy
|
|
724
|
+
from pandas.core.groupby.generic import DataFrameGroupBy
|
|
725
|
+
except ImportError: # pragma: no cover
|
|
726
|
+
try: # pandas>=0.23.0
|
|
727
|
+
from pandas.core.groupby.groupby import DataFrameGroupBy, SeriesGroupBy
|
|
728
|
+
except ImportError:
|
|
729
|
+
from pandas.core.groupby import DataFrameGroupBy, SeriesGroupBy
|
|
730
|
+
try: # pandas>=0.23.0
|
|
731
|
+
from pandas.core.groupby.groupby import GroupBy
|
|
732
|
+
except ImportError: # pragma: no cover
|
|
733
|
+
from pandas.core.groupby import GroupBy
|
|
734
|
+
|
|
735
|
+
try: # pandas>=0.23.0
|
|
736
|
+
from pandas.core.groupby.groupby import PanelGroupBy
|
|
737
|
+
except ImportError:
|
|
738
|
+
try:
|
|
739
|
+
from pandas.core.groupby import PanelGroupBy
|
|
740
|
+
except ImportError: # pandas>=0.25.0
|
|
741
|
+
PanelGroupBy = None
|
|
742
|
+
|
|
743
|
+
tqdm_kwargs = tqdm_kwargs.copy()
|
|
744
|
+
deprecated_t = [tqdm_kwargs.pop('deprecated_t', None)]
|
|
745
|
+
|
|
746
|
+
def inner_generator(df_function='apply'):
|
|
747
|
+
def inner(df, func, *args, **kwargs):
|
|
748
|
+
"""
|
|
749
|
+
Parameters
|
|
750
|
+
----------
|
|
751
|
+
df : (DataFrame|Series)[GroupBy]
|
|
752
|
+
Data (may be grouped).
|
|
753
|
+
func : function
|
|
754
|
+
To be applied on the (grouped) data.
|
|
755
|
+
**kwargs : optional
|
|
756
|
+
Transmitted to `df.apply()`.
|
|
757
|
+
"""
|
|
758
|
+
|
|
759
|
+
# Precompute total iterations
|
|
760
|
+
total = tqdm_kwargs.pop("total", getattr(df, 'ngroups', None))
|
|
761
|
+
if total is None: # not grouped
|
|
762
|
+
if df_function == 'applymap':
|
|
763
|
+
total = df.size
|
|
764
|
+
elif isinstance(df, Series):
|
|
765
|
+
total = len(df)
|
|
766
|
+
elif _Rolling_and_Expanding is None or \
|
|
767
|
+
not isinstance(df, _Rolling_and_Expanding):
|
|
768
|
+
# DataFrame or Panel
|
|
769
|
+
axis = kwargs.get('axis', 0)
|
|
770
|
+
if axis == 'index':
|
|
771
|
+
axis = 0
|
|
772
|
+
elif axis == 'columns':
|
|
773
|
+
axis = 1
|
|
774
|
+
# when axis=0, total is shape[axis1]
|
|
775
|
+
total = df.size // df.shape[axis]
|
|
776
|
+
|
|
777
|
+
# Init bar
|
|
778
|
+
if deprecated_t[0] is not None:
|
|
779
|
+
t = deprecated_t[0]
|
|
780
|
+
deprecated_t[0] = None
|
|
781
|
+
else:
|
|
782
|
+
t = cls(total=total, **tqdm_kwargs)
|
|
783
|
+
|
|
784
|
+
if len(args) > 0:
|
|
785
|
+
# *args intentionally not supported (see #244, #299)
|
|
786
|
+
TqdmDeprecationWarning(
|
|
787
|
+
"Except func, normal arguments are intentionally" +
|
|
788
|
+
" not supported by" +
|
|
789
|
+
" `(DataFrame|Series|GroupBy).progress_apply`." +
|
|
790
|
+
" Use keyword arguments instead.",
|
|
791
|
+
fp_write=getattr(t.fp, 'write', sys.stderr.write))
|
|
792
|
+
|
|
793
|
+
try:
|
|
794
|
+
func = df._is_builtin_func(func)
|
|
795
|
+
except TypeError:
|
|
796
|
+
pass
|
|
797
|
+
|
|
798
|
+
# Define bar updating wrapper
|
|
799
|
+
def wrapper(*args, **kwargs):
|
|
800
|
+
# update tbar correctly
|
|
801
|
+
# it seems `pandas apply` calls `func` twice
|
|
802
|
+
# on the first column/row to decide whether it can
|
|
803
|
+
# take a fast or slow code path; so stop when t.total==t.n
|
|
804
|
+
t.update(n=1 if not t.total or t.n < t.total else 0)
|
|
805
|
+
return func(*args, **kwargs)
|
|
806
|
+
|
|
807
|
+
# Apply the provided function (in **kwargs)
|
|
808
|
+
# on the df using our wrapper (which provides bar updating)
|
|
809
|
+
try:
|
|
810
|
+
return getattr(df, df_function)(wrapper, **kwargs)
|
|
811
|
+
finally:
|
|
812
|
+
t.close()
|
|
813
|
+
|
|
814
|
+
return inner
|
|
815
|
+
|
|
816
|
+
# Monkeypatch pandas to provide easy methods
|
|
817
|
+
# Enable custom tqdm progress in pandas!
|
|
818
|
+
Series.progress_apply = inner_generator()
|
|
819
|
+
SeriesGroupBy.progress_apply = inner_generator()
|
|
820
|
+
Series.progress_map = inner_generator('map')
|
|
821
|
+
SeriesGroupBy.progress_map = inner_generator('map')
|
|
822
|
+
|
|
823
|
+
DataFrame.progress_apply = inner_generator()
|
|
824
|
+
DataFrameGroupBy.progress_apply = inner_generator()
|
|
825
|
+
DataFrame.progress_applymap = inner_generator('applymap')
|
|
826
|
+
|
|
827
|
+
if Panel is not None:
|
|
828
|
+
Panel.progress_apply = inner_generator()
|
|
829
|
+
if PanelGroupBy is not None:
|
|
830
|
+
PanelGroupBy.progress_apply = inner_generator()
|
|
831
|
+
|
|
832
|
+
GroupBy.progress_apply = inner_generator()
|
|
833
|
+
GroupBy.progress_aggregate = inner_generator('aggregate')
|
|
834
|
+
GroupBy.progress_transform = inner_generator('transform')
|
|
835
|
+
|
|
836
|
+
if Rolling is not None and Expanding is not None:
|
|
837
|
+
Rolling.progress_apply = inner_generator()
|
|
838
|
+
Expanding.progress_apply = inner_generator()
|
|
839
|
+
elif _Rolling_and_Expanding is not None:
|
|
840
|
+
_Rolling_and_Expanding.progress_apply = inner_generator()
|
|
841
|
+
|
|
842
|
+
def __init__(self, iterable=None, desc=None, total=None, leave=True, file=None,
|
|
843
|
+
ncols=None, mininterval=0.1, maxinterval=10.0, miniters=None,
|
|
844
|
+
ascii=None, disable=False, unit='it', unit_scale=False,
|
|
845
|
+
dynamic_ncols=False, smoothing=0.3, bar_format=None, initial=0,
|
|
846
|
+
position=None, postfix=None, unit_divisor=1000, write_bytes=None,
|
|
847
|
+
lock_args=None, nrows=None, colour=None, delay=0, gui=False,
|
|
848
|
+
**kwargs):
|
|
849
|
+
"""
|
|
850
|
+
Parameters
|
|
851
|
+
----------
|
|
852
|
+
iterable : iterable, optional
|
|
853
|
+
Iterable to decorate with a progressbar.
|
|
854
|
+
Leave blank to manually manage the updates.
|
|
855
|
+
desc : str, optional
|
|
856
|
+
Prefix for the progressbar.
|
|
857
|
+
total : int or float, optional
|
|
858
|
+
The number of expected iterations. If unspecified,
|
|
859
|
+
len(iterable) is used if possible. If float("inf") or as a last
|
|
860
|
+
resort, only basic progress statistics are displayed
|
|
861
|
+
(no ETA, no progressbar).
|
|
862
|
+
If `gui` is True and this parameter needs subsequent updating,
|
|
863
|
+
specify an initial arbitrary large positive number,
|
|
864
|
+
e.g. 9e9.
|
|
865
|
+
leave : bool, optional
|
|
866
|
+
If [default: True], keeps all traces of the progressbar
|
|
867
|
+
upon termination of iteration.
|
|
868
|
+
If `None`, will leave only if `position` is `0`.
|
|
869
|
+
file : `io.TextIOWrapper` or `io.StringIO`, optional
|
|
870
|
+
Specifies where to output the progress messages
|
|
871
|
+
(default: sys.stderr). Uses `file.write(str)` and `file.flush()`
|
|
872
|
+
methods. For encoding, see `write_bytes`.
|
|
873
|
+
ncols : int, optional
|
|
874
|
+
The width of the entire output message. If specified,
|
|
875
|
+
dynamically resizes the progressbar to stay within this bound.
|
|
876
|
+
If unspecified, attempts to use environment width. The
|
|
877
|
+
fallback is a meter width of 10 and no limit for the counter and
|
|
878
|
+
statistics. If 0, will not print any meter (only stats).
|
|
879
|
+
mininterval : float, optional
|
|
880
|
+
Minimum progress display update interval [default: 0.1] seconds.
|
|
881
|
+
maxinterval : float, optional
|
|
882
|
+
Maximum progress display update interval [default: 10] seconds.
|
|
883
|
+
Automatically adjusts `miniters` to correspond to `mininterval`
|
|
884
|
+
after long display update lag. Only works if `dynamic_miniters`
|
|
885
|
+
or monitor thread is enabled.
|
|
886
|
+
miniters : int or float, optional
|
|
887
|
+
Minimum progress display update interval, in iterations.
|
|
888
|
+
If 0 and `dynamic_miniters`, will automatically adjust to equal
|
|
889
|
+
`mininterval` (more CPU efficient, good for tight loops).
|
|
890
|
+
If > 0, will skip display of specified number of iterations.
|
|
891
|
+
Tweak this and `mininterval` to get very efficient loops.
|
|
892
|
+
If your progress is erratic with both fast and slow iterations
|
|
893
|
+
(network, skipping items, etc) you should set miniters=1.
|
|
894
|
+
ascii : bool or str, optional
|
|
895
|
+
If unspecified or False, use unicode (smooth blocks) to fill
|
|
896
|
+
the meter. The fallback is to use ASCII characters " 123456789#".
|
|
897
|
+
disable : bool, optional
|
|
898
|
+
Whether to disable the entire progressbar wrapper
|
|
899
|
+
[default: False]. If set to None, disable on non-TTY.
|
|
900
|
+
unit : str, optional
|
|
901
|
+
String that will be used to define the unit of each iteration
|
|
902
|
+
[default: it].
|
|
903
|
+
unit_scale : bool or int or float, optional
|
|
904
|
+
If 1 or True, the number of iterations will be reduced/scaled
|
|
905
|
+
automatically and a metric prefix following the
|
|
906
|
+
International System of Units standard will be added
|
|
907
|
+
(kilo, mega, etc.) [default: False]. If any other non-zero
|
|
908
|
+
number, will scale `total` and `n`.
|
|
909
|
+
dynamic_ncols : bool, optional
|
|
910
|
+
If set, constantly alters `ncols` and `nrows` to the
|
|
911
|
+
environment (allowing for window resizes) [default: False].
|
|
912
|
+
smoothing : float, optional
|
|
913
|
+
Exponential moving average smoothing factor for speed estimates
|
|
914
|
+
(ignored in GUI mode). Ranges from 0 (average speed) to 1
|
|
915
|
+
(current/instantaneous speed) [default: 0.3].
|
|
916
|
+
bar_format : str, optional
|
|
917
|
+
Specify a custom bar string formatting. May impact performance.
|
|
918
|
+
[default: '{l_bar}{bar}{r_bar}'], where
|
|
919
|
+
l_bar='{desc}: {percentage:3.0f}%|' and
|
|
920
|
+
r_bar='| {n_fmt}/{total_fmt} [{elapsed}<{remaining}, '
|
|
921
|
+
'{rate_fmt}{postfix}]'
|
|
922
|
+
Possible vars: l_bar, bar, r_bar, n, n_fmt, total, total_fmt,
|
|
923
|
+
percentage, elapsed, elapsed_s, ncols, nrows, desc, unit,
|
|
924
|
+
rate, rate_fmt, rate_noinv, rate_noinv_fmt,
|
|
925
|
+
rate_inv, rate_inv_fmt, postfix, unit_divisor,
|
|
926
|
+
remaining, remaining_s, eta.
|
|
927
|
+
Note that a trailing ": " is automatically removed after {desc}
|
|
928
|
+
if the latter is empty.
|
|
929
|
+
initial : int or float, optional
|
|
930
|
+
The initial counter value. Useful when restarting a progress
|
|
931
|
+
bar [default: 0]. If using float, consider specifying `{n:.3f}`
|
|
932
|
+
or similar in `bar_format`, or specifying `unit_scale`.
|
|
933
|
+
position : int, optional
|
|
934
|
+
Specify the line offset to print this bar (starting from 0)
|
|
935
|
+
Automatic if unspecified.
|
|
936
|
+
Useful to manage multiple bars at once (eg, from threads).
|
|
937
|
+
postfix : dict or *, optional
|
|
938
|
+
Specify additional stats to display at the end of the bar.
|
|
939
|
+
Calls `set_postfix(**postfix)` if possible (dict).
|
|
940
|
+
unit_divisor : float, optional
|
|
941
|
+
[default: 1000], ignored unless `unit_scale` is True.
|
|
942
|
+
write_bytes : bool, optional
|
|
943
|
+
If (default: None) and `file` is unspecified,
|
|
944
|
+
bytes will be written in Python 2. If `True` will also write
|
|
945
|
+
bytes. In all other cases will default to unicode.
|
|
946
|
+
lock_args : tuple, optional
|
|
947
|
+
Passed to `refresh` for intermediate output
|
|
948
|
+
(initialisation, iterating, and updating).
|
|
949
|
+
nrows : int, optional
|
|
950
|
+
The screen height. If specified, hides nested bars outside this
|
|
951
|
+
bound. If unspecified, attempts to use environment height.
|
|
952
|
+
The fallback is 20.
|
|
953
|
+
colour : str, optional
|
|
954
|
+
Bar colour (e.g. 'green', '#00ff00').
|
|
955
|
+
delay : float, optional
|
|
956
|
+
Don't display until [default: 0] seconds have elapsed.
|
|
957
|
+
gui : bool, optional
|
|
958
|
+
WARNING: internal parameter - do not use.
|
|
959
|
+
Use tqdm.gui.tqdm(...) instead. If set, will attempt to use
|
|
960
|
+
matplotlib animations for a graphical output [default: False].
|
|
961
|
+
|
|
962
|
+
Returns
|
|
963
|
+
-------
|
|
964
|
+
out : decorated iterator.
|
|
965
|
+
"""
|
|
966
|
+
if write_bytes is None:
|
|
967
|
+
write_bytes = file is None and sys.version_info < (3,)
|
|
968
|
+
|
|
969
|
+
if file is None:
|
|
970
|
+
file = sys.stderr
|
|
971
|
+
|
|
972
|
+
if write_bytes:
|
|
973
|
+
# Despite coercing unicode into bytes, py2 sys.std* streams
|
|
974
|
+
# should have bytes written to them.
|
|
975
|
+
file = SimpleTextIOWrapper(
|
|
976
|
+
file, encoding=getattr(file, 'encoding', None) or 'utf-8')
|
|
977
|
+
|
|
978
|
+
file = DisableOnWriteError(file, tqdm_instance=self)
|
|
979
|
+
|
|
980
|
+
if disable is None and hasattr(file, "isatty") and not file.isatty():
|
|
981
|
+
disable = True
|
|
982
|
+
|
|
983
|
+
if total is None and iterable is not None:
|
|
984
|
+
try:
|
|
985
|
+
total = len(iterable)
|
|
986
|
+
except (TypeError, AttributeError):
|
|
987
|
+
total = None
|
|
988
|
+
if total == float("inf"):
|
|
989
|
+
# Infinite iterations, behave same as unknown
|
|
990
|
+
total = None
|
|
991
|
+
|
|
992
|
+
if disable:
|
|
993
|
+
self.iterable = iterable
|
|
994
|
+
self.disable = disable
|
|
995
|
+
with self._lock:
|
|
996
|
+
self.pos = self._get_free_pos(self)
|
|
997
|
+
self._instances.remove(self)
|
|
998
|
+
self.n = initial
|
|
999
|
+
self.total = total
|
|
1000
|
+
self.leave = leave
|
|
1001
|
+
return
|
|
1002
|
+
|
|
1003
|
+
if kwargs:
|
|
1004
|
+
self.disable = True
|
|
1005
|
+
with self._lock:
|
|
1006
|
+
self.pos = self._get_free_pos(self)
|
|
1007
|
+
self._instances.remove(self)
|
|
1008
|
+
raise (
|
|
1009
|
+
TqdmDeprecationWarning(
|
|
1010
|
+
"`nested` is deprecated and automated.\n"
|
|
1011
|
+
"Use `position` instead for manual control.\n",
|
|
1012
|
+
fp_write=getattr(file, 'write', sys.stderr.write))
|
|
1013
|
+
if "nested" in kwargs else
|
|
1014
|
+
TqdmKeyError("Unknown argument(s): " + str(kwargs)))
|
|
1015
|
+
|
|
1016
|
+
# Preprocess the arguments
|
|
1017
|
+
if ((ncols is None or nrows is None) and
|
|
1018
|
+
(file in (sys.stderr, sys.stdout))) or \
|
|
1019
|
+
dynamic_ncols: # pragma: no cover
|
|
1020
|
+
if dynamic_ncols:
|
|
1021
|
+
dynamic_ncols = _screen_shape_wrapper()
|
|
1022
|
+
if dynamic_ncols:
|
|
1023
|
+
ncols, nrows = dynamic_ncols(file)
|
|
1024
|
+
else:
|
|
1025
|
+
_dynamic_ncols = _screen_shape_wrapper()
|
|
1026
|
+
if _dynamic_ncols:
|
|
1027
|
+
_ncols, _nrows = _dynamic_ncols(file)
|
|
1028
|
+
if ncols is None:
|
|
1029
|
+
ncols = _ncols
|
|
1030
|
+
if nrows is None:
|
|
1031
|
+
nrows = _nrows
|
|
1032
|
+
|
|
1033
|
+
if miniters is None:
|
|
1034
|
+
miniters = 0
|
|
1035
|
+
dynamic_miniters = True
|
|
1036
|
+
else:
|
|
1037
|
+
dynamic_miniters = False
|
|
1038
|
+
|
|
1039
|
+
if mininterval is None:
|
|
1040
|
+
mininterval = 0
|
|
1041
|
+
|
|
1042
|
+
if maxinterval is None:
|
|
1043
|
+
maxinterval = 0
|
|
1044
|
+
|
|
1045
|
+
if ascii is None:
|
|
1046
|
+
ascii = not _supports_unicode(file)
|
|
1047
|
+
|
|
1048
|
+
if bar_format and not ((ascii is True) or _is_ascii(ascii)):
|
|
1049
|
+
# Convert bar format into unicode since terminal uses unicode
|
|
1050
|
+
bar_format = _unicode(bar_format)
|
|
1051
|
+
|
|
1052
|
+
if smoothing is None:
|
|
1053
|
+
smoothing = 0
|
|
1054
|
+
|
|
1055
|
+
# Store the arguments
|
|
1056
|
+
self.iterable = iterable
|
|
1057
|
+
self.desc = desc or ''
|
|
1058
|
+
self.total = total
|
|
1059
|
+
self.leave = leave
|
|
1060
|
+
self.fp = file
|
|
1061
|
+
self.ncols = ncols
|
|
1062
|
+
self.nrows = nrows
|
|
1063
|
+
self.mininterval = mininterval
|
|
1064
|
+
self.maxinterval = maxinterval
|
|
1065
|
+
self.miniters = miniters
|
|
1066
|
+
self.dynamic_miniters = dynamic_miniters
|
|
1067
|
+
self.ascii = ascii
|
|
1068
|
+
self.disable = disable
|
|
1069
|
+
self.unit = unit
|
|
1070
|
+
self.unit_scale = unit_scale
|
|
1071
|
+
self.unit_divisor = unit_divisor
|
|
1072
|
+
self.initial = initial
|
|
1073
|
+
self.lock_args = lock_args
|
|
1074
|
+
self.delay = delay
|
|
1075
|
+
self.gui = gui
|
|
1076
|
+
self.dynamic_ncols = dynamic_ncols
|
|
1077
|
+
self.smoothing = smoothing
|
|
1078
|
+
self._ema_dn = EMA(smoothing)
|
|
1079
|
+
self._ema_dt = EMA(smoothing)
|
|
1080
|
+
self._ema_miniters = EMA(smoothing)
|
|
1081
|
+
self.bar_format = bar_format
|
|
1082
|
+
self.postfix = None
|
|
1083
|
+
self.colour = colour
|
|
1084
|
+
self._time = time
|
|
1085
|
+
if postfix:
|
|
1086
|
+
try:
|
|
1087
|
+
self.set_postfix(refresh=False, **postfix)
|
|
1088
|
+
except TypeError:
|
|
1089
|
+
self.postfix = postfix
|
|
1090
|
+
|
|
1091
|
+
# Init the iterations counters
|
|
1092
|
+
self.last_print_n = initial
|
|
1093
|
+
self.n = initial
|
|
1094
|
+
|
|
1095
|
+
# if nested, at initial sp() call we replace '\r' by '\n' to
|
|
1096
|
+
# not overwrite the outer progress bar
|
|
1097
|
+
with self._lock:
|
|
1098
|
+
if position is None:
|
|
1099
|
+
self.pos = self._get_free_pos(self)
|
|
1100
|
+
else: # mark fixed positions as negative
|
|
1101
|
+
self.pos = -position
|
|
1102
|
+
|
|
1103
|
+
if not gui:
|
|
1104
|
+
# Initialize the screen printer
|
|
1105
|
+
self.sp = self.status_printer(self.fp)
|
|
1106
|
+
if delay <= 0:
|
|
1107
|
+
self.refresh(lock_args=self.lock_args)
|
|
1108
|
+
|
|
1109
|
+
# Init the time counter
|
|
1110
|
+
self.last_print_t = self._time()
|
|
1111
|
+
# NB: Avoid race conditions by setting start_t at the very end of init
|
|
1112
|
+
self.start_t = self.last_print_t
|
|
1113
|
+
|
|
1114
|
+
def __bool__(self):
|
|
1115
|
+
if self.total is not None:
|
|
1116
|
+
return self.total > 0
|
|
1117
|
+
if self.iterable is None:
|
|
1118
|
+
raise TypeError('bool() undefined when iterable == total == None')
|
|
1119
|
+
return bool(self.iterable)
|
|
1120
|
+
|
|
1121
|
+
def __nonzero__(self):
|
|
1122
|
+
return self.__bool__()
|
|
1123
|
+
|
|
1124
|
+
def __len__(self):
|
|
1125
|
+
return self.total if self.iterable is None else \
|
|
1126
|
+
(self.iterable.shape[0] if hasattr(self.iterable, "shape")
|
|
1127
|
+
else len(self.iterable) if hasattr(self.iterable, "__len__")
|
|
1128
|
+
else self.iterable.__length_hint__()
|
|
1129
|
+
if hasattr(self.iterable, "__length_hint__")
|
|
1130
|
+
else getattr(self, "total", None))
|
|
1131
|
+
|
|
1132
|
+
def __enter__(self):
|
|
1133
|
+
return self
|
|
1134
|
+
|
|
1135
|
+
def __exit__(self, exc_type, exc_value, traceback):
|
|
1136
|
+
try:
|
|
1137
|
+
self.close()
|
|
1138
|
+
except AttributeError:
|
|
1139
|
+
# maybe eager thread cleanup upon external error
|
|
1140
|
+
if (exc_type, exc_value, traceback) == (None, None, None):
|
|
1141
|
+
raise
|
|
1142
|
+
warn("AttributeError ignored", TqdmWarning, stacklevel=2)
|
|
1143
|
+
|
|
1144
|
+
def __del__(self):
|
|
1145
|
+
self.close()
|
|
1146
|
+
|
|
1147
|
+
def __str__(self):
|
|
1148
|
+
return self.format_meter(**self.format_dict)
|
|
1149
|
+
|
|
1150
|
+
@property
|
|
1151
|
+
def _comparable(self):
|
|
1152
|
+
return abs(getattr(self, "pos", 1 << 31))
|
|
1153
|
+
|
|
1154
|
+
def __hash__(self):
|
|
1155
|
+
return id(self)
|
|
1156
|
+
|
|
1157
|
+
def __iter__(self):
|
|
1158
|
+
"""Backward-compatibility to use: for x in tqdm(iterable)"""
|
|
1159
|
+
|
|
1160
|
+
# Inlining instance variables as locals (speed optimisation)
|
|
1161
|
+
iterable = self.iterable
|
|
1162
|
+
|
|
1163
|
+
# If the bar is disabled, then just walk the iterable
|
|
1164
|
+
# (note: keep this check outside the loop for performance)
|
|
1165
|
+
if self.disable:
|
|
1166
|
+
for obj in iterable:
|
|
1167
|
+
yield obj
|
|
1168
|
+
return
|
|
1169
|
+
|
|
1170
|
+
mininterval = self.mininterval
|
|
1171
|
+
last_print_t = self.last_print_t
|
|
1172
|
+
last_print_n = self.last_print_n
|
|
1173
|
+
min_start_t = self.start_t + self.delay
|
|
1174
|
+
n = self.n
|
|
1175
|
+
time = self._time
|
|
1176
|
+
|
|
1177
|
+
try:
|
|
1178
|
+
for obj in iterable:
|
|
1179
|
+
yield obj
|
|
1180
|
+
# Update and possibly print the progressbar.
|
|
1181
|
+
# Note: does not call self.update(1) for speed optimisation.
|
|
1182
|
+
n += 1
|
|
1183
|
+
|
|
1184
|
+
if n - last_print_n >= self.miniters:
|
|
1185
|
+
cur_t = time()
|
|
1186
|
+
dt = cur_t - last_print_t
|
|
1187
|
+
if dt >= mininterval and cur_t >= min_start_t:
|
|
1188
|
+
self.update(n - last_print_n)
|
|
1189
|
+
last_print_n = self.last_print_n
|
|
1190
|
+
last_print_t = self.last_print_t
|
|
1191
|
+
finally:
|
|
1192
|
+
self.n = n
|
|
1193
|
+
self.close()
|
|
1194
|
+
|
|
1195
|
+
def update(self, n=1):
|
|
1196
|
+
"""
|
|
1197
|
+
Manually update the progress bar, useful for streams
|
|
1198
|
+
such as reading files.
|
|
1199
|
+
E.g.:
|
|
1200
|
+
>>> t = tqdm(total=filesize) # Initialise
|
|
1201
|
+
>>> for current_buffer in stream:
|
|
1202
|
+
... ...
|
|
1203
|
+
... t.update(len(current_buffer))
|
|
1204
|
+
>>> t.close()
|
|
1205
|
+
The last line is highly recommended, but possibly not necessary if
|
|
1206
|
+
`t.update()` will be called in such a way that `filesize` will be
|
|
1207
|
+
exactly reached and printed.
|
|
1208
|
+
|
|
1209
|
+
Parameters
|
|
1210
|
+
----------
|
|
1211
|
+
n : int or float, optional
|
|
1212
|
+
Increment to add to the internal counter of iterations
|
|
1213
|
+
[default: 1]. If using float, consider specifying `{n:.3f}`
|
|
1214
|
+
or similar in `bar_format`, or specifying `unit_scale`.
|
|
1215
|
+
|
|
1216
|
+
Returns
|
|
1217
|
+
-------
|
|
1218
|
+
out : bool or None
|
|
1219
|
+
True if a `display()` was triggered.
|
|
1220
|
+
"""
|
|
1221
|
+
if self.disable:
|
|
1222
|
+
return
|
|
1223
|
+
|
|
1224
|
+
if n < 0:
|
|
1225
|
+
self.last_print_n += n # for auto-refresh logic to work
|
|
1226
|
+
self.n += n
|
|
1227
|
+
|
|
1228
|
+
# check counter first to reduce calls to time()
|
|
1229
|
+
if self.n - self.last_print_n >= self.miniters:
|
|
1230
|
+
cur_t = self._time()
|
|
1231
|
+
dt = cur_t - self.last_print_t
|
|
1232
|
+
if dt >= self.mininterval and cur_t >= self.start_t + self.delay:
|
|
1233
|
+
cur_t = self._time()
|
|
1234
|
+
dn = self.n - self.last_print_n # >= n
|
|
1235
|
+
if self.smoothing and dt and dn:
|
|
1236
|
+
# EMA (not just overall average)
|
|
1237
|
+
self._ema_dn(dn)
|
|
1238
|
+
self._ema_dt(dt)
|
|
1239
|
+
self.refresh(lock_args=self.lock_args)
|
|
1240
|
+
if self.dynamic_miniters:
|
|
1241
|
+
# If no `miniters` was specified, adjust automatically to the
|
|
1242
|
+
# maximum iteration rate seen so far between two prints.
|
|
1243
|
+
# e.g.: After running `tqdm.update(5)`, subsequent
|
|
1244
|
+
# calls to `tqdm.update()` will only cause an update after
|
|
1245
|
+
# at least 5 more iterations.
|
|
1246
|
+
if self.maxinterval and dt >= self.maxinterval:
|
|
1247
|
+
self.miniters = dn * (self.mininterval or self.maxinterval) / dt
|
|
1248
|
+
elif self.smoothing:
|
|
1249
|
+
# EMA miniters update
|
|
1250
|
+
self.miniters = self._ema_miniters(
|
|
1251
|
+
dn * (self.mininterval / dt if self.mininterval and dt
|
|
1252
|
+
else 1))
|
|
1253
|
+
else:
|
|
1254
|
+
# max iters between two prints
|
|
1255
|
+
self.miniters = max(self.miniters, dn)
|
|
1256
|
+
|
|
1257
|
+
# Store old values for next call
|
|
1258
|
+
self.last_print_n = self.n
|
|
1259
|
+
self.last_print_t = cur_t
|
|
1260
|
+
return True
|
|
1261
|
+
|
|
1262
|
+
def close(self):
|
|
1263
|
+
"""Cleanup and (if leave=False) close the progressbar."""
|
|
1264
|
+
if self.disable:
|
|
1265
|
+
return
|
|
1266
|
+
|
|
1267
|
+
# Prevent multiple closures
|
|
1268
|
+
self.disable = True
|
|
1269
|
+
|
|
1270
|
+
# decrement instance pos and remove from internal set
|
|
1271
|
+
pos = abs(self.pos)
|
|
1272
|
+
self._decr_instances(self)
|
|
1273
|
+
|
|
1274
|
+
if self.last_print_t < self.start_t + self.delay:
|
|
1275
|
+
# haven't ever displayed; nothing to clear
|
|
1276
|
+
return
|
|
1277
|
+
|
|
1278
|
+
# GUI mode
|
|
1279
|
+
if getattr(self, 'sp', None) is None:
|
|
1280
|
+
return
|
|
1281
|
+
|
|
1282
|
+
# annoyingly, _supports_unicode isn't good enough
|
|
1283
|
+
def fp_write(s):
|
|
1284
|
+
self.fp.write(_unicode(s))
|
|
1285
|
+
|
|
1286
|
+
try:
|
|
1287
|
+
fp_write('')
|
|
1288
|
+
except ValueError as e:
|
|
1289
|
+
if 'closed' in str(e):
|
|
1290
|
+
return
|
|
1291
|
+
raise # pragma: no cover
|
|
1292
|
+
|
|
1293
|
+
leave = pos == 0 if self.leave is None else self.leave
|
|
1294
|
+
|
|
1295
|
+
with self._lock:
|
|
1296
|
+
if leave:
|
|
1297
|
+
# stats for overall rate (no weighted average)
|
|
1298
|
+
self._ema_dt = lambda: None
|
|
1299
|
+
self.display(pos=0)
|
|
1300
|
+
fp_write('\n')
|
|
1301
|
+
else:
|
|
1302
|
+
# clear previous display
|
|
1303
|
+
if self.display(msg='', pos=pos) and not pos:
|
|
1304
|
+
fp_write('\r')
|
|
1305
|
+
|
|
1306
|
+
def clear(self, nolock=False):
|
|
1307
|
+
"""Clear current bar display."""
|
|
1308
|
+
if self.disable:
|
|
1309
|
+
return
|
|
1310
|
+
|
|
1311
|
+
if not nolock:
|
|
1312
|
+
self._lock.acquire()
|
|
1313
|
+
pos = abs(self.pos)
|
|
1314
|
+
if pos < (self.nrows or 20):
|
|
1315
|
+
self.moveto(pos)
|
|
1316
|
+
self.sp('')
|
|
1317
|
+
self.fp.write('\r') # place cursor back at the beginning of line
|
|
1318
|
+
self.moveto(-pos)
|
|
1319
|
+
if not nolock:
|
|
1320
|
+
self._lock.release()
|
|
1321
|
+
|
|
1322
|
+
def refresh(self, nolock=False, lock_args=None):
|
|
1323
|
+
"""
|
|
1324
|
+
Force refresh the display of this bar.
|
|
1325
|
+
|
|
1326
|
+
Parameters
|
|
1327
|
+
----------
|
|
1328
|
+
nolock : bool, optional
|
|
1329
|
+
If `True`, does not lock.
|
|
1330
|
+
If [default: `False`]: calls `acquire()` on internal lock.
|
|
1331
|
+
lock_args : tuple, optional
|
|
1332
|
+
Passed to internal lock's `acquire()`.
|
|
1333
|
+
If specified, will only `display()` if `acquire()` returns `True`.
|
|
1334
|
+
"""
|
|
1335
|
+
if self.disable:
|
|
1336
|
+
return
|
|
1337
|
+
|
|
1338
|
+
if not nolock:
|
|
1339
|
+
if lock_args:
|
|
1340
|
+
if not self._lock.acquire(*lock_args):
|
|
1341
|
+
return False
|
|
1342
|
+
else:
|
|
1343
|
+
self._lock.acquire()
|
|
1344
|
+
self.display()
|
|
1345
|
+
if not nolock:
|
|
1346
|
+
self._lock.release()
|
|
1347
|
+
return True
|
|
1348
|
+
|
|
1349
|
+
def unpause(self):
|
|
1350
|
+
"""Restart tqdm timer from last print time."""
|
|
1351
|
+
if self.disable:
|
|
1352
|
+
return
|
|
1353
|
+
cur_t = self._time()
|
|
1354
|
+
self.start_t += cur_t - self.last_print_t
|
|
1355
|
+
self.last_print_t = cur_t
|
|
1356
|
+
|
|
1357
|
+
def reset(self, total=None):
|
|
1358
|
+
"""
|
|
1359
|
+
Resets to 0 iterations for repeated use.
|
|
1360
|
+
|
|
1361
|
+
Consider combining with `leave=True`.
|
|
1362
|
+
|
|
1363
|
+
Parameters
|
|
1364
|
+
----------
|
|
1365
|
+
total : int or float, optional. Total to use for the new bar.
|
|
1366
|
+
"""
|
|
1367
|
+
self.n = 0
|
|
1368
|
+
if total is not None:
|
|
1369
|
+
self.total = total
|
|
1370
|
+
if self.disable:
|
|
1371
|
+
return
|
|
1372
|
+
self.last_print_n = 0
|
|
1373
|
+
self.last_print_t = self.start_t = self._time()
|
|
1374
|
+
self._ema_dn = EMA(self.smoothing)
|
|
1375
|
+
self._ema_dt = EMA(self.smoothing)
|
|
1376
|
+
self._ema_miniters = EMA(self.smoothing)
|
|
1377
|
+
self.refresh()
|
|
1378
|
+
|
|
1379
|
+
def set_description(self, desc=None, refresh=True):
|
|
1380
|
+
"""
|
|
1381
|
+
Set/modify description of the progress bar.
|
|
1382
|
+
|
|
1383
|
+
Parameters
|
|
1384
|
+
----------
|
|
1385
|
+
desc : str, optional
|
|
1386
|
+
refresh : bool, optional
|
|
1387
|
+
Forces refresh [default: True].
|
|
1388
|
+
"""
|
|
1389
|
+
self.desc = desc + ': ' if desc else ''
|
|
1390
|
+
if refresh:
|
|
1391
|
+
self.refresh()
|
|
1392
|
+
|
|
1393
|
+
def set_description_str(self, desc=None, refresh=True):
|
|
1394
|
+
"""Set/modify description without ': ' appended."""
|
|
1395
|
+
self.desc = desc or ''
|
|
1396
|
+
if refresh:
|
|
1397
|
+
self.refresh()
|
|
1398
|
+
|
|
1399
|
+
def set_postfix(self, ordered_dict=None, refresh=True, **kwargs):
|
|
1400
|
+
"""
|
|
1401
|
+
Set/modify postfix (additional stats)
|
|
1402
|
+
with automatic formatting based on datatype.
|
|
1403
|
+
|
|
1404
|
+
Parameters
|
|
1405
|
+
----------
|
|
1406
|
+
ordered_dict : dict or OrderedDict, optional
|
|
1407
|
+
refresh : bool, optional
|
|
1408
|
+
Forces refresh [default: True].
|
|
1409
|
+
kwargs : dict, optional
|
|
1410
|
+
"""
|
|
1411
|
+
# Sort in alphabetical order to be more deterministic
|
|
1412
|
+
postfix = OrderedDict([] if ordered_dict is None else ordered_dict)
|
|
1413
|
+
for key in sorted(kwargs.keys()):
|
|
1414
|
+
postfix[key] = kwargs[key]
|
|
1415
|
+
# Preprocess stats according to datatype
|
|
1416
|
+
for key in postfix.keys():
|
|
1417
|
+
# Number: limit the length of the string
|
|
1418
|
+
if isinstance(postfix[key], Number):
|
|
1419
|
+
postfix[key] = self.format_num(postfix[key])
|
|
1420
|
+
# Else for any other type, try to get the string conversion
|
|
1421
|
+
elif not isinstance(postfix[key], _basestring):
|
|
1422
|
+
postfix[key] = str(postfix[key])
|
|
1423
|
+
# Else if it's a string, don't need to preprocess anything
|
|
1424
|
+
# Stitch together to get the final postfix
|
|
1425
|
+
self.postfix = ', '.join(key + '=' + postfix[key].strip()
|
|
1426
|
+
for key in postfix.keys())
|
|
1427
|
+
if refresh:
|
|
1428
|
+
self.refresh()
|
|
1429
|
+
|
|
1430
|
+
def set_postfix_str(self, s='', refresh=True):
|
|
1431
|
+
"""
|
|
1432
|
+
Postfix without dictionary expansion, similar to prefix handling.
|
|
1433
|
+
"""
|
|
1434
|
+
self.postfix = str(s)
|
|
1435
|
+
if refresh:
|
|
1436
|
+
self.refresh()
|
|
1437
|
+
|
|
1438
|
+
def moveto(self, n):
|
|
1439
|
+
# TODO: private method
|
|
1440
|
+
self.fp.write(_unicode('\n' * n + _term_move_up() * -n))
|
|
1441
|
+
self.fp.flush()
|
|
1442
|
+
|
|
1443
|
+
@property
|
|
1444
|
+
def format_dict(self):
|
|
1445
|
+
"""Public API for read-only member access."""
|
|
1446
|
+
if self.disable and not hasattr(self, 'unit'):
|
|
1447
|
+
return defaultdict(lambda: None, {
|
|
1448
|
+
'n': self.n, 'total': self.total, 'elapsed': 0, 'unit': 'it'})
|
|
1449
|
+
if self.dynamic_ncols:
|
|
1450
|
+
self.ncols, self.nrows = self.dynamic_ncols(self.fp)
|
|
1451
|
+
return {
|
|
1452
|
+
'n': self.n, 'total': self.total,
|
|
1453
|
+
'elapsed': self._time() - self.start_t if hasattr(self, 'start_t') else 0,
|
|
1454
|
+
'ncols': self.ncols, 'nrows': self.nrows, 'prefix': self.desc,
|
|
1455
|
+
'ascii': self.ascii, 'unit': self.unit, 'unit_scale': self.unit_scale,
|
|
1456
|
+
'rate': self._ema_dn() / self._ema_dt() if self._ema_dt() else None,
|
|
1457
|
+
'bar_format': self.bar_format, 'postfix': self.postfix,
|
|
1458
|
+
'unit_divisor': self.unit_divisor, 'initial': self.initial,
|
|
1459
|
+
'colour': self.colour}
|
|
1460
|
+
|
|
1461
|
+
def display(self, msg=None, pos=None):
|
|
1462
|
+
"""
|
|
1463
|
+
Use `self.sp` to display `msg` in the specified `pos`.
|
|
1464
|
+
|
|
1465
|
+
Consider overloading this function when inheriting to use e.g.:
|
|
1466
|
+
`self.some_frontend(**self.format_dict)` instead of `self.sp`.
|
|
1467
|
+
|
|
1468
|
+
Parameters
|
|
1469
|
+
----------
|
|
1470
|
+
msg : str, optional. What to display (default: `repr(self)`).
|
|
1471
|
+
pos : int, optional. Position to `moveto`
|
|
1472
|
+
(default: `abs(self.pos)`).
|
|
1473
|
+
"""
|
|
1474
|
+
if pos is None:
|
|
1475
|
+
pos = abs(self.pos)
|
|
1476
|
+
|
|
1477
|
+
nrows = self.nrows or 20
|
|
1478
|
+
if pos >= nrows - 1:
|
|
1479
|
+
if pos >= nrows:
|
|
1480
|
+
return False
|
|
1481
|
+
if msg or msg is None: # override at `nrows - 1`
|
|
1482
|
+
msg = " ... (more hidden) ..."
|
|
1483
|
+
|
|
1484
|
+
if not hasattr(self, "sp"):
|
|
1485
|
+
raise TqdmDeprecationWarning(
|
|
1486
|
+
"Please use `tqdm.gui.tqdm(...)`"
|
|
1487
|
+
" instead of `tqdm(..., gui=True)`\n",
|
|
1488
|
+
fp_write=getattr(self.fp, 'write', sys.stderr.write))
|
|
1489
|
+
|
|
1490
|
+
if pos:
|
|
1491
|
+
self.moveto(pos)
|
|
1492
|
+
self.sp(self.__str__() if msg is None else msg)
|
|
1493
|
+
if pos:
|
|
1494
|
+
self.moveto(-pos)
|
|
1495
|
+
return True
|
|
1496
|
+
|
|
1497
|
+
@classmethod
|
|
1498
|
+
@contextmanager
|
|
1499
|
+
def wrapattr(cls, stream, method, total=None, bytes=True, **tqdm_kwargs):
|
|
1500
|
+
"""
|
|
1501
|
+
stream : file-like object.
|
|
1502
|
+
method : str, "read" or "write". The result of `read()` and
|
|
1503
|
+
the first argument of `write()` should have a `len()`.
|
|
1504
|
+
|
|
1505
|
+
>>> with tqdm.wrapattr(file_obj, "read", total=file_obj.size) as fobj:
|
|
1506
|
+
... while True:
|
|
1507
|
+
... chunk = fobj.read(chunk_size)
|
|
1508
|
+
... if not chunk:
|
|
1509
|
+
... break
|
|
1510
|
+
"""
|
|
1511
|
+
with cls(total=total, **tqdm_kwargs) as t:
|
|
1512
|
+
if bytes:
|
|
1513
|
+
t.unit = "B"
|
|
1514
|
+
t.unit_scale = True
|
|
1515
|
+
t.unit_divisor = 1024
|
|
1516
|
+
yield CallbackIOWrapper(t.update, stream, method)
|
|
1517
|
+
|
|
1518
|
+
|
|
1519
|
+
def trange(*args, **kwargs):
|
|
1520
|
+
"""
|
|
1521
|
+
A shortcut for tqdm(xrange(*args), **kwargs).
|
|
1522
|
+
On Python3+ range is used instead of xrange.
|
|
1523
|
+
"""
|
|
1524
|
+
return tqdm(_range(*args), **kwargs)
|